Built-in way to access previous average?

Forums ProRealTime English forum ProOrder support Built-in way to access previous average?

  • This topic has 1 reply, 2 voices, and was last updated 11 months ago by avatarJS.
Viewing 2 posts - 1 through 2 (of 2 total)
  • #215231

    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
    JS

    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…

    1 user thanked author for this post.
Viewing 2 posts - 1 through 2 (of 2 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login