Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Failed to open position

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

    #16
    Hello,

    Mabye you still have issues here with the multi time frame code? Would need to take a look at your code to further assist.

    Please send your code to support at ninjatrader dot com and reference this forum post

    I look forward to assisting you further.
    BrettNinjaTrader Product Management

    Comment


      #17
      Hi Brett, just emailed you. thanks.

      Comment


        #18
        Originally posted by rogueTrader View Post
        Hi Brett, just emailed you. thanks.

        I'm running NT7 on a Windows Server 2008 and using Kinetick for the feed.

        Comment


          #19
          Responded.
          BrettNinjaTrader Product Management

          Comment


            #20
            Hi brett, thanks for the advice. What is the frequency that the OnBarUpdate method gets called? I'm using a 1min primary bar.

            If the BarsInProgress is required, why did the Strategy Analyzer triggered?

            Comment


              #21
              Hello,

              OnBarUpdate will be called for each bar update. So for example a 5 minute chart main series witha 1 minute secondary.

              There will be 2 on OnBarUpdate() for a 10 minute period on the main series.

              Also there will be 10 OnBarUpdate() on the 1 minute period. On the 5th and 10th OnBarUpdate() on the 1 min series this will occur at the same time as the 5 minute OnBarUpdate(). You will have 2 OnBarUpdates run at the same time when these align. Hope this makes since.

              Therefor due to the multi treaded nature of this you wont know what OnBarUpdate runs when, which is what your unning into. You need to filter out your logic to run on one OnBarUpdate for your entry logic.

              Let me know if I can be of further assistance.
              BrettNinjaTrader Product Management

              Comment


                #22
                Hi Brett,

                Many thanks for your help.

                I would also like to ask if running a backtest using the Strategy Analyzer while having an enabled strategy in the Strategies tab affect the values in the variables in the same enabled strategy?

                For example, variable1 in the enabled strategy1 is currently 0.
                By running a backtest on strategy1 concurrently, variable 1 in the backtest becomes 5.
                So the question is, would variable1 in the enabled strategy becomes 5 too?

                Comment


                  #23
                  Hello,

                  Thanks for your note.

                  No each strategy run is independant.

                  Let me know if I can be of further assistance.
                  BrettNinjaTrader Product Management

                  Comment


                    #24
                    It seems that the discrepancies between my simulated trades and backtested trades might be due to the data source.


                    I would like to know if I could configure my strategy to use ONLY historical data pulled from the Kinetick server minute by minute?

                    What I want to achieve is that instead of reading off the realtime data from Kinetick, my enabled strategy will request for Historical data from Kinetick and use those instead. Hopefully this will solve the performance discrepancies between simulated and backtest.

                    Comment


                      #25
                      Hello,

                      When you start the strategy you would need to set Calculate On Bar Close = True for this to occur.
                      BrettNinjaTrader Product Management

                      Comment


                        #26
                        Hi Brett, I was using COBC = true previously but had differing results when compared to backtested results as well...

                        Do I need to use If (Historical) in my code to go along with COBC = true?

                        Comment


                          #27
                          Hello,

                          Yes to match backtesting you would need to run withen an if (historical) check. However this would cause the strategy to only run on historical data and no live data. Which is the same as a backtest. Therefor I dont believe this is what your looking for.

                          I guess what are the major differences when running the strategy live with COBC=True vs the backtest? In most cases these should be very close in results.

                          Let me know if I can be of further assistance.
                          BrettNinjaTrader Product Management

                          Comment


                            #28
                            Hi Brett,
                            Please see the screenshots and help to explain the discrepancies.

                            Screenshot 1 (Backtest period 1 Jan - 10 Jan) showing 2 trades executed


                            Screenshot 2 (Backtest period 1 Jan - 11 Jan) showing 1 trade executed

                            Any explanation?
                            Attached Files

                            Comment


                              #29
                              Hi roguetrader,

                              I can't identify a reason why the strategy would perform differently with this date range.

                              I would look at the underlying conditions for entry for the test ending 1 / 11/ 10 and see what values are being used and why there wasn't a trade. Print all values associated with entry conditions.

                              If you're comparing double values, please look into this article for potential issues with floating point arithmetic.
                              Ryan M.NinjaTrader Customer Service

                              Comment


                                #30
                                I would like to know if the following in my OnBarUpdate() block would force the enabled Strategy to pull historical data from Kinetick instead of using the real-time feed. (Assuming I've deleted all data in my Historical Data manager.)

                                if(!Historical) {
                                return;
                                }

                                if(BarsInProgress == 1) {
                                ...
                                }

                                else if(BarsInProgress == 0) {
                                ...
                                }

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by NullPointStrategies, Today, 05:17 AM
                                0 responses
                                41 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