Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Volumetrics Logic

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

    Volumetrics Logic

    Hello,

    when using volumetric dataseries with "NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsT ype barsType = BarsArray[1].BarsType as NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe;" how is the correct logic then please
    a.) barsType.Volumes[CurrentBar].GetBidVolumeForPrice(Low[0])...
    or
    b.) barsType.Volumes[CurrentBar].GetBidVolumeForPrice(Lows[0][0])

    As we do assign in first line to barsType I assume it can be both(?). Because if we would have a 2nd volumetric dataseries then it would be
    a.) barsType2.Volumes[CurrentBar].GetBidVolumeForPrice(Low[0])...
    or
    b.) barsType2.Volumes[CurrentBar].GetBidVolumeForPrice(Lows[0][0])

    Yes/No?

    I´m experiencing error messages concering onbarupdate. so I want to exclude this here

    Thank you!
    Tony

    #2
    Hello tonynt,

    Thanks for your post.

    GetBidVolumeForPrice is expecting a price associated with that bar as input. As the NinjaScript is Multi Time Frame, I would suggest to explicitly use the Multi Time Frame price references for that particular data series. For example, if the Volumetric bars are added as BarsArray[1], its explicit reference would be Closes[1][0] for its current Close value. I also suggest ensure that you are using BarsInProgress checks to ensure that you OnBarUpdate logic is happening on the data series you want that logic to process on.

    An important guide for making references to the appropriate Price Series and for restricting logic to a specific data series in a Multi Time Frame script can be found below.

    Multi Time Frame and Instruments (Important Read!) - https://ninjatrader.com/support/help...nstruments.htm

    Building off of this advise, I may suggest to place your code in a test script to narrow down error messages coming from OnBarUpdate without the other code complicating the matter. If you have reduced the code to a small test case and it is not clear what the issue is, we may be able to comment further or can give advice to break the issue down even more.

    I look forward to being of further assistance.
    Last edited by NinjaTrader_Jim; 03-18-2019, 02:57 PM.

    Comment


      #3
      Hello Jim,

      thank you for your reply. I´m working for years with multi-time frame and I know about accessing with "normal" dataseries. But I´m not 100% sure with volumetric.

      I posted the 2 lines to get an accurate reply about the logic for volumetric bars that might be different maybe because we are referencing already with barsType/barsType1/barsType2.

      Can you please confirm if your "Close[1][0]" is for volumetric in my example "barsType.Volumes[CurrentBar].GetBidVolumeForPrice(Lows[1][0])"?

      Thank you!
      Tony

      Comment


        #4
        Hello tonynt,

        Closes[1][0] or Lows[1][0] should be used for "barsType.Volumes[CurrentBar].GetBidVolumeForPrice(PRICE)" if this Volumetric data series is added to the script as BarsArray[1]. Please also make sure that the CurrentBars[1] (the bar indexes for the added data series) has enough bars available before referencing that Price Series.

        I look forward to being of further assistance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        50 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        126 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        69 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        42 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        46 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X