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 betsuni_123, Today, 04:20 PM
        0 responses
        3 views
        0 likes
        Last Post betsuni_123  
        Started by Aquila_Welokk, 04-29-2024, 01:14 PM
        2 responses
        22 views
        0 likes
        Last Post Aquila_Welokk  
        Started by samish18, 04-17-2024, 08:57 AM
        22 responses
        107 views
        0 likes
        Last Post samish18  
        Started by Ashkam, 04-29-2024, 09:28 AM
        2 responses
        26 views
        0 likes
        Last Post Ashkam
        by Ashkam
         
        Started by Felix Reichert, 04-26-2024, 02:12 PM
        6 responses
        41 views
        0 likes
        Last Post Felix Reichert  
        Working...
        X