커뮤니티

수식작성 부탁드립니다.

프로필 이미지
도시군인
2011-05-31 13:17:00
624
글번호 39256
답변완료
정말 감사드립니다. 일전에 비슷한 것을 문의드렸는데요. 아래 로직은 kodex200을 참조종목(일봉) 으로 하는 포지션 트레이딩 로직입니다. 일전에 부탁드렸듯이 매수청산시에는 매수를 , 원로직 매수시 매수청산을 할수록 반대로 시스템식 작성 부탁드립니다. 다음은 원로직 입니다. //&#160;KODEX200&#160;참조&#160;KODEX200&#160;적용&#160; Input&#160;:&#160;EmaLen(13),&#160;macd1(12),&#160;macd2(26),&#160;macd3(9),&#160;stoploss(5),&#160;len(5),&#160;mult(8),&#160;DiV(25); input:&#160;LongEmaLen(65),&#160;Longmacd1(60),&#160;Longmacd2(130),&#160;Longmacd3(45); var&#160;:&#160;&#160;emaV(0),&#160;MacdV(0),&#160;MacdS(0),&#160;MacdOsc(0); var&#160;:&#160;&#160;mp(0),&#160;stopprice(0),&#160;LemaV(0),&#160;LmacdV(0),&#160;LmacdS(0),&#160;LmacdOsc(0); &#160; emaV&#160;=&#160;data2(ema(C,EmaLen)); MacdV&#160;=&#160;data2(macd(macd1,macd2)); MacdS&#160;=&#160;data2(ema(MacdV,macd3)); MacdOsc&#160;=&#160;MacdV-MacdS; LemaV&#160;=&#160;data2(ema(C,LongEmaLen)); LmacdV&#160;=&#160;data2(macd(Longmacd1,Longmacd2)); LmacdS&#160;=&#160;data2(ema(LmacdV,Longmacd3)); LmacdOsc&#160;=&#160;LmacdV-LmacdS; If&#160;LemaV&#160;>&#160;LemaV[1]&#160;and&#160;LmacdOsc&#160;>&#160;LmacdOsc[1]&#160;then&#160;{ &#160;&#160;&#160;&#160;if&#160;emaV&#160;>&#160;emaV[1]&#160;and&#160;macdOsc&#160;>&#160;MacdOsc[1]&#160;Then &#160;&#160;&#160;&#160;&#160;buy(); }&#160; mp&#160;=&#160;marketposition; #mp에&#160;marketposition if&#160;MP&#160;==&#160;1&#160;and&#160;MP[1]&#160;<>&#160;1&#160;then&#160;Begin &#160;StopPrice&#160;=&#160;low&#160;-&#160;ma(range,4)*mult; end; If&#160;MP&#160;==&#160;1&#160;then&#160;begin &#160;exitlong&#160;("ExitLong",&#160;atstop,stopprice&#160;); &#160;stopprice&#160;=&#160;stopprice&#160;+(&#160;low-stopprice&#160;)/Div; end; input&#160;:&#160;af(0.0045),&#160;maxaf(0.1); var&#160;:&#160;parabolic(0); parabolic&#160;=&#160;sar(af,&#160;maxaf); if&#160;MarketPosition&#160;<>&#160;0&#160;then&#160;{ &#160;&#160;&#160;&#160;if&#160;c&#160;>&#160;parabolic&#160;Then &#160;&#160;&#160;&#160;exitlong("EL_파라볼릭청산",&#160;ATSTOP,&#160;PARABOLIC); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2011-05-31 16:30:05

