Help me plz anyone know how to plot stoploss line in graph ?

mastermind007

Well-Known Member
#4
thank you but i want it to plot in chart window , what code i hv to add ?
:thumb:
This code computes SL Values for long trades using 5 bar(weekly) Flow method. You can adjust computations for percentages and remove MACD based Buy/Sell. If you use different variables to signal entry exit,
use 'em in this formula instead of buy sell or alias 'em to Buy Sell

Code:
m = MACD();  /// Do not use this in real code 
s = Signal();  /// Do not use this in real code 
Buy = Cross(m,s); /// Do not use this in real code 
Sell = Cross(s,m); /// Do not use this in real code 

LongStop = IIf(Buy, ValueWhen(Buy, Ref(LLV(L,5),-1)),
	IIf (((BarsSince(Buy) >= 1) AND (BarsSince(Buy) < BarsSince(Sell))),
		LLV(L,BarsSince(Buy)-1), Null));

Plot(LongStop, "SL", colorBlack, styleStaircase | styleDots);
 

Similar threads