Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Access list of open positions in strategy?

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

    Access list of open positions in strategy?

    I am attempting to implement an anti-correlation logic in my strategy. Is it possible to somehow access all open trades in NinjaTrader? For instance if I have an open EUR/USD trade on another chart I would like to be able to know in a separate instance/chart of my strategy. I am aware that I could use some static list of some kind but would prefer to dip into the NinjaTrader open position list instead.

    Any input welcome

    #2
    Hello molecool,

    There is some unsupported code that can do this that you may try. Here is a the post with a code snippet.


    Let us know if we can be of further assistance.
    JCNinjaTrader Customer Service

    Comment


      #3
      Cool!

      This seems to work - cool. Follow up question - can I query the current account set in my running strategy?

      Comment


        #4
        Originally posted by molecool View Post
        This seems to work - cool. Follow up question - can I query the current account set in my running strategy?
        It is right there in the foreach loop: pos.Account.Name

        Comment


          #5
          Originally posted by koganam View Post
          It is right there in the foreach loop: pos.Account.Name
          No you misunderstand - not the strategies I'm querying but the one I'm running. I want to know the account name used in the strategy I am running right now. NOT all the others.

          Comment


            #6
            Account.Name should be just giving you that molecool, at least experience in my scripts.

            Comment


              #7
              Vielen Dank Bertrand - wusste nicht daß der Parameter global erhältlich war.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by CarlTrading, 03-31-2026, 09:41 PM
              1 response
              63 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by CarlTrading, 04-01-2026, 02:41 AM
              0 responses
              35 views
              0 likes
              Last Post CarlTrading  
              Started by CaptainJack, 03-31-2026, 11:44 PM
              0 responses
              54 views
              1 like
              Last Post CaptainJack  
              Started by CarlTrading, 03-30-2026, 11:51 AM
              0 responses
              61 views
              0 likes
              Last Post CarlTrading  
              Started by CarlTrading, 03-30-2026, 11:48 AM
              0 responses
              48 views
              0 likes
              Last Post CarlTrading  
              Working...
              X