Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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)
    Chris L.NinjaTrader Customer Service

    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:


        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by terofs, Yesterday, 04:18 PM
        1 response
        21 views
        0 likes
        Last Post terofs
        by terofs
         
        Started by CommonWhale, Today, 09:55 AM
        1 response
        3 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by Gerik, Today, 09:40 AM
        2 responses
        7 views
        0 likes
        Last Post Gerik
        by Gerik
         
        Started by RookieTrader, Today, 09:37 AM
        2 responses
        12 views
        0 likes
        Last Post RookieTrader  
        Started by alifarahani, Today, 09:40 AM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X