커뮤니티

수식어 부탁드립니다

프로필 이미지
푸른
2021-04-11 20:55:24
1047
글번호 147887
답변완료

첨부 이미지

input : 진입횟수(2); var : entry(0); if bdate != bdate[1] Then entry = 0; if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; if MarketPosition <= 0 and entry < 진입횟수 Then buy("b",atlimit,dayhigh-PriceScale*40); if MarketPosition == 1 Then exitlong("bx",atlimit,lowest(L,BarsSinceEntry)+PriceScale*35); if MarketPosition >= 0 and entry < 진입횟수 Then sell("s",atlimit,daylow+PriceScale*400); if MarketPosition == -1 Then ExitShort("sx",atlimit,Highest(H,BarsSinceEntry)-PriceScale*70); if sdate != sdate[1] Then SetStopEndofday(55000); if bdate != bdate[1] Then SetStopEndofday(0); ----------------------------------- 진입2회 수식어를 시간을 각기 달리하고 목표수익120틱 달성시 매매정지를 수식어로 부탁드립니다. 매수,매도청산 1회 07:00~22:00 매수,매도 청산 2회 22:00~익일 02:50
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2021-04-12 14:49:17

안녕하세요 예스스탁입니다. input : StartTime1(070000),EndTime1(220000),진입횟수1(1); input : StartTime2(220000),EndTime2(025000),진입횟수2(2); input : Xtime(055000),당일수익틱수(120); var : entry(0),Tcond1(false),Tcond2(False); Var : N1(0),dayPl(0),당일수익(0),Xcond(false); if (sdate != sdate[1] and stime >= EndTime1) or (sdate == sdate[1] and stime >= EndTime1 and stime[1] < EndTime1) Then Tcond1 = False; if (sdate != sdate[1] and stime >= StartTime1) or (sdate == sdate[1] and stime >= StartTime1 and stime[1] < StartTime1) Then { Tcond1 = true; entry = 0; Xcond = false; N1 = NetProfit; } if (sdate != sdate[1] and stime >= EndTime2) or (sdate == sdate[1] and stime >= EndTime2 and stime[1] < EndTime2) Then Tcond2 = False; if (sdate != sdate[1] and stime >= StartTime2) or (sdate == sdate[1] and stime >= StartTime2 and stime[1] < StartTime2) Then { Tcond2 = true; entry = 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; } if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; if MarketPosition <= 0 and Xcond == False and ((Tcond1 == true and entry < 진입횟수1) or (Tcond2 == true and entry < 진입횟수2)) Then buy("b",atlimit,dayhigh-PriceScale*40); if MarketPosition == 1 Then { exitlong("bx",atlimit,lowest(L,BarsSinceEntry)+PriceScale*35); ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts)); } if MarketPosition >= 0 and Xcond == False and ((Tcond1 == true and entry < 진입횟수1) or (Tcond2 == true and entry < 진입횟수2)) Then sell("s",atlimit,daylow+PriceScale*400); if MarketPosition == -1 Then { ExitShort("sx",atlimit,Highest(H,BarsSinceEntry)-PriceScale*70); ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts)); } if sdate != sdate[1] Then SetStopEndofday(Xtime); if bdate != bdate[1] Then SetStopEndofday(0); 즐거운 하루되세요 > 푸른 님이 쓴 글입니다. > 제목 : 수식어 부탁드립니다 > input : 진입횟수(2); var : entry(0); if bdate != bdate[1] Then entry = 0; if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then entry = entry+1; if MarketPosition <= 0 and entry < 진입횟수 Then buy("b",atlimit,dayhigh-PriceScale*40); if MarketPosition == 1 Then exitlong("bx",atlimit,lowest(L,BarsSinceEntry)+PriceScale*35); if MarketPosition >= 0 and entry < 진입횟수 Then sell("s",atlimit,daylow+PriceScale*400); if MarketPosition == -1 Then ExitShort("sx",atlimit,Highest(H,BarsSinceEntry)-PriceScale*70); if sdate != sdate[1] Then SetStopEndofday(55000); if bdate != bdate[1] Then SetStopEndofday(0); ----------------------------------- 진입2회 수식어를 시간을 각기 달리하고 목표수익120틱 달성시 매매정지를 수식어로 부탁드립니다. 매수,매도청산 1회 07:00~22:00 매수,매도 청산 2회 22:00~익일 02:50