커뮤니티

수식어 부탁드립니다

프로필 이미지
푸른
2021-04-09 08:39:01
717
글번호 147835
답변완료
input : StartTime(150000),EndTime(055000); Input : 당일수익틱수(120); var : 전환선(0),기준선(0),선행스팬1(0),선행스팬2(0); var : Tcond(false); Var : N1(0),dayPl(0),당일수익(0),Xcond(false); 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; Xcond = false; N1 = NetProfit; SetStopEndofday(0); } 당일수익 = PriceScale*당일수익틱수; daypl = NetProfit-N1; if TotalTrades > TotalTrades[1] then { if daypl >= 당일수익 Then Xcond = true; if IsExitName("dbp",1) == true or IsExitName("dsp",1) == true then Xcond = true; } 전환선 = (highest(H,9)+lowest(L,9))/2; 기준선 = (highest(H,26)+lowest(L,26))/2; 선행스팬1 = (전환선[25]+기준선[25])/2; 선행스팬2 = (highest(H,52)[25]+lowest(L,52)[25])/2; var1 = Disparity(20); if Tcond == true and xcond == False Then { if 전환선 > 기준선 and crossup(전환선,선행스팬1) and var1 >= 99 Then buy("b"); if MarketPosition == 1 then { ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts)); if 전환선 < 기준선 and CrossDown(전환선,선행스팬2) and var1 >= 99 Then exitlong(); } if 전환선 < 기준선 and CrossDown(전환선,선행스팬1) and var1 <= 101 Then sell("s"); if MarketPosition == -1 then { ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts)); if 전환선 > 기준선 and CrossUp(전환선,선행스팬2) and var1 <= 101 Then ExitShort(); } } ------------------------------------------------------------------------ input : StartTime(070000),EndTime(055500); input : BuyN(40),SellN(80),당일수익틱수(120);; var : Tcond(false),N1(0),dayPl(0),당일수익(0),Xcond(false); 당일수익 = PriceScale*당일수익틱수; 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 { var1 = O; Tcond = true; Xcond = false; N1 = NetProfit; SetStopEndofday(0); } daypl = NetProfit-N1; if TotalTrades > TotalTrades[1] then { if daypl >= 당일수익 Then Xcond = true; if IsExitName("dbp",1) == true or IsExitName("dsp",1) == true then Xcond = true; } if Tcond == true and Xcond == False Then { if MarketPosition <= 0 and L >= DayOpen-20*PriceScale Then Buy("b",AtLimit,DayOpen-20*PriceScale); if MarketPosition <= 0 and L >= DayOpen-30*PriceScale Then Sell("s",AtLimit,DayOpen+30*PriceScale); } if MarketPosition == 1 Then { ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts)); SetStopProfittarget(PriceScale*BuyN,PointStop); SetStopLoss(PriceScale*BuyN,PointStop); } Else if MarketPosition == -1 Then { ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts)); SetStopProfittarget(PriceScale*SellN,PointStop); SetStopLoss(PriceScale*SellN,PointStop); } Else { SetStopProfittarget(0); SetStopLoss(0); } ------------------------------------------ 상기 2개의 수식어를 하나의 수식어로 부탁드립니다. 매매시간은 07:00 익일 05:50이고 청산시간은 05:55 입니다. 목표수익은 120틱 입니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2021-04-09 13:35:34

