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 quantismo, 04-17-2024, 05:13 PM
    3 responses
    25 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by ScottWalsh, 04-16-2024, 04:29 PM
    7 responses
    34 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by cls71, Today, 04:45 AM
    0 responses
    5 views
    0 likes
    Last Post cls71
    by cls71
     
    Started by mjairg, 07-20-2023, 11:57 PM
    3 responses
    214 views
    1 like
    Last Post PaulMohn  
    Started by TheWhiteDragon, 01-21-2019, 12:44 PM
    4 responses
    547 views
    0 likes
    Last Post PaulMohn  
    Working...
    X