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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        648 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        369 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        108 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        572 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        574 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X