Exit strategy plot

Hi need some help regarding exit strategy, here is the option:

  • When market is trending relax trailing stoploss or do the reverse

here is the code:

relaxedStopLevel = HHV(C,5) * .60; // 40% of 5 Day High
tightStopLevel = C * .90; // 10% of Days Close

StopBuyAmount = IIf(IndexUpTrend, relaxedStopLevel, tightStopLevel);

ApplyStop(stopTypeTrailing,stopModePoint,StopBuyAmount,True,True,1); 
Equity(1); // THIS EVALUATES STOPS

Plot( StopBuyAmount, "stop", colorRed, styleDashed | styleOwnScale);

I am trying to plot StopBuyAmount, but when market is in down trend it dashed line jumps up above the candle.

Afl_Capture

Here is explorer view Afl_Capture2

@subsoft, you have to remove the | styleOwnScale flag in this line.

2 Likes

Legend! that worked :+1:

Thank you for your help @beppe

1 Like