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 CaptainJack, 05-29-2026, 05:09 AM
        0 responses
        476 views
        0 likes
        Last Post CaptainJack  
        Started by CaptainJack, 05-29-2026, 12:02 AM
        0 responses
        317 views
        0 likes
        Last Post CaptainJack  
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        254 views
        1 like
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        340 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        306 views
        0 likes
        Last Post CarlTrading  
        Working...
        X