ADR Label on chart

Forums ProRealTime English forum ProBuilder support ADR Label on chart

  • This topic has 9 replies, 3 voices, and was last updated 4 days ago by avatarJS.
Viewing 10 posts - 1 through 10 (of 10 total)
  • #243805

    Hi. I have a script that calculates and returns an ADR result(ADR in dollars, across the last 20 daily candles).

    Also, I’m sure there is an easier way to calculate this, but this is what I’m currently working with:

    DR=High-Low
    ADR=(DR[0]+DR[1]+DR[2]+DR[3]+DR[4]+DR[5]+DR[6]+DR[7]+DR[8]+DR[9]+DR[10]+DR[11]+DR[12]+DR[13]+DR[14]+DR[15]+DR[16]+DR[17]+DR[18]+DR[19])/20
    Return ADR

    My questions are:

    1. Is it possibly to get this result to show on the price chart in a label or bubble or similar, to appear near top of chart or near description or other, instead of regular chart type?
    2. Can I use TimeFrame to somehow show the Daily ADR as a DAILY average only, not changing with selected chart timeframe?

    Thanks

    #243828

    Hi, here is another way to calculate ADR.

    Here are some examples with the timeframe: https://www.prorealcode.com/documentation/timeframe-probacktest-proorder/

    #243837

    Awesome! Thanks so much! Works perfectly!

    #243861

    Hi. I made some adjustments to placement, font and color, but I still can’t figure out how to use Timeframe or other to always return the daily ADR regardless of chart timeframe I’m viewing.

    #243862
    JS

    If you want to use multiple timeframes, you can place the calculation of the indicator under the desired timeframe (in this case, daily) and the output (text, plot, print) under the “Default” timeframe…

    #243893

    Sorry it took me so long getting around to trying this, but I tried a couple of different ways with no success. I have slightly different position setting, but didn’t think that should make a difference.

    #243894
    JS

    If I have understood everything correctly, you want to display the daily ADR label in the chart while the chart’s timeframe can change…
    At least, this is what the code is written for and what it also executes…
    When I load the indicator into the chart (on the price), the ADR label appears in the top right corner of the chart. Now, if I change the chart’s timeframe, for example, to 1 hour (15k units), the label remains in the same position, and the value also stays the same…

    #243896

    Thank you. Not sure what other setting is different on my end, but I get errors when changing timeframes. I even tried changing units as well in case that made a difference. Copied and pasted also to be sure i didn’t mistype.

    #243898

    And, it’s really great as is, it’s not like I live off that item. Just a minor house cleaning type thing if I could get it resolved.

    #243899
    JS

    According to the error message, you are currently using:
    ADR = Average[20](High – Low)
    Which is not necessarily wrong…

    A better approach might be:
    DR = (High – Low)
    ADR = Average[20](DR)

    1 user thanked author for this post.
Viewing 10 posts - 1 through 10 (of 10 total)

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