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 GussJ, 03-04-2020, 03:11 PM
        11 responses
        3,221 views
        0 likes
        Last Post xiinteractive  
        Started by andrewtrades, Today, 04:57 PM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by chbruno, Today, 04:10 PM
        0 responses
        6 views
        0 likes
        Last Post chbruno
        by chbruno
         
        Started by josh18955, 03-25-2023, 11:16 AM
        6 responses
        437 views
        0 likes
        Last Post Delerium  
        Started by FAQtrader, Today, 03:35 PM
        0 responses
        9 views
        0 likes
        Last Post FAQtrader  
        Working...
        X