예스스탁
예스스탁 답변
2023-02-10 16:01:06
안녕하세요
예스스탁입니다.
1
문의하신 내용은 첫봉완성시로만 가능합니다.
주기가 높은 주기에서 8시1분에 청산이 되지 않습니다.
첫봉 완성시 청산입니다.
if Bdate != Bdate[1] Then
{
if MarketPosition == 1 and Bdate[BarsSinceEntry] != Bdate Then
ExitLong();
if MarketPosition == -1 and Bdate[BarsSinceEntry] != Bdate Then
ExitShort();
}
2
당일청산함수 제외하고
위 내용 추가해 드립니다.
input : starttime(180000),endtime(40000),n(30);
var : Tcond(false),hh(0),h1(0),ll(0),l1(0);
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;
}
if Tcond == true Then
{
input : 익절틱수(0),손절틱수(0);
if NextBarSdate != sDate Then
{
if NextBarOpen != C Then
{
Buy("b",AtStop,NextBarOpen+PriceScale*5);
}
}
ExitLong("bx",AtMarket);
if NextBarOpen == C Then
{
Buy("b1",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx1",AtMarket);
if NextBarSdate != sDate Then
{
if NextBarOpen != C Then
{
Sell("s",AtStop,NextBarOpen-PriceScale*5);
}
}
ExitShort("sx",AtMarket);
if NextBarOpen == C Then
{
Sell("s1",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx1",AtMarket);
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop); }
if Bdate != Bdate[1] Then
{
if MarketPosition == 1 and Bdate[BarsSinceEntry] != Bdate Then
ExitLong();
if MarketPosition == -1 and Bdate[BarsSinceEntry] != Bdate Then
ExitShort();
}
즐거운 하루되세요
> 푸른 님이 쓴 글입니다.
> 제목 : 문의 드립니다.
> 1.
해외선물 전일잔고를 08시01분에 청산하는 수식어를 부탁드립니다.
2.
input : starttime(180000),endtime(40000),n(30);
var : Tcond(false),hh(0),h1(0),ll(0),l1(0);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
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;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
if Tcond == true Then
{
input : 익절틱수(0),손절틱수(0);
if NextBarSdate != sDate Then
{
if NextBarOpen != C Then
{
Buy("b",AtStop,NextBarOpen+PriceScale*5);
}
}
ExitLong("bx",AtMarket);
if NextBarOpen == C Then
{
Buy("b1",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx1",AtMarket);
if NextBarSdate != sDate Then
{
if NextBarOpen != C Then
{
Sell("s",AtStop,NextBarOpen-PriceScale*5);
}
}
ExitShort("sx",AtMarket);
if NextBarOpen == C Then
{
Sell("s1",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx1",AtMarket);
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop); }
1번 수식어를 2번에 넣을수있는지요.
미리 감사드립니다.