• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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)
    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:

        https://ninjatrader.com/support/help...?positions.htm
        Chris L.NinjaTrader Customer Service

        Comment

        • Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by halozone, Today, 08:33 AM
          0 responses
          4 views
          0 likes
          Last Post halozone  
          Started by persoguillermo, Yesterday, 04:38 PM
          1 response
          16 views
          0 likes
          Last Post NinjaTrader_Marco  
          Started by algunion, Today, 03:56 AM
          0 responses
          36 views
          0 likes
          Last Post algunion  
          Started by memonolog, Today, 03:22 AM
          0 responses
          13 views
          0 likes
          Last Post memonolog  
          Started by keansound, Today, 01:21 AM
          1 response
          19 views
          0 likes
          Last Post NinjaTrader_Marco  
          Working...
          X