커뮤니티

특정 신호의 진입횟수 제한

프로필 이미지
맘속의행복
2026-01-13 12:18:45
33
글번호 229747
답변완료

안녕하세요


아래의 식은 당일 1회만 진입시키기 위해서 사용하려고 하는데, 시뮬레이션 결과 2회 이상의 진입이 일어나는 경우가 빈번합니다.

무엇이 잘못되었는지 검증을 해주시면 감사하겠습니다. 챠트는 국내선물 600틱 챠트 기준입니다.



var : Scount(0);

var : T2(0);

if Bdate != Bdate[1] Then

T2 = TimeToMinutes(sTime);



if Bdate != Bdate[1] Then

Scount = 0;

if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매도" Then

Scount = Scount+1;


if CurrentContracts > CurrentContracts[1] and TotalTrades > TotalTrades[1] and IsEntryName("매도",1) == True Then

Scount = Scount+1;


if Scount < 1 Then


if H < DayOpen()


and (T2 > 0 and TimeToMinutes(Time) > T2 + 30)

and (T2 > 0 and TimeToMinutes(Time) < T2 + 360)


Then

{

Sell("매도", AtLimit,DayOpen() - PriceScale *2);

}

if MarketPosition == -1 Then

{

if IsEntryName("매도") == true Then

{

SetStopLoss(0.30,PointStop);

ExitShort("매도익절", Atlimit, EntryPrice - Pricescale*20, "매도", 1, 1);

}

}

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

예스스탁 예스스탁 답변

2026-01-13 16:24:01

안녕하세요 예스스탁입니다. 같은 봉에서 진입과 청산이 발생하면 작성하신 진입카운트식으로는 체크가 되지 않습니다. 당일 진입횟수 카운트하는 내용을 변경해 드립니다. var : Scount(0); var : TT(0),T1(0),T2(0); TT = TotalTrades; if Bdate != Bdate[1] Then { T2 = TimeToMinutes(sTime); T1 = TT[1]; } Scount = TT-T1+IFF(MarketPosition != 0,1,0); if Scount < 1 Then { if H < DayOpen() and (T2 > 0 and TimeToMinutes(Time) > T2 + 30) and (T2 > 0 and TimeToMinutes(Time) < T2 + 360) Then { Sell("매도", AtLimit,DayOpen() - PriceScale *2); } } if MarketPosition == -1 Then { if IsEntryName("매도") == true Then { SetStopLoss(0.30,PointStop); ExitShort("매도익절", Atlimit, EntryPrice - Pricescale*20, "매도", 1, 1); } } 즐거운 하루 되세요