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 argusthome, 03-08-2026, 10:06 AM
    0 responses
    68 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    41 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    24 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    27 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    54 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X