ADR percent
Forums › ProRealTime English forum › ProBuilder support › ADR percent
- This topic has 7 replies, 3 voices, and was last updated 3 years ago by freecat1899.
-
-
01/28/2021 at 9:29 PM #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:
12345678// AVERAGE DAILY RANGE PERCENTAGEPMAXAVG = average[p](high)PMINAVG = average[p](low)PAVG = average [p] (close)ADRP = (PMAXAVG – PMINAVG)/PAVG*100return ADRP as “Average Daily Range Percent”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:
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
01/28/2021 at 9:49 PM #159737Always use the ‘Insert PRT Code’ button when putting code in your posts to make it easier for others to read.
Thank you 🙂
01/28/2021 at 10:34 PM #15974401/28/2021 at 11:24 PM #159747Thanks 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?
01/29/2021 at 12:37 PM #159812Try comparing the two with this code:
12345678// AVERAGE DAILY RANGE PERCENTAGEp = 14ATRP = (averagetruerange[p](close)/close)*100PMAXAVG = average[p](high)PMINAVG = average[p](low)PAVG = average [p] (close)ADRP = (PMAXAVG - PMINAVG)/PAVG*100return ADRP as "Average Daily Range Percent",ATRP as "Average True Range Percent"Moreover, the above code doesn’t skip gaps.
1 user thanked author for this post.
01/30/2021 at 10:55 PM #159965Hi,
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,
01/30/2021 at 11:13 PM #15996602/06/2021 at 10:03 PM #160553Well, 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.
-
AuthorPosts
Find exclusive trading pro-tools on