Built-in way to access previous average?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #215231 quote
    aldtradingaldtrading
    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
    JSJS
    Participant
    Master
    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.
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

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 JSJS
3 years, 4 months ago.

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