• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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.
    BrettNinjaTrader Product Management

    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

        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.
            BrettNinjaTrader Product Management

            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.
                BrettNinjaTrader Product Management

                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.
                        BrettNinjaTrader Product Management

                        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 XimoTrader, Today, 12:57 PM
                            1 response
                            6 views
                            0 likes
                            Last Post NinjaTrader_PatrickG  
                            Started by FxInception, Today, 12:27 PM
                            2 responses
                            10 views
                            0 likes
                            Last Post FxInception  
                            Started by siroya, Today, 10:34 AM
                            1 response
                            20 views
                            0 likes
                            Last Post NinjaTrader_ShawnB  
                            Started by Leeroy_Jenkins, Today, 11:22 AM
                            2 responses
                            12 views
                            0 likes
                            Last Post Leeroy_Jenkins  
                            Started by RedDuke, Today, 10:27 AM
                            2 responses
                            15 views
                            0 likes
                            Last Post RedDuke
                            by RedDuke
                             
                            Working...
                            X