Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Own Metrics based on Equity Curve

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

    Own Metrics based on Equity Curve

    Hello Ninja-Heros,

    at first I want to thank you for your excellent support.

    I found some examples in the net how to write own optimizer metrics. Is there an official help guide?

    The NT metrics (eg Max.DD) seems to be based on a trade by trade basis and I need one which considers open positions. I wrote code for calculating the metric as part of a strategy.

    My question is how to access it within the OptimizationType class?

    Lets say the code would be

    public class MyTurtle : Strategy
    {
    private double maxdrawdown=0.0;

    ...
    }


    How to access this withhin OptimizationType in order to avoid trouble due to to parallel execution during the optimization.


    Best Regards

    Thomas Benner

    #2
    Hello Thomas,
    OptimizationType has StrategyBase as its property, and you can access it from your custom OptimizationType.


    Say I have a custom strategy named MyHolyGrail and have a public property/input like MyInput0 then you can access it as:

    Code:
    public override double GetPerformanceValue(SystemPerformance systemPerformance)
    {
    	
    	if (this.Strategy is MyHolyGrail)
    	{
    		MyHolyGrail strategy = this.Strategy as MyHolyGrail;
    		
    		strategy.Print("debug from Optimization type " + strategy.MyInput0.ToString());
    	}
    
            //more codes
    }
    Unfortunately OptimizationType is not officially supported by us and thus there is no documentation regarding it.
    Last edited by NinjaTrader_Joydeep; 10-25-2012, 05:24 AM.
    JoydeepNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    78 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    45 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    29 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    32 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    64 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X