Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Market Order Bid Volume

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

    Market Order Bid Volume

    I am trying to create a custom indicator that needs the Market Order Bid Volume on the current bar and the previous bar. I was hoping to have data that duplicated the data produced by the “BuySellVolume” indicator. I have tried two different things to accomplish my goal. I have described the two efforts below. Can you recommend a better solution or perhaps a fix to my attempts?

    Effort #1
    I initially tried using:
    MOBidVolume = GetCurrentBidVolume(1)

    The code compiles but when I use the indicator, inside a chart, I get a “run time” error because the method apparently wants the value passed to them to be 0. The “run time” error says, ”Error on calling’OnBarUpdate’ method on bar 1: ‘GetCurrentBidVolume’: ‘barsSeriesIndex’must be between 0 and 0 but was 1

    Effort #2
    Use the code contained in the “BuySellVolume” indicator. The problem here is “Sells” and “Buys” variables appear to be declared as a Custom.Resource so I get a compile error.

    Do you have an easier approach?

    #2
    Hello goodknight777,

    Thanks for your post.

    We have moved this threadto the Indicator Development forum as the question pertains to Indicator Development, and not necessarily finding a pre-built indicator.

    GetCurrentBidVolume would get the volume of the most recent bid from, straight from the Level 1 feed, it would not be associated with a bar on a chart.

    I would recommend adding the BuySellVolume indicator to your hosting script or using its calculation in your own script.

    NinjaTrader.Custom.Resource.BuySellVolumeBuys and NinjaTrader.Custom.Resource.BuySellVolumeSells are just strings. Custom.Resource is used in many of our open source indicators so the text/strings can be converted to multi lingual strings depending on the language of the platform.

    In other words, you could replace NinjaTrader.Custom.Resource.BuySellVolumeBuy with "Buys" and NinjaTrader.Custom.Resource.BuySellVolumeSells with "Sells" and the indicator will compile without issue.

    We look forward to assisting.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    129 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    74 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    117 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    111 views
    1 like
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    89 views
    0 likes
    Last Post CarlTrading  
    Working...
    X