Average Daily Rate – ADR

Forums ProRealTime English forum ProBuilder support Average Daily Rate – ADR

Viewing 15 posts - 1 through 15 (of 15 total)
  • #130062

    Hello!

    I’m trying to code an Average Daily Rate indicator which includes a trading week of daily prices. I’d like to show it independently below the chart in a separate area.

    This is my code

    When I try to add this indicator to my chart, I get the following error:

    “A positive integer field is expected with Average”

    What am I missing here?

    Many thanks in advance for your help!

    #130063

    Are you sure you are not confounding with an Average Daily Range? Which is the X days average or each bar range. Recent french topic (and code) about ADR: https://www.prorealcode.com/topic/probleme-sur-indicateur-range-daily/

     

     

    1 user thanked author for this post.
    #130074

    Hello Nicolas,

    Thank you very much for your reply. Yes, I actually meant the “Average Daily Range”. I’ve read the post you pointed out, but I’m still not sure if using the following code (with daily prices) would give me the ADR indicator that I’m looking for, and if this is equivalent to the formula I was using before. I would appreciate if you could confirm.

    Thanks!

    #130084

    Your formula was wrong because you were using daily price values as period?

    This last code is not good if you want to use it on a timeframe inferior to the daily one. It also includes 7 days prior to the current one, which is not included, I don’t know if you want to include the current day or not?

    1 user thanked author for this post.
    #130089

    Hi Nicolas,

    I don’t know what was wrong with it, but I’m getting the error “A positive integer field is expected with Average” when I try to use it.

    I just need an indicator that returns the Average Daily Range for each trading day up to the previous one. So I’m not interested in the current one. My timeframe is 1 day.

    I’m only using daily candles, and I would like to view it below my chart, like some other pre-built indicators I’m currently using.

    Many thanks in advance for your reply.

     

     

    #130095

    If you just want an average of the last seven days ranges then the last code you posted works just fine.

    If you want the average for Mondays and the Average for Tuesdays and the average for Wednesdays then that is something totally different.

     

    1 user thanked author for this post.
    #130097

    OK, Thank you both!

    #172756

    How can I display the ADR of a stock for one month on screen as I don’t need this as separate indicator.

    Could you please share the code for that? Thanks.

    #172757

    To display whatever om screen you need an indicator.

    If you want to display it one month only, simply remove it when no more needed.

    I am not sure I understood what you mean, though.

    #172857

    I need to know which one is correct ADR formula for last one month ADR. I have following two codes and there is some variation comes in between these two results:

     

     

    Moderators Edit: Post edited – please use the ‘Insert PRT Button’ when inserting code in your posts.

    #172862

    If used ina Daily TF they are identical, but for the fact that the first one (Dhigh(1)-Dlow(1)) refers not to the last 20 periods, but to the previous 20 periods (not including today). You could use RANGE[1] to the second screener to make them match.

    If they are not used in a Daily TF, the first one correctly uses DAILY values (apart from the starting offset as explained above), while the second one refers to the RANGE according to the involved TF.

     

    #172918

    Thank you so much.

    #172921

    In the first part of my last post I wrote “for the fact that the first one (Dhigh(1)-Dlow(1)) refers not to the last 20 periods, but to the previous 20 periods”.

    The correct version is “due to the fact that the first one (Dhigh(1)-Dlow(1)) refers not to the last 20 periods, but to the previous 20 days”.

    Sorry for any misunderstanding this may have caused.

    #173027

    Sorry, I didn’t understand. What’s the difference between 20 periods and 20 days? On Daily chart they both will be same? what about in hourly chart?

    #173029

    The difference is on charts other than the daily one.

     

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

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