Built-in way to access previous average?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #215231 quote
    aldtrading
    Participant
    New

    Hello, I need to access the levels of a moving average for the x last bars, is there a built-in way to easily access those values, or should I use an array?

    Thanks

    #215233 quote
    JS
    Participant
    Senior
    Hi,

    When your moving average is defined in your code:

    MA20=Average[20](Close)

    Then you can access the last x-levels with:

    MA20[0]

    MA20[1]

    MA20[2]

    And so on…

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

Built-in way to access previous average?


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
aldtrading @aldtrading Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by JS
2 years, 8 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 05/26/2023
Status: Active
Attachments: No files
Logo Logo
Loading...