Average True Range trailing

Questions about MultiCharts and user contributed studies.
dannyz
Posts: 28
Joined: 26 Oct 2009

Average True Range trailing

Postby dannyz » 20 Nov 2009

I have noticed that the ATR trailing exit that is included in Multicharts moves with the market both ways. For example if you were using a ATR trailing lx and you were long and the market moved up the ATR would reset itself and move up aswell. But then if the market was to go back down the ATR would reset itself and go back down aswell. The thing I like about that is does protect your losses once the market moves in the opposite direction of your position. In this example i would have just wanted it to move up then once the market had moved back down to keep its stop were it was while the market was up and not move back down. Does anyone know how i could modify the script to do this?

Thanks

Danny Z

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Postby TJ » 20 Nov 2009

create a holding variable... eg. call it ATR.LX


calculate your exit price
e.g. exit price = var2 - var0


save the exit price to your holding variable ATR.LX

at the next bar,
if current exit price is smaller than previous bar's ATR.LX
then use ATR.LX instead of the exit price.

dannyz
Posts: 28
Joined: 26 Oct 2009

Postby dannyz » 27 Nov 2009

is you saved your exit price to the holding variable ATR.LX . would they not be the same value? How could you compare theym?

example
at the next bar,
if current exit price is smaller than previous bar's ATR.LX
then use ATR.LX instead of the exit price.


Return to “MultiCharts”