커뮤니티

문의 드립니다.

프로필 이미지
birdfire
2012-06-06 20:56:45
293
글번호 51715
답변완료
안녕하세요? 11시 이후에만 매매하도록 하고 싶어서 다음과 같이 작성했는데 9시경에 신호가 나오는 경우가 있습니다. 어떻게 하면 되는지요? input: atrmulti(1), stoploss(2); if stime > 110000 Then { //if ma(c, 150) > ma(c, 250) and ma(c, 250) > ma(c, 500) Then Buy( "b", AtStop, DayHigh(1)+ATR(5)*atrmulti ); Sell( "s", AtStop, DayLow(1)-ATR(5)*atrmulti ); If C < DayClose(1) Then Buy( "b2", AtStop, DayClose(1)+ATR(5)*atrmulti ); If C > DayClose(1) Then Sell( "s2", AtStop, DayClose(1)-ATR(5)*atrmulti ); } if MarketPosition <> 0 Then SetStopLoss( ATR(5)*2, PercentStop ); SetStopEndofday(143000);
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2012-06-07 15:44:05

안녕하세요 예스스탁입니다. atstop이나 atlimit은 현재봉에서 if조건만족하면 다음봉을 감시합니다. 당일 마지막봉에서 if문이 만족하면 다음날 첫봉에 신호가 발생하므로 아래와 같이 마지막봉에 if조건이 걸리지 않도록 제어하는 내용이 필요합니다. input: atrmulti(1), stoploss(2); if stime > 110000 and stime < 150000 Then { //if ma(c, 150) > ma(c, 250) and ma(c, 250) > ma(c, 500) Then Buy( "b", AtStop, DayHigh(1)+ATR(5)*atrmulti ); Sell( "s", AtStop, DayLow(1)-ATR(5)*atrmulti ); If C < DayClose(1) Then Buy( "b2", AtStop, DayClose(1)+ATR(5)*atrmulti ); If C > DayClose(1) Then Sell( "s2", AtStop, DayClose(1)-ATR(5)*atrmulti ); } SetStopLoss( ATR(5)*2, PercentStop ); SetStopEndofday(143000); 즐거운 하루되세요 > birdfire 님이 쓴 글입니다. > 제목 : 문의 드립니다. > 안녕하세요? 11시 이후에만 매매하도록 하고 싶어서 다음과 같이 작성했는데 9시경에 신호가 나오는 경우가 있습니다. 어떻게 하면 되는지요? input: atrmulti(1), stoploss(2); if stime > 110000 Then { //if ma(c, 150) > ma(c, 250) and ma(c, 250) > ma(c, 500) Then Buy( "b", AtStop, DayHigh(1)+ATR(5)*atrmulti ); Sell( "s", AtStop, DayLow(1)-ATR(5)*atrmulti ); If C < DayClose(1) Then Buy( "b2", AtStop, DayClose(1)+ATR(5)*atrmulti ); If C > DayClose(1) Then Sell( "s2", AtStop, DayClose(1)-ATR(5)*atrmulti ); } if MarketPosition <> 0 Then SetStopLoss( ATR(5)*2, PercentStop ); SetStopEndofday(143000);