input : starttime(20000),endtime(60000),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 NextBarOpen != C Then
{
Buy("b2",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx2",AtMarket);
if NextBarOpen != C Then
{
Buy("b3",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx3",AtMarket);
if NextBarOpen != C Then
{
Buy("b4",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx4",AtMarket);
if NextBarOpen != C Then
{
Buy("b5",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx5",AtMarket);
if NextBarOpen == C Then
{
Buy("b6",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx6",AtMarket);
if NextBarOpen == C Then
{
Buy("b7",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx7",AtMarket);
if NextBarOpen == C Then
{
Buy("b8",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx8",AtMarket);
if NextBarOpen == C Then
{
Buy("b9",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx9",AtMarket);
if NextBarOpen == C Then
{
Buy("b10",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx10",AtMarket);
if NextBarOpen == C Then
{
Buy("b11",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx11",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);
if NextBarOpen != C Then
{
Sell("s2",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx2",AtMarket);
if NextBarOpen != C Then
{
Sell("s3",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx3",AtMarket);
if NextBarOpen != C Then
{
Sell("s4",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx4",AtMarket);
if NextBarOpen != C Then
{
Sell("s5",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx5",AtMarket);
if NextBarOpen == C Then
{
Sell("s6",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx6",AtMarket);
if NextBarOpen == C Then
{
Sell("s7",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx7",AtMarket);
if NextBarOpen == C Then
{
Sell("s8",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx8",AtMarket);
if NextBarOpen == C Then
{
Sell("s9",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx9",AtMarket);
if NextBarOpen == C Then
{
Sell("s10",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx10",AtMarket);
if NextBarOpen == C Then
{
Sell("s11",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx11",AtMarket);
if NextBarSdate != sDate Then
{
if NextBarOpen != C Then
{
Buy("b12",AtStop,NextBarOpen+PriceScale*5);
}
}
ExitLong("bx12",AtMarket);
if NextBarOpen != C Then
{
Buy("b13",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx13",AtMarket);
if NextBarOpen != C Then
{
Buy("b14",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx14",AtMarket);
if NextBarOpen != C Then
{
Buy("b15",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx15",AtMarket);
if NextBarOpen != C Then
{
Buy("b16",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx16",AtMarket);
if NextBarOpen != C Then
{
Buy("b17",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx17",AtMarket);
if NextBarOpen == C Then
{
Buy("b18",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx18",AtMarket);
if NextBarOpen == C Then
{
Buy("b19",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx19",AtMarket);
if NextBarOpen == C Then
{
Buy("b20",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx20",AtMarket);
if NextBarOpen == C Then
{
Buy("b21",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx21",AtMarket);
if NextBarOpen == C Then
{
Buy("b22",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx22",AtMarket);
if NextBarOpen == C Then
{
Buy("b23",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx23",AtMarket);
if NextBarSdate != sDate Then
{
if NextBarOpen != C Then
{
Sell("s12",AtStop,NextBarOpen-PriceScale*5);
}
}
ExitShort("sx12",AtMarket);
if NextBarOpen != C Then
{
Sell("s13",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx13",AtMarket);
if NextBarOpen != C Then
{
Sell("s14",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx14",AtMarket);
if NextBarOpen != C Then
{
Sell("s15",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx15",AtMarket);
if NextBarOpen != C Then
{
Sell("s16",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx16",AtMarket);
if NextBarOpen != C Then
{
Sell("s17",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx17",AtMarket);
if NextBarOpen == C Then
{
Sell("s18",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx18",AtMarket);
if NextBarOpen == C Then
{
Sell("s19",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx19",AtMarket);
if NextBarOpen == C Then
{
Sell("s20",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx20",AtMarket);
if NextBarOpen == C Then
{
Sell("s21",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx21",AtMarket);
if NextBarOpen == C Then
{
Sell("s22",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx22",AtMarket);
if NextBarOpen == C Then
{
Sell("s23",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx23",AtMarket);
if NextBarSdate != sDate Then
{
if NextBarOpen != C Then
{
Buy("b24",AtStop,NextBarOpen+PriceScale*5);
}
}
ExitLong("bx24",AtMarket);
if NextBarOpen != C Then
{
Buy("b25",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx25",AtMarket);
if NextBarOpen != C Then
{
Buy("b26",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx26",AtMarket);
if NextBarOpen != C Then
{
Buy("b27",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx27",AtMarket);
if NextBarOpen != C Then
{
Buy("b28",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx28",AtMarket);
if NextBarOpen != C Then
{
Buy("b29",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx29",AtMarket);
if NextBarOpen == C Then
{
Buy("b30",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx30",AtMarket);
if NextBarOpen == C Then
{
Buy("b31",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx31",AtMarket);
if NextBarOpen == C Then
{
Buy("b32",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx32",AtMarket);
if NextBarOpen == C Then
{
Buy("b33",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx33",AtMarket);
if NextBarOpen == C Then
{
Buy("b34",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx34",AtMarket);
if NextBarOpen == C Then
{
Buy("b35",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx35",AtMarket);
if NextBarSdate != sDate Then
{
if NextBarOpen != C Then
{
Sell("s24",AtStop,NextBarOpen-PriceScale*5);
}
}
ExitShort("sx24",AtMarket);
if NextBarOpen != C Then
{
Sell("s25",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx25",AtMarket);
if NextBarOpen != C Then
{
Sell("s26",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx26",AtMarket);
if NextBarOpen != C Then
{
Sell("s27",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx27",AtMarket);
if NextBarOpen != C Then
{
Sell("s28",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx28",AtMarket);
if NextBarOpen != C Then
{
Sell("s29",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx29",AtMarket);
if NextBarOpen == C Then
{
Sell("s30",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx30",AtMarket);
if NextBarOpen == C Then
{
Sell("s31",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx31",AtMarket);
if NextBarOpen == C Then
{
Sell("s32",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx32",AtMarket);
if NextBarOpen == C Then
{
Sell("s33",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx33",AtMarket);
if NextBarOpen == C Then
{
Sell("s34",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx34",AtMarket);
if NextBarOpen == C Then
{
Sell("s35",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx35",AtMarket);
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop); }
-------------------------------------------------------------
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 문의 드립니다
>
안녕하세요
예스스탁입니다.
1
올리신 수식에 당일청산과 시간구간지정은 되어 있습니다.
시간구간은 Tcond인데 지정한 시간사이이면 true 아니면 false입니다.
해당 변수가 true일때만 신호가 발생하게 하셔야 합니다.
2
추가적으로 현재 올리신 수식에
매수는 0시 이후 첫봉에만 발생하게 되어 있습니다.
if NextBarSdate != sDate Then
위 조건은 다음봉시가의 날짜와 현재완성봉 날짜가 다르다는 표현으로
stime기준으로 0시 이후 첫봉입니다.
3
input : starttime(080000),endtime(63000),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);
}
}
input : 익절틱수(0),손절틱수(0);
if Tcond == true Then
{
if NextBarSdate != sDate Then
{
if NextBarOpen != C Then
{
Buy("b",AtStop,NextBarOpen+PriceScale*5);
}
}
if NextBarOpen != C Then
{
Sell("s",AtStop,NextBarOpen-PriceScale*5);
}
}
ExitLong("bx",AtMarket);
ExitShort("sx",AtMarket);
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
즐거운 하루되세요
> 푸른 님이 쓴 글입니다.
> 제목 : 문의 드립니다
> input : starttime(210000),endtime(63000),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;
hh = h;
ll = l;
h1 = hh[1];
l1 = ll[1];
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
input : 익절틱수(0),손절틱수(0);
if NextBarSdate != sDate Then
{
if NextBarOpen != C Then
{
Buy("b",AtStop,NextBarOpen+PriceScale*5);
}
}
ExitLong("bx",AtMarket);
if NextBarOpen != C Then
{
Sell("s",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx",AtMarket);
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
-----------------------
해외선물 매매구간인(08:00~익일07:00)에서 150분봉 매매시 endtime은 06:30 입니다.
endtime때 매매만 정지가되고 상품의 수량은 그대로인데 endtime전후로 당일 자동청산이
되도록 수식어를 포함하고자합니다.