커뮤니티

수식확인 부탁드립니다.

프로필 이미지
라떼처럼
2017-08-29 12:54:19
148
글번호 112304
답변완료
진입회수를 2로 하였을때 진입->청산 후 진입조건을 만족하여도 바로 진입이 되지 않습니다. 확인부탁드립니다. 그리고 실매매에서 진입이 되었는데 프로그램을 재실행하면 진입이 없는걸로 나오거나 진입이 없던 곳에서 진입이 되어 있습니다 . 확인부탁드립니다. 감사합니다.~ input : short(12),long(26),sig(9),P1(3),P2(30),P3(120); input : 최고익절1(30), 최고대비하락1(10), 손절(20); input : 시작시간(215000), 종료시간(030000); input : 진입회수(1); var : mav1(0,data1),mav2(0,data1),mav3(0,data1); var : Tcond(False,data1),Bcount(0,data1),Scount(0,data1); var : MACDO2(0,data2), MACDO1(0,data1); var : BH(0),SL(0); MACDO2 = data2(MACD_OSC(short,long,sig)); MACDO1 = data1(MACD_OSC(short,long,sig)); mav1 = data1(ma(c,P1)); mav2 = data1(ma(c,P2)); mav3 = data1(ma(c,P3)); if stime == 시작시간 or (stime >시작시간 and stime[1] < 시작시간) Then{ Tcond = true; Bcount = 0; Scount = 0; } if stime == 종료시간 or (stime > 종료시간 and stime[1] < 종료시간) Then{ Tcond = false; } //진입회수 if crossup(mav2,mav3) and MarketPosition != MarketPosition[1] and MarketPosition == 1 Then Bcount = Bcount+1; if CrossDown(mav2,mav3) and MarketPosition != MarketPosition[1] and MarketPosition == -1 Then Scount = Scount+1; //진입 if Tcond == true Then{ if Bcount < 진입회수 and MACDO2 > MACDO2[1] and crossup(mav2,mav3) Then buy("Buy"); if Scount < 진입회수 and MACDO2 < MACDO2[1] and CrossDown(mav2,mav3) Then sell("Sell"); } //청산1 if MarketPosition == 1 Then{ if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*최고익절1 Then ExitLong("B익절1",AtStop,highest(H,BarsSinceEntry)-PriceScale*최고대비하락1); ExitLong("B손절2",AtStop,EntryPrice-PriceScale*손절); } if MarketPosition == -1 Then{ if Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*최고익절1 Then ExitShort("S익절1",AtStop,Lowest(L,BarsSinceEntry)+PriceScale*최고대비하락1); ExitShort("S손절2",AtStop,EntryPrice+PriceScale*손절); } if 종료시간 <= sTime and sTime < 시작시간 then { if MarketPosition == 1 then{ ExitLong("B장종료"); } if MarketPosition == -1 then{ ExitShort("S장종료"); } }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2017-08-30 11:05:39

