커뮤니티

항상 감사드립니다.

프로필 이미지
상중하
2017-01-12 15:02:25
139
글번호 105842
답변완료

첨부 이미지

좀전에 수정해주신 수식을 적용했는데요 추가 진입이 이뤄지지가 않습니다. b1과 b2가 조건이 틀려야 한다고 하셨는데요 buy("b1",AtStop,NextBarOpen+PriceScale*1,2); buy("b2",AtStop,NextBarOpen+PriceScale*3,1); 이 두조건은 시스템에서 틀린것으로 인식한게 맞나요. 아니면 atstop를 atlimit 이런식으로 해야 시스템에서 틀린조건으로 인식하나요? input : 최대진입횟수(1); var : Xcond(false),HH(0); var1 = ma(c,5); var2 = ma(c,20); if TotalTrades > TotalTrades[1] Then{ if (IsExitName("dl1",1) == true or IsExitName("dl2",1) == true or IsExitName("bl1",1) or IsExitName("bl2",1)) Then Xcond = True; Else Xcond = false; } if MarketPosition == 0 and (Xcond == false or (MarketPosition == 1 and MaxEntries == 1) or (Xcond == true and BarsSinceExit(1) >= 1)) then { If CrossUP(var1, Var2) Then { buy("b1",AtStop,NextBarOpen+PriceScale*1,2); } } if MarketPosition == 1 then{ if MaxEntries >= 1 and MaxEntries < 최대진입횟수 Then { buy("b2",AtStop,NextBarOpen+PriceScale*3,1); } if CurrentContracts > CurrentContracts[1] Then HH = H; if H > HH Then HH = H; if MaxEntries == 1 Then{ MessageLog("%.2f",LatestEntryPrice(0)); ExitLong("dl1",atlimit,LatestEntryPrice(0)+PriceScale*20,"",1,1); } if MaxEntries == 2 Then ExitLong("bp2",atlimit,LatestEntryPrice(0)+PriceScale*20); if HH < LatestEntryPrice(0)+PriceScale*13 Then ExitLong("bl1",AtStop,LatestEntryPrice(0)-PriceScale*10); if HH >= LatestEntryPrice(0)+PriceScale*13 Then ExitLong("bl2",AtStop,LatestEntryPrice(0)+PriceScale*1); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2017-01-12 15:18:11

안녕하세요 예스스탁입니다. 1 buy("b1",AtStop,NextBarOpen+PriceScale*1,2); buy("b2",AtStop,NextBarOpen+PriceScale*3,1); 위 내용에서 틀린부분은 없습니다. 시가에서 1틱 상승하면 매수, 시가에서 3틱 상승하면 매도입니다. 이전 식에 추가진입하는 내용이 첫진입내용과 같이 묶어있어 무포지션이고 매수포지션이면 추가진입하라는 성립할수 없는 조건으로 조합이 되어 잇어 추가진입이 발생하지 않으니 분리하라고 설명드린것입니다. 2 최대진입횟수를 첫진입포함된 숫자로 지정해 주셔야 합니다, 현재 1로 되어 있어 추가진입이 발생하지 않았습니다. 3 수정한 식입니다. input : 최대진입횟수(2);#첫진입포함 최대 횟수로 지정 var : Xcond(false),HH(0); var1 = ma(c,5); var2 = ma(c,20); if TotalTrades > TotalTrades[1] Then{ if (IsExitName("dl1",1) == true or IsExitName("dl2",1) == true or IsExitName("bl1",1) or IsExitName("bl2",1)) Then Xcond = True; Else Xcond = false; } if MarketPosition == 0 and (Xcond == false or (MarketPosition == 1 and MaxEntries == 1) or (Xcond == true and BarsSinceExit(1) >= 1)) then { If CrossUP(var1, Var2) Then { buy("b1",AtStop,NextBarOpen+PriceScale*1,2); } } if MarketPosition == 1 then{ if MaxEntries >= 1 and MaxEntries < 최대진입횟수 and CrossUP(var1, Var2) Then { buy("b2",AtStop,NextBarOpen+PriceScale*3,1); } if CurrentContracts > CurrentContracts[1] Then HH = H; if H > HH Then HH = H; if MaxEntries == 1 Then{ MessageLog("%.2f",LatestEntryPrice(0)); ExitLong("dl1",atlimit,LatestEntryPrice(0)+PriceScale*20,"",1,1); } if MaxEntries == 2 Then ExitLong("bp2",atlimit,LatestEntryPrice(0)+PriceScale*20); if HH < LatestEntryPrice(0)+PriceScale*13 Then ExitLong("bl1",AtStop,LatestEntryPrice(0)-PriceScale*10); if HH >= LatestEntryPrice(0)+PriceScale*13 Then ExitLong("bl2",AtStop,LatestEntryPrice(0)+PriceScale*1); } 즐거운 하루되세요 > 상중하 님이 쓴 글입니다. > 제목 : 항상 감사드립니다. > 좀전에 수정해주신 수식을 적용했는데요 추가 진입이 이뤄지지가 않습니다. b1과 b2가 조건이 틀려야 한다고 하셨는데요 buy("b1",AtStop,NextBarOpen+PriceScale*1,2); buy("b2",AtStop,NextBarOpen+PriceScale*3,1); 이 두조건은 시스템에서 틀린것으로 인식한게 맞나요. 아니면 atstop를 atlimit 이런식으로 해야 시스템에서 틀린조건으로 인식하나요? input : 최대진입횟수(1); var : Xcond(false),HH(0); var1 = ma(c,5); var2 = ma(c,20); if TotalTrades > TotalTrades[1] Then{ if (IsExitName("dl1",1) == true or IsExitName("dl2",1) == true or IsExitName("bl1",1) or IsExitName("bl2",1)) Then Xcond = True; Else Xcond = false; } if MarketPosition == 0 and (Xcond == false or (MarketPosition == 1 and MaxEntries == 1) or (Xcond == true and BarsSinceExit(1) >= 1)) then { If CrossUP(var1, Var2) Then { buy("b1",AtStop,NextBarOpen+PriceScale*1,2); } } if MarketPosition == 1 then{ if MaxEntries >= 1 and MaxEntries < 최대진입횟수 Then { buy("b2",AtStop,NextBarOpen+PriceScale*3,1); } if CurrentContracts > CurrentContracts[1] Then HH = H; if H > HH Then HH = H; if MaxEntries == 1 Then{ MessageLog("%.2f",LatestEntryPrice(0)); ExitLong("dl1",atlimit,LatestEntryPrice(0)+PriceScale*20,"",1,1); } if MaxEntries == 2 Then ExitLong("bp2",atlimit,LatestEntryPrice(0)+PriceScale*20); if HH < LatestEntryPrice(0)+PriceScale*13 Then ExitLong("bl1",AtStop,LatestEntryPrice(0)-PriceScale*10); if HH >= LatestEntryPrice(0)+PriceScale*13 Then ExitLong("bl2",AtStop,LatestEntryPrice(0)+PriceScale*1); }