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 bortz, 11-06-2023, 08:04 AM
    47 responses
    1,607 views
    0 likes
    Last Post aligator  
    Started by jaybedreamin, Today, 05:56 PM
    0 responses
    9 views
    0 likes
    Last Post jaybedreamin  
    Started by DJ888, 04-16-2024, 06:09 PM
    6 responses
    19 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by Jon17, Today, 04:33 PM
    0 responses
    6 views
    0 likes
    Last Post Jon17
    by Jon17
     
    Started by Javierw.ok, Today, 04:12 PM
    0 responses
    15 views
    0 likes
    Last Post Javierw.ok  
    Working...
    X