Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    Paul H.NinjaTrader Customer Service

    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 AaronKoRn, Today, 09:49 PM
        0 responses
        11 views
        0 likes
        Last Post AaronKoRn  
        Started by carnitron, Today, 08:42 PM
        0 responses
        10 views
        0 likes
        Last Post carnitron  
        Started by strategist007, Today, 07:51 PM
        0 responses
        11 views
        0 likes
        Last Post strategist007  
        Started by StockTrader88, 03-06-2021, 08:58 AM
        44 responses
        3,980 views
        3 likes
        Last Post jhudas88  
        Started by rbeckmann05, Today, 06:48 PM
        0 responses
        9 views
        0 likes
        Last Post rbeckmann05  
        Working...
        X