Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

number of operations

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

    number of operations

    Hello,

    Is there a way to limit the number of trades to a determined level?I mean, I know you can limit the number of trades in an instrument such as for example:

    if (Bars.FirstBarOfSession)
    {
    Previoustrades = Performance.AllTrades.Count;
    }
    If( Performance.AllTrades.Count - Previoustrades >=NTrades)
    {return
    }

    But for example if I hace the same strategy running in 15 instruments and I would like that even in 10 of them the conditions to open a condition are true but I just want 3 open positions per day, is that possible?

    Thanks

    Sincerely

    #2
    Hello,

    There is no cross communication between strategy instances, so there would not be a supported method to check how many trades a strategy has taken, or to check how many positions are currently open.

    The only workaround would be to count the number of trades taken to an external file and then ask the strategy to read this file to determine how many total trades has been taken for that particular day.
    MatthewNinjaTrader Product Management

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by sjsj2732, Yesterday, 04:31 AM
    0 responses
    31 views
    0 likes
    Last Post sjsj2732  
    Started by NullPointStrategies, 03-13-2026, 05:17 AM
    0 responses
    286 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    283 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    132 views
    1 like
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    91 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Working...
    X