• 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 quinton77, Today, 04:46 AM
        0 responses
        2 views
        0 likes
        Last Post quinton77  
        Started by quinton77, Today, 04:36 AM
        0 responses
        5 views
        0 likes
        Last Post quinton77  
        Started by Globus000, Today, 04:36 AM
        0 responses
        2 views
        0 likes
        Last Post Globus000  
        Started by shaista parveen, Today, 02:52 AM
        0 responses
        5 views
        0 likes
        Last Post shaista parveen  
        Started by rimallz, Today, 02:26 AM
        0 responses
        11 views
        0 likes
        Last Post rimallz
        by rimallz
         
        Working...
        X