Square vs round brackets for ATR

Forums ProRealTime English forum ProBuilder support Square vs round brackets for ATR

Viewing 3 posts - 1 through 3 (of 3 total)
  • #130005

    I created some code with wonderful results accidentally by using AverageTrueRange(10) when I meant AverageTrueRange[10], ie over 10 periods.

    Could you please tell me what AverageTrueRange(10) returns?

    I see why I get confused – when I add Average True Range as an indicator, it’s titled Average True Range  (10).

    #130047

    ATR(10) will default to whatever the default period is for the ATR indicator because you have nothing in []. The default is [14] and the (10) is where you would normally put what you want to calculate the ATR of so normally (close) or it defaults to close if there is nothing in (). So you are calculating the 14 period ATR based on the number 10. My guess is that where close would normally be used in the calculation it is replaced with the value 10.

    It could be an interesting trend indicator or stop loss level though!

    #130112

    Thanks for that! What was used was a very big number, such as the price, and it gave great results because when I used it for my stop and target it was never hit – meaning that the trade was closed by the FLATAFTER statement, which turned out to give much better results than any stop and target that I found for this trend-following strategy.

Viewing 3 posts - 1 through 3 (of 3 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login