매수진입시간 시작 오전 9시1분에서 starttime(90100)
매수청산 시간을 오후 3시20분 endtime(152000);에 청산이 되도록 설정되어 있습니다
아래수식에서 매수진입 시간
(9시1분 시작 마지막 매수진입 시간이 15시00분까지만 매수진입 허용되도록 원합니다
청산은 청산기준에 따라 If Cond2 Then Exitlong("청산");되며
청산 신호가 발생 하지 않을경우 오후 3시20분 endtime(152000);에 청산이 되도록)
매수진입이 오전 9시 시작 오후 3시까지만 진입이 허용되도록 설정 추가 부탁 드립니다
input : starttime(90100),endtime(152000);
var : Tcond(false);
if (sdate != sdate[1] and stime >= starttime) or
(sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then
{
Tcond = true;
}
if (sdate != sdate[1] and stime >= endtime) or
(sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then
{
Tcond = false;
if MarketPosition == 1 Then
ExitLong("bx");
if MarketPosition == -1 Then
ExitShort("sx");
}
답변 1
예스스탁
예스스탁 답변
2019-11-04 16:07:14
안녕하세요
예스스탁입니다.
input : starttime(90100),endtime(150000),XTime(152000);
var : Tcond(false);
if (sdate != sdate[1] and stime >= starttime) or
(sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then
{
Tcond = true;
}
if (sdate != sdate[1] and stime >= endtime) or
(sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then
{
Tcond = false;
}
if Tcond == true then
{
매수진입수식
}
SetStopEndofday(XTime);
즐거운 하루되세요
> 뎅이요 님이 쓴 글입니다.
> 제목 : 거래시간 설정 확인부탁드립니다
>
매수진입시간 시작 오전 9시1분에서 starttime(90100)
매수청산 시간을 오후 3시20분 endtime(152000);에 청산이 되도록 설정되어 있습니다
아래수식에서 매수진입 시간
(9시1분 시작 마지막 매수진입 시간이 15시00분까지만 매수진입 허용되도록 원합니다
청산은 청산기준에 따라 If Cond2 Then Exitlong("청산");되며
청산 신호가 발생 하지 않을경우 오후 3시20분 endtime(152000);에 청산이 되도록)
매수진입이 오전 9시 시작 오후 3시까지만 진입이 허용되도록 설정 추가 부탁 드립니다
input : starttime(90100),endtime(152000);
var : Tcond(false);
if (sdate != sdate[1] and stime >= starttime) or
(sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then
{
Tcond = true;
}
if (sdate != sdate[1] and stime >= endtime) or
(sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then
{
Tcond = false;
if MarketPosition == 1 Then
ExitLong("bx");
if MarketPosition == -1 Then
ExitShort("sx");
}