커뮤니티
질문좀 드리겠습니다.
2010-06-14 18:36:22
800
글번호 30421
시스템식을 이렇게 만들어 봤습니다. 시가매매로 진입하여 1포인트 손실시 반대로
진입하는 식을 만들려고 합니다.그런데 실행시켜보니 exitlong하고 exitshort이
전혀 실행되지 않는 이유를 모르겠네요. 초보적인 질문이지만 시스템식을 고쳐
주셨으면 합니다.
if stime == 90300 then{
if dayopen > C Then{
Buy("b1",onclose,1);
If c <= EntryPrice(0) -1 Then{
Exitlong("exb1", OnClose, 1);
}
}
if dayopen < C Then{
Sell("s1",onclose,1);
If c <= EntryPrice(0) -1 Then{
ExitShort("exs1", OnClose, 1);
}
}
}
if MarketPosition == 0 and IsExitName("exs1",1) == true Then
buy("b2",OnClose,1);
if MarketPosition == 0 and IsExitName("exb1",1) == true then
sell("s2",OnClose,1);
setstopendofday(150000);
답변 1
예스스탁 예스스탁 답변
2010-06-15 14:52:52
안녕하세요
예스스탁입니다.
if stime == 90300 then{
if dayopen > C Then{
Buy("b1",onclose);
}
if dayopen < C Then{
Sell("s1",onclose);
}
}
If c <= EntryPrice(0)-1 Then{
Exitlong("exb1", OnClose);
}
If c <= EntryPrice(0) -1 Then{
ExitShort("exs1", OnClose);
}
if MarketPosition == 0 and IsExitName("exs1",1) == true Then
buy("b2",OnClose,def,1);
if MarketPosition == 0 and IsExitName("exb1",1) == true then
sell("s2",OnClose,def,1);
setstopendofday(150000);
기존의 청산식은 9시 3분에만 발동되게 되어 있고
9시 3분봉에는 진입이 발생하는 봉이므로
진입봉에서는 entryprice가 0입니다.
그러므로 신호가 발생될수 없는 구조입니다.
청산식을 시간과 분리하셔야 합니다.
즐거운 하루되세요
> 화이트호올 님이 쓴 글입니다.
> 제목 : 질문좀 드리겠습니다.
> 시스템식을 이렇게 만들어 봤습니다. 시가매매로 진입하여 1포인트 손실시 반대로
진입하는 식을 만들려고 합니다.그런데 실행시켜보니 exitlong하고 exitshort이
전혀 실행되지 않는 이유를 모르겠네요. 초보적인 질문이지만 시스템식을 고쳐
주셨으면 합니다.
if stime == 90300 then{
if dayopen > C Then{
Buy("b1",onclose,1);
If c <= EntryPrice(0) -1 Then{
Exitlong("exb1", OnClose, 1);
}
}
if dayopen < C Then{
Sell("s1",onclose,1);
If c <= EntryPrice(0) -1 Then{
ExitShort("exs1", OnClose, 1);
}
}
}
if MarketPosition == 0 and IsExitName("exs1",1) == true Then
buy("b2",OnClose,1);
if MarketPosition == 0 and IsExitName("exb1",1) == true then
sell("s2",OnClose,1);
setstopendofday(150000);