ADX from x days back

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #42175 quote
    Despair
    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
    Nicolas
    Keymaster
    Master

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

    #42177 quote
    Despair
    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_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
    Despair
    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
    Despair
    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
    Nicolas
    Keymaster
    Master

    Why not? 🙂

    #42193 quote
    Despair
    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.

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 Despair
8 years, 7 months ago.

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