수고하십니다.
아래식으로 cme종목과 항생지수를 거래할 때
정해진 시간대에서만 진입하도록 하려면 어떻게 해야 하나요?
(예를들어 10시~13시 그리고 23시~1시에만 진입허용)
input : N(9),N1(30);
var : ET(0);
if ET > 0 and sDate != sDate[1] Then
SetStopEndofday(ET);
if Bdate != Bdate[1] Then
{
SetStopEndofday(0);
if stime >= 80000 Then
ET = 060000;
else
ET = 050000;
}
if Bdate == Bdate[n-1] and CountIf(C>O,3) == 3 and c >= L[N-1]+PriceScale*n1 //and c >= DayHigh
Then
Buy();
if Bdate == Bdate[n-1] and CountIf(C<O,3) == 3 and c[n-1] >= L+PriceScale*n1 //and DayLow >= c
Then
Sell();
답변 1
예스스탁
예스스탁 답변
2023-05-11 10:57:34
안녕하세요
예스스탁입니다.
input : StartTime1(100000),EndTime1(130000);
input : StartTime2(230000),EndTime2(010000);
input : N(9),N1(30);
var : ET(0),Tcond(false);
if ET > 0 and sDate != sDate[1] Then
SetStopEndofday(ET);
if Bdate != Bdate[1] Then
{
SetStopEndofday(0);
if stime >= 80000 Then
ET = 060000;
else
ET = 050000;
}
if (sdate != sdate[1] and stime >= StartTime1) or
(sdate == sdate[1] and stime >= StartTime1 and stime[1] < StartTime1) Then
Tcond = true;
if (sdate != sdate[1] and stime >= EndTime1) or
(sdate == sdate[1] and stime >= EndTime1 and stime[1] < EndTime1) Then
Tcond = False;
if (sdate != sdate[1] and stime >= EndTime2) or
(sdate == sdate[1] and stime >= EndTime2 and stime[1] < EndTime2) Then
Tcond = False;
if (sdate != sdate[1] and stime >= StartTime2) or
(sdate == sdate[1] and stime >= StartTime2 and stime[1] < StartTime2) Then
Tcond = true;
if Tcond == true Then
{
if Bdate == Bdate[n-1] and CountIf(C>O,3) == 3 and c >= L[N-1]+PriceScale*n1 //and c >= DayHigh
Then
Buy();
if Bdate == Bdate[n-1] and CountIf(C<O,3) == 3 and c[n-1] >= L+PriceScale*n1 //and DayLow >= c
Then
Sell();
}
즐거운 하루되세요
> 예스요 님이 쓴 글입니다.
> 제목 : 문의 드립니다.~~~~
> 수고하십니다.
아래식으로 cme종목과 항생지수를 거래할 때
정해진 시간대에서만 진입하도록 하려면 어떻게 해야 하나요?
(예를들어 10시~13시 그리고 23시~1시에만 진입허용)
input : N(9),N1(30);
var : ET(0);
if ET > 0 and sDate != sDate[1] Then
SetStopEndofday(ET);
if Bdate != Bdate[1] Then
{
SetStopEndofday(0);
if stime >= 80000 Then
ET = 060000;
else
ET = 050000;
}
if Bdate == Bdate[n-1] and CountIf(C>O,3) == 3 and c >= L[N-1]+PriceScale*n1 //and c >= DayHigh
Then
Buy();
if Bdate == Bdate[n-1] and CountIf(C<O,3) == 3 and c[n-1] >= L+PriceScale*n1 //and DayLow >= c
Then
Sell();