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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    72 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    39 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    63 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    63 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    53 views
    0 likes
    Last Post CarlTrading  
    Working...
    X