커뮤니티
문의드립니다
2015-11-03 11:51:28
202
글번호 91993
안녕하세요
아래 식 에서 시작시간및 종료시간을 종목및 썸머타임에 관계없이 적용하고자합니다
현재 예스글로벌사용중인데 crude oil 같은종목은 시작시간이 썸머타임과 관련하여
변경되는것이 맞는것인가요?...
부탁드립니다.
===============================================================================
input : af1(0.01),max1(0.1);
input : S1(20),P1(53);
var : para1(0),T1(0);
var : Bcond1(false);
var : Scond1(false);
var : pre(0),daycnt(0);
para1 = sar(af1,max1);
if stime == 170000 or (stime > 170000 and stime[1] < 170000) Then
pre = TotalTrades;
if MarketPosition == 0 Then
daycnt = TotalTrades-Pre;
Else
daycnt = (TotalTrades-Pre)+1;
if stime >= 170000 or stime < 154000 Then{
if crossup(C,para1) Then{
Bcond1 = false;
var1 = H;
var2 = L;
T1 = 1;
}
if CrossDown(C,para1) Then{
Scond1 = false;
var1 = H;
var2 = L;
T1 = -1;
}
if T1 == 1 and T1[1] == 1 and Bcond1 == false and H >= var1[1]+PriceScale*1 Then
Bcond1 = true;
if T1 == -1 and T1[1] == -1 and Scond1 == false and L <= var2[1]-PriceScale*1 Then
Scond1 = true;
if T1 == 1 and Bcond1 == false Then
buy("B1",AtStop,var1+PriceScale*1);
if T1 == -1 and Scond1 == false Then
sell("S1",AtStop,var2-PriceScale*1);
if daycnt == 0 and crossup(c,var1) and c > para1 Then
buy("B2");
if daycnt == 0 and CrossDown(c,var2) and c < para1 Then
sell("S2");
}
=============================================================================
중략
============================================================================
if stime == 154000 or (stime > 154000 and stime[1] < 154000) Then{
exitlong("bexit");
ExitShort("sexit");
}
답변 1
예스스탁 예스스탁 답변
2015-11-03 17:26:19
안녕하세요
예스스탁입니다.
해외선물은 썸머타임에 따라 시작시간에 차이가 있습니다.
시작시간은 bdate != Bdate[1]로 조건을 지정하시면 됩니다
bdate는 영업일로 위 내용은 새로운 영업일이 시작하는 봉을 의미합니다
위와 같이 처리하면 시작시간은 썸머타임도 자동 반영됩니다
종료시간은 자동으로 알수가 없습니다.
종료시간은 직접 지정하셔야 합니다.
input : af1(0.01),max1(0.1);
input : S1(20),P1(53);
input : 종료시간(154000);
var : para1(0),T1(0);
var : Bcond1(false);
var : Scond1(false);
var : pre(0),daycnt(0),TimeCond(false);
para1 = sar(af1,max1);
if bdate != bdate Then{
pre = TotalTrades;
TimeCond = true;
}
if stime == 종료시간 or (stime > 종료시간 and stime[1] < 종료시간 ) Then{
TimeCond = false;
exitlong("bexit");
ExitShort("sexit");
}
if MarketPosition == 0 Then
daycnt = TotalTrades-Pre;
Else
daycnt = (TotalTrades-Pre)+1;
if Timecond == true Then{
if crossup(C,para1) Then{
Bcond1 = false;
var1 = H;
var2 = L;
T1 = 1;
}
if CrossDown(C,para1) Then{
Scond1 = false;
var1 = H;
var2 = L;
T1 = -1;
}
if T1 == 1 and T1[1] == 1 and Bcond1 == false and H >= var1[1]+PriceScale*1 Then
Bcond1 = true;
if T1 == -1 and T1[1] == -1 and Scond1 == false and L <= var2[1]-PriceScale*1 Then
Scond1 = true;
if T1 == 1 and Bcond1 == false Then
buy("B1",AtStop,var1+PriceScale*1);
if T1 == -1 and Scond1 == false Then
sell("S1",AtStop,var2-PriceScale*1);
if daycnt == 0 and crossup(c,var1) and c > para1 Then
buy("B2");
if daycnt == 0 and CrossDown(c,var2) and c < para1 Then
sell("S2");
}
즐거운 하루되세요
> 베드로 님이 쓴 글입니다.
> 제목 : 문의드립니다
> 안녕하세요
아래 식 에서 시작시간및 종료시간을 종목및 썸머타임에 관계없이 적용하고자합니다
현재 예스글로벌사용중인데 crude oil 같은종목은 시작시간이 썸머타임과 관련하여
변경되는것이 맞는것인가요?...
부탁드립니다.
===============================================================================
input : af1(0.01),max1(0.1);
input : S1(20),P1(53);
var : para1(0),T1(0);
var : Bcond1(false);
var : Scond1(false);
var : pre(0),daycnt(0);
para1 = sar(af1,max1);
if stime == 170000 or (stime > 170000 and stime[1] < 170000) Then
pre = TotalTrades;
if MarketPosition == 0 Then
daycnt = TotalTrades-Pre;
Else
daycnt = (TotalTrades-Pre)+1;
if stime >= 170000 or stime < 154000 Then{
if crossup(C,para1) Then{
Bcond1 = false;
var1 = H;
var2 = L;
T1 = 1;
}
if CrossDown(C,para1) Then{
Scond1 = false;
var1 = H;
var2 = L;
T1 = -1;
}
if T1 == 1 and T1[1] == 1 and Bcond1 == false and H >= var1[1]+PriceScale*1 Then
Bcond1 = true;
if T1 == -1 and T1[1] == -1 and Scond1 == false and L <= var2[1]-PriceScale*1 Then
Scond1 = true;
if T1 == 1 and Bcond1 == false Then
buy("B1",AtStop,var1+PriceScale*1);
if T1 == -1 and Scond1 == false Then
sell("S1",AtStop,var2-PriceScale*1);
if daycnt == 0 and crossup(c,var1) and c > para1 Then
buy("B2");
if daycnt == 0 and CrossDown(c,var2) and c < para1 Then
sell("S2");
}
=============================================================================
중략
============================================================================
if stime == 154000 or (stime > 154000 and stime[1] < 154000) Then{
exitlong("bexit");
ExitShort("sexit");
}
다음글