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

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.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by algospoke, Yesterday, 06:40 PM
    2 responses
    19 views
    0 likes
    Last Post algospoke  
    Started by ghoul, Today, 06:02 PM
    3 responses
    14 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by jeronymite, 04-12-2024, 04:26 PM
    3 responses
    45 views
    0 likes
    Last Post jeronymite  
    Started by Barry Milan, Yesterday, 10:35 PM
    7 responses
    20 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by AttiM, 02-14-2024, 05:20 PM
    10 responses
    181 views
    0 likes
    Last Post jeronymite  
    Working...
    X