커뮤니티
기준라인
2020-01-20 11:58:33
171
글번호 130544
답변대로
수식 방배열은 20개로 했고
시뮬레이션 최소값을 0.05부터 했으나 똑같은 문제가 발생합니다.
시뮬레이션에서 0과 3사이의 결과가 2개만 나오는데
중간에 0.5와 1.00과 1.5를 실제 대입하면
-2.84, 12.06, 10.18이 나옵니다.(수수료 0.0032, 슬리피지 진입,청산 2틱씩)
시뮬레이션에서 보이는 값과 하나하나 대입한 결과값이 다른 경우는 처음입니다.
************************************************************************************
안녕하세요
예스스탁입니다.
1
Array : EP[10](0);
배열이 총 10개 방입니다. (0번방~9번방)
10개 이상 지정하시면 해당 배열의 방갯수도 늘려주셔야 합니다.
2
상승은 0보다 큰값을 지정하셔야 합니다.
상승 0은 해당 수식에서 의미가 없는 습니다.
0.05씩 상승하면 최소값을 0.05로 지정하시기 바랍니다.
즐거운 하루되세요
*********************************************************************************
input : 기준(265),상승(1.00);
input : 손절1(50),익절1(300),TR1(150);
input : 손절2(50),익절2(300),TR2(150);
input : 손절3(50),익절3(300),TR3(150);
input : 손절4(50),익절4(300),TR4(150);
input : 손절5(50),익절5(300),TR5(150);
input : 손절6(50),익절6(300),TR6(150);
input : 손절7(50),익절7(300),TR7(150);
input : 손절8(50),익절8(300),TR8(150);
input : 손절9(50),익절9(300),TR9(150);
input : 손절10(50),익절10(300),TR10(150);
input : 손절11(50),익절11(300),TR11(150);
input : 손절12(50),익절12(300),TR12(150);
Array : EP[20](0);
if MarketPosition == 0 and H < 기준+상승 and ExitDate(1) != sdate Then
buy("b1",AtStop,기준+상승);
if MarketPosition == 1 Then
{
var1 = (기준+상승) + 상승*MaxEntries;
EP[MaxEntries] = LatestEntryPrice(0);
if MaxEntries == 1 and H < var1 Then
buy("b2",AtStop,var1);
if MaxEntries == 2 and H < var1 Then
buy("b3",AtStop,var1);
if MaxEntries == 3 and H < var1 Then
buy("b4",AtStop,var1);
if MaxEntries == 4 and H < var1 Then
buy("b5",AtStop,var1);
if MaxEntries == 5 and H < var1 Then
buy("b6",AtStop,var1);
if MaxEntries == 6 and H < var1 Then
buy("b7",AtStop,var1);
if MaxEntries == 7 and H < var1 Then
buy("b8",AtStop,var1);
if MaxEntries == 8 and H < var1 Then
buy("b9",AtStop,var1);
if MaxEntries == 9 and H < var1 Then
buy("b10",AtStop,var1);
if MaxEntries == 10 and H < var1 Then
buy("b11",AtStop,var1);
if MaxEntries == 11 and H < var1 Then
buy("b12",AtStop,var1);
if MaxEntries >= 1 and EP[1] > 0 Then
{
ExitLong("bl1",AtStop,EP[1]-PriceScale*손절1,"b1");
ExitLong("bp1",Atlimit,EP[1]+PriceScale*익절1,"b1");
ExitLong("btr1",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR1,"b1");
}
if MaxEntries >= 2 and EP[2] > 0 Then
{
ExitLong("bl2",AtStop,EP[2]-PriceScale*손절2,"b2");
ExitLong("bp2",Atlimit,EP[2]+PriceScale*익절2,"b2");
ExitLong("btr2",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR2,"b2");
}
if MaxEntries >= 3 and EP[3] > 0 Then
{
ExitLong("bl3",AtStop,EP[3]-PriceScale*손절3,"b3");
ExitLong("bp3",Atlimit,EP[3]+PriceScale*익절3,"b3");
ExitLong("btr3",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR3,"b3");
}
if MaxEntries >= 4 and EP[4] > 0 Then
{
ExitLong("bl4",AtStop,EP[4]-PriceScale*손절4,"b4");
ExitLong("bp4",Atlimit,EP[4]+PriceScale*익절4,"b4");
ExitLong("btr4",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR4,"b4");
}
if MaxEntries >= 5 and EP[5] > 0 Then
{
ExitLong("bl5",AtStop,EP[5]-PriceScale*손절5,"b5");
ExitLong("bp5",Atlimit,EP[5]+PriceScale*익절5,"b5");
ExitLong("btr5",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR5,"b5");
}
if MaxEntries >= 6 and EP[6] > 0 Then
{
ExitLong("bl6",AtStop,EP[6]-PriceScale*손절6,"b6");
ExitLong("bp6",Atlimit,EP[6]+PriceScale*익절6,"b6");
ExitLong("btr6",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR6,"b6");
}
if MaxEntries >= 7 and EP[7] > 0 Then
{
ExitLong("bl7",AtStop,EP[7]-PriceScale*손절7,"b7");
ExitLong("bp7",Atlimit,EP[7]+PriceScale*익절7,"b7");
ExitLong("btr7",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR7,"b7");
}
if MaxEntries >= 8 and EP[8] > 0 Then
{
ExitLong("bl8",AtStop,EP[8]-PriceScale*손절8,"b8");
ExitLong("bp8",Atlimit,EP[8]+PriceScale*익절8,"b8");
ExitLong("btr8",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR8,"b8");
}
if MaxEntries >= 9 and EP[9] > 0 Then
{
ExitLong("bl9",AtStop,EP[9]-PriceScale*손절9,"b9");
ExitLong("bp9",Atlimit,EP[9]+PriceScale*익절9,"b9");
ExitLong("btr9",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR9,"b9");
}
if MaxEntries >= 10 and EP[10] > 0 Then
{
ExitLong("bl10",AtStop,EP[10]-PriceScale*손절10,"b10");
ExitLong("bp10",Atlimit,EP[10]+PriceScale*익절10,"b10");
ExitLong("btr10",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR10,"b10");
}
if MaxEntries >= 11 and EP[11] > 0 Then
{
ExitLong("bl11",AtStop,EP[11]-PriceScale*손절11,"b11");
ExitLong("bp11",Atlimit,EP[11]+PriceScale*익절11,"b11");
ExitLong("btr11",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR11,"b11");
}
if MaxEntries >= 12 and EP[12] > 0 Then
{
ExitLong("bl12",AtStop,EP[12]-PriceScale*손절12,"b12");
ExitLong("bp12",Atlimit,EP[12]+PriceScale*익절12,"b12");
ExitLong("btr12",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR12,"b12");
}
}
- 1. 20190723.jpg (0.37 MB)
답변 2
예스스탁 예스스탁 답변
2019-07-23 15:20:08
> 목마와숙녀 님이 쓴 글입니다.
> 제목 : 문의
> 답변대로
수식 방배열은 20개로 했고
시뮬레이션 최소값을 0.05부터 했으나 똑같은 문제가 발생합니다.
시뮬레이션에서 0과 3사이의 결과가 2개만 나오는데
중간에 0.5와 1.00과 1.5를 실제 대입하면
-2.84, 12.06, 10.18이 나옵니다.(수수료 0.0032, 슬리피지 진입,청산 2틱씩)
시뮬레이션에서 보이는 값과 하나하나 대입한 결과값이 다른 경우는 처음입니다.
************************************************************************************
안녕하세요
예스스탁입니다.
1
Array : EP[10](0);
배열이 총 10개 방입니다. (0번방~9번방)
10개 이상 지정하시면 해당 배열의 방갯수도 늘려주셔야 합니다.
2
상승은 0보다 큰값을 지정하셔야 합니다.
상승 0은 해당 수식에서 의미가 없는 습니다.
0.05씩 상승하면 최소값을 0.05로 지정하시기 바랍니다.
즐거운 하루되세요
*********************************************************************************
input : 기준(265),상승(1.00);
input : 손절1(50),익절1(300),TR1(150);
input : 손절2(50),익절2(300),TR2(150);
input : 손절3(50),익절3(300),TR3(150);
input : 손절4(50),익절4(300),TR4(150);
input : 손절5(50),익절5(300),TR5(150);
input : 손절6(50),익절6(300),TR6(150);
input : 손절7(50),익절7(300),TR7(150);
input : 손절8(50),익절8(300),TR8(150);
input : 손절9(50),익절9(300),TR9(150);
input : 손절10(50),익절10(300),TR10(150);
input : 손절11(50),익절11(300),TR11(150);
input : 손절12(50),익절12(300),TR12(150);
Array : EP[20](0);
if MarketPosition == 0 and H < 기준+상승 and ExitDate(1) != sdate Then
buy("b1",AtStop,기준+상승);
if MarketPosition == 1 Then
{
var1 = (기준+상승) + 상승*MaxEntries;
EP[MaxEntries] = LatestEntryPrice(0);
if MaxEntries == 1 and H < var1 Then
buy("b2",AtStop,var1);
if MaxEntries == 2 and H < var1 Then
buy("b3",AtStop,var1);
if MaxEntries == 3 and H < var1 Then
buy("b4",AtStop,var1);
if MaxEntries == 4 and H < var1 Then
buy("b5",AtStop,var1);
if MaxEntries == 5 and H < var1 Then
buy("b6",AtStop,var1);
if MaxEntries == 6 and H < var1 Then
buy("b7",AtStop,var1);
if MaxEntries == 7 and H < var1 Then
buy("b8",AtStop,var1);
if MaxEntries == 8 and H < var1 Then
buy("b9",AtStop,var1);
if MaxEntries == 9 and H < var1 Then
buy("b10",AtStop,var1);
if MaxEntries == 10 and H < var1 Then
buy("b11",AtStop,var1);
if MaxEntries == 11 and H < var1 Then
buy("b12",AtStop,var1);
if MaxEntries >= 1 and EP[1] > 0 Then
{
ExitLong("bl1",AtStop,EP[1]-PriceScale*손절1,"b1");
ExitLong("bp1",Atlimit,EP[1]+PriceScale*익절1,"b1");
ExitLong("btr1",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR1,"b1");
}
if MaxEntries >= 2 and EP[2] > 0 Then
{
ExitLong("bl2",AtStop,EP[2]-PriceScale*손절2,"b2");
ExitLong("bp2",Atlimit,EP[2]+PriceScale*익절2,"b2");
ExitLong("btr2",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR2,"b2");
}
if MaxEntries >= 3 and EP[3] > 0 Then
{
ExitLong("bl3",AtStop,EP[3]-PriceScale*손절3,"b3");
ExitLong("bp3",Atlimit,EP[3]+PriceScale*익절3,"b3");
ExitLong("btr3",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR3,"b3");
}
if MaxEntries >= 4 and EP[4] > 0 Then
{
ExitLong("bl4",AtStop,EP[4]-PriceScale*손절4,"b4");
ExitLong("bp4",Atlimit,EP[4]+PriceScale*익절4,"b4");
ExitLong("btr4",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR4,"b4");
}
if MaxEntries >= 5 and EP[5] > 0 Then
{
ExitLong("bl5",AtStop,EP[5]-PriceScale*손절5,"b5");
ExitLong("bp5",Atlimit,EP[5]+PriceScale*익절5,"b5");
ExitLong("btr5",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR5,"b5");
}
if MaxEntries >= 6 and EP[6] > 0 Then
{
ExitLong("bl6",AtStop,EP[6]-PriceScale*손절6,"b6");
ExitLong("bp6",Atlimit,EP[6]+PriceScale*익절6,"b6");
ExitLong("btr6",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR6,"b6");
}
if MaxEntries >= 7 and EP[7] > 0 Then
{
ExitLong("bl7",AtStop,EP[7]-PriceScale*손절7,"b7");
ExitLong("bp7",Atlimit,EP[7]+PriceScale*익절7,"b7");
ExitLong("btr7",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR7,"b7");
}
if MaxEntries >= 8 and EP[8] > 0 Then
{
ExitLong("bl8",AtStop,EP[8]-PriceScale*손절8,"b8");
ExitLong("bp8",Atlimit,EP[8]+PriceScale*익절8,"b8");
ExitLong("btr8",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR8,"b8");
}
if MaxEntries >= 9 and EP[9] > 0 Then
{
ExitLong("bl9",AtStop,EP[9]-PriceScale*손절9,"b9");
ExitLong("bp9",Atlimit,EP[9]+PriceScale*익절9,"b9");
ExitLong("btr9",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR9,"b9");
}
if MaxEntries >= 10 and EP[10] > 0 Then
{
ExitLong("bl10",AtStop,EP[10]-PriceScale*손절10,"b10");
ExitLong("bp10",Atlimit,EP[10]+PriceScale*익절10,"b10");
ExitLong("btr10",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR10,"b10");
}
if MaxEntries >= 11 and EP[11] > 0 Then
{
ExitLong("bl11",AtStop,EP[11]-PriceScale*손절11,"b11");
ExitLong("bp11",Atlimit,EP[11]+PriceScale*익절11,"b11");
ExitLong("btr11",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR11,"b11");
}
if MaxEntries >= 12 and EP[12] > 0 Then
{
ExitLong("bl12",AtStop,EP[12]-PriceScale*손절12,"b12");
ExitLong("bp12",Atlimit,EP[12]+PriceScale*익절12,"b12");
ExitLong("btr12",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR12,"b12");
}
}
목마와숙녀
2019-07-23 15:38:44
목마와숙녀 님에 의해 삭제된 답변입니다.
다음글
이전글