커뮤니티

문의 드립니다

프로필 이미지
푸른
2024-03-20 11:48:32
787
글번호 177671
답변완료
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시에 청산이 되질 않아서 수식어 수정이 가능한지 문의드립니다
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2024-03-20 15:07:10

안녕하세요 예스스탁입니다. 수식에 04시에 당일청산하는 내용이 있습니다. 다만 아래와 같은 이유로 당일청산을 볼수 없습니다. 1 차트가 일봉이면 당일청산은 동작하지 않습니다. 2 ExitLong("bx17",AtMarket); 분봉이하의 주기라고 해도 현재 수식에 위와 같이 이름만 다르지 진입만 하면 다음봉 시가에 청산하는 내용이 다수가 있습니다. 당일청산이 발생하는 봉에 이미 해당 청산들로 청산이 됩니다. 즐거운 하루되세요 > 푸른 님이 쓴 글입니다. > 제목 : 문의 드립니다 > 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시에 청산이 되질 않아서 수식어 수정이 가능한지 문의드립니다