안녕하세요 예스스탁입니다. input : StartTime(70000),EndTime(055000); input : BuyN(40),SellN(80); input : Xtime(055500); Input : 당일수익틱수(120); var : 전환선(0),기준선(0),선행스팬1(0),선행스팬2(0); var : Tcond(false); Var : N1(0),dayPl(0),당일수익(0),Xcond(false); if sDate != sDate[1] then SetStopEndofday(xtime); 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 { var1 = O; Tcond = true; Xcond = false; N1 = NetProfit; SetStopEndofday(0); } 당일수익 = PriceScale*당일수익틱수; daypl = NetProfit-N1; if TotalTrades > TotalTrades[1] then { if daypl >= 당일수익 Then Xcond = true; if IsExitName("dbp",1) == true or IsExitName("dsp",1) == true then Xcond = true; } 전환선 = (highest(H,9)+lowest(L,9))/2; 기준선 = (highest(H,26)+lowest(L,26))/2; 선행스팬1 = (전환선[25]+기준선[25])/2; 선행스팬2 = (highest(H,52)[25]+lowest(L,52)[25])/2; var1 = Disparity(20); if Tcond == true and xcond == False Then { if 전환선 > 기준선 and crossup(전환선,선행스팬1) and var1 >= 99 Then buy("b1"); if 전환선 < 기준선 and CrossDown(전환선,선행스팬1) and var1 <= 101 Then sell("s1"); if MarketPosition <= 0 and L >= DayOpen-20*PriceScale Then Buy("b2",AtLimit,DayOpen-20*PriceScale); if MarketPosition <= 0 and L >= DayOpen-30*PriceScale Then Sell("s2",AtLimit,DayOpen+30*PriceScale); if MarketPosition == 1 and IsEntryName("b1") == true then { if 전환선 < 기준선 and CrossDown(전환선,선행스팬2) and var1 >= 99 Then exitlong("bx1"); } if MarketPosition == -1 and IsEntryName("s1") == true then { if 전환선 > 기준선 and CrossUp(전환선,선행스팬2) and var1 <= 101 Then ExitShort("sx1"); } } if MarketPosition == 1 and IsEntryName("b2",0) == true Then { SetStopProfittarget(PriceScale*BuyN,PointStop); SetStopLoss(PriceScale*BuyN,PointStop); } Else if MarketPosition == -1 and IsEntryName("s2",0) == true Then { SetStopProfittarget(PriceScale*SellN,PointStop); SetStopLoss(PriceScale*SellN,PointStop); } Else { SetStopProfittarget(0); SetStopLoss(0); } if MarketPosition == 1 Then { ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts)); } if MarketPosition == -1 Then { ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts)); } 즐거운 하루되세요 > 푸른 님이 쓴 글입니다. > 제목 : 수식어 부탁드립니다 > input : StartTime(150000),EndTime(055000); Input : 당일수익틱수(120); var : 전환선(0),기준선(0),선행스팬1(0),선행스팬2(0); var : Tcond(false); Var : N1(0),dayPl(0),당일수익(0),Xcond(false); 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; Xcond = false; N1 = NetProfit; SetStopEndofday(0); } 당일수익 = PriceScale*당일수익틱수; daypl = NetProfit-N1; if TotalTrades > TotalTrades[1] then { if daypl >= 당일수익 Then Xcond = true; if IsExitName("dbp",1) == true or IsExitName("dsp",1) == true then Xcond = true; } 전환선 = (highest(H,9)+lowest(L,9))/2; 기준선 = (highest(H,26)+lowest(L,26))/2; 선행스팬1 = (전환선[25]+기준선[25])/2; 선행스팬2 = (highest(H,52)[25]+lowest(L,52)[25])/2; var1 = Disparity(20); if Tcond == true and xcond == False Then { if 전환선 > 기준선 and crossup(전환선,선행스팬1) and var1 >= 99 Then buy("b"); if MarketPosition == 1 then { ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts)); if 전환선 < 기준선 and CrossDown(전환선,선행스팬2) and var1 >= 99 Then exitlong(); } if 전환선 < 기준선 and CrossDown(전환선,선행스팬1) and var1 <= 101 Then sell("s"); if MarketPosition == -1 then { ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts)); if 전환선 > 기준선 and CrossUp(전환선,선행스팬2) and var1 <= 101 Then ExitShort(); } } ------------------------------------------------------------------------ input : StartTime(070000),EndTime(055500); input : BuyN(40),SellN(80),당일수익틱수(120);; var : Tcond(false),N1(0),dayPl(0),당일수익(0),Xcond(false); 당일수익 = PriceScale*당일수익틱수; 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 { var1 = O; Tcond = true; Xcond = false; N1 = NetProfit; SetStopEndofday(0); } daypl = NetProfit-N1; if TotalTrades > TotalTrades[1] then { if daypl >= 당일수익 Then Xcond = true; if IsExitName("dbp",1) == true or IsExitName("dsp",1) == true then Xcond = true; } if Tcond == true and Xcond == False Then { if MarketPosition <= 0 and L >= DayOpen-20*PriceScale Then Buy("b",AtLimit,DayOpen-20*PriceScale); if MarketPosition <= 0 and L >= DayOpen-30*PriceScale Then Sell("s",AtLimit,DayOpen+30*PriceScale); } if MarketPosition == 1 Then { ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts)); SetStopProfittarget(PriceScale*BuyN,PointStop); SetStopLoss(PriceScale*BuyN,PointStop); } Else if MarketPosition == -1 Then { ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts)); SetStopProfittarget(PriceScale*SellN,PointStop); SetStopLoss(PriceScale*SellN,PointStop); } Else { SetStopProfittarget(0); SetStopLoss(0); } ------------------------------------------ 상기 2개의 수식어를 하나의 수식어로 부탁드립니다. 매매시간은 07:00 익일 05:50이고 청산시간은 05:55 입니다. 목표수익은 120틱 입니다.