커뮤니티

문의

프로필 이미지
이주엽
2017-11-07 15:45:26
160
글번호 113970
답변완료
항상 좋은 답변 감사드립니다. 아래 수식으로 ETF나ELW를 매매하려합니다. 매수진입때는 kodex레버리지, 매도진입때는 kodex 인버스를 매수하려 하는데 선물지수를 기초로 ETF를 매매할 수 있도록 변형부탁드립니다. 감사합니다.. 1. 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 CrossDown(C, vB_value) Then ExitLong("BX"); If time <= 115900 And TT - PreTT <= 2 Then Begin If CrossUp(C, vA_value) Then Buy("B"); If CrossDown(C, vB_value) Then ExitLong("bx1"); 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 End; SetStopEndofday(151500); 2 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("SX"); If time <= 115900 And TT - PreTT <= 2 Then Begin If CrossUp(C, vA_value) Then ExitShort("Sx1"); If CrossDown(C, vB_value) Then sell("S"); End; 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(151500);
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2017-11-07 17:11:05

안녕하세요 예스스탁입니다. 1번식은 기본차트 kodex레버리지, 참조데이터(data2)는 선물 2번식은 기본차트 kodex인버스, 참조데이터(data2)는 선물 로 차크 구성하고 적용하시면 됩니다. 2번식은 신호만 매수와 매수청산으로 변경하고 이름은 신호명칭은 변경하지 않았습니다. 이용에 참고하시기 바랍니다. 1. 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(151500); 2 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(151500); 즐거운 하루되세요 > 이주엽 님이 쓴 글입니다. > 제목 : 문의 > 항상 좋은 답변 감사드립니다. 아래 수식으로 ETF나ELW를 매매하려합니다. 매수진입때는 kodex레버리지, 매도진입때는 kodex 인버스를 매수하려 하는데 선물지수를 기초로 ETF를 매매할 수 있도록 변형부탁드립니다. 감사합니다.. 1. 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 CrossDown(C, vB_value) Then ExitLong("BX"); If time <= 115900 And TT - PreTT <= 2 Then Begin If CrossUp(C, vA_value) Then Buy("B"); If CrossDown(C, vB_value) Then ExitLong("bx1"); 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 End; SetStopEndofday(151500); 2 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("SX"); If time <= 115900 And TT - PreTT <= 2 Then Begin If CrossUp(C, vA_value) Then ExitShort("Sx1"); If CrossDown(C, vB_value) Then sell("S"); End; 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(151500);