커뮤니티

문의드립니다

프로필 이미지
해피슈
2018-12-24 17:47:20
259
글번호 124742
답변완료
아래 수식에서 지수 10 이평 60 이평 정배열 이고 20이평 60이평 정배열일때만 매수 지수 10 이평 60 이평 역배열 이고 20이평 60이평 역배열일때만 매도 10 이평과 20 이평은 정배열 역배열 상관없이 수식 수정 부탁드립니다 input : starttime(101500),endtime(170000); var : Tcond(false); if starttime == 0 Then { if sdate != sdate[1] Then Tcond = true; } Else { if (sdate != sdate[1] and stime >= starttime) or (sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then Tcond = true; } if endtime == 0 then { if sdate != sdate[1] Then Tcond = false; } Else { if (sdate != sdate[1] and stime >= endtime) or (sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then { Tcond = false; if MarketPosition == 1 Then ExitLong("bx"); if MarketPosition == -1 Then ExitShort("sx"); } } INPUT : LENGTH(10); VAR : TCHAN(0), BCHAN(0); #상단 TCHAN = HIGHEST(HIGH, LENGTH)[1]; #하단 BCHAN = LOWEST(LOW, LENGTH)[1]; #20지수이평이 60지수이평보다 크면 #다음봉에 하단 이하의 시세가 발생하면 즉시 매수진입 if Tcond == true and ema(C,20) > ema(C, 60) Then buy("buy", atlimit, BCHAN); #매수진입 후 if MarketPosition == 1 Then { #상단까지 시세 상승하면 즉시 청산 exitlong("EL_상단터치", atlimit, TCHAN); #30틱 수익이면 즉시 청산 exitlong("EL_익절",atlimit, EntryPrice + PriceScale*30); #30틱 손실이면 즉시 청산 exitlong("EL_손절",AtStop, EntryPrice - PriceScale*30); } #20지수이평이 60지수이평보다 작으면 #다음봉에 상단 이상의 시세가 발생하면 즉시 매도진입 if Tcond == true and ema(C,20) < ema(C, 60) Then sell("sell", atlimit, TCHAN); #매도진입 후 if MarketPosition == -1 Then { #하단까지 시세 하락하면 즉시 청산 exitshort("ES_하단터치", atlimit, BCHAN); #30틱 수익이면 즉시 청산 exitshort("ES_익절",atlimit, EntryPrice - PriceScale*30); #30틱 손실이면 즉시 청산 exitshort("ES_손절",AtStop, EntryPrice + PriceScale*30); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2018-12-26 10:06:52

안녕하세요 예스스탁입니다. input : starttime(101500),endtime(170000); var : Tcond(false); if starttime == 0 Then { if sdate != sdate[1] Then Tcond = true; } Else { if (sdate != sdate[1] and stime >= starttime) or (sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then Tcond = true; } if endtime == 0 then { if sdate != sdate[1] Then Tcond = false; } Else { if (sdate != sdate[1] and stime >= endtime) or (sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then { Tcond = false; if MarketPosition == 1 Then ExitLong("bx"); if MarketPosition == -1 Then ExitShort("sx"); } } INPUT : LENGTH(10),P1(10),P2(20),P3(60); VAR : TCHAN(0), BCHAN(0),emav1(0),emav2(0),emav3(0); emav1 = ema(c,P1); emav2 = ema(c,P2); emav3 = ema(c,P3); #상단 TCHAN = HIGHEST(HIGH, LENGTH)[1]; #하단 BCHAN = LOWEST(LOW, LENGTH)[1]; #20지수이평이 60지수이평보다 크면 #다음봉에 하단 이하의 시세가 발생하면 즉시 매수진입 if Tcond == true and emav2 > emav3 and emav1 > emav3 Then buy("buy", atlimit, BCHAN); #매수진입 후 if MarketPosition == 1 Then { #상단까지 시세 상승하면 즉시 청산 exitlong("EL_상단터치", atlimit, TCHAN); #30틱 수익이면 즉시 청산 exitlong("EL_익절",atlimit, EntryPrice + PriceScale*30); #30틱 손실이면 즉시 청산 exitlong("EL_손절",AtStop, EntryPrice - PriceScale*30); } #20지수이평이 60지수이평보다 작으면 #다음봉에 상단 이상의 시세가 발생하면 즉시 매도진입 if Tcond == true and emav2 < emav3 and emav1 < emav3 Then sell("sell", atlimit, TCHAN); #매도진입 후 if MarketPosition == -1 Then { #하단까지 시세 하락하면 즉시 청산 exitshort("ES_하단터치", atlimit, BCHAN); #30틱 수익이면 즉시 청산 exitshort("ES_익절",atlimit, EntryPrice - PriceScale*30); #30틱 손실이면 즉시 청산 exitshort("ES_손절",AtStop, EntryPrice + PriceScale*30); } 즐거운 하루되세요 > 해피슈 님이 쓴 글입니다. > 제목 : 문의드립니다 > 아래 수식에서 지수 10 이평 60 이평 정배열 이고 20이평 60이평 정배열일때만 매수 지수 10 이평 60 이평 역배열 이고 20이평 60이평 역배열일때만 매도 10 이평과 20 이평은 정배열 역배열 상관없이 수식 수정 부탁드립니다 input : starttime(101500),endtime(170000); var : Tcond(false); if starttime == 0 Then { if sdate != sdate[1] Then Tcond = true; } Else { if (sdate != sdate[1] and stime >= starttime) or (sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then Tcond = true; } if endtime == 0 then { if sdate != sdate[1] Then Tcond = false; } Else { if (sdate != sdate[1] and stime >= endtime) or (sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then { Tcond = false; if MarketPosition == 1 Then ExitLong("bx"); if MarketPosition == -1 Then ExitShort("sx"); } } INPUT : LENGTH(10); VAR : TCHAN(0), BCHAN(0); #상단 TCHAN = HIGHEST(HIGH, LENGTH)[1]; #하단 BCHAN = LOWEST(LOW, LENGTH)[1]; #20지수이평이 60지수이평보다 크면 #다음봉에 하단 이하의 시세가 발생하면 즉시 매수진입 if Tcond == true and ema(C,20) > ema(C, 60) Then buy("buy", atlimit, BCHAN); #매수진입 후 if MarketPosition == 1 Then { #상단까지 시세 상승하면 즉시 청산 exitlong("EL_상단터치", atlimit, TCHAN); #30틱 수익이면 즉시 청산 exitlong("EL_익절",atlimit, EntryPrice + PriceScale*30); #30틱 손실이면 즉시 청산 exitlong("EL_손절",AtStop, EntryPrice - PriceScale*30); } #20지수이평이 60지수이평보다 작으면 #다음봉에 상단 이상의 시세가 발생하면 즉시 매도진입 if Tcond == true and ema(C,20) < ema(C, 60) Then sell("sell", atlimit, TCHAN); #매도진입 후 if MarketPosition == -1 Then { #하단까지 시세 하락하면 즉시 청산 exitshort("ES_하단터치", atlimit, BCHAN); #30틱 수익이면 즉시 청산 exitshort("ES_익절",atlimit, EntryPrice - PriceScale*30); #30틱 손실이면 즉시 청산 exitshort("ES_손절",AtStop, EntryPrice + PriceScale*30); }