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

When LIVE with CalculateOnBarClose no Trades

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

    When LIVE with CalculateOnBarClose no Trades

    Dear Support team,

    Cannot figure out, why I do not get any LIVE trades. My strategy should produce with the close of today (CalculateOnBarClose = TRUE) Orders for tomorrow. The problem seems to be that OnBarUpdate is not being called. From my understand it should have been called already since most of todays exchange sessions are over (Europe) and the Close values should be there. Correct?

    The strategy works fine for historic data and it produces LIVE Trades when I set CalculateOnBarClose = FALSE.

    Did I miss anything?

    Thx, Peter

    #2
    Hello Peter,

    OnBarUpdate is not connected in any way to the close of a session. A bar isn't "completed" until a new one begins. If you have COBC = true logic, it won't be processed until the first tick of the next session.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Hi Ryan,

      Ok understood and worked fine for European Stock Indices today in the morning, where I did get my new real-time positions with the start of today's trading session (8.00 a.m).

      What I do not understand ist the behaviour of my trading script on the US Interest Rates. The session template I use there starts with the trading sessing at 14.20 our time (Vienna/Europe) and stops at 21.00 our time. When I uploaded the strategy into the chart today at around 12.00, I had already a simulated position on, because there was a daily bar for today available. When I change the chart to e.g. 30 minute bars, I do not see any 30 minute bars for today, what is correct.

      Can this be correct?

      Thx, Peter

      Thx, Peter

      Comment


        #4
        Hi Peter,

        Can you please clarify what you're seeing? Is it a charting issue or strategy behavior?
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          For me it's a charting issue, because there should not be a daily bar for today before the start time of the session template. Correct? The result is a misbehaviour of my strategy.

          Comment


            #6
            Who is your data provider? Some data providers supply their own daily bars, that operate independent of NinjaTrader's session templates, and others are built from the intraday data available.
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              Interactive Brokers

              Comment


                #8
                OK. Yes, IB supplies their own daily bars so it will not adhere to session template definitions.

                Within NinjaTrader, you may consider working with simulated daily bars. If your session trades from 14:20 - 21:00, you can create 400-minute bars to simulate this session.
                Ryan M.NinjaTrader Customer Service

                Comment


                  #9
                  Ok I understand. But what happens, when I switch in this kind of 1 Minute chart to daily. Does NT then take for each day the 400 1 minute bars to calculate the daily bars. Or do I have the same problem like before.

                  Comment


                    #10
                    There's unfortunately no way to configure the daily bars according to the session defined. They're supplied directly from IB according to their time definitions.

                    Using 400 minute bars is a way to simulate a daily bar using only the session hours you'd like to use.
                    Ryan M.NinjaTrader Customer Service

                    Comment


                      #11
                      Understood. One last question: Is it really possible to trade an automatic end-of-day strategy (CalculateOnBarClose = TRUE) on a 1 Minute bar chart. Let's assume that the daily bar and the 400 1 minute bars would mirror the same trading session and match 100% (not the IB case!!). Would NT produce identical orders?

                      Thx for your support Ryan!!

                      Comment


                        #12
                        Yes, the 400 minute bars should be close to what you're looking for and it's possible to setup an automated strategy using these. One distinction is that you're not seeing a settlement value for these bars. The close of the bar is the last trade rather than the settlement value supplied with daily bars.
                        Ryan M.NinjaTrader Customer Service

                        Comment


                          #13
                          The trading issue for the US markets over IB is still not solved for me. Anyway, by going through the NT helpfiles I found out that it is possible to establish multiple simultaneous connections to different connectivity providers:

                          So I am thinking about the following solution, which might solve my issue:
                          Connection 1: Kinetick free End-of-day data
                          Connection 2: IB

                          From what I understand is, that all the daily data is then coming from Kinetick and the trading would be over IB. Since Kinetick daily bars match with the specified trading session within NT, this should solve my issue. I would trade the daily bars from Kinetick and place my orders through IB. Is this correct?

                          The streaming live quotes from Kinetick should not necessary, since my trades are just issued on daily bars. Is this correct?

                          Thx, Peter

                          Comment


                            #14
                            Hi Peter, that would be correct in that setup all data would be taken from the primary Kinetick connection and the IB is only uses to place your trades then. If you don't need intraday data for your trading, it should be fine.
                            BertrandNinjaTrader Customer Service

                            Comment


                              #15
                              Hi Bertrand,

                              Well, I am not sure anymore, whether this really solves my issue. I am testing the daily bars for the DAX future since this morning and no additional bar for today (3.1.) has been added. When am I changing to intraday data, obviously IB data is taken, and then I am getting bars for today.

                              So, any ideas what could I do in order to get productive with the Kinetick/IB solution for daily bars?

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by burtoninlondon, Today, 12:38 AM
                              0 responses
                              9 views
                              0 likes
                              Last Post burtoninlondon  
                              Started by AaronKoRn, Yesterday, 09:49 PM
                              0 responses
                              14 views
                              0 likes
                              Last Post AaronKoRn  
                              Started by carnitron, Yesterday, 08:42 PM
                              0 responses
                              11 views
                              0 likes
                              Last Post carnitron  
                              Started by strategist007, Yesterday, 07:51 PM
                              0 responses
                              13 views
                              0 likes
                              Last Post strategist007  
                              Started by StockTrader88, 03-06-2021, 08:58 AM
                              44 responses
                              3,983 views
                              3 likes
                              Last Post jhudas88  
                              Working...
                              X