Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Events not firing after Add 120 minute timeframe

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

    Events not firing after Add 120 minute timeframe

    Using NT 7.0.1000.2
    If I attempt to backtest a strategy that uses:
    Add(PeriodType.Minute,120);
    in Inititilize then Initialize completes without error, but other events (OnStartup and OnBarUpdate) do no fire.

    If I use Add(PeriodType.Minute,119);
    then everything is OK. But 120 or more causes other events to stop (with no errors recorded).

    Is this a bug that has been fixed by a later version?

    #2
    DaveE, I am not aware of such a bug, but you should definitely upgrade to the latest 7.0.1000.6. There have been quite a few changes and fixes in the last four releases. Please upgrade and try again and let me know if it doesn't work out.
    AustinNinjaTrader Customer Service

    Comment


      #3
      Thanks for the quick reply Austin.
      I just upgraded to 7.0.1000.6.
      The problem is still there but I have some further info:
      Problem occurs only if the base dataseries is Range or RangeAlt.

      If I try to run the strategy live (instead of backtest) with Range or RangeAlt as base and strategy Add's 120 minute then behavious is slightly different because now OnStartUp IS called (but OnBarUpdate still is not).

      Comment


        #4
        Dave, are there any errors in the log (right-most tab of Control Center)? Could you post your strategy here so I could test this out?
        AustinNinjaTrader Customer Service

        Comment


          #5
          The most annoying thing is that there are no errors recorded.
          There seems to be some code in NT that effectively does this:
          "If base is Range or RangeAlt and then 120 or more minute bar is Add-ed ... then dont produce any OnBarUpdate events (but dont report any error)"
          I will try to send some stripped down code to reproduce later.

          Comment


            #6
            I can assure there is no such code, please make sure there is enough data to generate the bars by extending the "days to add" to a large value.

            Once you get the code stripped down, I'll be glad to test it.
            AustinNinjaTrader Customer Service

            Comment


              #7
              Part of the problem may be that the code does not seem to follow the documentation for BarsRequired.
              Docs say "In a multi-series strategy this restriction applies only for the primary Bars object." But in fact what seems to happen is the strategy is not started (so no "OnStartUp") until the largest of all periods (base or Add-ed) has got BarsRequired bars.

              The attached test strategy demonstrates this bug.

              If I run this in Strategy Analyzer for a timeframe of just one day (with FX data covering 24 hours), and use a base of say 60 min and specify MinsToAdd=120 then I get all the events fired as expected. But if I specify MinsToAdd=240 with the default "Min bars required"=20 then strategy does not start. But according to the documentation BarsRequired should only apply to the base period!

              This is only part of the problem. I will send a more realistic strategy later demonstrating the original problem.
              Attached Files

              Comment


                #8
                Hi Dave, I will checks the docs and ensure this is correctly covered - however for MultiSeries script BarsRequired does have to be covered for all bars objects, so 20 240 min bars have to be present in the one case you posted.
                BertrandNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Segwin, 05-07-2018, 02:15 PM
                10 responses
                1,769 views
                0 likes
                Last Post Leafcutter  
                Started by Rapine Heihei, 04-23-2024, 07:51 PM
                2 responses
                30 views
                0 likes
                Last Post Max238
                by Max238
                 
                Started by Shansen, 08-30-2019, 10:18 PM
                24 responses
                943 views
                0 likes
                Last Post spwizard  
                Started by Max238, Today, 01:28 AM
                0 responses
                10 views
                0 likes
                Last Post Max238
                by Max238
                 
                Started by rocketman7, Today, 01:00 AM
                0 responses
                7 views
                0 likes
                Last Post rocketman7  
                Working...
                X