안녕하세요
아래식으로
cme clude oil 온종일(8시에서 5시)거래시
11시에서 14시 사이와
20시에서 23시 사이에는
잔고에 대한 청산은 되고
진입은 안되는 것으로 하려면
어떻게 해야하나요?
input : ntime(60),N(4),N1(120),A1(3);
input : 익절틱수(0),손절틱수(0);
input : StartTime(80000),EndTime(50000);
var : S1(0),D1(0),TM(0),TF(0);
var : cnt(0),SumSqrt(0),Stdv(0);
var : sum(0),BBmd(0),Bbup(0),BBdn(0);
Array : CC[100](0);
var : Tcond(false);
if (NextBarSdate != sdate and NextBarStime >= EndTime) or
(NextBarSdate == sdate and NextBarStime >= EndTime and stime < EndTime) Then
Tcond = False;
if (NextBarSdate != sdate and NextBarStime >= StartTime) or
(NextBarSdate == sdate and NextBarStime >= StartTime and stime < StartTime) Then
{
Tcond = true;
S1 = TimeToMinutes(NextBarStime);
D1 = NextBarSdate;
}
if D1 > 0 then
{
if NextBarSdate == D1 Then
TM = TimeToMinutes(NextBarStime)-S1;
Else
TM = TimeToMinutes(NextBarStime)+1440-S1;
TF = TM%ntime;
if NextBarSdate != sdate or
(NextBarSdate == sdate and ntime > 1 and TF < TF[1]) or
(NextBarSdate == sdate and ntime > 1 and TM >= TM[1]+ntime) or
(NextBarSdate == sdate and ntime == 1 and TM > TM[1]) Then
{
var1 = NextBarOpen;
}
if Tcond == true and MarketPosition <= 0 Then
if Bdate == Bdate[n-1] and C>O
Then
Buy();
if Bdate == Bdate[n-1] and C<0
Then
Sell();
}
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(50000);
}
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
답변 1
예스스탁
예스스탁 답변
2023-12-11 15:50:52
안녕하세요
예스스탁입니다.
input : ntime(60),N(4),N1(120),A1(3);
input : 익절틱수(0),손절틱수(0);
input : StartTime(80000),EndTime(50000);
var : S1(0),D1(0),TM(0),TF(0);
var : cnt(0),SumSqrt(0),Stdv(0);
var : sum(0),BBmd(0),Bbup(0),BBdn(0);
Array : CC[100](0);
var : Tcond(false),ExitOnly1(False),ExitOnly2(False);
if (NextBarSdate != sdate and NextBarStime >= EndTime) or
(NextBarSdate == sdate and NextBarStime >= EndTime and stime < EndTime) Then
Tcond = False;
if (NextBarSdate != sdate and NextBarStime >= StartTime) or
(NextBarSdate == sdate and NextBarStime >= StartTime and stime < StartTime) Then
{
Tcond = true;
S1 = TimeToMinutes(NextBarStime);
D1 = NextBarSdate;
}
ExitOnly1 = sTime >= 110000 and sTime <= 140000;
ExitOnly2 = sTime >= 200000 and sTime <= 230000;
if D1 > 0 then
{
if NextBarSdate == D1 Then
TM = TimeToMinutes(NextBarStime)-S1;
Else
TM = TimeToMinutes(NextBarStime)+1440-S1;
TF = TM%ntime;
if NextBarSdate != sdate or
(NextBarSdate == sdate and ntime > 1 and TF < TF[1]) or
(NextBarSdate == sdate and ntime > 1 and TM >= TM[1]+ntime) or
(NextBarSdate == sdate and ntime == 1 and TM > TM[1]) Then
{
var1 = NextBarOpen;
}
if Tcond == true Then
{
if MarketPosition <= 0 and Bdate == Bdate[n-1] and C>O Then
{
if ExitOnly2 == False and ExitOnly2 == False Then
Buy();
Else
ExitShort();
}
if MarketPosition >= 0 and Bdate == Bdate[n-1] and C<O Then
{
if ExitOnly2 == False and ExitOnly2 == False Then
Sell();
Else
ExitLong();
}
}
}
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(50000);
}
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
즐거운 하루되세요
> 예스요 님이 쓴 글입니다.
> 제목 : 문의 드립니다.~~~~
> 안녕하세요
아래식으로
cme clude oil 온종일(8시에서 5시)거래시
11시에서 14시 사이와
20시에서 23시 사이에는
잔고에 대한 청산은 되고
진입은 안되는 것으로 하려면
어떻게 해야하나요?
input : ntime(60),N(4),N1(120),A1(3);
input : 익절틱수(0),손절틱수(0);
input : StartTime(80000),EndTime(50000);
var : S1(0),D1(0),TM(0),TF(0);
var : cnt(0),SumSqrt(0),Stdv(0);
var : sum(0),BBmd(0),Bbup(0),BBdn(0);
Array : CC[100](0);
var : Tcond(false);
if (NextBarSdate != sdate and NextBarStime >= EndTime) or
(NextBarSdate == sdate and NextBarStime >= EndTime and stime < EndTime) Then
Tcond = False;
if (NextBarSdate != sdate and NextBarStime >= StartTime) or
(NextBarSdate == sdate and NextBarStime >= StartTime and stime < StartTime) Then
{
Tcond = true;
S1 = TimeToMinutes(NextBarStime);
D1 = NextBarSdate;
}
if D1 > 0 then
{
if NextBarSdate == D1 Then
TM = TimeToMinutes(NextBarStime)-S1;
Else
TM = TimeToMinutes(NextBarStime)+1440-S1;
TF = TM%ntime;
if NextBarSdate != sdate or
(NextBarSdate == sdate and ntime > 1 and TF < TF[1]) or
(NextBarSdate == sdate and ntime > 1 and TM >= TM[1]+ntime) or
(NextBarSdate == sdate and ntime == 1 and TM > TM[1]) Then
{
var1 = NextBarOpen;
}
if Tcond == true and MarketPosition <= 0 Then
if Bdate == Bdate[n-1] and C>O
Then
Buy();
if Bdate == Bdate[n-1] and C<0
Then
Sell();
}
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(50000);
}
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}