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

Custom Optimization

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

    Custom Optimization

    Hello

    I am starting to look into creating custom criteria for optimization and need a bit of direction.

    I have looked at the script files for the available default optimizations to get a feel for how it is to work. The actual script for that element looks to be incredibly straightforward. But, I do not see where it pulls certain calculations from. For example, optimizing for the Sharpe Ratio simply says

    Code:
    return systemPerformance.AllTrades.TradesPerformance.SharpeRatio;
    Clearly there needs to be a place that NT is storing the calculation for the Sharpe Ratio and therefore additional code needs to be written and placed in a file somewhere.

    Can you please point me in the right direction of starting to write my own optimization?

    Thank you very much for your help!

    #2
    Hello jg123,

    Thank you for your post.

    The calculation can be viewed at the following link: http://www.ninjatrader.com/support/h...efinitions.htm

    There is no code or file available that details this calculation.

    Comment


      #3
      Hi Patrick

      Unfortunately, I didn't quite write very clearly what I am after. I apologize for that.

      I actually am not specifically looking for the Sharpe Ratio calculation. I was attempting to use that as an example to bring clarity to what I was looking for.

      I am trying to create my own custom Optimization via NinjaScript. I noticed, as I was looking through all of the default optimizations' code, that there were no calculations within the script. My assumption was then that calculations do not belong in this optimization script; but, instead, are somewhere else and then referenced from the optimization script.

      I am looking for information on how to create my own optimization from scratch.

      Comment


        #4
        Hello Jg123,

        Custom Optimizations are not supported with NinjaTrader.
        If you are interested in creating one, you would need to take a look at the current optimizations available by going to (My) Documents -> NinjaTrader 7 -> bin -> Custom -> Type
        There are two, @DefaultOptimizationMethod and @GeneticOptimizer
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by jg123 View Post
          Hi Patrick

          Unfortunately, I didn't quite write very clearly what I am after. I apologize for that.

          I actually am not specifically looking for the Sharpe Ratio calculation. I was attempting to use that as an example to bring clarity to what I was looking for.

          I am trying to create my own custom Optimization via NinjaScript. I noticed, as I was looking through all of the default optimizations' code, that there were no calculations within the script. My assumption was then that calculations do not belong in this optimization script; but, instead, are somewhere else and then referenced from the optimization script.

          I am looking for information on how to create my own optimization from scratch.
          Are you asking about optimization criteria, or optimization method?

          Comment


            #6
            Hi Cal

            Actually I am not trying to create a new method of optimization, such as Simulated Annealing or Multipoint Hill Climbing or any of those. I am happy to, for now, continue using the Default and Genetic optimizations. My question is about creating a criteria with which to optimize for. Such as, in the example, one can optimize for the best Sharpe Ratio or lowest drawdown, etc. I want to tell NinjaTrader, "Please optimize for xyz..." It can use the Default or Genetic optimizer.

            So, my question is, where do I create this optimization?

            Comment


              #7
              Koganam, I asking about the criteria. That is probably the better way of asking it. Thank you for the clarification.

              Comment


                #8
                Originally posted by jg123 View Post
                Koganam, I asking about the criteria. That is probably the better way of asking it. Thank you for the clarification.
                There are quite a few threads and examples in this forum of that. Here are some:

                ref: https://www.ninjatrader.com/support/...ad.php?t=67962


                This one actually has 2 custom fitness functions that you can grab for study and use: http://www.ninjatrader.com/support/f...ad.php?t=39493

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by arvidvanstaey, Today, 02:19 PM
                4 responses
                11 views
                0 likes
                Last Post arvidvanstaey  
                Started by samish18, 04-17-2024, 08:57 AM
                16 responses
                61 views
                0 likes
                Last Post samish18  
                Started by jordanq2, Today, 03:10 PM
                2 responses
                9 views
                0 likes
                Last Post jordanq2  
                Started by traderqz, Today, 12:06 AM
                10 responses
                18 views
                0 likes
                Last Post traderqz  
                Started by algospoke, 04-17-2024, 06:40 PM
                5 responses
                48 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Working...
                X