커뮤니티

문의드립니다.

프로필 이미지
카르마다
2026-03-05 10:17:29
53
글번호 230909
답변완료

선물 진입식에 대한 문의입니다.


첫 진입후 특정 조건에 맞으면 추가 진입하는 식인데 이게 딱 한 번만 나오게 만들고 싶습니다.

첫 진입봉 후 3개봉에서 추가 진입조건이 계속 만족하더라도 이 추가 진입식은 딱한번만 적용되면 그 다음봉에서 만족해도 안나오게 하고 싶습니다.


Buy("매수1",OnClose,Def,2);


if MarketPosition == 1 Then

{

if MaxEntries >= 1 and MaxEntries <= 4 and

( (BarsSinceEntry==1 and C >= O+PriceScale*5) or (BarsSinceEntry==2 and C >= O+PriceScale*15) or

(BarsSinceEntry==3 and C > O and !(C > EntryPrice+PriceScale*30) ) Then

Buy("매수2",OnClose,Def,2);

}

수정 부탁드립니다~

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

예스스탁 예스스탁 답변

2026-03-05 14:41:11

안녕하세요 예스스탁입니다. 1 해당 진입이 첫진입 후 두번째로 발생하는 진입이면 아래와 같이 MaxEntries 조건을 MaxEntries == 1 로 변경하시면 됩니다. if MarketPosition == 1 Then { if MaxEntries == 1 and ((BarsSinceEntry==1 and C >= O+PriceScale*5) or (BarsSinceEntry==2 and C >= O+PriceScale*15) or (BarsSinceEntry==3 and C > O and !(C > EntryPrice+PriceScale*30))) Then Buy("매수2",OnClose,Def,2); } 2 MaxEntries >= 1 and MaxEntries <= 4 사이에 1회진입이면 아래식 이용하시면 됩니다. if MarketPosition == 1 Then { if CurrentContracts > CurrentContracts[1] and LatestEntryName(0) == "매수2" Then Condition1 = true; if Condition1 == true and MaxEntries >= 1 and MaxEntries <= 4 and ((BarsSinceEntry==1 and C >= O+PriceScale*5) or (BarsSinceEntry==2 and C >= O+PriceScale*15) or (BarsSinceEntry==3 and C > O and !(C > EntryPrice+PriceScale*30))) Then Buy("매수2",OnClose,Def,2); } Else Condition1 = False; 즐거운 하루되세요