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 quicksandatl, 05-09-2024, 11:11 AM
    3 responses
    23 views
    0 likes
    Last Post quicksandatl  
    Started by morrnel, 05-12-2024, 06:07 PM
    6 responses
    67 views
    1 like
    Last Post NinjaTrader_Manfred  
    Started by algospoke, 05-13-2024, 06:53 PM
    2 responses
    21 views
    0 likes
    Last Post algospoke  
    Started by janio973, Yesterday, 07:24 PM
    6 responses
    30 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by AlphaOptions, 06-18-2013, 08:24 AM
    5 responses
    2,172 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Working...
    X