커뮤니티

문의 드립니다.

프로필 이미지
푸른
2022-12-05 22:50:32
1526
글번호 164358
답변완료

첨부 이미지

input : starttime(180000),endtime(60000),n(30); var : Tcond(false),hh(0),h1(0),ll(0),l1(0); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= endtime) or (sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then { Tcond = false; } if (sdate != sdate[1] and stime >= starttime) or (sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then { Tcond = true; hh = h; ll = l; h1 = hh[1]; l1 = ll[1]; IF Endtime <= starttime Then { SetStopEndofday(0); } } input : 익절틱수(0),손절틱수(30); if NextBarOpen != C Then { Buy("b1",AtStop,NextBarOpen+PriceScale*10); } ExitLong("bx1",AtMarket); if NextBarOpen != C Then { Sell("s1",AtStop,NextBarOpen-PriceScale*10); } ExitShort("sx1",AtMarket); if NextBarSdate == sDate Then { if NextBarOpen == C Then { Buy("b2",AtStop,NextBarOpen+PriceScale*10); } } ExitLong("bx2",AtMarket); if NextBarOpen == C Then { Sell("s2",AtStop,NextBarOpen-PriceScale*10); } ExitShort("sx2",AtMarket); SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); ExitLong("bx"); ExitShort("sx"); 그래프는 익절 40틱이 포함된 60분봉 수식어의 신호입니다. s1, 1계약 매도 진입신호후 60봉완성시 익절인 40틱에 오지않아서 청산이 안되고 그 다음봉인 s2 에서 1계약이 추가되어 평균단가가 조금 내려간 2계약이 되는것을 확인 하였습니다. 저런경우 2계약의 평균단가로 변동이 생겨서 익절을 설정했을시 지정한 폭의 청산이 불가 할수도 있습니다. 문의 드리고자하는것은 60봉 완성시 주문했던 계약수가 익절 상관없이 청산되고 그 다음 신호는 다시 계약수가 형성되는 수식어가 가능한지요 ? 늘 감사드립니다.
시스템
답변 2
프로필 이미지

예스스탁 예스스탁 답변

2022-12-06 13:36:57

안녕하세요 예스스타입니다. ExitLong("bx"); ExitShort("sx"); 현재 수식에 신호상 봉완성시에 청산되는 내용이 있습니다. 첨부하신 그림에서도 매봉 종가에 bx나 sx로 진입된 수량이 모두 청산되고 있습니다. 작성하신 식에서 신호상 다음봉에 추가 진입하는 내용은 없습니다. 위는 신호상 내용이고 청산신호에 대한 주문이 미체결이 있으면 실제 계좌상으로는 2계약 누적이 될수 있습니다. 하지만 위의 경우 시스템에서는 별로도 처리를 할 방법이 없습니다. 시스템은 신호상의 내용으로만 처리가 가능한데 이미 청산이 발생하고 새로운진입이 발생한 경우라 별도로 2계약으로 인지를 할 방법이 없습니다. 도움을 드리지 못해 죄송합니다. 즐거운 하루되세요 > 푸른 님이 쓴 글입니다. > 제목 : 문의 드립니다. > input : starttime(180000),endtime(60000),n(30); var : Tcond(false),hh(0),h1(0),ll(0),l1(0); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= endtime) or (sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then { Tcond = false; } if (sdate != sdate[1] and stime >= starttime) or (sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then { Tcond = true; hh = h; ll = l; h1 = hh[1]; l1 = ll[1]; IF Endtime <= starttime Then { SetStopEndofday(0); } } input : 익절틱수(0),손절틱수(30); if NextBarOpen != C Then { Buy("b1",AtStop,NextBarOpen+PriceScale*10); } ExitLong("bx1",AtMarket); if NextBarOpen != C Then { Sell("s1",AtStop,NextBarOpen-PriceScale*10); } ExitShort("sx1",AtMarket); if NextBarSdate == sDate Then { if NextBarOpen == C Then { Buy("b2",AtStop,NextBarOpen+PriceScale*10); } } ExitLong("bx2",AtMarket); if NextBarOpen == C Then { Sell("s2",AtStop,NextBarOpen-PriceScale*10); } ExitShort("sx2",AtMarket); SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); ExitLong("bx"); ExitShort("sx"); 그래프는 익절 40틱이 포함된 60분봉 수식어의 신호입니다. s1, 1계약 매도 진입신호후 60봉완성시 익절인 40틱에 오지않아서 청산이 안되고 그 다음봉인 s2 에서 1계약이 추가되어 평균단가가 조금 내려간 2계약이 되는것을 확인 하였습니다. 저런경우 2계약의 평균단가로 변동이 생겨서 익절을 설정했을시 지정한 폭의 청산이 불가 할수도 있습니다. 문의 드리고자하는것은 60봉 완성시 주문했던 계약수가 익절 상관없이 청산되고 그 다음 신호는 다시 계약수가 형성되는 수식어가 가능한지요 ? 늘 감사드립니다.
프로필 이미지

푸른

2022-12-07 14:10:17

input:length(5),a틱(10),b틱(10),c틱(5); Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0),Text1(0),process(0),T(0); Array:HH[10,2](0),LL[10,2](0); input : StartTime(150000),EndTime(60000); var : Tcond(false); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then Tcond = False; if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; IF Endtime <= starttime Then { SetStopEndofday(0); } } process = 0; If Highest(H,length) == H and lastHiVal <> H and Lowest(L,length) == L and lastLoVal <> L Then { If LL[1,1] > L Then process = -1; If HH[1,1] < H Then process = 1; } Else If Highest(H,length) == H and lastHiVal <> H Then process = 1; Else If Lowest(L,length) == L and lastLoVal <> L Then process = -1; If process == 1 Then { T = 1; lastHiVal = H; If HH[1,2] < LL[1,2] Then { For j = 10 DownTo 2 { HH[j,1] = HH[j-1,1]; HH[j,2] = HH[j-1,2]; } } If HH[1,2] < LL[1,2] or HH[1,1] < H Then { HH[1,1] = H; HH[1,2] = Index; sBar = Index - LL[1,2]; eBar = 0; If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then { TL_Delete(TL1); Text_Delete(Text1); } if LL[1,1] > 0 Then { TL1 = TL_New(sDate[sBar],sTime[sBar],LL[1,1],sDate[eBar],sTime[eBar],HH[1,1]); Text1 = Text_New(sDate[eBar],sTime[eBar],HH[1,1],"+"+NumToStr(abs(HH[1,1]-LL[1,1])/PriceScale,0)); Text_SetStyle(Text1, 2, 1); } Else { Text_Delete(text1); Text1 = Text_New(sDate[eBar],sTime[eBar],HH[1,1],"+"+NumToStr(abs(HH[1,1]-LL[1,1])/PriceScale,2)); Text_SetStyle(Text1, 2, 1); } Text_SetStyle(Text1, 2, 1); } if MarketPosition <= 0 and HH[2,1] >= LL[2,1]+PriceScale*a틱 and LL[1,1] <= HH[2,1]-PriceScale*b틱 and Tcond == true Then Buy("b",AtStop,HH[2,1]+PriceScale*c틱); } If process == -1 Then { T = -1; lastLoVal = L; If LL[1,2] < HH[1,2] Then { For j = 10 DownTo 2 { LL[j,1] = LL[j-1,1]; LL[j,2] = LL[j-1,2]; } } If LL[1,2] < HH[1,2] or LL[1,1] > L Then { LL[1,1] = L; LL[1,2] = Index; sBar = Index - HH[1,2]; eBar = 0; If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then { TL_Delete(TL1); Text_Delete(Text1); } if HH[1,1] > 0 Then { TL1 = TL_New(sDate[sBar],sTime[sBar],HH[1,1],sDate[eBar],sTime[eBar],LL[1,1]); Text1 = Text_New(sDate[eBar],sTime[eBar],LL[1,1],"-"+NumToStr(abs(HH[1,1]-LL[1,1])/PriceScale,0)); Text_SetStyle(Text1, 2, 0); } Else { Text_Delete(text1); Text1 = Text_New(sDate[eBar],sTime[eBar],LL[1,1],"-"+NumToStr(abs(HH[1,1]-LL[1,1])/PriceScale,0)); Text_SetStyle(Text1, 2, 0); } } if MarketPosition >= 0 and LL[2,1] <= HH[2,1]-PriceScale*a틱 and HH[1,1] >= LL[2,1]+PriceScale*b틱 and Tcond == true Then Sell("s",AtStop,LL[2,1]-PriceScale*c틱); } ------------------------------------------- > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 문의 드립니다. > 안녕하세요 예스스타입니다. ExitLong("bx"); ExitShort("sx"); 현재 수식에 신호상 봉완성시에 청산되는 내용이 있습니다. 첨부하신 그림에서도 매봉 종가에 bx나 sx로 진입된 수량이 모두 청산되고 있습니다. 작성하신 식에서 신호상 다음봉에 추가 진입하는 내용은 없습니다. 위는 신호상 내용이고 청산신호에 대한 주문이 미체결이 있으면 실제 계좌상으로는 2계약 누적이 될수 있습니다. 하지만 위의 경우 시스템에서는 별로도 처리를 할 방법이 없습니다. 시스템은 신호상의 내용으로만 처리가 가능한데 이미 청산이 발생하고 새로운진입이 발생한 경우라 별도로 2계약으로 인지를 할 방법이 없습니다. 도움을 드리지 못해 죄송합니다. 즐거운 하루되세요 > 푸른 님이 쓴 글입니다. > 제목 : 문의 드립니다. > input : starttime(180000),endtime(60000),n(30); var : Tcond(false),hh(0),h1(0),ll(0),l1(0); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= endtime) or (sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then { Tcond = false; } if (sdate != sdate[1] and stime >= starttime) or (sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then { Tcond = true; hh = h; ll = l; h1 = hh[1]; l1 = ll[1]; IF Endtime <= starttime Then { SetStopEndofday(0); } } input : 익절틱수(0),손절틱수(30); if NextBarOpen != C Then { Buy("b1",AtStop,NextBarOpen+PriceScale*10); } ExitLong("bx1",AtMarket); if NextBarOpen != C Then { Sell("s1",AtStop,NextBarOpen-PriceScale*10); } ExitShort("sx1",AtMarket); if NextBarSdate == sDate Then { if NextBarOpen == C Then { Buy("b2",AtStop,NextBarOpen+PriceScale*10); } } ExitLong("bx2",AtMarket); if NextBarOpen == C Then { Sell("s2",AtStop,NextBarOpen-PriceScale*10); } ExitShort("sx2",AtMarket); SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); ExitLong("bx"); ExitShort("sx"); 그래프는 익절 40틱이 포함된 60분봉 수식어의 신호입니다. s1, 1계약 매도 진입신호후 60봉완성시 익절인 40틱에 오지않아서 청산이 안되고 그 다음봉인 s2 에서 1계약이 추가되어 평균단가가 조금 내려간 2계약이 되는것을 확인 하였습니다. 저런경우 2계약의 평균단가로 변동이 생겨서 익절을 설정했을시 지정한 폭의 청산이 불가 할수도 있습니다. 문의 드리고자하는것은 60봉 완성시 주문했던 계약수가 익절 상관없이 청산되고 그 다음 신호는 다시 계약수가 형성되는 수식어가 가능한지요 ? 늘 감사드립니다.