예스스탁
예스스탁 답변
2024-03-28 13:05:40
안녕하세요
예스스탁입니다.
1
수식에 시간대를 체크하는 Tcond 와 같은 변수는 지정되어 있지만
해당 변수로 제어하는 내용이 진입/청산식에 사용되지 않고 있습니다.
또한 NextBarSdate != sDate 위와 같은 표현은 0시를 의미합니다.
위와 같은 표현은 모두 삭제하고 Tcond가 true일때만 진입청산하게 변경해 드립니다.
2
input : starttime(40000),endtime(60000),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 Tcond == true 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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);
즐거운 하루되세요
> 푸른 님이 쓴 글입니다.
> 제목 : 문의 드립니다
> input : starttime(40000),endtime(60000),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);
수식어의 시간설정은 04시부터 06시까지 2시간인데 신호는 00시부터 나옵니다.
수정이 가능한지 문의 드립니다.