3xATR indicator for trending/contrarian trades
Forums › ProRealTime English forum › ProBuilder support › 3xATR indicator for trending/contrarian trades
- This topic has 4 replies, 2 voices, and was last updated 7 years ago by rowestock.
-
-
04/10/2017 at 1:09 PM #31614
Hello,
Hello, I have 2 requests which I was hoping the community could help with…….
1. Please see the attached png. This shows the indicator called “ATR _ stop”. Please can you check the colours as the coloured point changes colour 1 bar late (I have inserted the code used below).12345678910111213141516171819202122232425262728293031// Périodep = 10// Average True Range XATRx = AverageTrueRange[p](close) * 3.0// ATRts = ATR Trailing Stop// Inversion de tendanceIF close crosses over ATRts THENATRts = close - ATRxELSIF close crosses under ATRts THENATRts = close + ATRxENDIF// Cacul de l'ATRts lors de la même tendanceIF close > ATRts THENATRnew = close - ATRxIF ATRnew > ATRts THENATRts = ATRnewENDIFELSIF close < ATRts THENATRnew = close + ATRxIF ATRnew < ATRts THENATRts = ATRnewENDIFENDIFreturn ATRts as "ATR Trailing Stop"2. My second request is that we create code very similar to above, but what I want is:
a) Data points marked on the price chart 3.0 ATRs above and below the last price where the ATR is 10.
e.g. if current price is 533 and ATR (10) is 40.6, then data point below should be 411.2 [533 – (40.6×3)] and data point above should be 654.8 [533 + (40.6×3)].Your help is much appreciated!!
:0)
04/16/2017 at 12:18 PM #321581/ this is the 1st code to color correctly the ATR stoploss line according to up/down Close above/below it as requested:
123456789101112131415161718192021222324252627282930313233// Périodep = 10// Average True Range XATRx = AverageTrueRange[p](close) * 3.0// ATRts = ATR Trailing Stop// Inversion de tendanceIF close crosses over ATRts THENATRts = close - ATRxr=0g=200ELSIF close crosses under ATRts THENATRts = close + ATRxr=200g=0ENDIF// Cacul de l'ATRts lors de la même tendanceIF close > ATRts THENATRnew = close - ATRxIF ATRnew > ATRts THENATRts = ATRnewENDIFELSIF close < ATRts THENATRnew = close + ATRxIF ATRnew < ATRts THENATRts = ATRnewENDIFENDIFreturn ATRts coloured(r,g,0) as "ATR Trailing Stop"For your second query, I understand that you want to draw a channel made of the upper and lower ATR band calculation?
04/18/2017 at 10:08 PM #32523Thanks Nicolas. That is perfect for request 1 :0)
On request 2, yes, an ATR band above and below the last price would be ideal.
I would set the ATR as 10 periods and the bands above and below the the last price to be a multiple of 3.0. Please see the attached chart pic.
Obviously a 3*10ATR band will be quite wide, but each user can adjust their ATR multiple accordingly. They can also adjust their ATR period.
Many thanks for your assistance!
04/19/2017 at 8:20 AM #32546So it would not be displayed like the ‘supertrend’ style? Because even if it uses ATR, it is not updating each candle with the current ATR value.
I think you are talking about ATR bands: https://www.prorealcode.com/prorealtime-indicators/multiple-atr-bands/
04/20/2017 at 5:09 PM #32790 -
AuthorPosts
Find exclusive trading pro-tools on