커뮤니티
기준라인 수식과 피라미딩
2020-01-20 11:53:34
241
글번호 130654
별첨파일은 아래수식을 시뮬레이션한 결과들 입니다.
피라미딩시 20개까지 진입하는 수식이고
Array : EP[30](0); 이고
피라미딩설정창에서 다른진입신호만허용입니다.
질문1) 첨부파일 첫번째
2019년 1월 28일 첫번째 진입의 손절(미니선물 50틱 ,1.00)이 적용되지 않고 end of day로 청산되었습니다.
2017년 3월 24일 첫번째 진입 손절은 정상처리됨.
질문2) 첨부파일 두번째
EP[1], EP[5], EP[30]순으로 방배열을 조정해 보았음
3가지 경우 모두 2019.4.19 MAX16개 진입이 발생했습니다.(년간 진입횟수와 수익은 서로 다름)
방배열 숫자가 작으면 피라미딩MAX도 작아지는 것 아닌지요
질문3)
피라미딩설정창에서 다른진입신호만허용과 모든진입신호허용이 있는데
buy만 진입하는 수식에서 위 구분은 어떤 차이를 발생시키나요.
항상 고맙습니다.
***********************************************************************************
input : 기준(283),상승(0.10);
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);
input : 손절13(50),익절13(300),TR13(150);
input : 손절14(50),익절14(300),TR14(150);
input : 손절15(50),익절15(300),TR15(150);
input : 손절16(50),익절16(300),TR16(150);
input : 손절17(50),익절17(300),TR17(150);
input : 손절18(50),익절18(300),TR18(150);
input : 손절19(50),익절19(300),TR19(150);
input : 손절20(50),익절20(300),TR20(150);
Array : EP[30](0);
if MarketPosition == 0 and NextBarOpen < 기준+상승 and ExitDate(1) != sdate Then
buy("b1",AtStop,기준+상승);
if MarketPosition == 1 Then
{
var1 = (기준+상승) + 상승*MaxEntries;
EP[MaxEntries] = LatestEntryPrice(0);
if MaxEntries == 1 and NextBarOpen < var1 Then
buy("b2",AtStop,var1);
if MaxEntries == 2 and NextBarOpen < var1 Then
buy("b3",AtStop,var1);
if MaxEntries == 3 and NextBarOpen < var1 Then
buy("b4",AtStop,var1);
if MaxEntries == 4 and NextBarOpen < var1 Then
buy("b5",AtStop,var1);
if MaxEntries == 5 and NextBarOpen < var1 Then
buy("b6",AtStop,var1);
if MaxEntries == 6 and NextBarOpen < var1 Then
buy("b7",AtStop,var1);
if MaxEntries == 7 and NextBarOpen < var1 Then
buy("b8",AtStop,var1);
if MaxEntries == 8 and NextBarOpen < var1 Then
buy("b9",AtStop,var1);
if MaxEntries == 9 and NextBarOpen < var1 Then
buy("b10",AtStop,var1);
if MaxEntries == 10 and NextBarOpen < var1 Then
buy("b11",AtStop,var1);
if MaxEntries == 11 and NextBarOpen < var1 Then
buy("b12",AtStop,var1);
if MaxEntries == 12 and NextBarOpen < var1 Then
buy("b13",AtStop,var1);
if MaxEntries == 13 and NextBarOpen < var1 Then
buy("b14",AtStop,var1);
if MaxEntries == 14 and NextBarOpen < var1 Then
buy("b15",AtStop,var1);
if MaxEntries == 15 and NextBarOpen < var1 Then
buy("b16",AtStop,var1);
if MaxEntries == 16 and NextBarOpen < var1 Then
buy("b17",AtStop,var1);
if MaxEntries == 17 and NextBarOpen < var1 Then
buy("b18",AtStop,var1);
if MaxEntries == 18 and NextBarOpen < var1 Then
buy("b19",AtStop,var1);
if MaxEntries == 19 and NextBarOpen < var1 Then
buy("b20",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");
}
if MaxEntries >= 13 and EP[13] > 0 Then
{
ExitLong("bl13",AtStop,EP[13]-PriceScale*손절13,"b13");
ExitLong("bp13",Atlimit,EP[13]+PriceScale*익절13,"b13");
ExitLong("btr13",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR13,"b13");
}
if MaxEntries >= 14 and EP[14] > 0 Then
{
ExitLong("bl14",AtStop,EP[14]-PriceScale*손절14,"b14");
ExitLong("bp14",Atlimit,EP[14]+PriceScale*익절14,"b14");
ExitLong("btr14",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR14,"b14");
}
if MaxEntries >= 15 and EP[15] > 0 Then
{
ExitLong("bl15",AtStop,EP[15]-PriceScale*손절15,"b15");
ExitLong("bp15",Atlimit,EP[15]+PriceScale*익절15,"b15");
ExitLong("btr15",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR15,"b15");
}
if MaxEntries >= 16 and EP[16] > 0 Then
{
ExitLong("bl16",AtStop,EP[16]-PriceScale*손절16,"b16");
ExitLong("bp16",Atlimit,EP[16]+PriceScale*익절16,"b16");
ExitLong("btr16",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR16,"b16");
}
if MaxEntries >= 17 and EP[17] > 0 Then
{
ExitLong("bl17",AtStop,EP[17]-PriceScale*손절17,"b17");
ExitLong("bp17",Atlimit,EP[17]+PriceScale*익절17,"b17");
ExitLong("btr17",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR17,"b17");
}
if MaxEntries >= 18 and EP[18] > 0 Then
{
ExitLong("bl18",AtStop,EP[18]-PriceScale*손절18,"b18");
ExitLong("bp18",Atlimit,EP[18]+PriceScale*익절18,"b18");
ExitLong("btr18",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR18,"b18");
}
if MaxEntries >= 19 and EP[19] > 0 Then
{
ExitLong("bl19",AtStop,EP[19]-PriceScale*손절19,"b19");
ExitLong("bp19",Atlimit,EP[19]+PriceScale*익절19,"b19");
ExitLong("btr19",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR19,"b19");
}
if MaxEntries >= 20 and EP[20] > 0 Then
{
ExitLong("bl20",AtStop,EP[20]-PriceScale*손절20,"b20");
ExitLong("bp20",Atlimit,EP[20]+PriceScale*익절20,"b20");
ExitLong("btr20",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR20,"b20");
}
}
- 1. 손절_이상.jpg (0.49 MB)
- 2. 20190726.jpg (0.40 MB)
답변 1
예스스탁 예스스탁 답변
2019-07-26 13:49:04
안녕하세요
예스스탁입니다.
1
과거 시뮬레이션일때는 당일청산으로 설정한 시간이 포함된 봉에는
진입과 청산신호가 발생하지 않습니다.
실시간에서는 봉의 모든 틱의 시간과 움직임을 파악해 가므로
지정한 당일청산시간보다 손절이 먼저 만족하면 손절이 먼저 발생하지만
과거봉은 봉안의 모든 틱이 있지 않아 당일청산이 포함된 봉에서
선후를 판단할수 없어 당일청산이 포함된 봉에서는 진입과 청산이 발생하지 않게 되어 있습니다.
2
배열변수는 진입순서대로 값을 저장하기 위해 사용하는 변수입니다.
배열변수의 방갯수가 피라미딩의 추가진입횟수를 제한하지는 않습니다.
수식에서 배열은 청산식에만 사용됩니다. 진입식에는 사용되는 부분이 없습니다.
피라미딩 횟수는 진입이후 최대 진입횟수를 리턴하는 MaxEntries로 진입수식에서 제한됩니다.
3
피라미딩설정에서
[다른진입신호만허용]은 수식에 다수의 buy나 다수의 sell이 있을경우 각 buy나 sell별로 한번씩만 추가진입을 허용하는 설정이고
[모든진입신호허용]은 횟수에 관계없이 발생하게 하는 설정입니다.
if 조건1 then
buy("b1");
if 조건2 then
buy("b2");
위와 같이 2개의 buy를 사용하는 전략이 있고
조건1 --> 조건2 --> 조건1 --> 조건2
순서로 조건이 만족했을때
다른진입신호만허용하면 1번씩만 신호가 발생하게 되고
조건1(신호발생) --> 조건2(신호발생) --> 조건1(신호발생없음) --> 조건2(신호발생없음)
모든진입신호허용은 조건이 만족할때마다 신호가 발생하게 됩니다.
조건1(신호발생) --> 조건2(신호발생) --> 조건1(신호발생) --> 조건2(신호발생)
즐거운 하루되세요
> 목마와숙녀 님이 쓴 글입니다.
> 제목 : 문의
> 별첨파일은 아래수식을 시뮬레이션한 결과들 입니다.
피라미딩시 20개까지 진입하는 수식이고
Array : EP[30](0); 이고
피라미딩설정창에서 다른진입신호만허용입니다.
질문1) 첨부파일 첫번째
2019년 1월 28일 첫번째 진입의 손절(미니선물 50틱 ,1.00)이 적용되지 않고 end of day로 청산되었습니다.
2017년 3월 24일 첫번째 진입 손절은 정상처리됨.
질문2) 첨부파일 두번째
EP[1], EP[5], EP[30]순으로 방배열을 조정해 보았음
3가지 경우 모두 2019.4.19 MAX16개 진입이 발생했습니다.(년간 진입횟수와 수익은 서로 다름)
방배열 숫자가 작으면 피라미딩MAX도 작아지는 것 아닌지요
질문3)
피라미딩설정창에서 다른진입신호만허용과 모든진입신호허용이 있는데
buy만 진입하는 수식에서 위 구분은 어떤 차이를 발생시키나요.
항상 고맙습니다.
***********************************************************************************
input : 기준(283),상승(0.10);
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);
input : 손절13(50),익절13(300),TR13(150);
input : 손절14(50),익절14(300),TR14(150);
input : 손절15(50),익절15(300),TR15(150);
input : 손절16(50),익절16(300),TR16(150);
input : 손절17(50),익절17(300),TR17(150);
input : 손절18(50),익절18(300),TR18(150);
input : 손절19(50),익절19(300),TR19(150);
input : 손절20(50),익절20(300),TR20(150);
Array : EP[30](0);
if MarketPosition == 0 and NextBarOpen < 기준+상승 and ExitDate(1) != sdate Then
buy("b1",AtStop,기준+상승);
if MarketPosition == 1 Then
{
var1 = (기준+상승) + 상승*MaxEntries;
EP[MaxEntries] = LatestEntryPrice(0);
if MaxEntries == 1 and NextBarOpen < var1 Then
buy("b2",AtStop,var1);
if MaxEntries == 2 and NextBarOpen < var1 Then
buy("b3",AtStop,var1);
if MaxEntries == 3 and NextBarOpen < var1 Then
buy("b4",AtStop,var1);
if MaxEntries == 4 and NextBarOpen < var1 Then
buy("b5",AtStop,var1);
if MaxEntries == 5 and NextBarOpen < var1 Then
buy("b6",AtStop,var1);
if MaxEntries == 6 and NextBarOpen < var1 Then
buy("b7",AtStop,var1);
if MaxEntries == 7 and NextBarOpen < var1 Then
buy("b8",AtStop,var1);
if MaxEntries == 8 and NextBarOpen < var1 Then
buy("b9",AtStop,var1);
if MaxEntries == 9 and NextBarOpen < var1 Then
buy("b10",AtStop,var1);
if MaxEntries == 10 and NextBarOpen < var1 Then
buy("b11",AtStop,var1);
if MaxEntries == 11 and NextBarOpen < var1 Then
buy("b12",AtStop,var1);
if MaxEntries == 12 and NextBarOpen < var1 Then
buy("b13",AtStop,var1);
if MaxEntries == 13 and NextBarOpen < var1 Then
buy("b14",AtStop,var1);
if MaxEntries == 14 and NextBarOpen < var1 Then
buy("b15",AtStop,var1);
if MaxEntries == 15 and NextBarOpen < var1 Then
buy("b16",AtStop,var1);
if MaxEntries == 16 and NextBarOpen < var1 Then
buy("b17",AtStop,var1);
if MaxEntries == 17 and NextBarOpen < var1 Then
buy("b18",AtStop,var1);
if MaxEntries == 18 and NextBarOpen < var1 Then
buy("b19",AtStop,var1);
if MaxEntries == 19 and NextBarOpen < var1 Then
buy("b20",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");
}
if MaxEntries >= 13 and EP[13] > 0 Then
{
ExitLong("bl13",AtStop,EP[13]-PriceScale*손절13,"b13");
ExitLong("bp13",Atlimit,EP[13]+PriceScale*익절13,"b13");
ExitLong("btr13",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR13,"b13");
}
if MaxEntries >= 14 and EP[14] > 0 Then
{
ExitLong("bl14",AtStop,EP[14]-PriceScale*손절14,"b14");
ExitLong("bp14",Atlimit,EP[14]+PriceScale*익절14,"b14");
ExitLong("btr14",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR14,"b14");
}
if MaxEntries >= 15 and EP[15] > 0 Then
{
ExitLong("bl15",AtStop,EP[15]-PriceScale*손절15,"b15");
ExitLong("bp15",Atlimit,EP[15]+PriceScale*익절15,"b15");
ExitLong("btr15",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR15,"b15");
}
if MaxEntries >= 16 and EP[16] > 0 Then
{
ExitLong("bl16",AtStop,EP[16]-PriceScale*손절16,"b16");
ExitLong("bp16",Atlimit,EP[16]+PriceScale*익절16,"b16");
ExitLong("btr16",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR16,"b16");
}
if MaxEntries >= 17 and EP[17] > 0 Then
{
ExitLong("bl17",AtStop,EP[17]-PriceScale*손절17,"b17");
ExitLong("bp17",Atlimit,EP[17]+PriceScale*익절17,"b17");
ExitLong("btr17",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR17,"b17");
}
if MaxEntries >= 18 and EP[18] > 0 Then
{
ExitLong("bl18",AtStop,EP[18]-PriceScale*손절18,"b18");
ExitLong("bp18",Atlimit,EP[18]+PriceScale*익절18,"b18");
ExitLong("btr18",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR18,"b18");
}
if MaxEntries >= 19 and EP[19] > 0 Then
{
ExitLong("bl19",AtStop,EP[19]-PriceScale*손절19,"b19");
ExitLong("bp19",Atlimit,EP[19]+PriceScale*익절19,"b19");
ExitLong("btr19",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR19,"b19");
}
if MaxEntries >= 20 and EP[20] > 0 Then
{
ExitLong("bl20",AtStop,EP[20]-PriceScale*손절20,"b20");
ExitLong("bp20",Atlimit,EP[20]+PriceScale*익절20,"b20");
ExitLong("btr20",AtStop,highest(h,BarsSinceEntry)-PriceScale*TR20,"b20");
}
}