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 CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    28 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    125 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    181 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    94 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    138 views
    0 likes
    Last Post cmoran13  
    Working...
    X