Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

MarketPosition with multi-instrument strategy

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

    MarketPosition with multi-instrument strategy

    Hi,

    I have a strategy that I'm running fine, but I just added multi-instrument to it. I'm running the strategy on the ES chart. When I do a check of MarketPosition, and I'm flat on ES but long AAPL for example, I get a reading of MarketPosition being flat.

    I'm sure this is an easy fix, but I couldn't find it in the documentation. How do I check the MarketPosition of AAPL (assuming it is my 2nd instrument and ES is my first)?

    Thanks,

    Rich

    #2
    Hello Rich,

    You use Positions[x] , where x is the series index.

    if (Positions[1].MarketPosition == MarketPosition.Long)
    Print(Positions[1].MarketPosition.ToString());
    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    72 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    44 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    25 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    29 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    60 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X