커뮤니티

문의

프로필 이미지
이주엽
2018-01-09 10:59:32
184
글번호 115584
답변완료
선물수식으로 etf거래를 하기 위해서 수식을 두 개로 나누어 놓았는데, 이상하게 선물에서는 진입신호가 뜨는데 etf에서는 신호가 발생하지 않는 경우가 있습니다. 특히 1번수식에서 몇차례 생겼는데 그 전날 진입신호가 나온후 청산된 후, 그 다음날 선물에서는 또 다시 진입신호가 나왔는 데 etf에서는 진입조건이 되어도 신호가 나오지 않습니다. 교정부탁드립니다. 감사합니다. 선물수식 Var : vA_value(0), vB_value(0),vStartMin(0); input : BarsEntryInterval(20), pMaxContracts(4),pTimeInterval(11); var : PreTT(0), TT(0),cond99(false); If date <> date[1] Then Begin vA_value = H; vB_value = L; Cond99 = False; vStartMin = TimeToMinutes(stime); PreTT = TotalTrades[1]; End; If Cond99 == False Then Begin if vA_value < H Then vA_value = H; if vB_value > L Then vB_value = L; End; If (TimeToMinutes(stime) - vStartMin) == pTimeInterval And Cond99 == False Then Begin Cond99 = True; End; if Cond99 Then Begin If CrossUp(C, vA_value) Then ExitShort("BX"); If CrossDown(C, vB_value) Then ExitLong("SX"); If time <= 115900 And TT - PreTT <= 2 Then Begin If CrossUp(C, vA_value) Then Buy("B"); If CrossDown(C, vB_value) Then Sell("S"); End; if MarketPosition == 1 And C > vA_value And CurrentContracts < pMaxContracts Then Begin if BarsSinceEntry == ( 1 * BarsEntryInterval) Then Buy("reBuy1"); if BarsSinceEntry == ( 2 * BarsEntryInterval) Then Buy("reBuy2"); if BarsSinceEntry == ( 3 * BarsEntryInterval) Then Buy("reBuy3"); End Else if MarketPosition == -1 And C < vB_value And CurrentContracts < pMaxContracts Then Begin if BarsSinceEntry == ( 1 * BarsEntryInterval) Then Sell("reSell1"); if BarsSinceEntry == ( 2 * BarsEntryInterval) Then Sell("reSell2"); if BarsSinceEntry == ( 3 * BarsEntryInterval) Then Sell("reSell3"); End; End; SetStopEndofday(150000); 1.ETF input : BarsEntryInterval(20), pMaxContracts(4),pTimeInterval(11); Var : vA_value(0,data2), vB_value(0,data2),vStartMin(0,data2); var : PreTT(0,data1), TT(0,data1),cond99(false,data2); If data2(date <> date[1]) Then { vA_value = data2(H); vB_value = data2(L); Cond99 = False; vStartMin = data2(TimeToMinutes(stime)); PreTT = TotalTrades[1]; } TT = TotalTrades; If Cond99 == False Then { if vA_value < data2(H) Then vA_value = data2(H); if vB_value > data2(L) Then vB_value = data2(L); } If data2((TimeToMinutes(stime) - vStartMin) == pTimeInterval And Cond99 == False) Then { Cond99 = True; } if Cond99 Then { If data2(CrossDown(C, vB_value)) Then ExitLong("BX"); If data2(time <= 115900) And TT - PreTT <= 2 Then Begin If data2(CrossUp(C, vA_value)) Then Buy("B"); If data2(CrossDown(C, vB_value)) Then ExitLong("bx1"); End; if MarketPosition == 1 And data2(C > vA_value) And CurrentContracts < pMaxContracts Then { if BarsSinceEntry == ( 1 * BarsEntryInterval) Then Buy("reBuy1"); if BarsSinceEntry == ( 2 * BarsEntryInterval) Then Buy("reBuy2"); if BarsSinceEntry == ( 3 * BarsEntryInterval) Then Buy("reBuy3"); } } SetStopEndofday(150000); 2.ETF인버스 input : BarsEntryInterval(20), pMaxContracts(4),pTimeInterval(11); Var : vA_value(0,data2), vB_value(0,data2),vStartMin(0,data2); var : PreTT(0,data1), TT(0,data1),cond99(false,data2); If data2(date <> date[1]) Then Begin vA_value = data2(H); vB_value = data2(L); Cond99 = False; vStartMin = data2(TimeToMinutes(stime)); PreTT = TotalTrades[1]; End; TT = TotalTrades; If Cond99 == False Then Begin if vA_value < data2(H) Then vA_value = data2(H); if vB_value > data2(L) Then vB_value = data2(L); End; If data2((TimeToMinutes(stime) - vStartMin) == pTimeInterval And Cond99 == False) Then Begin Cond99 = True; End; if Cond99 Then { If data2(CrossUp(C, vA_value)) Then ExitLong("SX"); If data2(time <= 115900) And TT - PreTT <= 2 Then { If data2(CrossUp(C, vA_value)) Then ExitLong("Sx1"); If data2(CrossDown(C, vB_value)) Then Buy("S"); } if MarketPosition == 1 And data2(C < vB_value) And CurrentContracts < pMaxContracts Then { if BarsSinceEntry == ( 1 * BarsEntryInterval) Then Buy("reSell1"); if BarsSinceEntry == ( 2 * BarsEntryInterval) Then Buy("reSell2"); if BarsSinceEntry == ( 3 * BarsEntryInterval) Then Buy("reSell3"); } } SetStopEndofday(150000);
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2018-01-10 11:28:48

