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 SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    47 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    22 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    15 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    21 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    23 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X