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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    102 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    144 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    71 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    125 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    79 views
    0 likes
    Last Post PaulMohn  
    Working...
    X