Announcement

Collapse
No announcement yet.

values question

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

  • values question

    i'm building a formula and am not sure how to set the proper values. Basically, all that I need is close today > close yesterday

    something like this

    if (
    close(today) > close(yesterday) &&
    volume(today) > volume(yesterday)
    ) onAction1()


    new to efs. any assistance is appreciated

  • #2
    stvchez,

    To access the current close value use: close()
    To access the previous bars value use: close(-1)
    To access the one before that: close(-2)

    etc...

    The same concept works for open(), close(), high(), low() and volume().

    If you are setting up more than a few conditionals using the same parameters, it would pay (resource wise) to save it as a variable first:

    nClose = close();
    nClose_1 = close(-1);


    However, if all of your EFS is going to be fairly simple conditional checking as you show in your example, you may want to check out the formula wizard, as it will generate the code for you reducing any need for a "learning curve".

    Hope this helps,

    Garth
    Garth

    Comment

    Working...
    X