Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

FirstBarOfSession true on every tick?

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

    FirstBarOfSession true on every tick?

    Hi,

    I am programming a strategy that runs on every tick. The first thing I want it to check in the OBU is if Bars.FirstBarOfSession == true.

    When does this return "true" for a strategy that has "Calculate On Bar Close = false"?
    a) on every tick while the first bar is building
    b) only when the first bar was completed

    What if I have 2 symbols? Will it return true/false according to the current BIP or only for the main symbol?

    Thanks,
    NutFlush

    #2
    Hi NutFlush,

    Thank you for your post.

    FirstBarOfSession will return true when the CurrentBar is the First bar of the session. With COBC set to false it will return true the entire time the bar is being built until it closes.

    With more than one symbol it will return all the BIPs that are true for that case since it's pulling the info from the chart.

    If the symbols have different sessions templates you will see Bars.FBOS become true from different times.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      If you have different bars series you could also use

      BarsArray[0].FirstBarOfSession (while BarsInProgress == 0)
      BarsArray[1].FirstBarOfSession (while BarsInProgress == 1)

      Comment


        #4
        Will try that! Thanks Harry!

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        152 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        89 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        133 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        127 views
        1 like
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        107 views
        0 likes
        Last Post CarlTrading  
        Working...
        X