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 rocketman7, Today, 09:41 AM
    4 responses
    15 views
    0 likes
    Last Post rocketman7  
    Started by selu72, Today, 02:01 PM
    1 response
    9 views
    0 likes
    Last Post NinjaTrader_Zachary  
    Started by WHICKED, Today, 02:02 PM
    2 responses
    13 views
    0 likes
    Last Post WHICKED
    by WHICKED
     
    Started by f.saeidi, Today, 12:14 PM
    8 responses
    21 views
    0 likes
    Last Post f.saeidi  
    Started by Mikey_, 03-23-2024, 05:59 PM
    3 responses
    56 views
    0 likes
    Last Post Sam2515
    by Sam2515
     
    Working...
    X