ADR percent

Viewing 8 posts - 1 through 8 (of 8 total)
  • #159733

    Hello,

    I made a question in this post in the library, but i guess it’s hard to see there, maybe someone can help me here:

    https://www.prorealcode.com/prorealtime-indicators/average-daily-range/

    Hello, I wanted to create a percent ADR based on this indicator, so I wrote this code that IMO it looks ok:

    However, when I use it, it doesn’t seem to give out correct values as it is giving me a higher value than the ATRP described in this post for the same 20 daily periods:

    https://www.prorealcode.com/prorealtime-indicators/average-true-range-percent-atrp/#:~:text=The%20Average%20True%20Range%20Percent,variation%20and%20not%20prices%20itselves.

    From my understanding of ADRP and ATRP, ADRP should always be lower than ATRP as it doesn’t include gaps.

    Can someone help me out? thanks

    #159737

    Always use the ‘Insert PRT Code’ button when putting code in your posts to make it easier for others to read.

    Thank you 🙂

     

    #159744

    Try changing line 6 to:

     

    #159747

    Thanks a lot, however that doesn’t seem to change the formula, it gives the same result.

    With 90% of stocks, it seems that both the ATRP and the ADRP I posted give the correct value. But with some of them ADRP is bigger. With SNDL for instances. Any clue?

    #159812

    Try comparing the two with this code:

    Moreover, the above code doesn’t skip gaps.

    1 user thanked author for this post.
    #159965

    Hi,

    This code you posted gives as a result both the ADRP and ATRP i posted in a single indicator.

    However, the issue is still the same. In most stocks the ATRP is higher than the ADRP, but in some the ADRP is higher. From my understanding of ADRP and ATRP that should be impossible as ATRP includes gaps and ADRP doesn’t, hence ATRP must always be bigger than ADRP.

    Can someone confirm or explain to me if I’m wrong.

    In case that’s ok, I would greatly appreciate if someone can give me the correct formula for ADRP.

    Thank you,

    #159966

    AVERAGETRUERANGE uses a Wilder moving average where as your ADRP uses a simple moving average.

    #160553

    Well, thank you very much good sir, that explains the slight discrepancy. Then it’s not that important. I added both indicators in a single box and go by the highest.

Viewing 8 posts - 1 through 8 (of 8 total)
Similar topics:

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