ADX from x days back

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #42175 quote
    DespairDespair
    Blocked
    Master

    Is there a possibility to refer to the ADX of x days back? So I maybe want to know what the ADX[14] was last friday. Can this be done?

    #42176 quote
    NicolasNicolas
    Keymaster
    Legend

    Just save the ADX value in a variable and if current day is Friday?

    #42177 quote
    DespairDespair
    Blocked
    Master

    Yes, I thought about this option. Thought there maybe was another way but thank you. I will to it like this.

    #42178 quote
    JC_BywanJC_Bywan
    Moderator
    Master

    I guess you ask because you might think the [14] syntax is “taken” by nature of adx[], and can’t use the [x] on top of this to look back x days before, but PRT language allows you to cumulate both sets of brackets, so… adx[14][x] works (as long as your x is a positive integer of course)

    Despair thanked this post
    #42183 quote
    DespairDespair
    Blocked
    Master

    Hmm but if I want to have this condition rolling, say: Compare adx[14] with adx[14] x bars ago. It is not so easy to save the value x bars ago in a variable. Any idea Nicolas?

    #42186 quote
    DespairDespair
    Blocked
    Master

    I got an idea. I can put a 1 period average on the ads and then refer to the average x periods back. This should work, shouldn’t it?

    #42187 quote
    NicolasNicolas
    Keymaster
    Legend

    Why not? 🙂

    #42193 quote
    DespairDespair
    Blocked
    Master

    It worked with a 1-period average but Noobywans solutions seems more elegant. I thought cumulating brackets wasn’t allowed. Thanks for this advice!

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

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

ADX from x days back


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Despair @despair Blocked
Summary

This topic contains 7 replies,
has 3 voices, and was last updated by DespairDespair
9 years, 1 month ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 08/01/2017
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...