Square vs round brackets for ATR

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #130005 quote
    teapot2002
    Participant
    Average

    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 quote
    Vonasi
    Moderator
    Master

    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!

    Screenshot_2-1.png Screenshot_2-1.png
    #130112 quote
    teapot2002
    Participant
    Average

    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)
  • You must be logged in to reply to this topic.

Square vs round brackets for ATR


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
teapot2002 @teapot2002 Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by teapot2002
5 years, 9 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 05/05/2020
Status: Active
Attachments: 1 files
Logo Logo
Loading...