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 Learner Trader, Today, 01:49 AM
    0 responses
    1 view
    0 likes
    Last Post Learner Trader  
    Started by alcorr247, Yesterday, 09:53 PM
    1 response
    37 views
    0 likes
    Last Post NinjaTrader_ChrisSch  
    Started by traderslab, Yesterday, 10:27 PM
    0 responses
    35 views
    0 likes
    Last Post traderslab  
    Started by jjanguda, Yesterday, 09:40 PM
    1 response
    41 views
    0 likes
    Last Post NinjaTrader_ChrisSch  
    Started by jeronymite, Yesterday, 07:15 PM
    0 responses
    60 views
    0 likes
    Last Post jeronymite  
    Working...
    X