Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

custom optimization criteria for annualizing cummulative profit

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

    custom optimization criteria for annualizing cummulative profit

    Suppose I want to write my custom optimization criteria

    public class MyOptCrit : OptimizationType
    {

    }

    where I need the function to use annualized version of "cummulative profit".

    For instance, suppose I am doing an optimization over the period say 3/1/2010 to 3/1/2016, i.e. a period of 6 years, and the cummulative return returned in the summary tab is 205%, then

    (i) how can I get the cummulative return ? i.e. is there something similar to "systemPerformance.AllTrades.??.??.CummulativeProf it" ?

    (i) how can I make the function get the start and end dates for the data (i.e. 3/1/2010 and 3/1/2016) and convert it into say years (6 years in this case) ? Is there a way something similar to "Strategy.BeginDate" and "Strategy.EndDate" ?



    Thanks

    #2
    Hello uday12,

    Thank you for writing in.

    You will be able to utilize systemPerformance.AllTrades.TradesPerformance.Curr ency.CumProfit to obtain the cumulative profit of the collection: https://ninjatrader.com/support/help...?cumprofit.htm

    Unfortunately, you will not be able to obtain the times specified within the Strategy Analyzer window. Additionally, the GetPerformanceValue() method will return a double value as its return type is double. You'll be unable to return a DateTime object to the Strategy Analyzer's "Performance" column.
    Zachary G.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    51 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    142 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    160 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    96 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    275 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X