Announcement

Collapse
No announcement yet.

bar reference in studies

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • bar reference in studies

    When I program in easy language I can do things such as this:

    If MACDAVG >= MACDAVG[1].....
    (comparing the function to the fuction one bar ago)

    Since the mac function does not have a parameter for previous bars, is there an easy way to do the same thing in EFS?

    Thanks,

  • #2
    cod0973
    You can easily retrieve past values of builtin studies.
    For example assuming you named your MACD study vMACD you would then retrieve the prior value by writing vMACD.getValue(MACDStudy.MACD,-nn) where -nn is the number of bars back ie -1 is the prior bar, -2 two bars ago, etc
    Alex

    Comment

    Working...
    X