Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

# open positions

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

    # open positions

    I am looking for a command to tell me the total number of open positions for a multi insrument strategy.
    Can you please help?

    #2
    Hello PaulZ,

    Thanks for your post.

    In a multi-Instrument strategy you can use Positions - Holds an array of Position objects that represent positions managed by the strategy. http://ninjatrader.com/support/helpG...?positions.htm

    While this won't give you directly the number of open positions, you can use a for loop to cycle through the array of Positions and test if each instrument is not flat and increment a counter variable.

    Comment


      #3
      Dear NinjaTrader_Paul,

      I understand your reponse, but this has number of serious drawbacks:
      - I need to run a loop through all my Positions (up to hundreds of stocks) each time I want to check the number of open trades. This eats CPU cpacity.
      - I can only check if the market position of an instrument is flat. I cannot identify if multiple orders have been placed for an instrument, so I do dot get a correct response to my question how many orders are open. Only for how many instruments orders have been placed.

      Is there really no simpler and more efficient way to know how many orders have been entered and not yet closed?
      E.g. The sytem knows the number of entries that are open at any point in time as this is checked against EntriesPerDirection before a new trade is entered. What is the parameter with which the system is tracking this and how can this parameter be captured?

      Comment


        #4
        Hello PaulZ,

        Thank you for your response.

        There would not be a means to do this without manually tracking the orders and positions with your own counter or by looping through the collection provided in NinjaScript.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        66 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        149 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        162 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        99 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        286 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X