Announcement

Collapse
No announcement yet.

Barstate_newbar

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

  • Barstate_newbar

    Hi
    BARSTATE_NEWBAR
    How do you get to use the last bar real bar.
    0 bar gives open,high,low,close all the same.
    do you have to capture the data and them use it.
    anything that signals the end of a bar.
    Sam
    sam

  • #2
    Hello Sam,

    At the BARSTATE_NEWBAR instance, the formula is processing the opening trade for the new bar. At that moment, the open, high, low and close for the new bar are all the same value because there is only one trade for that bar. The moment this opening trade occurs is the first instance that signals to EFS that the previous bar has just closed. If you want to look at the data on the bar that just closed, which is now at bar index -1, you just need to reference that bar index in your function calls.

    open(-1)
    high(-1)
    low(-1)
    close(-1)
    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment

    Working...
    X