아래와 같이 9시부터 매매 시작해서 23시 55분봉 종가에서 청산하는 수식을
9시부터 매매해서 23시 55분 전까지만 진입 허용하고,
청산은 다음날 5시에 하는 식으로 변경 부탁합니다.
input : starttime(090000),endtime(235500);
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");
}
if Tcond == true then
{
답변 1
예스스탁
예스스탁 답변
2020-11-24 14:11:51
안녕하세요
예스스탁입니다.
input : starttime(090000),endtime(235500),Xtime(050000);
var : Tcond(false);
if sDate != sDate[1] Then
SetStopEndofday(Xtime);
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
{
진입청산수식
}
즐거운 하루되세요
> 란돌 님이 쓴 글입니다.
> 제목 : 수식 수정 부탁합니다.
> 아래와 같이 9시부터 매매 시작해서 23시 55분봉 종가에서 청산하는 수식을
9시부터 매매해서 23시 55분 전까지만 진입 허용하고,
청산은 다음날 5시에 하는 식으로 변경 부탁합니다.
input : starttime(090000),endtime(235500);
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");
}
if Tcond == true then
{