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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    110 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    156 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    74 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    125 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    79 views
    0 likes
    Last Post PaulMohn  
    Working...
    X