지수선물 적용 예정입니다
9~10시 고가 > 11시~12시 고가 매수청산
9~10시 저가 < 11시~12시 저가 매도청산
신속하고 정확한 답변 부탁드립니다
답변 1
예스스탁
예스스탁 답변
2021-08-09 11:16:18
안녕하세요
예스스탁입니다.
input : StartTime1(90000),EndTime1(100000);
input : StartTime2(110000),EndTime2(120000);
var : Tcond1(false),Tcond2(false);
var : H1(0),L1(0),H2(0),L2(0);
if (sdate != sdate[1] and stime >= EndTime1) or
(sdate == sdate[1] and stime >= EndTime1 and stime[1] < EndTime1) Then
Tcond1 = False;
if (sdate != sdate[1] and stime >= StartTime1) or
(sdate == sdate[1] and stime >= StartTime1 and stime[1] < StartTime1) Then
{
Tcond1 = true;
H1 = h;
L1 = L;
}
if Tcond1 == true Then
{
if h1 > 0 and h > h1 Then
h1 = h;
if l1 > 0 and l < l1 Then
l1 = l;
}
if (sdate != sdate[1] and stime >= EndTime2) or
(sdate == sdate[1] and stime >= EndTime2 and stime[1] < EndTime2) Then
{
Tcond2 = False;
if MarketPosition == 1 and H1 > 0 and H2 > 0 and H1 > H2 Then
ExitLong();
if MarketPosition == -1 and L1 > 0 and L2 > 0 and L1 < L2 Then
ExitShort();
}
if (sdate != sdate[1] and stime >= StartTime2) or
(sdate == sdate[1] and stime >= StartTime2 and stime[1] < StartTime2) Then
{
Tcond2 = true;
H2 = h;
L2 = L;
}
if Tcond2 == true Then
{
if h2 > 0 and h > h2 Then
h2= h;
if l2 > 0 and l < l2 Then
l2 = l;
}
즐거운 하루되세요
> 우리상향 님이 쓴 글입니다.
> 제목 : 시스템 질문입니다
> 지수선물 적용 예정입니다
9~10시 고가 > 11시~12시 고가 매수청산
9~10시 저가 < 11시~12시 저가 매도청산
신속하고 정확한 답변 부탁드립니다