Daily ATR

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #47002 quote
    pimento
    Participant
    Average

    How to I code a DAILY ATR to use on intraday charts. I have tried thw following but it does not give me a single value for the day as I was expecting it would.

    tr1 = ABS(DHigh(1) – DLow(1))
    tr2 = ABS(DHigh(1) – DClose(2))
    tr3 = ABS(DLow(1) – DClose(2))

    TrueRange = wilderaverage[14](max(abs(Dhigh(i)-Dlow(i)),max(abs(Dhigh(i)-Dclose(i+1)),abs(Dlow(i)-Dclose(i+1)))))

    #47007 quote
    pimento
    Participant
    Average

    Sorry posted the wrong second half of the formula.

     

    tr1 = ABS(DHigh(1) – DLow(1))
    tr2 = ABS(DHigh(1) – DClose(2))
    tr3 = ABS(DLow(1) – DClose(2))

    TrueRange = wilderaverage[14](Max(MAX(tr1,tr2),MAX(tr2,tr3)))

    #47023 quote
    Despair
    Blocked
    Master

    Check if you get the close that you think you do. Depending on which security you use this for the close might be in the middle of the night.

    #47218 quote
    Nicolas
    Keymaster
    Master

    I already coded something around the Daily ATR calculation on an intraday timeframe, this is an example: https://www.prorealcode.com/prorealtime-indicators/daily-atr-range-for-intraday-chart/

    #47257 quote
    pimento
    Participant
    Average

    Thanks Nicolas and Despair.

    I am trying to put this into a Trading System, and cannot get it to work. The code returns a value for the current day, but I need a value for every day going back, and can’t see what to do.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Daily ATR


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
pimento @pimento Participant
Summary

This topic contains 4 replies,
has 3 voices, and was last updated by pimento
8 years, 5 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 09/22/2017
Status: Active
Attachments: No files
Logo Logo
Loading...