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

Want to use something other than SystemPerformance in an OptimizationType

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

    Want to use something other than SystemPerformance in an OptimizationType

    I've developed a learning algorithm, and I want to port it directly into NinjaTrader. I want to use the optimizer to basically control the learning of the algorithm for future strategy use. I'm trying to pass my neural network to an OptimizationType (i.e.: System Quality Number || Net Profit per Trade), but as far as I know, optimization types can only accept an argument of SystemPerformance. While this makes perfect sense, I was wondering if there was a way I could pass my neural network in there, either by attaching it to the SystemPerformance instance somehow or by getting the optimization type to accept something other than SystemPerformance.

    Here's basic OptimizationType code:

    Code:
    using System;
    using NinjaTrader.Gui.Design;
    using NinjaTrader.Strategy;
    
    namespace MoGo.NinjaTrader.OptimisationMeasures
    {
        /// <summary>
        /// </summary>
        [DisplayName("MoGo Entry Efficiency")]
        public class entryeff : OptimizationType
        {
            /// <summary>
            /// Return the performance value of a backtesting result.
            /// </summary>
            /// <param name="systemPerformance"></param>
            /// <returns></returns>
            public override double GetPerformanceValue(SystemPerformance systemPerformance)
            {
                var entryefficiency = systemPerformance.AllTrades.TradesPerformance.Currency.AvgMfe;
                return entryefficiency;
            }
        }
    }
    I would like to change the GetPerformanceValue argument to accept the following:

    Code:
    /// <returns></returns>
            public override double GetPerformanceValue(BasicNetwork mynetwork)
            {
    I guess I'm just fuzzy on the how.

    I'm using Matt Craig's badass MoGo optimizer as a starting point, if anyone has experience.

    Note: I know this doesn't fall under standard support, feel free to ignore this if you must regular support team.

Latest Posts

Collapse

Topics Statistics Last Post
Started by Rapine Heihei, Today, 08:19 PM
0 responses
1 view
0 likes
Last Post Rapine Heihei  
Started by f.saeidi, Today, 08:01 PM
1 response
4 views
0 likes
Last Post NinjaTrader_Manfred  
Started by Rapine Heihei, Today, 07:51 PM
0 responses
4 views
0 likes
Last Post Rapine Heihei  
Started by frslvr, 04-11-2024, 07:26 AM
5 responses
96 views
1 like
Last Post caryc123  
Started by algospoke, 04-17-2024, 06:40 PM
6 responses
49 views
0 likes
Last Post algospoke  
Working...
X