해외선물Input : af(0.02), maxAF(0.2);
Var : value(0);
value = sar(af,maxAF);
# 매수/매도청산
If C > value and stime>=160000 and stime<=235959 Then
{
buy();
}
# 매도/매수청산
If C < value and stime>=160000 and stime<=235959 Then
{
sell();
}
if stime==000000 then
ExitLong("etl",atstop,c);
if stime==000000 then
ExitShort("ets",atstop,c);
위와 같이 시간제어 했는데 거래내역을 보니
원하는대로 시간제어가 되지 않는데 나스닥해외선물을 한국시간으로
"당일16시에서 익일 04시까지" 시간제어 통해
진입 청산나오도록 하고 싶습니다 도와 주세요
답변 1
예스스탁
예스스탁 답변
2019-11-15 10:55:06
안녕하세요
예스스탁입니다.
Input : af(0.02), maxAF(0.2);
input : starttime(160000),endtime(040000);
var : Tcond(false);
Var : value(0);
value = sar(af,maxAF);
if sdate != sdate[1] Then
SetStopEndofday(endtime);
if (sdate != sdate[1] and stime >= endtime) or
(sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then
{
Tcond = false;
}
if (sdate != sdate[1] and stime >= starttime) or
(sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then
{
Tcond = true;
SetStopEndofday(0);
}
if Tcond == true then
{
If C > value Then
{
buy();
}
If C < value Then
{
sell();
}
}
즐거운 하루되세요
> 새벽아이 님이 쓴 글입니다.
> 제목 : 해외선물 시간제어 방법 문의
> 해외선물Input : af(0.02), maxAF(0.2);
Var : value(0);
value = sar(af,maxAF);
# 매수/매도청산
If C > value and stime>=160000 and stime<=235959 Then
{
buy();
}
# 매도/매수청산
If C < value and stime>=160000 and stime<=235959 Then
{
sell();
}
if stime==000000 then
ExitLong("etl",atstop,c);
if stime==000000 then
ExitShort("ets",atstop,c);
위와 같이 시간제어 했는데 거래내역을 보니
원하는대로 시간제어가 되지 않는데 나스닥해외선물을 한국시간으로
"당일16시에서 익일 04시까지" 시간제어 통해
진입 청산나오도록 하고 싶습니다 도와 주세요