커뮤니티

시스템식 문의드립니다.

프로필 이미지
묘선낭자
2013-06-17 08:22:21
200
글번호 64368
답변완료
안녕하세요. 시스템식 부탁드립니다. If data2(crossup(ema(c,n1),ma(H,n2)) or crossup(ema(c,n1),ma(L,n2))이면 data2(Index21) If data2(crossdown(ema(c,n1),ma(H,n2)) or crossdown(ema(c,n1),ma(L,n2))이면 data2(Index22) If data3(ema(c,n3)>ema(O,n3) and C>wma(c,n3))이면 data3(Index31) If data3(ema(c,n3)<ema(O,n3) and C<wma(c,n3))이면 data3(Index32) If data2(Index21>Index22) and data3(Index31>Index32)이면 data1(Index11) 매도포지션 있다면 매도청산 If data2(Index21<Index22) and data3(Index31<Index32)이면 data1(Index12) 매수포지션 있다면 매수청산 If data1(Index11>Index12 and ema(C,n4)[1]>ema(c,n5)[1] and ema(O,n4)[1]>ema(c,n5)[1] and C[1]<=O[1] and C<O and L<ema(c,n4) and L<ema(O,n4))이거나 data1(Index11>Index12 and L<ema(c,n6))이면 매수 : 1연속손실시 1계약(이익-손실) 2,3연속손실시 2계약(이익-손실-손실 또는 이익-손실-손실-손실) 4연속손실시 4계약 연속3회 진입 (손실-손실-손실-손실)4계약 (손실-손실-손실-손실-이익)4계약 (손실-손실-손실-손실-이익-이익)4계약 If data1(Index11<Index12 and ema(C,n4)[1]<ema(c,n5)[1] and ema(O,n4)[1]<ema(c,n5)[1] and C[1]>=O[1] and C>O and H>ema(c,n4) and H>ema(O,n4))이거나 data1(Index11<Index12 and H>ema(c,n6)이면 매도 : 1연속손실시 1계약(이익-손실) 2,3연속손실시 2계약(이익-손실-손실 또는 이익-손실-손실-손실) 4연속손실시 4계약 연속3회 진입 (손실-손실-손실-손실)4계약 (손실-손실-손실-손실-이익)4계약 (손실-손실-손실-손실-이익-이익)4계약 익절 : 41틱 익절후 동일방향 연속진입 금지(매수 매도 번갈아 진입토록) 매매시간 : 오전7시-익일 오전 5시55분 오전7시를 하루시작으로 계산하여 누적순이익(당일총수익-당일총손실)이 164틱을 넘으면 모두 청산하고 당일매매 접음 매매자체의 진입은 전일데이터를 포함하여 분석진입하되(손실횟수분석도 마찬가지) Index11이나 Index12중 둘중하나가 당일발생한 이후부터 진입. n1,n2,n3,n4,n5,n6는 최적화가 가능하도록 작성 부탁드립니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2013-06-17 16:52:34

안녕하세요 예스스탁입니다. input : n1(0),n2(0),n3(0),n4(0),n5(0),n6(0); var : index21(0,data2),index22(0,data2),index31(0,data3),index32(0,data3),index11(0,data1),index12(0,data1); var : NP(0,data1),NP1(0,data1),dayPL(0,data1),cond1(false,data1),cond2(false,data1),cond3(false,data1); var : EntryVol(0); NP = NetProfit; if data1(stime == 070000 or (stime > 070000 and stime[1]< 070000)) Then{ NP1 = NP[1]; index21 = 0; index22 = 0; index31 = 0; index32 = 0; } dayPL = NP-NP1; If data2(crossup(ema(c,n1),ma(H,n2)) or crossup(ema(c,n1),ma(L,n2))) Then index21 = data2(index); If data2(crossdown(ema(c,n1),ma(H,n2)) or crossdown(ema(c,n1),ma(L,n2))) then index22 = data2(index); If data3(ema(c,n3)>ema(O,n3) and C>wma(c,n3)) Then index31 = data3(Index); If data3(ema(c,n3)<ema(O,n3) and C<wma(c,n3)) Then index32 = data3(Index); If data2(Index21>Index22) and data3(Index31>Index32) Then{ index11 = data1(Index); if MarketPosition == -1 Then ExitShort(); } If data2(Index21<Index22) and data3(Index31<Index32) Then{ index12 = data1(Index12); if MarketPosition == 1 Then ExitLong(); } if PositionProfit(1) < 0 and PositionProfit(2) > 0 Then EntryVol = 1; #1연속손실시 1계약(이익-손실) else if PositionProfit(1) < 0 and PositionProfit(2) < 0 and PositionProfit(3) > 0 Then EntryVol = 2; #2연속손실시 2계약(이익-손실-손실) else if PositionProfit(1) < 0 and PositionProfit(2) < 0 and PositionProfit(3) > 0 and PositionProfit(4) > 0 Then EntryVol = 2; #3연속손실시 2계약(이익-손실-손실-손실) else if PositionProfit(1) < 0 and PositionProfit(2) < 0 and PositionProfit(3) > 0 and PositionProfit(4) < 0 Then EntryVol = 4; #4연속손실시 (손실-손실-손실-손실)4계약 else if PositionProfit(1) < 0 and PositionProfit(2) < 0 and PositionProfit(3) > 0 and PositionProfit(4) < 0 and PositionProfit(5) > 0 Then EntryVol = 4; #4연속손실시(손실-손실-손실-손실-이익)4계약 else if PositionProfit(1) < 0 and PositionProfit(2) < 0 and PositionProfit(3) > 0 and PositionProfit(4) < 0 and PositionProfit(5) > 0 and PositionProfit(6) > 0 Then EntryVol = 4; #4연속손실시(손실-손실-손실-손실-이익-이익)4계약 Else EntryVol = 1;# 그외에는 모두 1계약 cond1 = dayPL < data1(PriceScale)*154; cond2 = stime >= 070000 or stime < 055500; cond3 = index21 > 0 or index22 > 0; If Cond1 == true and cond2 == true and cond3 == true Then{ if data1(Index11>Index12 and ema(C,n4)[1]>ema(c,n5)[1] and ema(O,n4)[1]>ema(c,n5)[1] and C[1]<=O[1] and C<O and L<ema(c,n4) and L<ema(O,n4)) or data1(Index11>Index12 and L<ema(c,n6)) Then{ if !(MarketPosition == 0 and MarketPosition(1) == 1 and PositionProfit(1) > 0) Then buy("b",OnClose,def,entryVol); } If data1(Index11<Index12 and ema(C,n4)[1]<ema(c,n5)[1] and ema(O,n4)[1]<ema(c,n5)[1] and C[1]>=O[1] and C>O and H>ema(c,n4) and H>ema(O,n4)) or data1(Index11<Index12 and H>ema(c,n6)) Then{ if !(MarketPosition == 0 and MarketPosition(1) == -1 and PositionProfit(1) > 0) Then sell("s",OnClose,def,entryVol); } } if dayPL >= data1(PriceScale)*154 Then{ exitlong(); ExitShort(); } 즐거운 하루되세요 > 묘선낭자 님이 쓴 글입니다. > 제목 : 시스템식 문의드립니다. > 안녕하세요. 시스템식 부탁드립니다. If data2(crossup(ema(c,n1),ma(H,n2)) or crossup(ema(c,n1),ma(L,n2))이면 data2(Index21) If data2(crossdown(ema(c,n1),ma(H,n2)) or crossdown(ema(c,n1),ma(L,n2))이면 data2(Index22) If data3(ema(c,n3)>ema(O,n3) and C>wma(c,n3))이면 data3(Index31) If data3(ema(c,n3)<ema(O,n3) and C<wma(c,n3))이면 data3(Index32) If data2(Index21>Index22) and data3(Index31>Index32)이면 data1(Index11) 매도포지션 있다면 매도청산 If data2(Index21<Index22) and data3(Index31<Index32)이면 data1(Index12) 매수포지션 있다면 매수청산 If data1(Index11>Index12 and ema(C,n4)[1]>ema(c,n5)[1] and ema(O,n4)[1]>ema(c,n5)[1] and C[1]<=O[1] and C<O and L<ema(c,n4) and L<ema(O,n4))이거나 data1(Index11>Index12 and L<ema(c,n6))이면 매수 : 1연속손실시 1계약(이익-손실) 2,3연속손실시 2계약(이익-손실-손실 또는 이익-손실-손실-손실) 4연속손실시 4계약 연속3회 진입 (손실-손실-손실-손실)4계약 (손실-손실-손실-손실-이익)4계약 (손실-손실-손실-손실-이익-이익)4계약 If data1(Index11<Index12 and ema(C,n4)[1]<ema(c,n5)[1] and ema(O,n4)[1]<ema(c,n5)[1] and C[1]>=O[1] and C>O and H>ema(c,n4) and H>ema(O,n4))이거나 data1(Index11<Index12 and H>ema(c,n6)이면 매도 : 1연속손실시 1계약(이익-손실) 2,3연속손실시 2계약(이익-손실-손실 또는 이익-손실-손실-손실) 4연속손실시 4계약 연속3회 진입 (손실-손실-손실-손실)4계약 (손실-손실-손실-손실-이익)4계약 (손실-손실-손실-손실-이익-이익)4계약 익절 : 41틱 익절후 동일방향 연속진입 금지(매수 매도 번갈아 진입토록) 매매시간 : 오전7시-익일 오전 5시55분 오전7시를 하루시작으로 계산하여 누적순이익(당일총수익-당일총손실)이 164틱을 넘으면 모두 청산하고 당일매매 접음 매매자체의 진입은 전일데이터를 포함하여 분석진입하되(손실횟수분석도 마찬가지) Index11이나 Index12중 둘중하나가 당일발생한 이후부터 진입. n1,n2,n3,n4,n5,n6는 최적화가 가능하도록 작성 부탁드립니다.