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 SalmaTrader, 07-07-2026, 10:26 PM
              0 responses
              47 views
              0 likes
              Last Post SalmaTrader  
              Started by CarlTrading, 07-05-2026, 01:16 PM
              0 responses
              22 views
              0 likes
              Last Post CarlTrading  
              Started by CaptainJack, 06-17-2026, 10:32 AM
              0 responses
              15 views
              0 likes
              Last Post CaptainJack  
              Started by kinfxhk, 06-17-2026, 04:15 AM
              0 responses
              21 views
              0 likes
              Last Post kinfxhk
              by kinfxhk
               
              Started by kinfxhk, 06-17-2026, 04:06 AM
              0 responses
              23 views
              0 likes
              Last Post kinfxhk
              by kinfxhk
               
              Working...
              X