Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnBarUpdate with MultiTimeFrame

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

    OnBarUpdate with MultiTimeFrame

    Hello,
    i wrote a strategy which uses 4 Timeframes.
    1 Minute, 2 Seconds, 10 Seconds and 30 Seconds.
    this works perfect until 31 December 2021.
    currently the OnBarUpdate only called with the CharTimeFrame.

    I build a new Strategy to show my issue (Attachted)

    As you see, i Print the Current BarsInProgress to the Ouput.
    After finishing the Historical Data, the OnBarUpdate is not called anymore.
    (Attached png is a Screenshot from Output)

    this is the last Line in Output:
    Enabling NinjaScript strategy 'DataSeriesSample/252736643' : On starting a real-time strategy - StartBehavior=WaitUntilFlat EntryHandling=All entries EntriesPerDirection=1 StopTargetHandling=Per entry execution ErrorHandling=Stop strategy, cancel orders, close positions ExitOnSessionClose=False SetOrderQuantityBy=Strategy ConnectionLossHandling=Recalculate DisconnectDelaySeconds=10 CancelEntriesOnStrategyDisable=False CancelExitsOnStrategyDisable=False Calculate=On price change IsUnmanaged=False MaxRestarts=4 in 5 minutes

    In the case, i remove the AddDataSeries Line from the Strategy, OnBarUpdate is called as expected.

    In my Original Strategy, OnBarUpdate is also called after this "Enabling"-Outputline, but only with Timeframes greater-than-or-equal (to) then Chart-TimeFrame.

    This behavior changes from one Day to the next.

    Attached Files

    #2
    Hello SpikeLGWG,

    Please try restarting the platform and during the restart clear the cache. after doing so please open the chart and reload all historical data for each instrument/timeframe used.


    To delete the cache, follow the steps below:
    • Shut down NinjaTrader.
    • Open the Documents > NinjaTrader 8 > db folder.
    • Delete the sub-folder named 'cache'.
    If that does not resolve the issue please let me know.

    Comment


      #3
      Hello,

      Thank you for your answer!
      I delete the folder Cache and the cleared all folders in Dokuments\Ninjatrader 8
      In ninjatrader i cleared all Historical data.

      And i have the same result.

      The sample i attached only works in Historical-Data until to then Output-Line "Enable" (i placed a screenshot)
      And my orignal Strategy (only works on Live) is called only with BarsInProgress of the chart and not the second DataSeries with an interval lower then the chart.
      If the second Dataseries have the same Timeframe as the Chart, it is processed in OnBarUpdate.

      Have you a second hint?

      Comment


        #4
        Hello SpikeLGWG,

        Unfortunately from the given details I cant see anything that would stop OnBarUpdate from being called.

        I would suggest trying a different calculation mode to see if that changes the result.

        Alternatively check which specific series is causing this to happen, for example check that a single series script works and then if so move on to one additional series etc.

        Comment


          #5
          Hello,

          the attached Sample works without DataSeries as expected.
          I try all calculationmodes too.

          In my Original Strategy, i tried all DataSeries i suggest. DataSeries equal or grater then Chart will work, Dataseries smaller then Chart didn't work.

          How can i create more Details for you?

          Comment


            #6
            Hello SpikeLGWG,

            Please try using the playback connection to check if that works or if this relates to the specific data provider being used.

            I look forward to being of further assistance.

            Comment


              #7
              Hello,

              I testet my Original Strategy:
              The Playback Connection with historical Data will works as expected.

              Yesterday i deletet all historical Data, which i downloaded today from the Coinbase-Connector in the Historical Data -> Get Market Replay data.

              After them i opend a new Chart and added my Strategy, press play and it will work as expected.

              Comment


                #8
                Hello,

                i reinstalled the ninjatrader (with deleting all ninjatrader folders on HDD) and i have the same behavior.

                Comment


                  #9
                  Hello SpikeLGWG,

                  You mentioned this is happening with coinbase, is the symbol being used one of the default symbols that comes with the platform or have you tried adding custom symbols? At this time only a few symbol pairs on coinbase are supported and are the ones that come by default in the instrument lst. Other custom instruments can potentially be added without error however they may have no data or no historical data to work with.

                  The playback data is recorded data held on NinjaTrader servers so if that works it may relate to the specific instrument being tested on the coinbase connection not having live data. Are you able to verify that a chart open to those timeframes is receiving live data/building bars for that symbol?



                  I look forward to being of further assistance.

                  Comment


                    #10
                    Hello,

                    BTCUSD
                    And on 2021 December 31 this Strategy works perfekt.

                    So, did change Coinbase some things?



                    Comment


                      #11
                      Hello SpikeLGWG,

                      I tried the sample on my end and it appears to be working as expected on the coinbase/btcusd pair. Are you on the current 8.0.25.0 release?

                      Have you also tried using less days to load for the test and only including days in the current year? I see it working from last year to this year and also just this year, there was no difference.

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

                      Comment


                        #12
                        Hello,

                        8.0.25.0 64 Bit is the current Installed version.

                        Yes, i test a custom Range only in this year. I thougt the Change of the year could be a Problem, DateTime-"Calculating" is sometimes difficult.

                        Realy strange thing.

                        Comment


                          #13
                          I have an Simulation-Account? Maybe is her someting changed?

                          Comment


                            #14
                            Hello SpikeLGWG,

                            There were no specific changes mentioned with the .25 release and I can see this working as expected from my end so I don't believe anything has changed on the coinbase side to prevent tt from working. I would suggest to fully uninstall the platform and make sure there are no files remaining in the program files/NinjaTrader 8 directory. After doing that re install and re test. The coinbase connection is not reliant on the account as there are no live coinbase accounts at this time. The sim account can be used to simulate trades on many connections including coinbase.


                            Comment


                              #15
                              Hello,

                              i uninstalled Ninjatrader, deleted all folders on Harddisk, Deleted alle entries with "Ninjatrader" from the regesitry (RegEdit) Install the latest Ninjatrader and i have the same behavior.

                              In the case we can not solve this Problem, i have to change the Plattform.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by NullPointStrategies, Today, 05:17 AM
                              0 responses
                              52 views
                              0 likes
                              Last Post NullPointStrategies  
                              Started by argusthome, 03-08-2026, 10:06 AM
                              0 responses
                              130 views
                              0 likes
                              Last Post argusthome  
                              Started by NabilKhattabi, 03-06-2026, 11:18 AM
                              0 responses
                              70 views
                              0 likes
                              Last Post NabilKhattabi  
                              Started by Deep42, 03-06-2026, 12:28 AM
                              0 responses
                              43 views
                              0 likes
                              Last Post Deep42
                              by Deep42
                               
                              Started by TheRealMorford, 03-05-2026, 06:15 PM
                              0 responses
                              47 views
                              0 likes
                              Last Post TheRealMorford  
                              Working...
                              X