답변완료
수정부탁드립니다.
안녕하세요?
아래수식에서 보유포지션이 있을때 진입신호가 생기면 반대로 진입하면서 청산되고있는데요, 앞서 진입한 포지션이 익/손절이 완전 되고난 이후에 신호가나올때 다음매매가 진입되게 하고싶습니다.
감사합니다.
input : p1(5),p2(20);
input : 양봉(4),음봉(4);
input : 익절틱수(50),손절틱수(50),진입횟수(3),N(5);
var : entry(0),cnt(0);
var1 = ma(c,P1);
var2 = ma(C,P2);
if Bdate != Bdate[1] Then
entry = 0;
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if MarketPosition <= 0 and
VAR1 < Var2 and
entry < 진입횟수 and
C[1] <= O[1]-음봉*PriceScale and
O != C[1] and
C >= O-양봉*PriceScale Then
Buy();
if MarketPosition >= 0 and
VAR1 > Var2 and
entry < 진입횟수 and
C[1] >= O[1]+양봉*PriceScale and
O != C[1] and
C <= O-음봉*PriceScale Then
Sell();
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
2022-08-07
904
글번호 161354
시스템