커뮤니티

문의 드립니다

프로필 이미지
푸른
2023-11-03 14:15:53
830
글번호 173702
답변완료
input : StartTime(70000),EndTime(50000),진입횟수(2); input : 익절틱수(0),손절틱수(0); var : Tcond(False),entry(0); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; entry = 0; IF Endtime <= starttime Then { SetStopEndofday(0); } } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then { Tcond = False; } if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; if Tcond == true Then { if MarketPosition <= 0 and entry < 진입횟수 Then buy("b",atlimit,dayhigh-PriceScale*250); if MarketPosition == 1 Then exitlong("bx",atlimit,lowest(L,BarsSinceEntry)+PriceScale*500); if MarketPosition >= 0 and entry < 진입횟수 Then sell("s",atlimit,daylow+PriceScale*7000); if MarketPosition == -1 Then ExitShort("sx",atlimit,Highest(H,BarsSinceEntry)-PriceScale*40); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 2번 진입은 1번하고 동일한 가격에 진입신호가 되도록 부탁드립니다. 늘 감사드립니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2023-11-03 15:01:27

안녕하세요 예스스탁입니다. input : StartTime(70000),EndTime(50000),진입횟수(2); input : 익절틱수(0),손절틱수(0); var : Tcond(False),entry(0),SE(0),BE(0); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; entry = 0; BE = 0; SE = 0; IF Endtime <= starttime Then { SetStopEndofday(0); } } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then { Tcond = False; } if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; if Tcond == true Then { if MarketPosition <= 0 and entry < 진입횟수 then { if entry < 1 Then buy("b1",atlimit,dayhigh-PriceScale*250); Else { if L > BE Then buy("b2",atlimit,BE); Else buy("b3",AtStop,BE); } } if MarketPosition == 1 Then { if BE == 0 Then BE = EntryPrice; exitlong("bx",atlimit,lowest(L,BarsSinceEntry)+PriceScale*500); } if MarketPosition >= 0 and entry < 진입횟수 Then { if entry < 1 Then sell("s",atlimit,daylow+PriceScale*7000); Else { if H < SE Then Sell("s2",atlimit,SE); Else Sell("s3",AtStop,SE); } } if MarketPosition == -1 Then { if SE == 0 Then SE = EntryPrice; ExitShort("sx",atlimit,Highest(H,BarsSinceEntry)-PriceScale*40); } } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 즐거운 하루되세요 > 푸른 님이 쓴 글입니다. > 제목 : 문의 드립니다 > input : StartTime(70000),EndTime(50000),진입횟수(2); input : 익절틱수(0),손절틱수(0); var : Tcond(False),entry(0); IF Endtime > starttime Then SetStopEndofday(Endtime); Else { if sDate != sDate[1] Then SetStopEndofday(Endtime); } if (sdate != sdate[1] and stime >= StartTime) or (sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then { Tcond = true; entry = 0; IF Endtime <= starttime Then { SetStopEndofday(0); } } if (sdate != sdate[1] and stime >= EndTime) or (sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then { Tcond = False; } if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; if Tcond == true Then { if MarketPosition <= 0 and entry < 진입횟수 Then buy("b",atlimit,dayhigh-PriceScale*250); if MarketPosition == 1 Then exitlong("bx",atlimit,lowest(L,BarsSinceEntry)+PriceScale*500); if MarketPosition >= 0 and entry < 진입횟수 Then sell("s",atlimit,daylow+PriceScale*7000); if MarketPosition == -1 Then ExitShort("sx",atlimit,Highest(H,BarsSinceEntry)-PriceScale*40); } SetStopProfittarget(PriceScale*익절틱수,PointStop); SetStopLoss(PriceScale*손절틱수,PointStop); 2번 진입은 1번하고 동일한 가격에 진입신호가 되도록 부탁드립니다. 늘 감사드립니다.