안녕하세요 예스스탁입니다. // KODEX200 참조 KODEX200 적용 Input : EmaLen(13), macd1(12), macd2(26), macd3(9), stoploss(5), len(5), mult(8), DiV(25); input: LongEmaLen(65), Longmacd1(60), Longmacd2(130), Longmacd3(45); var : emaV(0), MacdV(0), MacdS(0), MacdOsc(0); var : mp(0), stopprice(0), LemaV(0), LmacdV(0), LmacdS(0), LmacdOsc(0),cond(false),Vr1(0); emaV = data2(ema(C,EmaLen)); MacdV = data2(macd(macd1,macd2)); MacdS = data2(ema(MacdV,macd3)); MacdOsc = MacdV-MacdS; LemaV = data2(ema(C,LongEmaLen)); LmacdV = data2(macd(Longmacd1,Longmacd2)); LmacdS = data2(ema(LmacdV,Longmacd3)); LmacdOsc = LmacdV-LmacdS; cond = LemaV > LemaV[1] and LmacdOsc > LmacdOsc[1] and emaV > emaV[1] and macdOsc > MacdOsc[1]; If vr1 == 0 and cond == true Then{ vr1 = 1; } #mp = marketposition; #mp에 marketposition if vr1 == 1 and vr1[1] == 0 then{ StopPrice = low - ma(range,4)*mult; } If vr1 == 1 then begin if L <= Stopprice then vr1 = 0; stopprice = stopprice +( low-stopprice )/Div; end; input : af(0.0045), maxaf(0.1); var : parabolic(0); parabolic = sar(af, maxaf); if vr1 == 1 then { if c[1] > parabolic[1] and L <= PARABOLIC[1] Then vr1 = 0; #exitlong("EL_파라볼릭청산", ATSTOP, PARABOLIC); } if vr1 == 0 and vr1[1] == 1 then buy(); if vr1 == 1 and vr1[1] == 0 then ExitLong(); 즐거운 하루되세요 > 도시군인 님이 쓴 글입니다. > 제목 : 수식작성 부탁드립니다. > 정말 감사드립니다. 일전에 비슷한 것을 문의드렸는데요. 아래 로직은 kodex200을 참조종목(일봉) 으로 하는 포지션 트레이딩 로직입니다. 일전에 부탁드렸듯이 매수청산시에는 매수를 , 원로직 매수시 매수청산을 할수록 반대로 시스템식 작성 부탁드립니다. 다음은 원로직 입니다. //&nbsp;KODEX200&nbsp;참조&nbsp;KODEX200&nbsp;적용&nbsp; Input&nbsp;:&nbsp;EmaLen(13),&nbsp;macd1(12),&nbsp;macd2(26),&nbsp;macd3(9),&nbsp;stoploss(5),&nbsp;len(5),&nbsp;mult(8),&nbsp;DiV(25); input:&nbsp;LongEmaLen(65),&nbsp;Longmacd1(60),&nbsp;Longmacd2(130),&nbsp;Longmacd3(45); var&nbsp;:&nbsp;&nbsp;emaV(0),&nbsp;MacdV(0),&nbsp;MacdS(0),&nbsp;MacdOsc(0); var&nbsp;:&nbsp;&nbsp;mp(0),&nbsp;stopprice(0),&nbsp;LemaV(0),&nbsp;LmacdV(0),&nbsp;LmacdS(0),&nbsp;LmacdOsc(0); &nbsp; emaV&nbsp;=&nbsp;data2(ema(C,EmaLen)); MacdV&nbsp;=&nbsp;data2(macd(macd1,macd2)); MacdS&nbsp;=&nbsp;data2(ema(MacdV,macd3)); MacdOsc&nbsp;=&nbsp;MacdV-MacdS; LemaV&nbsp;=&nbsp;data2(ema(C,LongEmaLen)); LmacdV&nbsp;=&nbsp;data2(macd(Longmacd1,Longmacd2)); LmacdS&nbsp;=&nbsp;data2(ema(LmacdV,Longmacd3)); LmacdOsc&nbsp;=&nbsp;LmacdV-LmacdS; If&nbsp;LemaV&nbsp;>&nbsp;LemaV[1]&nbsp;and&nbsp;LmacdOsc&nbsp;>&nbsp;LmacdOsc[1]&nbsp;then&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;emaV&nbsp;>&nbsp;emaV[1]&nbsp;and&nbsp;macdOsc&nbsp;>&nbsp;MacdOsc[1]&nbsp;Then &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;buy(); }&nbsp; mp&nbsp;=&nbsp;marketposition; #mp에&nbsp;marketposition if&nbsp;MP&nbsp;==&nbsp;1&nbsp;and&nbsp;MP[1]&nbsp;<>&nbsp;1&nbsp;then&nbsp;Begin &nbsp;StopPrice&nbsp;=&nbsp;low&nbsp;-&nbsp;ma(range,4)*mult; end; If&nbsp;MP&nbsp;==&nbsp;1&nbsp;then&nbsp;begin &nbsp;exitlong&nbsp;("ExitLong",&nbsp;atstop,stopprice&nbsp;); &nbsp;stopprice&nbsp;=&nbsp;stopprice&nbsp;+(&nbsp;low-stopprice&nbsp;)/Div; end; input&nbsp;:&nbsp;af(0.0045),&nbsp;maxaf(0.1); var&nbsp;:&nbsp;parabolic(0); parabolic&nbsp;=&nbsp;sar(af,&nbsp;maxaf); if&nbsp;MarketPosition&nbsp;<>&nbsp;0&nbsp;then&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;c&nbsp;>&nbsp;parabolic&nbsp;Then &nbsp;&nbsp;&nbsp;&nbsp;exitlong("EL_파라볼릭청산",&nbsp;ATSTOP,&nbsp;PARABOLIC); }