답변완료
문의 드립니다
input : starttime(130000),endtime(40000),n(10);
var : Tcond(false),hh(0),h1(0),ll(0),l1(0);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1]and Tcond == true 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*10);
}
}
ExitLong("bx",AtMarket);
if NextBarOpen != C Then
{
Buy("b1",AtStop,NextBarOpen+PriceScale*10);
}
ExitLong("bx1",AtMarket);
if NextBarSdate != sDate Then
{
if NextBarOpen != C Then
{
Sell("s",AtStop,NextBarOpen-PriceScale*10);
}
}
ExitShort("sx",AtMarket);
if NextBarOpen != C Then
{
Sell("s1",AtStop,NextBarOpen-PriceScale*10);
}
ExitShort("sx1",AtMarket);
if NextBarSdate == sDate Then
{
if NextBarOpen == C Then
{
Buy("b2",AtStop,NextBarOpen+PriceScale*10);
}
}
ExitLong("bx2",AtMarket);
if NextBarOpen == C Then
{
Buy("b3",AtStop,NextBarOpen+PriceScale*10);
}
ExitLong("bx3",AtMarket);
if NextBarSdate == sDate Then
{
if NextBarOpen == C Then
{
Sell("s2",AtStop,NextBarOpen-PriceScale*10);
}
}
ExitShort("sx2",AtMarket);
if NextBarOpen == C Then
{
Sell("s3",AtStop,NextBarOpen-PriceScale*10);
}
ExitShort("sx3",AtMarket);
if NextBarSdate != sDate Then
{
if NextBarOpen != C Then
{
Buy("b4",AtStop,NextBarOpen+PriceScale*10);
}
}
ExitLong("bx4",AtMarket);
if NextBarOpen != C Then
{
Buy("b5",AtStop,NextBarOpen+PriceScale*10);
}
ExitLong("bx5",AtMarket);
if NextBarSdate != sDate Then
{
if NextBarOpen != C Then
{
Sell("s4",AtStop,NextBarOpen-PriceScale*10);
}
}
ExitShort("sx4",AtMarket);
if NextBarOpen != C Then
{
Sell("s5",AtStop,NextBarOpen-PriceScale*10);
}
ExitShort("sx5",AtMarket);
if NextBarSdate == sDate Then
{
if NextBarOpen == C Then
{
Buy("b6",AtStop,NextBarOpen+PriceScale*10);
}
}
ExitLong("bx6",AtMarket);
if NextBarOpen == C Then
{
Buy("b7",AtStop,NextBarOpen+PriceScale*10);
}
ExitLong("bx7",AtMarket);
if NextBarSdate == sDate Then
{
if NextBarOpen == C Then
{
Sell("s6",AtStop,NextBarOpen-PriceScale*10);
}
}
ExitShort("sx6",AtMarket);
if NextBarOpen == C Then
{
Sell("s7",AtStop,NextBarOpen-PriceScale*10);
}
ExitShort("sx7",AtMarket);
if NextBarSdate != sDate Then
{
if NextBarOpen != C Then
{
Buy("b8",AtStop,NextBarOpen+PriceScale*10);
}
}
ExitLong("bx8",AtMarket);
if NextBarOpen != C Then
{
Buy("b9",AtStop,NextBarOpen+PriceScale*10);
}
ExitLong("bx9",AtMarket);
if NextBarSdate != sDate Then
{
if NextBarOpen != C Then
{
Sell("s8",AtStop,NextBarOpen-PriceScale*10);
}
}
ExitShort("sx8",AtMarket);
if NextBarOpen != C Then
{
Sell("s9",AtStop,NextBarOpen-PriceScale*10);
}
ExitShort("sx9",AtMarket);
if NextBarSdate == sDate Then
{
if NextBarOpen == C Then
{
Buy("b10",AtStop,NextBarOpen+PriceScale*10);
}
}
ExitLong("bx10",AtMarket);
if NextBarOpen == C Then
{
Buy("b11",AtStop,NextBarOpen+PriceScale*10);
}
ExitLong("bx11",AtMarket);
if NextBarSdate == sDate Then
{
if NextBarOpen == C Then
{
Sell("s10",AtStop,NextBarOpen-PriceScale*10);
}
}
ExitShort("sx10",AtMarket);
if NextBarOpen == C Then
{
Sell("s11",AtStop,NextBarOpen-PriceScale*10);
}
ExitShort("sx11",AtMarket);
if NextBarSdate != sDate Then
{
if NextBarOpen != C Then
{
Buy("b12",AtStop,NextBarOpen+PriceScale*10);
}
}
ExitLong("bx12",AtMarket);
if NextBarOpen != C Then
{
Buy("b13",AtStop,NextBarOpen+PriceScale*10);
}
ExitLong("bx13",AtMarket);
if NextBarSdate != sDate Then
{
if NextBarOpen != C Then
{
Sell("s12",AtStop,NextBarOpen-PriceScale*10);
}
}
ExitShort("sx12",AtMarket);
if NextBarOpen != C Then
{
Sell("s13",AtStop,NextBarOpen-PriceScale*10);
}
ExitShort("sx13",AtMarket);
if NextBarSdate == sDate Then
{
if NextBarOpen == C Then
{
Buy("b14",AtStop,NextBarOpen+PriceScale*10);
}
}
ExitLong("bx14",AtMarket);
if NextBarOpen == C Then
{
Buy("b15",AtStop,NextBarOpen+PriceScale*10);
}
ExitLong("bx15",AtMarket);
if NextBarSdate == sDate Then
{
if NextBarOpen == C Then
{
Sell("s14",AtStop,NextBarOpen-PriceScale*10);
}
}
ExitShort("sx14",AtMarket);
if NextBarOpen == C Then
{
Sell("s15",AtStop,NextBarOpen-PriceScale*10);
}
ExitShort("sx15",AtMarket);
if NextBarSdate != sDate Then
{
if NextBarOpen != C Then
{
Buy("b16",AtStop,NextBarOpen+PriceScale*10);
}
}
ExitLong("bx16",AtMarket);
if NextBarOpen != C Then
{
Buy("b17",AtStop,NextBarOpen+PriceScale*10);
}
ExitLong("bx17",AtMarket);
if NextBarSdate != sDate Then
{
if NextBarOpen != C Then
{
Sell("s16",AtStop,NextBarOpen-PriceScale*10);
}
}
ExitShort("sx16",AtMarket);
if NextBarOpen != C Then
{
Sell("s17",AtStop,NextBarOpen-PriceScale*10);
}
ExitShort("sx17",AtMarket);
if NextBarSdate == sDate Then
{
if NextBarOpen == C Then
{
Buy("b18",AtStop,NextBarOpen+PriceScale*10);
}
}
ExitLong("bx18",AtMarket);
if NextBarOpen == C Then
{
Buy("b19",AtStop,NextBarOpen+PriceScale*10);
}
ExitLong("bx19",AtMarket);
if NextBarSdate == sDate Then
{
if NextBarOpen == C Then
{
Sell("s18",AtStop,NextBarOpen-PriceScale*10);
}
}
ExitShort("sx18",AtMarket);
if NextBarOpen == C Then
{
Sell("s19",AtStop,NextBarOpen-PriceScale*10);
}
ExitShort("sx19",AtMarket);
if NextBarSdate != sDate Then
{
if NextBarOpen != C Then
{
Buy("b20",AtStop,NextBarOpen+PriceScale*10);
}
}
ExitLong("bx20",AtMarket);
if NextBarOpen != C Then
{
Buy("b21",AtStop,NextBarOpen+PriceScale*10);
}
ExitLong("bx21",AtMarket);
if NextBarSdate != sDate Then
{
if NextBarOpen != C Then
{
Sell("s20",AtStop,NextBarOpen-PriceScale*10);
}
}
ExitShort("sx20",AtMarket);
if NextBarOpen != C Then
{
Sell("s21",AtStop,NextBarOpen-PriceScale*10);
}
ExitShort("sx21",AtMarket);
if NextBarSdate == sDate Then
{
if NextBarOpen == C Then
{
Buy("b22",AtStop,NextBarOpen+PriceScale*10);
}
}
ExitLong("bx22",AtMarket);
if NextBarOpen == C Then
{
Buy("b23",AtStop,NextBarOpen+PriceScale*10);
}
ExitLong("bx23",AtMarket);
if NextBarSdate == sDate Then
{
if NextBarOpen == C Then
{
Sell("s22",AtStop,NextBarOpen-PriceScale*10);
}
}
ExitShort("sx22",AtMarket);
if NextBarOpen == C Then
{
Sell("s23",AtStop,NextBarOpen-PriceScale*10);
}
ExitShort("sx23",AtMarket);
if NextBarSdate != sDate Then
{
if NextBarOpen != C Then
{
Buy("b24",AtStop,NextBarOpen+PriceScale*10);
}
}
ExitLong("bx24",AtMarket);
if NextBarOpen != C Then
{
Buy("b25",AtStop,NextBarOpen+PriceScale*10);
}
ExitLong("bx25",AtMarket);
if NextBarSdate != sDate Then
{
if NextBarOpen != C Then
{
Sell("s24",AtStop,NextBarOpen-PriceScale*10);
}
}
ExitShort("sx24",AtMarket);
if NextBarOpen != C Then
{
Sell("s25",AtStop,NextBarOpen-PriceScale*10);
}
ExitShort("sx25",AtMarket);
if NextBarSdate == sDate Then
{
if NextBarOpen == C Then
{
Buy("b26",AtStop,NextBarOpen+PriceScale*10);
}
}
ExitLong("bx26",AtMarket);
if NextBarOpen == C Then
{
Buy("b27",AtStop,NextBarOpen+PriceScale*10);
}
ExitLong("bx27",AtMarket);
if NextBarSdate == sDate Then
{
if NextBarOpen == C Then
{
Sell("s26",AtStop,NextBarOpen-PriceScale*10);
}
}
ExitShort("sx26",AtMarket);
if NextBarOpen == C Then
{
Sell("s27",AtStop,NextBarOpen-PriceScale*10);
}
ExitShort("sx27",AtMarket);
if NextBarSdate != sDate Then
{
if NextBarOpen != C Then
{
Buy("b28",AtStop,NextBarOpen+PriceScale*10);
}
}
ExitLong("bx28",AtMarket);
if NextBarOpen != C Then
{
Buy("b29",AtStop,NextBarOpen+PriceScale*10);
}
ExitLong("bx29",AtMarket);
if NextBarSdate != sDate Then
{
if NextBarOpen != C Then
{
Sell("s28",AtStop,NextBarOpen-PriceScale*10);
}
}
ExitShort("sx28",AtMarket);
if NextBarOpen != C Then
{
Sell("s29",AtStop,NextBarOpen-PriceScale*10);
}
ExitShort("sx29",AtMarket);
if NextBarSdate == sDate Then
{
if NextBarOpen == C Then
{
Buy("b30",AtStop,NextBarOpen+PriceScale*10);
}
}
ExitLong("bx30",AtMarket);
if NextBarOpen == C Then
{
Buy("b31",AtStop,NextBarOpen+PriceScale*10);
}
ExitLong("bx31",AtMarket);
if NextBarSdate == sDate Then
{
if NextBarOpen == C Then
{
Sell("s30",AtStop,NextBarOpen-PriceScale*10);
}
}
ExitShort("sx30",AtMarket);
if NextBarOpen == C Then
{
Sell("s31",AtStop,NextBarOpen-PriceScale*10);
}
ExitShort("sx31",AtMarket);
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
--------
아침 4시에 청산이 되질 않아서 수식어
수정이 가능한지 문의드립니다
2024-03-20
786
글번호 177671
시스템