Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How is called the OnBarUpdate method from Indicators?

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

    #16
    Originally posted by NinjaTrader_ChelseaB View Post
    Ah, thanks ...

    So, uh, how come Add-ons cannot be backtested?

    Comment


      #17
      Hello bltdavid,

      Strategies are the only script designed to be back-tested and are the only scripts that have Strategy Performance.

      Addons place orders directly through the Account in real-time only, and cannot place orders historically. Backtest is placing orders in State.Historical which an addon cannot do.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #18
        Thanks, much appreciated!

        Fernand0, did you try forward-testing in Sim101 with live data?
        Does your Add-on work with Market-Replay?

        Well, I guess my work here is done ... Good luck, Fernand0!

        Comment


          #19
          Originally posted by NinjaTrader_ChelseaB View Post
          Hello Fernand0,

          That is correct. NinjaTrader does not allow for backtesting addons.

          Indicators called from a strategy will automatically have OnBarUpdate() triggered by NinjaTrader, you don't have to do this. We do this for you. You don't have to worry about triggering OnBarUpdate() in a called indicator.

          But if you have a custom class (that is instantiated and not static) that is called by a script from OnBarUpdate(), then the strategy thread will be calling the custom class from OnBarUpdate() when NinjaTrader is triggering OnBarUpdate() in the strategy.

          If you have custom events declared and custom event handlers this would be getting outside of what is supported by NinjaTrader.
          I need backtesting, I'm using Neuroevolution..
          Addons have Playback at least? (i don't mean to run the addon on the Playback, i mean the possibility of running a bunch of data over and over again automatically)

          Comment


            #20
            Hello Fernand0,

            If you need backtesting the script should be a NinjaScript Strategy.

            Addons can be run while connected to Playback.

            Your own custom logic can do whatever you would like with the data. If you want to have loops that loop over data from a BarsRequest this is your choice to code this.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #21
              Ok, let's rewind this a bit..

              Can i use BarsRequest to run several strategies at once, like an optimization(backtest)?
              Last edited by Fernand0; 03-10-2020, 03:18 PM.

              Comment


                #22
                Hello Fernand0,

                BarsRequest is a concept for Addons. Strategies use AddDataSeries() to add data and this is processed in OnBarUpdate().

                BarsRequest for addons requires a custom method event handler to process the data.

                With a BarsRequest you get data. If you want to make your own system of saving entry prices and exit prices and make your own fill algorithm, your own indicators, and everything else used for optimizing, I'm sure with enough work you could replicate your own custom Strategy Analyzer to work with addons. And sure, I don't see any reason you wouldn't be able to run multiple strategies at the same time if the custom logic is sophisticated enough to do that.

                NinjaTrader created the Strategy class for the intention of having a type of script that can be back-tested and optimized.
                Chelsea B.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by argusthome, 03-08-2026, 10:06 AM
                0 responses
                109 views
                0 likes
                Last Post argusthome  
                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                0 responses
                59 views
                0 likes
                Last Post NabilKhattabi  
                Started by Deep42, 03-06-2026, 12:28 AM
                0 responses
                37 views
                0 likes
                Last Post Deep42
                by Deep42
                 
                Started by TheRealMorford, 03-05-2026, 06:15 PM
                0 responses
                40 views
                0 likes
                Last Post TheRealMorford  
                Started by Mindset, 02-28-2026, 06:16 AM
                0 responses
                77 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Working...
                X