Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

download daily p&l of optimization results for multiple results

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

    download daily p&l of optimization results for multiple results

    suppose i have an optimization criteria where i ask it to return 20 results. is there any automatic way (like inserting some line of code in the optimizer or objective function) where i can output the daily p&l results (in points, or in percentages) of the 20 results in some csv file something like this:

    date, strategy1, strategy2, ...., strategy20
    01/01/2016, -0.00123, 0.00315, ...., -0.00657
    ...
    02/08/2016, 0.02310, 0.0231, ..., -0.00259

    etc.

    I want to select a few results from the optimizer that are uncorrelated (or less correlated, or simply work differently in different periods etc.), and I was think to transport the results to excel (or some spreadsheet) to check for correlations.

    #2
    Hello uday12,

    Thank you for writing in.

    We do have a reference sample on our support forum detailing how you can utilize StreamWriter to write to a file: http://ninjatrader.com/support/forum...ead.php?t=3475

    You can print out the values of cumulative profit within the OnTermination() method of your strategy. Here's an example below (though this shows just a simple print rather than using StreamWriter):
    Code:
    protected override void OnTermination()
    {
         // prints cumulative profit of all trades when strategy is shutting down at the end of an optimization run
         Print(Performance.AllTrades.TradesPerformance.Currency.CumProfit);
    }
    More information about OnTermination() can be found at within this help guide link: http://ninjatrader.com/support/helpG...ermination.htm

    Please, let us know if we may be of further assistance.
    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
    61 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    148 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    162 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    98 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    286 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X