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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    68 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    39 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    63 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    62 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    53 views
    0 likes
    Last Post CarlTrading  
    Working...
    X