Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

checking for trade name in optimizer

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

    checking for trade name in optimizer

    I have a Unmanaged trade strategy, whose trades appear in the Backtest named as either "Sell", or "Buy", or "Exit on close".

    Suppose I want to write my own custom optimization function


    public override double GetPerformanceValue(SystemPerformance systemPerformance)
    {
    ....
    double numTrades = systemPerformance.AllTrades.Count;
    ....
    for (int i = 0; i < numTrades-1; i++)
    {
    Trade t1 = systemPerformance.AllTrades[i];
    // calculate something where the logic is different if t1 had
    // "Exit on Close" event to close the trade
    }
    ....
    }


    To check in the above code if Trade t1 had an "exit on close", should I use t1.Exit.Name, or should I use t1.ExitExecution.Name ?

    Thanks
    Last edited by uday12; 03-11-2016, 05:52 PM.

    #2
    Hello uday12,

    Thank you for writing in.

    Exit.Name is the documented property for a Trade object: https://ninjatrader.com/support/help...nt7/?trade.htm

    This will obtain the name of the execution of the exit.

    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 GussJ, 03-04-2020, 03:11 PM
    11 responses
    3,229 views
    0 likes
    Last Post xiinteractive  
    Started by andrewtrades, Today, 04:57 PM
    1 response
    14 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by chbruno, Today, 04:10 PM
    0 responses
    7 views
    0 likes
    Last Post chbruno
    by chbruno
     
    Started by josh18955, 03-25-2023, 11:16 AM
    6 responses
    441 views
    0 likes
    Last Post Delerium  
    Started by FAQtrader, Today, 03:35 PM
    0 responses
    12 views
    0 likes
    Last Post FAQtrader  
    Working...
    X