Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnMarketData from the secondary series

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

    OnMarketData from the secondary series

    Hello! I'm trying to get current Ask and current Bid price from the secondary Series.
    I'm using OnMarketData events. How can I get current ask and bid from multi-instrument indicator/strategy?
    F.e. Main Data Series is GC 02-12 and the Secondary ic CL 01-20. I need to get current Ask and Bid from CL 01-20.

    Thank you!

    #2
    Hi YevhenShynkarenko, thanks for your note.

    The GetCurentBid and GetCurrentAsk method have overrides that have a barsinprogressindex parameter. For the primary call GetCurrentAsk(0); and for the secondary call GetCurrentAsk(1)

    Comment


      #3
      Originally posted by NinjaTrader_ChrisL View Post
      Hi YevhenShynkarenko, thanks for your note.

      The GetCurentBid and GetCurrentAsk method have overrides that have a barsinprogressindex parameter. For the primary call GetCurrentAsk(0); and for the secondary call GetCurrentAsk(1)
      Big thanks. One more question,
      How to get Unrealized Profit Loss from multi-instrument strategy? F.e. I have opened position on both instruments (GC, CL). How can I get the Unrealized PnL from GC and from CL.
      Can I do this in OnMarketData?
      Thanks!

      Comment


        #4
        Hi YevhenShynkarenko, thanks for your patience.

        The Positions object can be used for this case. See the documentation below:


        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        82 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        43 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        64 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        68 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        56 views
        0 likes
        Last Post CarlTrading  
        Working...
        X