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 CarlTrading, Yesterday, 09:41 PM
    1 response
    29 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, Today, 02:41 AM
    0 responses
    12 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, Yesterday, 11:44 PM
    0 responses
    21 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    38 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    34 views
    0 likes
    Last Post CarlTrading  
    Working...
    X