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

Access other instruments' contract volume from one indicator

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

    Access other instruments' contract volume from one indicator

    Hey!
    I'm trying to access the real time daily volume of other contracts and instruments from one indicator. For example, I want to have the indicator on the current CL contract and pull the real time daily volume for other instruments and contracts, such as the next month or two for the current instrument or whatever else. I see that I can easily get the current instrument's daily volume by the following:

    Code:
    Instrument.MarketData.DailyVolume.Volume
    However, I don't see how to do this for other instruments.
    Thank you!
    Paul

    #2
    Hello Paul,

    Thank you for your note.

    This is fundamental data that is provided from OnFundamentalData().


    Each instrument added with AddDataSeries() will trigger OnFundamentalData().
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hey Chelsea,

      Thank you for your response. It looks like I would have to add the data series manually though? It says not to dynamically add dataseries objects. This would seem to eliminate the possibility of finding the daily volume of the following month's contract of the main instrument, correct? So if I was trading CL 03-19 I couldn't easily monitor the daily volume of CL 04-19 and without changing any code, if I loaded a chart of CL 04-19 it would monitor the daily volume of CL 05-19?

      Thank you!
      Paul

      Comment


        #4
        Hello Paul,

        You are correct, you cannot dynamically add series. This would need to be hard coded in the script.

        You could instead use the Addon approach with a BarsRequest and assign a handler method to the fundamentalData.Update event.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thank you Chelsea! When I get to that point, I'll try this approach to see if it works.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by michi08, 10-05-2018, 09:31 AM
          3 responses
          740 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by sightcareclickhere, Today, 01:55 PM
          0 responses
          1 view
          0 likes
          Last Post sightcareclickhere  
          Started by Mindset, 05-06-2023, 09:03 PM
          9 responses
          258 views
          0 likes
          Last Post ender_wiggum  
          Started by Mizzouman1, Today, 07:35 AM
          4 responses
          18 views
          0 likes
          Last Post Mizzouman1  
          Started by philmg, Today, 01:17 PM
          1 response
          9 views
          0 likes
          Last Post NinjaTrader_ChristopherJ  
          Working...
          X