커뮤니티

시스템식 부탁드립니다.

프로필 이미지
양치기
2024-01-14 16:28:51
665
글번호 175724
답변완료
항상 도움주셔서 감사합니다. 종목 : 해외선물 아래시스템식에서 매수, 매도 진입이후 18시간이 지나면 청산하고 싶습니다. 시스템식 변형 부탁드립니다. input : pt(10),sl(15); input : p1(10),p2(20); var : vol(1); // 진입수량 var : line1(0),line2(0) ; var : etime(0) ; line1 = ma(c,p1) ; line2 = ma(c,p2) ; value1 = pt/PointValue; //$로 익절 value2 = sl/PointValue; //$로 손절 if MarketPosition == 0 and crossup(line1,line2) Then { Buy("b",OnClose,Def,vol); etime = sTime+180000 ; } if MarketPosition == 0 and CrossDown(line1,line2) Then { Sell("s",OnClose,Def,vol); etime = sTime+180000 ; } If stime == etime Then ExitLong("bx"); ExitShort("sx"); ##### 스탑로스 ##### SetStopProfittarget(value1*PriceScale,PointStop); SetStopLoss(Value2*PriceScale,PointStop); 감사합니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2024-01-15 17:32:43

안녕하세요 예스스탁입니다. input : pt(10),sl(15); input : p1(10),p2(20); var : vol(1); // 진입수량 var : line1(0),line2(0) ; var : S1(0),D1(0),TM(0),BTM(0),STM(0); if Bdate != Bdate[1] Then { S1 = TimeToMinutes(stime); D1 = sdate; } if D1 > 0 then { if sdate == D1 Then TM = TimeToMinutes(stime)-S1; Else TM = TimeToMinutes(stime)+1440-S1; } line1 = ma(c,p1) ; line2 = ma(c,p2) ; value1 = pt/PointValue; //$로 익절 value2 = sl/PointValue; //$로 손절 if MarketPosition == 0 and crossup(line1,line2) Then { Buy("b",OnClose,Def,vol); BTM = TM; } if MarketPosition == 0 and CrossDown(line1,line2) Then { Sell("s",OnClose,Def,vol); STM = TM; } if MarketPosition == 1 and TM >= BTM+(18*60) Then ExitLong(); if MarketPosition == -1 and TM >= STM+(18*60) Then ExitShort(); ##### 스탑로스 ##### SetStopProfittarget(value1*PriceScale,PointStop); SetStopLoss(Value2*PriceScale,PointStop); 즐거운 하루되세요 > 양치기 님이 쓴 글입니다. > 제목 : 시스템식 부탁드립니다. > 항상 도움주셔서 감사합니다. 종목 : 해외선물 아래시스템식에서 매수, 매도 진입이후 18시간이 지나면 청산하고 싶습니다. 시스템식 변형 부탁드립니다. input : pt(10),sl(15); input : p1(10),p2(20); var : vol(1); // 진입수량 var : line1(0),line2(0) ; var : etime(0) ; line1 = ma(c,p1) ; line2 = ma(c,p2) ; value1 = pt/PointValue; //$로 익절 value2 = sl/PointValue; //$로 손절 if MarketPosition == 0 and crossup(line1,line2) Then { Buy("b",OnClose,Def,vol); etime = sTime+180000 ; } if MarketPosition == 0 and CrossDown(line1,line2) Then { Sell("s",OnClose,Def,vol); etime = sTime+180000 ; } If stime == etime Then ExitLong("bx"); ExitShort("sx"); ##### 스탑로스 ##### SetStopProfittarget(value1*PriceScale,PointStop); SetStopLoss(Value2*PriceScale,PointStop); 감사합니다.