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

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.

    JesseNinjaTrader Customer Service

    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.

        JesseNinjaTrader Customer Service

        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.
            JesseNinjaTrader Customer Service

            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.
                  JesseNinjaTrader Customer Service

                  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.
                      JesseNinjaTrader Customer Service

                      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.


                            JesseNinjaTrader Customer Service

                            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 FishTrade, 05-13-2024, 11:11 PM
                              3 responses
                              12 views
                              0 likes
                              Last Post FishTrade  
                              Started by Graci117, Yesterday, 09:02 PM
                              1 response
                              12 views
                              0 likes
                              Last Post NinjaTrader_Manfred  
                              Started by ETFVoyageur, Yesterday, 07:55 PM
                              0 responses
                              9 views
                              0 likes
                              Last Post ETFVoyageur  
                              Started by janio973, Yesterday, 07:24 PM
                              1 response
                              7 views
                              0 likes
                              Last Post NinjaTrader_Manfred  
                              Started by aligator, 01-06-2022, 12:14 PM
                              4 responses
                              252 views
                              0 likes
                              Last Post john_44573  
                              Working...
                              X