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 wzgy0920, 04-20-2024, 06:09 PM
    2 responses
    26 views
    0 likes
    Last Post wzgy0920  
    Started by wzgy0920, 02-22-2024, 01:11 AM
    5 responses
    32 views
    0 likes
    Last Post wzgy0920  
    Started by wzgy0920, Yesterday, 09:53 PM
    2 responses
    49 views
    0 likes
    Last Post wzgy0920  
    Started by Kensonprib, 04-28-2021, 10:11 AM
    5 responses
    191 views
    0 likes
    Last Post Hasadafa  
    Started by GussJ, 03-04-2020, 03:11 PM
    11 responses
    3,230 views
    0 likes
    Last Post xiinteractive  
    Working...
    X