Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Frequency of Bars.sFirstBarOfSession?

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

    Frequency of Bars.sFirstBarOfSession?


    What is the frequency of Bars.sFirstBarOfSession?

    I presume this would be true once every 24 hours, during trading days. While I understand the time will differ for different markets, I presume this becomes true once in 24 hour cycles, as opposed to weekly or other multi-day cycles.

    Am I right? Thanks,


    Last edited by timmbbo; 06-28-2023, 10:20 PM.

    #2
    It depends on what TradingHours you have selected for the chart (or for the series, if you added it with AddDataSeries). If the TradingHours has one session per 24-hour period, then yes, it will be once in 24 hours. But, some trading hours (especially non-USA exchanges) have multiple sessions per day. In this case, Bars.IsFirstBarOfSession could potentially be true several times per 24-hours.

    Take a look, for instance, at China Futures (Night).

    Click image for larger version  Name:	image.png Views:	0 Size:	42.6 KB ID:	1258164
    Bruce DeVault
    QuantKey Trading Vendor Services
    NinjaTrader Ecosystem Vendor - QuantKey

    Comment


      #3
      QuantKey_Bruce I thought it updates only once every 24 hours.

      Comment


        #4
        Originally posted by Trader17 View Post
        QuantKey_Bruce I thought it updates only once every 24 hours.
        Well, it does, if your trading hours only have one session every 24 hours.
        Bruce DeVault
        QuantKey Trading Vendor Services
        NinjaTrader Ecosystem Vendor - QuantKey

        Comment


          #5
          So you saying even a 15 minute break or loss of data can trigger a first bar of session? Wait for NT8 NinjaTrader_BrandonHto respond.

          Comment


            #6
            No, I am saying it happens on the first bar in a defined SESSION in your trading hours (see example screenshot above to see how a trading hours with more than one session per date is defined). Disconnecting and reconnecting without reloading the chart and still within the same session would not trigger this. Nor would any other events that don't reload the chart and are within the same SESSION.
            Bruce DeVault
            QuantKey Trading Vendor Services
            NinjaTrader Ecosystem Vendor - QuantKey

            Comment


              #7
              Originally posted by QuantKey_Bruce View Post
              No, I am saying it happens on the first bar in a defined SESSION in your trading hours (see example screenshot above to see how a trading hours with more than one session per date is defined). Disconnecting and reconnecting without reloading the chart and still within the same session would not trigger this. Nor would any other events that don't reload the chart and are within the same SESSION.
              Got that. But these in the chart above are still a session a day across 2 days. I do not think say have 6, 6 hour sessions per day. Unless NT8 can do that.

              Comment


                #8
                This intrigues me somewhat;
                I wouldn't know the answer, but my guts tell me that Bruce could be (should be ?) right. This should be easy to plot. But this makes me wonder :

                Disconnecting and reconnecting without reloading the chart and still within the same session would not trigger this. Nor would any other events that don't reload the chart and are within the same SESSION.
                Is this correct ? (see emphasis)
                Why would reloading the chart trigger that "event" which happened in the past ? So with backtesting you'd pass that event (it will be triggered at each new session). But I would hope the trigger would not occur during the loading of the chart as far as it would concern a strategy.
                Maybe it is to be translated to "SessionIsActive" or the likes. And after loading of the chart we're at the current time and then it is true or false. And might it come down to something like this, then it definitely would be false for Asian lunch etc. times.

                Bruce, small disclaimer : as you know I don't know a hoot about NT yet, and I only try to read-in to the environment.

                Anyway, plot that Bars.sFirstBarOfSession and let it loose on some mysterious Asian Future and run a backtest over it, right ?

                PS: Somehow I feel this should be (?) related to Settling Times. If that is so, the China Futures would still settle one time per 24 hours (somewhere). But that right away would impose a problem for postponed Settling (like a short session on a Friday, the Future settling on Monday (or even Tuesday). Blabla.

                Comment


                  #9
                  The idea of daily settlement is unrelated to the end of a session, even if they happen to coincide for common futures e.g. ES. Settlement could for instance occur at 5 pm ET the following day for the positions you were holding at 5 pm ET the previous trading day, while the session could end at 6 pm ET. That's just an example - it could be anything.
                  Bruce DeVault
                  QuantKey Trading Vendor Services
                  NinjaTrader Ecosystem Vendor - QuantKey

                  Comment


                    #10

                    Bruce, thanks for your explanation.

                    Question - what is the navigation path to get to the window "Trading Hours", shown in your first answer. I can't find a way to get to that window.

                    Thanks,

                    Comment


                      #11
                      From Control Center, using the top menu, Tools -> Trading Hours. At the left, select the trading hours template you are interested in, and you will see its details at the right.
                      Bruce DeVault
                      QuantKey Trading Vendor Services
                      NinjaTrader Ecosystem Vendor - QuantKey

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by NullPointStrategies, Today, 05:17 AM
                      0 responses
                      39 views
                      0 likes
                      Last Post NullPointStrategies  
                      Started by argusthome, 03-08-2026, 10:06 AM
                      0 responses
                      124 views
                      0 likes
                      Last Post argusthome  
                      Started by NabilKhattabi, 03-06-2026, 11:18 AM
                      0 responses
                      64 views
                      0 likes
                      Last Post NabilKhattabi  
                      Started by Deep42, 03-06-2026, 12:28 AM
                      0 responses
                      41 views
                      0 likes
                      Last Post Deep42
                      by Deep42
                       
                      Started by TheRealMorford, 03-05-2026, 06:15 PM
                      0 responses
                      46 views
                      0 likes
                      Last Post TheRealMorford  
                      Working...
                      X