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 DJ888, Today, 10:57 PM
        0 responses
        1 view
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by MacDad, 02-25-2024, 11:48 PM
        7 responses
        158 views
        0 likes
        Last Post loganjarosz123  
        Started by Belfortbucks, Today, 09:29 PM
        0 responses
        7 views
        0 likes
        Last Post Belfortbucks  
        Started by zstheorist, Today, 07:52 PM
        0 responses
        7 views
        0 likes
        Last Post zstheorist  
        Started by pmachiraju, 11-01-2023, 04:46 AM
        8 responses
        151 views
        0 likes
        Last Post rehmans
        by rehmans
         
        Working...
        X