커뮤니티

다시 문의 드립니다.

프로필 이미지
도시군인
2011-05-31 22:14:02
717
글번호 39270
답변완료

첨부 이미지

자꾸 질문드려서 죄송합니다. 저한테는 다소 중요한 로직이라, 한번만 더 부탁드립니다. 아래 사진은 일전에 문의드렸던 KODEX ETF 포지션 트레이딩 로직을 적용한 사진입니다. 거듭 문의 드렸는데, 로직은 적절한거 같은데, KODEX리버리지(혹은 KODEX200)의 신호와 정확히 반대방향으로 발생하지 않습니다. 무엇이 문제 일까요? 그리고 원로직의 주종목을 KODEX200과 KODEX리버리지 달리 적용했을시 신호의 차이가 있는데, 이건 아무래도 청산시 DATA2(참조종목) 데이타를 쓰지 않아서 그런거 같은데, 이부분도 수정 부탁드립니다. 로직1, KODEX리버리지 적용 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); 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; If LemaV > LemaV[1] and LmacdOsc > LmacdOsc[1] then { if emaV > emaV[1] and macdOsc > MacdOsc[1] Then buy(); } mp = marketposition; if MP == 1 and MP[1] <> 1 then Begin StopPrice = low - ma(range,4)*mult; end; If MP == 1 then begin exitlong ("ExitLong", atstop,stopprice ); stopprice = stopprice +( low-stopprice )/Div; end; input : af(0.0045), maxaf(0.1); var : parabolic(0); parabolic = sar(af, maxaf); if MarketPosition <> 0 then { if c > parabolic Then exitlong("EL_파라볼릭청산", ATSTOP, PARABOLIC); } 로직2 KODEX 인버스 적용 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; } 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(); 감사 합니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2011-06-01 11:29:30

안녕하세요 예스스탁입니다. 수정한 식입니다. data2를 kodex200 data3을 kodex레버리지로 설정하시기 바랍니다. 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; } if vr1 == 1 and vr1[1] == 0 then{ StopPrice = data3(low - ma(range,4)*mult); } If vr1 == 1 then begin if data3(L) <= Stopprice then vr1 = 0; stopprice = stopprice +( data3(l)-stopprice )/Div; end; input : af(0.0045), maxaf(0.1); var : parabolic(0); parabolic = data3(sar(af, maxaf)); if vr1 == 1 then { if data3(c[1]) > parabolic[1] and data3(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(); 즐거운 하루되세요 > 도시군인 님이 쓴 글입니다. > 제목 : 다시 문의 드립니다. > 자꾸 질문드려서 죄송합니다. 저한테는 다소 중요한 로직이라, 한번만 더 부탁드립니다. 아래 사진은 일전에 문의드렸던 KODEX ETF 포지션 트레이딩 로직을 적용한 사진입니다. 거듭 문의 드렸는데, 로직은 적절한거 같은데, KODEX리버리지(혹은 KODEX200)의 신호와 정확히 반대방향으로 발생하지 않습니다. 무엇이 문제 일까요? 그리고 원로직의 주종목을 KODEX200과 KODEX리버리지 달리 적용했을시 신호의 차이가 있는데, 이건 아무래도 청산시 DATA2(참조종목) 데이타를 쓰지 않아서 그런거 같은데, 이부분도 수정 부탁드립니다. 로직1, KODEX리버리지 적용 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); 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; If LemaV > LemaV[1] and LmacdOsc > LmacdOsc[1] then { if emaV > emaV[1] and macdOsc > MacdOsc[1] Then buy(); } mp = marketposition; if MP == 1 and MP[1] <> 1 then Begin StopPrice = low - ma(range,4)*mult; end; If MP == 1 then begin exitlong ("ExitLong", atstop,stopprice ); stopprice = stopprice +( low-stopprice )/Div; end; input : af(0.0045), maxaf(0.1); var : parabolic(0); parabolic = sar(af, maxaf); if MarketPosition <> 0 then { if c > parabolic Then exitlong("EL_파라볼릭청산", ATSTOP, PARABOLIC); } 로직2 KODEX 인버스 적용 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; } 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(); 감사 합니다.