Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 Brevo, Today, 01:45 AM
    0 responses
    3 views
    0 likes
    Last Post Brevo
    by Brevo
     
    Started by aussugardefender, Today, 01:07 AM
    0 responses
    3 views
    0 likes
    Last Post aussugardefender  
    Started by pvincent, 06-23-2022, 12:53 PM
    14 responses
    239 views
    0 likes
    Last Post Nyman
    by Nyman
     
    Started by TraderG23, 12-08-2023, 07:56 AM
    9 responses
    384 views
    1 like
    Last Post Gavini
    by Gavini
     
    Started by oviejo, Today, 12:28 AM
    0 responses
    6 views
    0 likes
    Last Post oviejo
    by oviejo
     
    Working...
    X