커뮤니티

문의드립니다.

프로필 이미지
번성
2022-10-05 04:02:34
991
글번호 162726
답변완료
좋은 답변 감사드립니다. 지수 변동이 생길 때 첫 진입 방법은 그대로 하고, 다음 추가 진입 방법을 변경해주시면 고맙겠습니다. 2, 3, 4, 5, 6, 7...번째까지 추가 진입시 첫 진입 이후 추가되는 +, - 진입 틱 수를 각각 지정할 수 있게 해주시고, 2, 3, 4, 5, 6, 7...번째까지 추가 진입 수량도 각각 지정할 수 있게 해주세요. 라고 위와 같이 문의드려 아래와 같은 답을 받았으나, 추가진입 수량이 각 단계별로 1,2,3,4,5,6개가 추가되어 총 진입수량이 1,3,6,10,15,21개로 고정되어 나타납니다. 각 단계마다 제가 원하는 수량 만큼 추가 진입될 수 있게 수정 부탁드립니다. 안녕하세요 예스스탁입니다. Input:length(12); Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0),TL2(0),TL3(0),Text1(0),처리구분(""),TL_Val1(0),TL_Val2(0),color(0); var:T(0),B(0),Bx(0),S(0),Sx(0); Array:고점[10,2](0),저점[10,2](0); 처리구분 = ""; If Highest(H,length) == H and lastHiVal <> H and Lowest(L,length) == L and lastLoVal <> L Then { If 저점[1,1] > L Then 처리구분 = "저점처리"; If 고점[1,1] < H Then 처리구분 = "고점처리"; } Else If Highest(H,length) == H and lastHiVal <> H Then 처리구분 = "고점처리"; Else If Lowest(L,length) == L and lastLoVal <> L Then 처리구분 = "저점처리"; If 처리구분 == "고점처리" Then { T = 1; lastHiVal = H; If 고점[1,2] < 저점[1,2] Then { For j = 10 DownTo 2 { 고점[j,1] = 고점[j-1,1]; 고점[j,2] = 고점[j-1,2]; } } If 고점[1,2] < 저점[1,2] or 고점[1,1] < H Then { 고점[1,1] = H; 고점[1,2] = Index; sBar = Index - 저점[1,2]; eBar = 0; If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then { TL_Delete(TL1); Text_Delete(Text1); If 고점[3,1][1] < 고점[2,1][1] and 고점[2,1][1] > 고점[1,1][1] and 저점[2,1][1] < 저점[1,1][1] Then TL_Delete(TL2); } if 고점[1,1] > 고점[2,1] or 고점[2,1] == 0 Then{ color = RED; # buy("b"); } TL1 = TL_New(sDate[sBar],sTime[sBar],저점[1,1],sDate[eBar],sTime[eBar],고점[1,1]); TL_SetColor(TL1,color); Text1 = Text_New(sDate[eBar],sTime[eBar],고점[1,1],NumToStr(abs(고점[1,1]-저점[1,1])/PriceScale,0)+NewLine+NumToStr(고점[1,1],2)); Text_SetStyle(Text1, 2, 1); If 고점[3,1] < 고점[2,1] and 고점[2,1] > 고점[1,1] and 저점[2,1] < 저점[1,1] Then { sBar = Index - 저점[2,2]; eBar = Index - 저점[1,2]; } } } If 처리구분 == "저점처리" Then { T = -1; lastLoVal = L; If 저점[1,2] < 고점[1,2] Then { For j = 10 DownTo 2 { 저점[j,1] = 저점[j-1,1]; 저점[j,2] = 저점[j-1,2]; } } If 저점[1,2] < 고점[1,2] or 저점[1,1] > L Then { 저점[1,1] = L; 저점[1,2] = Index; sBar = Index - 고점[1,2]; eBar = 0; If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then { TL_Delete(TL1); Text_Delete(Text1); If 저점[2,1][1] < 저점[1,1][1] and 저점[2,1][1] < 저점[3,1][1] and 고점[2,1][1] > 고점[1,1][1] Then TL_Delete(TL3); } if 저점[1,1] < 저점[2,1] or 저점[2,1] == 0 Then{ color = blue; # sell("s"); } TL1 = TL_New(sDate[sBar],sTime[sBar],고점[1,1],sDate[eBar],sTime[eBar],저점[1,1]); TL_SetColor(TL1,color); Text1 = Text_New(sDate[eBar],sTime[eBar],저점[1,1],NumToStr(abs(고점[1,1]-저점[1,1])/PriceScale,0)+NewLine+NumToStr(저점[1,1],2)); Text_SetStyle(Text1, 2, 0); If 저점[2,1] < 저점[1,1] and 저점[2,1] < 저점[3,1] and 고점[2,1] > 고점[1,1] Then { sBar = Index - 고점[2,2]; eBar = Index - 고점[1,2]; } } } TL_SetSize(TL1,3); input : 첫진입틱수(1); input : N1(1),추가진입틱수1(5); input : N2(1),추가진입틱수2(10); input : N3(1),추가진입틱수3(15); input : N4(1),추가진입틱수4(20); input : N5(1),추가진입틱수5(25); input : N6(1),추가진입틱수6(30); #상승구간의 마지막저점 저장 if Color == RED Then { var1 = 저점[2,1]; } #하락구간의 마지막 고점 저장 if Color == BLUE Then { var2 = 고점[2,1]; } if MarketPosition <= 0 Then { if color == BLUE and var1 > 0 and L > var1-PriceScale*첫진입틱수 Then Buy("b1",AtLimit,var1-PriceScale*첫진입틱수,1); } if MarketPosition == 1 Then { value1 = Floor(MaxEntries/N1)+1; value2 = Floor(MaxEntries/N2)+1; value3 = Floor(MaxEntries/N3)+1; value4 = Floor(MaxEntries/N4)+1; value5 = Floor(MaxEntries/N5)+1; value6 = Floor(MaxEntries/N6)+1; if MaxEntries == 1 Then Buy("b2",AtLimit,(var1[BarsSinceEntry]-PriceScale*첫진입틱수)-(PriceScale*추가진입틱수1),value1); if MaxEntries == 2 Then Buy("b3",AtLimit,(var1[BarsSinceEntry]-PriceScale*첫진입틱수)-(PriceScale*추가진입틱수2),value2); if MaxEntries == 3 Then Buy("b4",AtLimit,(var1[BarsSinceEntry]-PriceScale*첫진입틱수)-(PriceScale*추가진입틱수3),value3); if MaxEntries == 4 Then Buy("b5",AtLimit,(var1[BarsSinceEntry]-PriceScale*첫진입틱수)-(PriceScale*추가진입틱수4),value4); if MaxEntries ==5 Then Buy("b6",AtLimit,(var1[BarsSinceEntry]-PriceScale*첫진입틱수)-(PriceScale*추가진입틱수5),value5); if MaxEntries == 6 Then Buy("b7",AtLimit,(var1[BarsSinceEntry]-PriceScale*첫진입틱수)-(PriceScale*추가진입틱수6),value6); if T == -1 and 고점[1,1] > 0 Then ExitLong("bx1",AtLimit,고점[1,1]+PriceScale*1); if T == 1 and 고점[2,1] > 0 Then ExitLong("bx2",AtLimit,고점[2,1]+PriceScale*1); } if MarketPosition >= 0 Then { if Color == RED and Var2 > 0 and H < var2+PriceScale*첫진입틱수 Then Sell("s1",AtLimit,Var2+PriceScale*첫진입틱수,1); } if MarketPosition == -1 Then { value1 = Floor(MaxEntries/N1)+1; value2 = Floor(MaxEntries/N1)+1; value3 = Floor(MaxEntries/N1)+1; value4 = Floor(MaxEntries/N1)+1; value5 = Floor(MaxEntries/N1)+1; value6 = Floor(MaxEntries/N1)+1; if MaxEntries == 1 Then Sell("s2",AtLimit,(var2[BarsSinceEntry]+PriceScale*첫진입틱수)+(PriceScale*추가진입틱수1),value1); if MaxEntries == 2 Then Sell("s3",AtLimit,(var2[BarsSinceEntry]+PriceScale*첫진입틱수)+(PriceScale*추가진입틱수2),value2); if MaxEntries == 3 Then Sell("s4",AtLimit,(var2[BarsSinceEntry]+PriceScale*첫진입틱수)+(PriceScale*추가진입틱수3),value3); if MaxEntries == 4 Then Sell("s5",AtLimit,(var2[BarsSinceEntry]+PriceScale*첫진입틱수)+(PriceScale*추가진입틱수4),value4); if MaxEntries == 5 Then Sell("s6",AtLimit,(var2[BarsSinceEntry]+PriceScale*첫진입틱수)+(PriceScale*추가진입틱수5),value5); if MaxEntries == 6 Then Sell("s7",AtLimit,(var2[BarsSinceEntry]+PriceScale*첫진입틱수)+(PriceScale*추가진입틱수6),value6); if T == 1 and 저점[1,1] > 0 Then ExitShort("sx1",AtLimit,저점[1,1]-PriceScale*1); if T == -1 and 저점[2,1] > 0 Then ExitShort("sx2",AtLimit,저점[2,1]-PriceScale*1); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2022-10-06 09:49:12

안녕하세요 예스스탁입니다. 기존 수량계산식이 Floor(MaxEntries/N)+1로 해당 N값을 진입별로 구분해 드렸습니다. 위 계산식을 사용하지 않고 지정한 수량으로 진입하게 수정해 드립니다. Input:length(12); input : N1(1),첫진입틱수(1); input : N2(2),추가진입틱수1(5); input : N3(3),추가진입틱수2(10); input : N4(4),추가진입틱수3(15); input : N5(5),추가진입틱수4(20); input : N6(6),추가진입틱수5(25); input : N7(7),추가진입틱수6(30); Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0),TL2(0),TL3(0),Text1(0),처리구분(""),TL_Val1(0),TL_Val2(0),color(0); var:T(0),B(0),Bx(0),S(0),Sx(0); Array:고점[10,2](0),저점[10,2](0); 처리구분 = ""; If Highest(H,length) == H and lastHiVal <> H and Lowest(L,length) == L and lastLoVal <> L Then { If 저점[1,1] > L Then 처리구분 = "저점처리"; If 고점[1,1] < H Then 처리구분 = "고점처리"; } Else If Highest(H,length) == H and lastHiVal <> H Then 처리구분 = "고점처리"; Else If Lowest(L,length) == L and lastLoVal <> L Then 처리구분 = "저점처리"; If 처리구분 == "고점처리" Then { T = 1; lastHiVal = H; If 고점[1,2] < 저점[1,2] Then { For j = 10 DownTo 2 { 고점[j,1] = 고점[j-1,1]; 고점[j,2] = 고점[j-1,2]; } } If 고점[1,2] < 저점[1,2] or 고점[1,1] < H Then { 고점[1,1] = H; 고점[1,2] = Index; sBar = Index - 저점[1,2]; eBar = 0; If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then { TL_Delete(TL1); Text_Delete(Text1); If 고점[3,1][1] < 고점[2,1][1] and 고점[2,1][1] > 고점[1,1][1] and 저점[2,1][1] < 저점[1,1][1] Then TL_Delete(TL2); } if 고점[1,1] > 고점[2,1] or 고점[2,1] == 0 Then{ color = RED; # buy("b"); } TL1 = TL_New(sDate[sBar],sTime[sBar],저점[1,1],sDate[eBar],sTime[eBar],고점[1,1]); TL_SetColor(TL1,color); Text1 = Text_New(sDate[eBar],sTime[eBar],고점[1,1],NumToStr(abs(고점[1,1]-저점[1,1])/PriceScale,0)+NewLine+NumToStr(고점[1,1],2)); Text_SetStyle(Text1, 2, 1); If 고점[3,1] < 고점[2,1] and 고점[2,1] > 고점[1,1] and 저점[2,1] < 저점[1,1] Then { sBar = Index - 저점[2,2]; eBar = Index - 저점[1,2]; } } } If 처리구분 == "저점처리" Then { T = -1; lastLoVal = L; If 저점[1,2] < 고점[1,2] Then { For j = 10 DownTo 2 { 저점[j,1] = 저점[j-1,1]; 저점[j,2] = 저점[j-1,2]; } } If 저점[1,2] < 고점[1,2] or 저점[1,1] > L Then { 저점[1,1] = L; 저점[1,2] = Index; sBar = Index - 고점[1,2]; eBar = 0; If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then { TL_Delete(TL1); Text_Delete(Text1); If 저점[2,1][1] < 저점[1,1][1] and 저점[2,1][1] < 저점[3,1][1] and 고점[2,1][1] > 고점[1,1][1] Then TL_Delete(TL3); } if 저점[1,1] < 저점[2,1] or 저점[2,1] == 0 Then{ color = blue; # sell("s"); } TL1 = TL_New(sDate[sBar],sTime[sBar],고점[1,1],sDate[eBar],sTime[eBar],저점[1,1]); TL_SetColor(TL1,color); Text1 = Text_New(sDate[eBar],sTime[eBar],저점[1,1],NumToStr(abs(고점[1,1]-저점[1,1])/PriceScale,0)+NewLine+NumToStr(저점[1,1],2)); Text_SetStyle(Text1, 2, 0); If 저점[2,1] < 저점[1,1] and 저점[2,1] < 저점[3,1] and 고점[2,1] > 고점[1,1] Then { sBar = Index - 고점[2,2]; eBar = Index - 고점[1,2]; } } } TL_SetSize(TL1,3); #상승구간의 마지막저점 저장 if Color == RED Then { var1 = 저점[2,1]; } #하락구간의 마지막 고점 저장 if Color == BLUE Then { var2 = 고점[2,1]; } if MarketPosition <= 0 Then { if color == BLUE and var1 > 0 and L > var1-PriceScale*첫진입틱수 Then Buy("b1",AtLimit,var1-PriceScale*첫진입틱수,N1); } if MarketPosition == 1 Then { if MaxEntries == 1 Then Buy("b2",AtLimit,(var1[BarsSinceEntry]-PriceScale*첫진입틱수)-(PriceScale*추가진입틱수1),N2); if MaxEntries == 2 Then Buy("b3",AtLimit,(var1[BarsSinceEntry]-PriceScale*첫진입틱수)-(PriceScale*추가진입틱수2),N3); if MaxEntries == 3 Then Buy("b4",AtLimit,(var1[BarsSinceEntry]-PriceScale*첫진입틱수)-(PriceScale*추가진입틱수3),N4); if MaxEntries == 4 Then Buy("b5",AtLimit,(var1[BarsSinceEntry]-PriceScale*첫진입틱수)-(PriceScale*추가진입틱수4),N5); if MaxEntries ==5 Then Buy("b6",AtLimit,(var1[BarsSinceEntry]-PriceScale*첫진입틱수)-(PriceScale*추가진입틱수5),N6); if MaxEntries == 6 Then Buy("b7",AtLimit,(var1[BarsSinceEntry]-PriceScale*첫진입틱수)-(PriceScale*추가진입틱수6),N7); if T == -1 and 고점[1,1] > 0 Then ExitLong("bx1",AtLimit,고점[1,1]+PriceScale*1); if T == 1 and 고점[2,1] > 0 Then ExitLong("bx2",AtLimit,고점[2,1]+PriceScale*1); } if MarketPosition >= 0 Then { if Color == RED and Var2 > 0 and H < var2+PriceScale*첫진입틱수 Then Sell("s1",AtLimit,Var2+PriceScale*첫진입틱수,1); } if MarketPosition == -1 Then { if MaxEntries == 1 Then Sell("s2",AtLimit,(var2[BarsSinceEntry]+PriceScale*첫진입틱수)+(PriceScale*추가진입틱수1),N2); if MaxEntries == 2 Then Sell("s3",AtLimit,(var2[BarsSinceEntry]+PriceScale*첫진입틱수)+(PriceScale*추가진입틱수2),N3); if MaxEntries == 3 Then Sell("s4",AtLimit,(var2[BarsSinceEntry]+PriceScale*첫진입틱수)+(PriceScale*추가진입틱수3),N4); if MaxEntries == 4 Then Sell("s5",AtLimit,(var2[BarsSinceEntry]+PriceScale*첫진입틱수)+(PriceScale*추가진입틱수4),N5); if MaxEntries == 5 Then Sell("s6",AtLimit,(var2[BarsSinceEntry]+PriceScale*첫진입틱수)+(PriceScale*추가진입틱수5),N6); if MaxEntries == 6 Then Sell("s7",AtLimit,(var2[BarsSinceEntry]+PriceScale*첫진입틱수)+(PriceScale*추가진입틱수6),N7); if T == 1 and 저점[1,1] > 0 Then ExitShort("sx1",AtLimit,저점[1,1]-PriceScale*1); if T == -1 and 저점[2,1] > 0 Then ExitShort("sx2",AtLimit,저점[2,1]-PriceScale*1); } 즐거운 하루되세요 > 번성 님이 쓴 글입니다. > 제목 : 문의드립니다. > 좋은 답변 감사드립니다. 지수 변동이 생길 때 첫 진입 방법은 그대로 하고, 다음 추가 진입 방법을 변경해주시면 고맙겠습니다. 2, 3, 4, 5, 6, 7...번째까지 추가 진입시 첫 진입 이후 추가되는 +, - 진입 틱 수를 각각 지정할 수 있게 해주시고, 2, 3, 4, 5, 6, 7...번째까지 추가 진입 수량도 각각 지정할 수 있게 해주세요. 라고 위와 같이 문의드려 아래와 같은 답을 받았으나, 추가진입 수량이 각 단계별로 1,2,3,4,5,6개가 추가되어 총 진입수량이 1,3,6,10,15,21개로 고정되어 나타납니다. 각 단계마다 제가 원하는 수량 만큼 추가 진입될 수 있게 수정 부탁드립니다. 안녕하세요 예스스탁입니다. Input:length(12); Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0),TL2(0),TL3(0),Text1(0),처리구분(""),TL_Val1(0),TL_Val2(0),color(0); var:T(0),B(0),Bx(0),S(0),Sx(0); Array:고점[10,2](0),저점[10,2](0); 처리구분 = ""; If Highest(H,length) == H and lastHiVal <> H and Lowest(L,length) == L and lastLoVal <> L Then { If 저점[1,1] > L Then 처리구분 = "저점처리"; If 고점[1,1] < H Then 처리구분 = "고점처리"; } Else If Highest(H,length) == H and lastHiVal <> H Then 처리구분 = "고점처리"; Else If Lowest(L,length) == L and lastLoVal <> L Then 처리구분 = "저점처리"; If 처리구분 == "고점처리" Then { T = 1; lastHiVal = H; If 고점[1,2] < 저점[1,2] Then { For j = 10 DownTo 2 { 고점[j,1] = 고점[j-1,1]; 고점[j,2] = 고점[j-1,2]; } } If 고점[1,2] < 저점[1,2] or 고점[1,1] < H Then { 고점[1,1] = H; 고점[1,2] = Index; sBar = Index - 저점[1,2]; eBar = 0; If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then { TL_Delete(TL1); Text_Delete(Text1); If 고점[3,1][1] < 고점[2,1][1] and 고점[2,1][1] > 고점[1,1][1] and 저점[2,1][1] < 저점[1,1][1] Then TL_Delete(TL2); } if 고점[1,1] > 고점[2,1] or 고점[2,1] == 0 Then{ color = RED; # buy("b"); } TL1 = TL_New(sDate[sBar],sTime[sBar],저점[1,1],sDate[eBar],sTime[eBar],고점[1,1]); TL_SetColor(TL1,color); Text1 = Text_New(sDate[eBar],sTime[eBar],고점[1,1],NumToStr(abs(고점[1,1]-저점[1,1])/PriceScale,0)+NewLine+NumToStr(고점[1,1],2)); Text_SetStyle(Text1, 2, 1); If 고점[3,1] < 고점[2,1] and 고점[2,1] > 고점[1,1] and 저점[2,1] < 저점[1,1] Then { sBar = Index - 저점[2,2]; eBar = Index - 저점[1,2]; } } } If 처리구분 == "저점처리" Then { T = -1; lastLoVal = L; If 저점[1,2] < 고점[1,2] Then { For j = 10 DownTo 2 { 저점[j,1] = 저점[j-1,1]; 저점[j,2] = 저점[j-1,2]; } } If 저점[1,2] < 고점[1,2] or 저점[1,1] > L Then { 저점[1,1] = L; 저점[1,2] = Index; sBar = Index - 고점[1,2]; eBar = 0; If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then { TL_Delete(TL1); Text_Delete(Text1); If 저점[2,1][1] < 저점[1,1][1] and 저점[2,1][1] < 저점[3,1][1] and 고점[2,1][1] > 고점[1,1][1] Then TL_Delete(TL3); } if 저점[1,1] < 저점[2,1] or 저점[2,1] == 0 Then{ color = blue; # sell("s"); } TL1 = TL_New(sDate[sBar],sTime[sBar],고점[1,1],sDate[eBar],sTime[eBar],저점[1,1]); TL_SetColor(TL1,color); Text1 = Text_New(sDate[eBar],sTime[eBar],저점[1,1],NumToStr(abs(고점[1,1]-저점[1,1])/PriceScale,0)+NewLine+NumToStr(저점[1,1],2)); Text_SetStyle(Text1, 2, 0); If 저점[2,1] < 저점[1,1] and 저점[2,1] < 저점[3,1] and 고점[2,1] > 고점[1,1] Then { sBar = Index - 고점[2,2]; eBar = Index - 고점[1,2]; } } } TL_SetSize(TL1,3); input : 첫진입틱수(1); input : N1(1),추가진입틱수1(5); input : N2(1),추가진입틱수2(10); input : N3(1),추가진입틱수3(15); input : N4(1),추가진입틱수4(20); input : N5(1),추가진입틱수5(25); input : N6(1),추가진입틱수6(30); #상승구간의 마지막저점 저장 if Color == RED Then { var1 = 저점[2,1]; } #하락구간의 마지막 고점 저장 if Color == BLUE Then { var2 = 고점[2,1]; } if MarketPosition <= 0 Then { if color == BLUE and var1 > 0 and L > var1-PriceScale*첫진입틱수 Then Buy("b1",AtLimit,var1-PriceScale*첫진입틱수,1); } if MarketPosition == 1 Then { value1 = Floor(MaxEntries/N1)+1; value2 = Floor(MaxEntries/N2)+1; value3 = Floor(MaxEntries/N3)+1; value4 = Floor(MaxEntries/N4)+1; value5 = Floor(MaxEntries/N5)+1; value6 = Floor(MaxEntries/N6)+1; if MaxEntries == 1 Then Buy("b2",AtLimit,(var1[BarsSinceEntry]-PriceScale*첫진입틱수)-(PriceScale*추가진입틱수1),value1); if MaxEntries == 2 Then Buy("b3",AtLimit,(var1[BarsSinceEntry]-PriceScale*첫진입틱수)-(PriceScale*추가진입틱수2),value2); if MaxEntries == 3 Then Buy("b4",AtLimit,(var1[BarsSinceEntry]-PriceScale*첫진입틱수)-(PriceScale*추가진입틱수3),value3); if MaxEntries == 4 Then Buy("b5",AtLimit,(var1[BarsSinceEntry]-PriceScale*첫진입틱수)-(PriceScale*추가진입틱수4),value4); if MaxEntries ==5 Then Buy("b6",AtLimit,(var1[BarsSinceEntry]-PriceScale*첫진입틱수)-(PriceScale*추가진입틱수5),value5); if MaxEntries == 6 Then Buy("b7",AtLimit,(var1[BarsSinceEntry]-PriceScale*첫진입틱수)-(PriceScale*추가진입틱수6),value6); if T == -1 and 고점[1,1] > 0 Then ExitLong("bx1",AtLimit,고점[1,1]+PriceScale*1); if T == 1 and 고점[2,1] > 0 Then ExitLong("bx2",AtLimit,고점[2,1]+PriceScale*1); } if MarketPosition >= 0 Then { if Color == RED and Var2 > 0 and H < var2+PriceScale*첫진입틱수 Then Sell("s1",AtLimit,Var2+PriceScale*첫진입틱수,1); } if MarketPosition == -1 Then { value1 = Floor(MaxEntries/N1)+1; value2 = Floor(MaxEntries/N1)+1; value3 = Floor(MaxEntries/N1)+1; value4 = Floor(MaxEntries/N1)+1; value5 = Floor(MaxEntries/N1)+1; value6 = Floor(MaxEntries/N1)+1; if MaxEntries == 1 Then Sell("s2",AtLimit,(var2[BarsSinceEntry]+PriceScale*첫진입틱수)+(PriceScale*추가진입틱수1),value1); if MaxEntries == 2 Then Sell("s3",AtLimit,(var2[BarsSinceEntry]+PriceScale*첫진입틱수)+(PriceScale*추가진입틱수2),value2); if MaxEntries == 3 Then Sell("s4",AtLimit,(var2[BarsSinceEntry]+PriceScale*첫진입틱수)+(PriceScale*추가진입틱수3),value3); if MaxEntries == 4 Then Sell("s5",AtLimit,(var2[BarsSinceEntry]+PriceScale*첫진입틱수)+(PriceScale*추가진입틱수4),value4); if MaxEntries == 5 Then Sell("s6",AtLimit,(var2[BarsSinceEntry]+PriceScale*첫진입틱수)+(PriceScale*추가진입틱수5),value5); if MaxEntries == 6 Then Sell("s7",AtLimit,(var2[BarsSinceEntry]+PriceScale*첫진입틱수)+(PriceScale*추가진입틱수6),value6); if T == 1 and 저점[1,1] > 0 Then ExitShort("sx1",AtLimit,저점[1,1]-PriceScale*1); if T == -1 and 저점[2,1] > 0 Then ExitShort("sx2",AtLimit,저점[2,1]-PriceScale*1); }