안녕하세요 예스스탁입니다. 1 수식 적용해 보았지만 올리신 내용과 같이 조건만족시 신호가 발생하지 않는 경우를 찾지 못했습니다. 진입회수 2이상으로 지정해도 모두 지정된 조건 만족하는 봉에 신호가 발생합니다. 2 if crossup(mav2,mav3) and MarketPosition != MarketPosition[1] and MarketPosition == 1 Then Bcount = Bcount+1; if CrossDown(mav2,mav3) and MarketPosition != MarketPosition[1] and MarketPosition == -1 Then Scount = Scount+1; 에서 크로스조건은 제거하시기 바랍니다. if MarketPosition != MarketPosition[1] and MarketPosition == 1 Then Bcount = Bcount+1; if MarketPosition != MarketPosition[1] and MarketPosition == -1 Then Scount = Scount+1; 3 참조데이터를 이용하는 경우에 싱크문제로 실시간과 시뮬레이션의 신호가 다를수 있습니다. 아래글 참고하시기 바랍니다 https://www.yesstock.com/YesTrader/YesLanguage/YesLanguage_help/4_9_3.htm 수식은 미완성봉의 데이터를 사용하지 않습니다. 기본차트 봉 완성시 참조데이터의 가장 최근 완성봉을 기준으로 조건을 체크하게 되는데 실제매매에서 참조데이터의 봉완성시세가 기본차트 봉완성시세보다 먼저들어오느냐 나중에 들어오는냐에 따라 참조데이터의 최근 완성봉이 달라지게 됩니다. 과거 시뮬레이션에서 봉은 초단위 이하의 시간은 무시하기에 실전에서는 기본차트보다 늦게 봉완성이 되어서 해당 봉에서 사용하지 못했습니다. 시뮬레이션에서는 동시만족으로 체크하는 경우도 있습니다. 참조데이터를 이용시에 시장 구조적인 문제로 시뮬레이션과 실제매매를 완전히 일치하게 할수있는 방법은 없습니다. 즐거운 하루되세요 > 라떼처럼 님이 쓴 글입니다. > 제목 : 수식확인 부탁드립니다. > 진입회수를 2로 하였을때 진입->청산 후 진입조건을 만족하여도 바로 진입이 되지 않습니다. 확인부탁드립니다. 그리고 실매매에서 진입이 되었는데 프로그램을 재실행하면 진입이 없는걸로 나오거나 진입이 없던 곳에서 진입이 되어 있습니다 . 확인부탁드립니다. 감사합니다.~ input : short(12),long(26),sig(9),P1(3),P2(30),P3(120); input : 최고익절1(30), 최고대비하락1(10), 손절(20); input : 시작시간(215000), 종료시간(030000); input : 진입회수(1); var : mav1(0,data1),mav2(0,data1),mav3(0,data1); var : Tcond(False,data1),Bcount(0,data1),Scount(0,data1); var : MACDO2(0,data2), MACDO1(0,data1); var : BH(0),SL(0); MACDO2 = data2(MACD_OSC(short,long,sig)); MACDO1 = data1(MACD_OSC(short,long,sig)); mav1 = data1(ma(c,P1)); mav2 = data1(ma(c,P2)); mav3 = data1(ma(c,P3)); if stime == 시작시간 or (stime >시작시간 and stime[1] < 시작시간) Then{ Tcond = true; Bcount = 0; Scount = 0; } if stime == 종료시간 or (stime > 종료시간 and stime[1] < 종료시간) Then{ Tcond = false; } //진입회수 if crossup(mav2,mav3) and MarketPosition != MarketPosition[1] and MarketPosition == 1 Then Bcount = Bcount+1; if CrossDown(mav2,mav3) and MarketPosition != MarketPosition[1] and MarketPosition == -1 Then Scount = Scount+1; //진입 if Tcond == true Then{ if Bcount < 진입회수 and MACDO2 > MACDO2[1] and crossup(mav2,mav3) Then buy("Buy"); if Scount < 진입회수 and MACDO2 < MACDO2[1] and CrossDown(mav2,mav3) Then sell("Sell"); } //청산1 if MarketPosition == 1 Then{ if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*최고익절1 Then ExitLong("B익절1",AtStop,highest(H,BarsSinceEntry)-PriceScale*최고대비하락1); ExitLong("B손절2",AtStop,EntryPrice-PriceScale*손절); } if MarketPosition == -1 Then{ if Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*최고익절1 Then ExitShort("S익절1",AtStop,Lowest(L,BarsSinceEntry)+PriceScale*최고대비하락1); ExitShort("S손절2",AtStop,EntryPrice+PriceScale*손절); } if 종료시간 <= sTime and sTime < 시작시간 then { if MarketPosition == 1 then{ ExitLong("B장종료"); } if MarketPosition == -1 then{ ExitShort("S장종료"); } }