커뮤니티

진입 오류 수정

프로필 이미지
목마와숙녀
2026-07-02 22:42:52
82
글번호 232664
답변완료

아래 수식은

당일 084500부터 발생한 봉을 기준삼아 당일 추세를 보고

오전 9시이후 부터 진입코자 만든 수식입니다.

그런데 당일 첫봉에 진입하는 경우가 종종 생깁니다.


매일 084500분에 생긴 봉부터 계산하는 수식의 오류인지 아니면

우선순위(T1,T2,T3) 설정의 오류인지

수식 수정 부탁드립니다.


항상 고맙습니다.


*************************************************************************************************


input : ntime(084500);

input: lock1(100000),연속봉(3),연속small(0.0),연속large(0.16);

input: lock2(120000),연속봉2(2),연속small2(0.1),연속large2(1);

input: lock3(140000),x연속봉(2),x연속small(0.08),x연속large(0.16);

input: ls(1.7),tr1(2.2),tr2(2.1);

var : Tcond(False,Data1),ii(0,Data1);

var : T(0),T1(0),entry(0);


if Bdate != Bdate[1] Then

       T1 = TotalTrades;


if MarketPosition == 0 Then

       entry = TotalTrades-T1;

Else

       entry = (TotalTrades-T1)+1;


if data1(Bdate != Bdate[1]) Then

      Tcond = False;


if Data1((sdate != sdate[1] and stime >= ntime) or

      (sdate == sdate[1] and stime >= ntime and stime[1] < ntime)) Then

{

      Tcond = true;

        ii = 0;

}

if tcond == true Then

{

      ii = ii +1;


      if ii >= 연속봉  and sTime<lock1 and

     data1(accumN(iff(C<O,1,0),연속봉) == 연속봉 and ExitDate(1) != sdate and AccumN(abs(C-O), 연속봉) >= 연속small and AccumN(abs(C-O), 연속봉) < 연속large) then

            T = 1;


      if T == 1 and ii >= 연속봉2  and sTime<lock2 and

     data1(accumN(iff(C>O,1,0),연속봉2) == 연속봉2 and ExitDate(1) != sdate and AccumN(abs(C-O), 연속봉2) >= 연속small2 and AccumN(abs(C-O), 연속봉2) < 연속large2) then

            T = 2;

    


      if T == 2 and  ii >= x연속봉 and sTime<lock3 and

     data1(accumN(iff(C<O,1,0),x연속봉) == x연속봉 and ExitDate(1) != sdate and AccumN(abs(C-O), x연속봉) >= x연속small and AccumN(abs(C-O), x연속봉) < x연속large) then

            {

T = 3;

Sell("s");

            }  

}


SetStopLoss(ls,PointStop);

SetStopTrailing(tr2,tr1,PointStop);



시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2026-07-03 13:52:51

안녕하세요 예스스탁입니다. input : ntime(084500); input: lock1(100000),연속봉(3),연속small(0.0),연속large(0.16); input: lock2(120000),연속봉2(2),연속small2(0.1),연속large2(1); input: lock3(140000),x연속봉(2),x연속small(0.08),x연속large(0.16); input: ls(1.7),tr1(2.2),tr2(2.1); var : Tcond(False,Data1),ii(0,Data1); var : T(0),T1(0),entry(0); if Bdate != Bdate[1] Then T1 = TotalTrades; if MarketPosition == 0 Then entry = TotalTrades-T1; Else entry = (TotalTrades-T1)+1; if data1(Bdate != Bdate[1]) Then Tcond = False; if Data1((sdate != sdate[1] and stime >= ntime) or (sdate == sdate[1] and stime >= ntime and stime[1] < ntime)) Then { Tcond = true; ii = 0; T = 0; } if tcond == true Then { ii = ii +1; if ii >= 연속봉 and sTime<lock1 and data1(accumN(iff(C<O,1,0),연속봉) == 연속봉 and ExitDate(1) != sdate and AccumN(abs(C-O), 연속봉) >= 연속small and AccumN(abs(C-O), 연속봉) < 연속large) then T = 1; if T == 1 and ii >= 연속봉2 and sTime<lock2 and data1(accumN(iff(C>O,1,0),연속봉2) == 연속봉2 and ExitDate(1) != sdate and AccumN(abs(C-O), 연속봉2) >= 연속small2 and AccumN(abs(C-O), 연속봉2) < 연속large2) then T = 2; if T == 2 and ii >= x연속봉 and sTime<lock3 and data1(accumN(iff(C<O,1,0),x연속봉) == x연속봉 and ExitDate(1) != sdate and AccumN(abs(C-O), x연속봉) >= x연속small and AccumN(abs(C-O), x연속봉) < x연속large) then { T = 3; Sell("s"); } } SetStopLoss(ls,PointStop); SetStopTrailing(tr2,tr1,PointStop); 즐거운 하루되세요