Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

backtest / optimization exposed to ninjascript

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

    backtest / optimization exposed to ninjascript

    Will it be possible in NT8 to backtest stategies and run the optimizer through ninjascript?

    The reason I ask, is I wanted to integrate a custom built application that does the following:
    a) semi-automated optimizations
    b) multi-system optimizations
    c) strategy ranking application

    If those objects were exposed I would be able to leverage the NT8 optimization engine instead of having a custom solution.

    #2
    We definitely exposed programming custom optimizers, optimization fitnesses, and performance metrics however the act of actually running your own optimization we did not discuss during initial development.

    You bring up a very interesting idea and I see no reason so far why we wouldn't allow that currently.

    I'll do some research and throw together some Add On documentation on the topic if I'm able to support it. Give me a few days to get everything together and I'll repost.

    Comment


      #3
      That would be terrific Brett !

      Comment


        #4
        Originally posted by GrumpyTrader View Post
        Will it be possible in NT8 to backtest stategies and run the optimizer through ninjascript?

        The reason I ask, is I wanted to integrate a custom built application that does the following:
        a) semi-automated optimizations
        b) multi-system optimizations
        c) strategy ranking application

        If those objects were exposed I would be able to leverage the NT8 optimization engine instead of having a custom solution.
        Yes very good + the ability to save out and rank performance settings and re-run then as templates for a universe of instruments - and remove the parameter overwriting when parameters do not change 1;1;1 etc 0- the data then can be saved locally or uploaded to a remote repository - as json, xml or csv results or settings xml files etc
        MicroTrends
        NinjaTrader Ecosystem Vendor - micro-trends.co.uk

        Comment


          #5
          Originally posted by NinjaTrader_Brett View Post
          We definitely exposed programming custom optimizers, optimization fitnesses, and performance metrics however the act of actually running your own optimization we did not discuss during initial development.

          You bring up a very interesting idea and I see no reason so far why we wouldn't allow that currently.

          I'll do some research and throw together some Add On documentation on the topic if I'm able to support it. Give me a few days to get everything together and I'll repost.
          Hey Brett,
          I was wondering if you made any headway on this?

          Best
          GT

          Comment


            #6
            Some but not ready to post yet, likely be next week.

            Comment


              #7
              I have to 'second' this as something that could be very helpful indeed, and appreciate your looking into this, Brett (and your mentioning it, Grumpy!)

              Comment


                #8
                Wanted to provide an update that the Running of an optimization isn't exceedingly difficult, however setting up a fresh strategy to feed the optimizer correctly is more involved. As such I may not be able to support this. I'll spend some more time looking at the complexity involved and get back but will require additional time and is lower priority then other beta tasks we have ongoing so will take me additional time.

                Thanks for your patience.

                Comment


                  #9
                  Originally posted by Dionysus View Post
                  I have to 'second' this as something that could be very helpful indeed, and appreciate your looking into this, Brett (and your mentioning it, Grumpy!)
                  I will third it, but certainly a stable NT8 release is a higher priority for me and the NT community.

                  Comment


                    #10
                    Thanks Brett,
                    I completely understand and agree. Perhaps after NT8 is released you could revisit it as I do think it would allow for very interesting addon's.

                    Comment


                      #11
                      Hey Brett,
                      I was wondering if you could share some information on how to do this (even though it is unsupported). I'm at the point now with the AddOn i've been working on that I either use the built in optimizer or create my own. I completely understand if you can't support it but I think I will be able to figure it out if you just point me in the right direction.

                      Comment


                        #12
                        GrumpyTrader,

                        Once I get to a production release I would be able to look more heavily into official supported such steps. Either by being able to document all the steps properly or providing some 'wrapper' method call you could make to just do the Backtest/Optimization. Until then this would be unsupported since there are several steps you have to do in the right order to get an optimization to run.

                        As for a hint that you could look into if you did want to chase it further on your own... the trigger point is "RunOptimization()" method in NinjaTrader.Core.StrategyBase. Before you call that method on a strategy instance you must first setup any bars using InitializeBars() on that strategy instance. That is as far as I could comment until we get through beta and make a determination on how the above will change as we look into potentially officially supporting that use case.

                        Comment


                          #13
                          Thanks Brett. Give's me a research project. :-)

                          Comment


                            #14
                            Here is as far as I got with programically running a backtest. The problem is at calling the InitializeBars on the NinjaScriptBase method of a strategy. I get the callback but the bars aren't initialized. I can't step into the code so no way for me to figure out the issue. Perhaps someone else following this thread can take a look and has some ideas of what to try.
                            Attached Files

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by algospoke, Yesterday, 06:40 PM
                            2 responses
                            18 views
                            0 likes
                            Last Post algospoke  
                            Started by ghoul, Today, 06:02 PM
                            3 responses
                            14 views
                            0 likes
                            Last Post NinjaTrader_Manfred  
                            Started by jeronymite, 04-12-2024, 04:26 PM
                            3 responses
                            44 views
                            0 likes
                            Last Post jeronymite  
                            Started by Barry Milan, Yesterday, 10:35 PM
                            7 responses
                            20 views
                            0 likes
                            Last Post NinjaTrader_Manfred  
                            Started by AttiM, 02-14-2024, 05:20 PM
                            10 responses
                            180 views
                            0 likes
                            Last Post jeronymite  
                            Working...
                            X