Here is a function I wrote to take care of this and set up for percent risk money management.
Sub ATRStopAndRisk(AtrMult) Dim ATROnEntry As BarArray settraderisk(Average(TrueRange,3,0)*AtrMult) If MarketPosition<>MarketPositionΏ] Then ATROnEntry=AtrMult*Average(TrueRange,3,1) End If ExitLong("ATRStopLX","",GetCurrentSize(""),EntryPrice-ATROnEntry,Stop,Day) ExitShort("ATRStopSX","",GetCurrentSize(""),EntryPrice+ATROnEntry,Stop,Day) End Sub
Make it a system function. Comment out the dollar stop and add this function. |