• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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

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

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by uiwislth, Yesterday, 11:25 PM
        0 responses
        4 views
        0 likes
        Last Post uiwislth  
        Started by Steve L, Yesterday, 10:04 PM
        0 responses
        3 views
        0 likes
        Last Post Steve L
        by Steve L
         
        Started by marianfed, Yesterday, 09:47 PM
        0 responses
        4 views
        0 likes
        Last Post marianfed  
        Started by hir04068, Yesterday, 09:29 PM
        0 responses
        2 views
        0 likes
        Last Post hir04068  
        Started by iq200, 03-11-2018, 07:49 PM
        24 responses
        1,017 views
        0 likes
        Last Post mrlucky1x  
        Working...
        X