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

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 Option Whisperer, Today, 09:55 AM
        1 response
        11 views
        0 likes
        Last Post bltdavid  
        Started by port119, Today, 02:43 PM
        0 responses
        1 view
        0 likes
        Last Post port119
        by port119
         
        Started by Philippe56140, Today, 02:35 PM
        0 responses
        3 views
        0 likes
        Last Post Philippe56140  
        Started by 00nevest, Today, 02:27 PM
        0 responses
        2 views
        0 likes
        Last Post 00nevest  
        Started by Jonafare, 12-06-2012, 03:48 PM
        5 responses
        3,986 views
        0 likes
        Last Post rene69851  
        Working...
        X