Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Daily bars open and close times in live trading

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

    Daily bars open and close times in live trading

    Hello,
    I was wondering what determine the daily bars start and end times when trading live or paper.
    Is those times unchangeable or can I determine what they are using session template.

    For example, lets assume that I'm trading with daily bars on the ES which its session time is 17:00-16:15 CT. Now I change the session template to be 17:30-16:00. If I put a market order on bar close when CalculateOnBarClose = true, will it actually be sent at 16:00 and wait until 17:30 to be executed, or will it won't matter at it will still be executed at 17:00?

    #2
    Hello orenshkol,

    Thank you for your post.

    Some of the data providers will supply the Daily bars as is, meaning the Session Templates will have no affect on the Daily Bars. Who do you connect to for data?

    I look forward to your response.

    Comment


      #3
      I'm using IQFeed.

      Comment


        #4
        Hello orenshkol,

        Thank you for your response.

        The Session Template will affect the Daily bars in IQFeed, however the order itself will not be affected by the Session Template. Once submitted to the broker and then exchange it will fill based on trading hours of the exchange. Please contact your broker for more information on the order fills.

        Please let me know if I may be of further assistance.

        Comment


          #5
          Your answer is unclear.

          The Session Template will affect the Daily bars in IQFeed
          How? It doesn't affect the OHLC values, so what it does affect?

          however the order itself will not be affected by the Session Template.
          What doesn't it affect? It's value? The time I send it?

          Once submitted to the broker and then exchange it will fill based on trading hours of the exchange.
          So it will work on Sim01 but not in a real live account? What precisely will it do?

          Please be much more specific and give and example (you can use the one I gave at the start of the thread).

          Comment


            #6
            Hello orenshkol,

            Thank you for your response.

            The Session Template should affect the OHLC values for IQFeed Daily data, are you connected to IQFeed first from left to right on the bottom left hand corner of the Control Center?

            When the order can fill is not affected by the Session Template in NinjaTrader. The exchange trading hours, meaning when the trades are occurring will affect when you get a fill.

            Can you provide more detail on what you are testing? Are you backtesting the strategy?

            Comment


              #7
              I'm running checks on on SIM01 and putting marketable limit at the daily bar close, which is filled at the next bar open. I gave you an example of what I'm trying to do:

              For example, lets assume that I'm trading with daily bars on the ES which its session time is 17:00-16:15 CT. Now I change the session template to be 17:30-16:00. If I put a market order on bar close when CalculateOnBarClose = true, will it actually be sent at 16:00 and wait until 17:30 to be executed, or will it won't matter at it will still be executed at 17:00?
              Please answer what will happen in that scenario when running on SIM01 and in live.

              The Session Template should affect the OHLC values for IQFeed Daily data
              This directly contradicts what I see and what I was told, again I'm talking only about daily bars and using only IQFeed as a data provider.

              Comment


                #8
                Hello orenshkol,

                You are correct on the Daily bars for IQFeed, I made a mistake there and thank you for bringing it to my attention.

                Moving on to the order itself. Let's be specific here and give examples:

                Let's say you are running your strategy on a live account, your strategy calculates it will place an entry at the close of the daily bar and the daily bar closes before the extended hours. Well this means trading is still going on after hours and just because your bar has closed and a new one has not opened, does not mean it will wait to fill until the next bar. Session Templates do not dictate when an order can fill, this true in both Simulation and Live trading.

                However, in historical testing (backtesting) all we have are the bars and their open, high, low and close. thus orders will fill within those sessions.

                I hope I have been clear in my description here.

                Comment


                  #9
                  Thank you for your clarification. I did a few tests on my on and have a few question.

                  The test: I created a generic strategy that sends a marketable limit on the bar close, and in simulation is indeed filled at the next bar open. I than ran it on SIM01 on ES with a session template of 17:15 - 16:00 CT, on 1 day bars and 1440 minute bars.

                  The results are that the 1 day bar strategy placed the order at 17:00 according to the close price at 16:15, and the 1440 minute bar strategy placed the order at 17:15 according to the close price at 16:00, exactly like you expect according to the simulation (the weird thing is, and what got me started down this rabbit hole, is when I used 15:30 - 15:15 CT session on ES, the order was placed at 15:30 and not at 17:00 as you expect, as if the program somehow recognized the 15:15 to 15:30 market halt on ES as the day end).

                  The reason both the strategies placed the order at session open, and not on the defined session close (16:00) as you predicted, is that according to my logs they waited until the session open (17:00 on day bar and 17:15 on 1440 minute bar) to send the limit order.

                  So in summery: minute bar act according to the session template and day bar according to the real market times, both of them wait to the open of the next session open to place the order, and so matches in their behavior to the simulation.

                  My questions regarding this are:
                  1. Do my conclusions makes sense? And this is how the program indeed works?
                  2. What is the mechanism that causes the strategy to wait until the session open to send the order?
                  3. Will it work the same when I run this test on live as it did on SIM01?

                  Thank you for helpfulness and patience.

                  Comment


                    #10
                    Hello orenshkol,

                    both of them wait to the open of the next session open to place the order, and so matches in their behavior to the simulation.
                    This is correct, a bar is not closed until the open of the next bar. When running CalculateOnBarClose = True, the conditions are not calculated until the close of the bar. This would be true in Simulation and Live.

                    Comment


                      #11
                      So it will work exactly the in way in Live like it did on SIM01?

                      Comment


                        #12
                        Hello orenshkol,

                        Yes, the simulator will follow the same behavior on when to place order an order based on your strategy.

                        However, the simulator account will fill orders differently and will not be exactly the same as a live environment fill.
                        Alex G.NinjaTrader Customer Service

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by smartromain, 03-13-2024, 01:42 AM
                        5 responses
                        92 views
                        0 likes
                        Last Post AndreiBig  
                        Started by Noerclou, Today, 04:55 AM
                        0 responses
                        4 views
                        0 likes
                        Last Post Noerclou  
                        Started by llanqui, Yesterday, 09:59 AM
                        2 responses
                        19 views
                        0 likes
                        Last Post llanqui
                        by llanqui
                         
                        Started by ThoriSten, Today, 03:56 AM
                        0 responses
                        6 views
                        0 likes
                        Last Post ThoriSten  
                        Started by PhillT, 04-19-2024, 02:16 PM
                        3 responses
                        25 views
                        0 likes
                        Last Post mangel2000  
                        Working...
                        X