안녕하세요 예스스탁입니다. 1. etf input : BarsEntryInterval(20), pMaxContracts(4),pTimeInterval(11); Var : vA_value(0), vB_value(0),vStartMin(0); var : PreTT(0), TT(0),cond99(false); If data2(bdate <> bdate[1]) Then { vA_value = data2(H); vB_value = data2(L); Cond99 = False; vStartMin = data2(TimeToMinutes(stime)); PreTT = TotalTrades[1]; } TT = TotalTrades; If Cond99 == False Then { if vA_value < data2(H) Then vA_value = data2(H); if vB_value > data2(L) Then vB_value = data2(L); } If data2((TimeToMinutes(stime) - vStartMin) == pTimeInterval And Cond99 == False) Then { Cond99 = True; } if Cond99 Then { #If data2(CrossUp(C, vA_value)) Then ExitShort("BX"); If data2(CrossDown(C, vB_value)) Then ExitLong("SX"); If data2(time <= 115900) And TT - PreTT <= 2 Then { If data2(CrossUp(C, vA_value)) Then Buy("B"); If data2(CrossDown(C, vB_value)) Then ExitLong("S"); } if MarketPosition == 1 And data2(C > vA_value) And CurrentContracts < pMaxContracts Then{ if BarsSinceEntry == ( 1 * BarsEntryInterval) Then Buy("reBuy1"); if BarsSinceEntry == ( 2 * BarsEntryInterval) Then Buy("reBuy2"); if BarsSinceEntry == ( 3 * BarsEntryInterval) Then Buy("reBuy3"); } /* if MarketPosition == -1 And data2(C < vB_value) And CurrentContracts < pMaxContracts Then{ if BarsSinceEntry == ( 1 * BarsEntryInterval) Then Sell("reSell1"); if BarsSinceEntry == ( 2 * BarsEntryInterval) Then Sell("reSell2"); if BarsSinceEntry == ( 3 * BarsEntryInterval) Then Sell("reSell3"); }*/ } SetStopEndofday(150000); 2 인버스 input : BarsEntryInterval(20), pMaxContracts(4),pTimeInterval(11); Var : vA_value(0), vB_value(0),vStartMin(0); var : PreTT(0), TT(0),cond99(false); If data2(bdate <> bdate[1]) Then { vA_value = data2(H); vB_value = data2(L); Cond99 = False; vStartMin = data2(TimeToMinutes(stime)); PreTT = TotalTrades[1]; } TT = TotalTrades; If Cond99 == False Then { if vA_value < data2(H) Then vA_value = data2(H); if vB_value > data2(L) Then vB_value = data2(L); } If data2((TimeToMinutes(stime) - vStartMin) == pTimeInterval And Cond99 == False) Then { Cond99 = True; } if Cond99 Then { If data2(CrossUp(C, vA_value)) Then Exitlong("BX"); #If data2(CrossDown(C, vB_value)) Then ExitLong("SX"); If data2(time <= 115900) And TT - PreTT <= 2 Then { If data2(CrossUp(C, vA_value)) Then ExitLong("B"); If data2(CrossDown(C, vB_value)) Then Buy("S"); } /* if MarketPosition == 1 And data2(C > vA_value) And CurrentContracts < pMaxContracts Then{ if BarsSinceEntry == ( 1 * BarsEntryInterval) Then Buy("reBuy1"); if BarsSinceEntry == ( 2 * BarsEntryInterval) Then Buy("reBuy2"); if BarsSinceEntry == ( 3 * BarsEntryInterval) Then Buy("reBuy3"); }*/ if MarketPosition == 1 And data2(C < vB_value) And CurrentContracts < pMaxContracts Then{ if BarsSinceEntry == ( 1 * BarsEntryInterval) Then Buy("reSell1"); if BarsSinceEntry == ( 2 * BarsEntryInterval) Then Buy("reSell2"); if BarsSinceEntry == ( 3 * BarsEntryInterval) Then Buy("reSell3"); } } SetStopEndofday(150000); 즐거운 하루되세요 > 이주엽 님이 쓴 글입니다. > 제목 : 문의 > 선물수식으로 etf거래를 하기 위해서 수식을 두 개로 나누어 놓았는데, 이상하게 선물에서는 진입신호가 뜨는데 etf에서는 신호가 발생하지 않는 경우가 있습니다. 특히 1번수식에서 몇차례 생겼는데 그 전날 진입신호가 나온후 청산된 후, 그 다음날 선물에서는 또 다시 진입신호가 나왔는 데 etf에서는 진입조건이 되어도 신호가 나오지 않습니다. 교정부탁드립니다. 감사합니다. 선물수식 Var : vA_value(0), vB_value(0),vStartMin(0); input : BarsEntryInterval(20), pMaxContracts(4),pTimeInterval(11); var : PreTT(0), TT(0),cond99(false); If date <> date[1] Then Begin vA_value = H; vB_value = L; Cond99 = False; vStartMin = TimeToMinutes(stime); PreTT = TotalTrades[1]; End; If Cond99 == False Then Begin if vA_value < H Then vA_value = H; if vB_value > L Then vB_value = L; End; If (TimeToMinutes(stime) - vStartMin) == pTimeInterval And Cond99 == False Then Begin Cond99 = True; End; if Cond99 Then Begin If CrossUp(C, vA_value) Then ExitShort("BX"); If CrossDown(C, vB_value) Then ExitLong("SX"); If time <= 115900 And TT - PreTT <= 2 Then Begin If CrossUp(C, vA_value) Then Buy("B"); If CrossDown(C, vB_value) Then Sell("S"); End; if MarketPosition == 1 And C > vA_value And CurrentContracts < pMaxContracts Then Begin if BarsSinceEntry == ( 1 * BarsEntryInterval) Then Buy("reBuy1"); if BarsSinceEntry == ( 2 * BarsEntryInterval) Then Buy("reBuy2"); if BarsSinceEntry == ( 3 * BarsEntryInterval) Then Buy("reBuy3"); End Else if MarketPosition == -1 And C < vB_value And CurrentContracts < pMaxContracts Then Begin if BarsSinceEntry == ( 1 * BarsEntryInterval) Then Sell("reSell1"); if BarsSinceEntry == ( 2 * BarsEntryInterval) Then Sell("reSell2"); if BarsSinceEntry == ( 3 * BarsEntryInterval) Then Sell("reSell3"); End; End; SetStopEndofday(150000); 1.ETF input : BarsEntryInterval(20), pMaxContracts(4),pTimeInterval(11); Var : vA_value(0,data2), vB_value(0,data2),vStartMin(0,data2); var : PreTT(0,data1), TT(0,data1),cond99(false,data2); If data2(date <> date[1]) Then { vA_value = data2(H); vB_value = data2(L); Cond99 = False; vStartMin = data2(TimeToMinutes(stime)); PreTT = TotalTrades[1]; } TT = TotalTrades; If Cond99 == False Then { if vA_value < data2(H) Then vA_value = data2(H); if vB_value > data2(L) Then vB_value = data2(L); } If data2((TimeToMinutes(stime) - vStartMin) == pTimeInterval And Cond99 == False) Then { Cond99 = True; } if Cond99 Then { If data2(CrossDown(C, vB_value)) Then ExitLong("BX"); If data2(time <= 115900) And TT - PreTT <= 2 Then Begin If data2(CrossUp(C, vA_value)) Then Buy("B"); If data2(CrossDown(C, vB_value)) Then ExitLong("bx1"); End; if MarketPosition == 1 And data2(C > vA_value) And CurrentContracts < pMaxContracts Then { if BarsSinceEntry == ( 1 * BarsEntryInterval) Then Buy("reBuy1"); if BarsSinceEntry == ( 2 * BarsEntryInterval) Then Buy("reBuy2"); if BarsSinceEntry == ( 3 * BarsEntryInterval) Then Buy("reBuy3"); } } SetStopEndofday(150000); 2.ETF인버스 input : BarsEntryInterval(20), pMaxContracts(4),pTimeInterval(11); Var : vA_value(0,data2), vB_value(0,data2),vStartMin(0,data2); var : PreTT(0,data1), TT(0,data1),cond99(false,data2); If data2(date <> date[1]) Then Begin vA_value = data2(H); vB_value = data2(L); Cond99 = False; vStartMin = data2(TimeToMinutes(stime)); PreTT = TotalTrades[1]; End; TT = TotalTrades; If Cond99 == False Then Begin if vA_value < data2(H) Then vA_value = data2(H); if vB_value > data2(L) Then vB_value = data2(L); End; If data2((TimeToMinutes(stime) - vStartMin) == pTimeInterval And Cond99 == False) Then Begin Cond99 = True; End; if Cond99 Then { If data2(CrossUp(C, vA_value)) Then ExitLong("SX"); If data2(time <= 115900) And TT - PreTT <= 2 Then { If data2(CrossUp(C, vA_value)) Then ExitLong("Sx1"); If data2(CrossDown(C, vB_value)) Then Buy("S"); } if MarketPosition == 1 And data2(C < vB_value) And CurrentContracts < pMaxContracts Then { if BarsSinceEntry == ( 1 * BarsEntryInterval) Then Buy("reSell1"); if BarsSinceEntry == ( 2 * BarsEntryInterval) Then Buy("reSell2"); if BarsSinceEntry == ( 3 * BarsEntryInterval) Then Buy("reSell3"); } } SetStopEndofday(150000);