커뮤니티

부탁드립니다.

프로필 이미지
에리조나
2013-05-02 22:42:54
198
글번호 62740
답변완료
안녕하세요? 수고가 많습니다. 제가 질문이 정확하지 못해서 죄송합니다. 아래의 1번식을 작성해서 사용할려고 하는데 120분봉에 적용하여 매매할려고 합니다. 그런데 마지막봉이나 동시호가에 조건이 만족되면 매매체결이 안되니 그때는 다음날 매수가 발생하도록 하고 싶습니다. --1번식 if maV1 > maV2 and c > maV2 then{ if macd < macdsig Then{ if (crossup(var3,var4) and countif(crossup(var1,var2),N ) >= 1) or (crossup(var1,var2) and countif(crossup(var3,var4),N ) >= 1) Then{ buy("b1",OnClose,def,1); } } } 아래의 식은 120분봉 매매시 마지막봉이나 동시호가에 조건이 만족하면 다음날 시초가에 매매신호가 발생하는 수식으로 알고 있는데요...위의 1번매매식을 아래의 2번, 3번 매매식으로 적용을 해주시면 감사하겠습니다. --2번식 #당일 두번째봉까지 if dayindex+1 <= 2 Then{ if 매수진입조건 Then buy(); if 매수청산조건 Then ExitLong(); if 매도진입조건 Then Sell(); if 매도청산조건 Then ExitShort(); } --3번식 #당일 네번째 봉에서 #세번째 네번째봉중 조건 한번이라도 맞으면 다음날 시초가에 신호 및 주문 if dayindex+1 == 4 Then{ if MarketPosition != 1 and countif(매수진입조건,2) >= 1 Then buy("b2",AtMarket); if MarketPosition == 1 and countif(매수청산조건,2) >= 1 Then ExitLong("bx2",AtMarket); if MarketPosition != -1 and countif(매도진입조건,2) >= 1 Then Sell("s2",AtMarket); if MarketPosition == -1 and countif(매도청산조건,2) >= 1 Then ExitShort("sx2",AtMarket); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2013-05-03 11:40:35

안녕하세요 예스스탁입니다. 적용하시는 종목이 선물이나 옵션이시면 정규장 마지마봉이 13시~14시 59분59초이고 정규장 시간은 15시 05분 까지이므로 아래식 사용하시면 됩니다. var : mav1(0),mav2(0),macd(0),macdsig(0),N(0); if dayindex+1 <= 3 Then{ if maV1 > maV2 and c > maV2 and macd < macdsig and (crossup(var3,var4) and countif(crossup(var1,var2),N ) >= 1) or (crossup(var1,var2) and countif(crossup(var3,var4),N ) >= 1) Then buy("b1",OnClose,def,1); } if dayindex+1 == 4 Then{ if countif(maV1 > maV2 and c > maV2 and macd < macdsig and (crossup(var3,var4) and countif(crossup(var1,var2),N ) >= 1) or (crossup(var1,var2) and countif(crossup(var3,var4),N ) >= 1),2) >= 1 Then buy("b1.",AtMarket,def,1); } 현물이면 아래식을 사용하시면 됩니다. var : mav1(0),mav2(0),macd(0),macdsig(0),N(0); if dayindex+1 <= 2 Then{ if maV1 > maV2 and c > maV2 and macd < macdsig and (crossup(var3,var4) and countif(crossup(var1,var2),N ) >= 1) or (crossup(var1,var2) and countif(crossup(var3,var4),N ) >= 1) Then buy("b1",OnClose,def,1); } if dayindex+1 == 4 Then{ if countif(maV1 > maV2 and c > maV2 and macd < macdsig and (crossup(var3,var4) and countif(crossup(var1,var2),N ) >= 1) or (crossup(var1,var2) and countif(crossup(var3,var4),N ) >= 1),2) >= 1 Then buy("b1.",AtMarket,def,1); } 즐거운 하루되세요 > 에리조나 님이 쓴 글입니다. > 제목 : 부탁드립니다. > 안녕하세요? 수고가 많습니다. 제가 질문이 정확하지 못해서 죄송합니다. 아래의 1번식을 작성해서 사용할려고 하는데 120분봉에 적용하여 매매할려고 합니다. 그런데 마지막봉이나 동시호가에 조건이 만족되면 매매체결이 안되니 그때는 다음날 매수가 발생하도록 하고 싶습니다. --1번식 if maV1 > maV2 and c > maV2 then{ if macd < macdsig Then{ if (crossup(var3,var4) and countif(crossup(var1,var2),N ) >= 1) or (crossup(var1,var2) and countif(crossup(var3,var4),N ) >= 1) Then{ buy("b1",OnClose,def,1); } } } 아래의 식은 120분봉 매매시 마지막봉이나 동시호가에 조건이 만족하면 다음날 시초가에 매매신호가 발생하는 수식으로 알고 있는데요...위의 1번매매식을 아래의 2번, 3번 매매식으로 적용을 해주시면 감사하겠습니다. --2번식 #당일 두번째봉까지 if dayindex+1 <= 2 Then{ if 매수진입조건 Then buy(); if 매수청산조건 Then ExitLong(); if 매도진입조건 Then Sell(); if 매도청산조건 Then ExitShort(); } --3번식 #당일 네번째 봉에서 #세번째 네번째봉중 조건 한번이라도 맞으면 다음날 시초가에 신호 및 주문 if dayindex+1 == 4 Then{ if MarketPosition != 1 and countif(매수진입조건,2) >= 1 Then buy("b2",AtMarket); if MarketPosition == 1 and countif(매수청산조건,2) >= 1 Then ExitLong("bx2",AtMarket); if MarketPosition != -1 and countif(매도진입조건,2) >= 1 Then Sell("s2",AtMarket); if MarketPosition == -1 and countif(매도청산조건,2) >= 1 Then ExitShort("sx2",AtMarket); }