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