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

Historical Bid/Ask Volume without Tick Replay

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

    Historical Bid/Ask Volume without Tick Replay

    Hi Support,

    I am trying to verify if my data feed has historical bid/ask volume. I have used AddDataSeries with MarketDataType.Ask (as described here https://ninjatrader.com/support/foru...ng-tick-replay).

    In OnBarUpdate(), when I try to access the Ask volume using "Volumes[1][0]",or "BarsArray[1].GetVolume(0)", I get an out of bound index error. Does this mean there is no historical Ask Volume, and that data series was never populated?

    Thanks for ur help.
    -Alaa

    #2
    Hello Alaa,

    Is the CurrentBars[bar index] greater than 0? (Meaning has at least one bar for that series been processed yet?)

    Do you see the data available in the Tools -> Historical Data window on the Edit tab in the Historical section for the data type, ask and bid?

    What is the connection type you are connected to?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea,

      My data feed is Continuum. The indicator does not do anything other than printing the vol / askvol. It is a alive feed but I also have Bid/Ask/Last data downloaded and I can see it in "Historical Data"

      The first Print is fine, but he second gives out of bound index error.

      if (CurrentBar < 1)
      return;

      Print(Volumes[0][0].ToString());

      Print("Vol: " + Volumes[0][0].ToString() +
      " | Ask Vol: " + BarsArray[1].GetVolume(0).ToString() );

      Click image for larger version

Name:	image.png
Views:	249
Size:	39.6 KB
ID:	1170926
      Attached Files

      Comment


        #4
        Hello aelagha,

        If the bars index is 1 for the added series, the CurrentBars[1] must be greater than 0.

        It appears that you are checking bars index 1 while bars index 0 is processing in OnBarUpdate().

        Below is a link to the help guide on CurrentBars and BarsInProgress.

        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by love2code2trade, 04-17-2024, 01:45 PM
        4 responses
        37 views
        0 likes
        Last Post love2code2trade  
        Started by alifarahani, Today, 09:40 AM
        2 responses
        13 views
        0 likes
        Last Post alifarahani  
        Started by junkone, Today, 11:37 AM
        3 responses
        16 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by pickmyonlineclass, Today, 12:23 PM
        0 responses
        3 views
        0 likes
        Last Post pickmyonlineclass  
        Started by frankthearm, Yesterday, 09:08 AM
        12 responses
        44 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Working...
        X