Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 jeronymite, 04-12-2024, 04:26 PM
        3 responses
        44 views
        0 likes
        Last Post jeronymite  
        Started by Barry Milan, Yesterday, 10:35 PM
        7 responses
        20 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by AttiM, 02-14-2024, 05:20 PM
        10 responses
        179 views
        0 likes
        Last Post jeronymite  
        Started by ghoul, Today, 06:02 PM
        0 responses
        9 views
        0 likes
        Last Post ghoul
        by ghoul
         
        Started by DanielSanMartin, Yesterday, 02:37 PM
        2 responses
        13 views
        0 likes
        Last Post DanielSanMartin  
        Working...
        X