Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Understanding volume value

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

    Understanding volume value

    hi everyone
    I'm new here so i am sorry if this message is not by specific format or something, please corrent me if needed.

    I'm pulling HistoricalData from IB API and i get volume value (as int) that do not match the volume i see on chart.

    Someone knows why? How can i calculate the real volume?

    thanks alot,

    #2
    Hello algotzvi,

    Thank you for your inquiry and welcome to the NinjaTrader Support Forum!

    Can you please provide the code you are using to obtain the volume from historical bars?

    What values are you getting? What values are expected?
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      explenation

      code for requesting hitstorical quotes:

      self.conn.reqHistoricalData(6,
      contract,
      datetime.now(),
      period,
      '1 min',
      'TRADES',
      True, # rth - regular trading hours
      1) # date style - 1 or 2

      sample for quote received :

      historicalData, <historicalData reqId=6, date=20151218 22:59:00, open=36.36, high=36.38, low=36.33, close=36.34, volume=2730, count=756, WAP=36.359, hasGaps=False>

      What is the number under volume? why does it different from the number I see on IB ?

      Comment


        #4
        Hello algotzvi,

        I am not clear of what you are using to obtain historical data with the code snippet you have provided me.

        Are you coding this through NinjaScript?

        To access the volume of a bar in a NinjaScript script, you would utilize the Volume collection: https://ninjatrader.com/support/help...7/?volume2.htm
        Zachary G.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        23 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        115 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        68 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        223 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        406 views
        0 likes
        Last Post CaptainJack  
        Working...
        X