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

getting open positions

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

    getting open positions

    We are finishing up a strategy and are coding position sizing based on Kelly Formula. In our calculations we would also like to use in the formula "number of current open positions" , Is there a function to get the open positions? We are using IB. Thanks for any help.

    #2
    Hello,

    There is not a supported function to get all open positions on all instruments.

    Each strategy instances will only be aware of the positions on that strategy. There is no cross communication between strategy instances and there is no way to read the position directly from another strategy.
    MatthewNinjaTrader Product Management

    Comment


      #3
      So is there no function to get portfolio? All in the same strategy.

      Comment


        #4
        Hello spiv1,

        Could you clarify what values you are looking for when you are referring to portfolio?

        Happy to be of further assistance.
        JCNinjaTrader Customer Service

        Comment


          #5
          We have studied extensively over our backtesting the amount of concurrent positions open in order to determine ASR (account size required) for each strategy so we have decided to incorporate the same logic in to our position sizing algo. So we simply need a count of open positions at the time a new signal is triggered. The position values like P&L, share quantity, etc etc is not relevant for the calculation. We just need to know the quantity of open positions. Thanks.

          Comment


            #6
            Hello,

            If this is all from the same strategy instance, you can get it using a Position object.

            Please see our Help Guide on these objects for more information:



            As long as you have one strategy instance that is opening positions on these instrument, you can obtain the information. If you have separate instances running on different instruments, the position information cannot be shared.
            MatthewNinjaTrader Product Management

            Comment


              #7
              Yes. All from the same instance. Excellent. We will look at this right away. Thanks!!

              Comment


                #8
                Hello,

                I was having the same problem with the lack of inter-strategy communication that NinjaTrader offers. So, we went out of the bos to create a small algorithm to workaround this issue. Please read this article:



                Feel free to contact us if you need this implemented in your strategies.

                Thanks
                Umer

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by mmenigma, Today, 02:22 PM
                1 response
                3 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by frankthearm, Today, 09:08 AM
                9 responses
                35 views
                0 likes
                Last Post NinjaTrader_Clayton  
                Started by NRITV, Today, 01:15 PM
                2 responses
                9 views
                0 likes
                Last Post NRITV
                by NRITV
                 
                Started by maybeimnotrader, Yesterday, 05:46 PM
                5 responses
                26 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by quantismo, Yesterday, 05:13 PM
                2 responses
                21 views
                0 likes
                Last Post quantismo  
                Working...
                X