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

Can Volumetric bars be added as a second data series?

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

    Can Volumetric bars be added as a second data series?

    Hi,

    The title sums up my question. I'm seeking a way to access the Volumetric metrics in an indicator that won't be applied to a Volumetric chart.

    Thanks

    #2
    Hello palinuro,

    thanks for the post.

    You will need to add a volumetric series to your chart using AddVolumetric():



    There is an example use case on the above help guide page.

    If you have never worked with multiple data series in your scripts before, please read this page of the help guide on multi-instrument and multi-timeframe scripts:



    Please let us know if we may be of any further assistance.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Thanks, that's just what I was looking for, but I couldn't find it via navigating in Help.

      Comment


        #4
        How to use GetMaxVol after using AddVolumetric() 2nd data series?

        Dear NT8 Support,

        I've a question : After I use AddVolumetric(...) to add a 2nd data series, how do I access the ordeflow info? eg. how to use GetMaximumVolume()? Note that I don't want to display the OrderFlow bartype in my chart.

        I tried : BarsArray[1][0].GetMaximumVolume(null, out price);
        but it can't compile.

        I've read your web Help:...
        NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe barsType = ChartBars.Bars.BarsSeries.BarsType as NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe;
        But this requires I've the volumetric bartype displayed in my chart.

        Thanks,
        Tiang

        Comment


          #5
          Hello Tiang,

          Thank you for the note.

          You will need to cast the BarsArray.BarsType object to a VolumetricBarsType object like they do in the help guide page:

          Code:
          		protected override void OnBarUpdate()
          		{
          
          			double price;
          			
          			
          			NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsType barsType = BarsArray[1].BarsType as NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsType;
          			if (barsType == null)
          			          return;
          			
          
                          Print("Maximum Ask: " + barsType.Volumes[0].GetMaximumVolume(true, out price) + " at price: " + price);
                          Print("Maximum Bid: " + barsType.Volumes[0].GetMaximumVolume(false, out price) + " at price: " + price);
                          Print("Maximum Combined: " + barsType.Volumes[0].GetMaximumVolume(null, out price) + " at price: " + price);
          			
          		}
          https://ninjatrader.com/support/help...tric_bars2.htm - Using Orderflow Volumetric bars in NinjaScript.

          Please let us know if you have any questions.
          Chris L.NinjaTrader Customer Service

          Comment


            #6
            I got it working following your helpful guides. Thanks Chris.

            Comment


              #7
              Hello,

              How do I use "Size Filter" property programmatically for volumetric bars? Ex - filter all contract greater than volume of 5 per tick?

              Thanks

              Comment


                #8
                Hello music_p13,

                Thanks for the post.

                I was not able to find any Size Filter parameter in the Volumetric bars object. One could add logic to their script to ignore any values below some number X with an conditional statement.

                A quick example:

                Code:
                double val = barsType.Volumes[CurrentBar].GetBidVolumeForPrice(Close[0]);
                			
                			val = (val > 5) ? val : 0;
                			Print(val);
                Please let me know if you have any questions.
                Chris L.NinjaTrader Customer Service

                Comment


                  #9
                  I thinks all it will do is it will provide volume in the Bid/Ask greater than certain value (if I look at historical bar).

                  It might work if I use it on each tick and save each value into some kind of array...

                  Can this be added as a feature when adding Volumetric Series as additional series and to supply "Filter Size" property when adding this series (maybe in a new release of NinjaTrader) in order to completely emulate chart functionality...

                  Also another great addition would be to add imbalance highlighted value as seen on Volumetric chart.

                  Thanks

                  Comment


                    #10
                    Hello music_p13,

                    I have created a feature request for a Size Filter overload for AddVolumetric(). The ticket ID is SFT-3585.

                    I have created another feature request to track interest behind having Show imbalances accessible through the Volumetric Data Access methods. I also noted adding appropriate AddVolumetric() overloads so this could be configured programmatically. The ID is SFT-3586

                    We collect interest in feature requests before determining if the feature should be implemented. For that reason we cannot offer an ETA or promise of fulfillment. Upon implementation, the number for the ticket ID can be publicly found in the Release Notes page of the help guide. I will provide a link below.

                    Release Notes - https://ninjatrader.com/support/help...ease_notes.htm

                    Please let us know if there is anything else we can do to help.
                    JimNinjaTrader Customer Service

                    Comment


                      #11
                      I followed the instructions above, and i create the indicator aa2
                      when i want to attach an a graph it doesn't ppear in the list of indicators
                      why?
                      no errors appear when compiled aa2.cs

                      Please help

                      Comment


                        #12
                        Hello xg5463,

                        The Name property in the indicator is "BarsRenderTest." This will be the name listed in the Indicators window.

                        Please let me know if you have any additional questions.
                        JimNinjaTrader Customer Service

                        Comment


                          #13
                          Hello,

                          when adding volumetric as additional dataseries is there always to include the instrument in the syntax (and not as "usually" only bartype...)? when using for differnt instruments one need to have then for every instrument a proper script when using volumetrics as add series.

                          ??

                          Thank you!
                          Tony

                          Comment


                            #14
                            Hello tonynt,

                            If you use null as the instrument name, the primary data series will be used for the instrument.

                            Please let us know if we can be of further assistance.
                            JimNinjaTrader Customer Service

                            Comment


                              #15
                              Hello,

                              thank you for your reply. When I add volumetric as add dataseries I have in the code

                              NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe barsType = BarsArray[1].BarsType as NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe;

                              to work with in the code eg like if(barsType.Volumes[CurrentBar].GetBidVolumeForPrice(Low[0])....

                              But how does one have to do when volumetric is needed for 3 added dataseries (or primary and 2 added dataseries) please?

                              Thank you!
                              Tony
                              Last edited by tonynt; 01-13-2019, 02:25 PM. Reason: typing error

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by PhillT, Today, 02:16 PM
                              2 responses
                              3 views
                              0 likes
                              Last Post PhillT
                              by PhillT
                               
                              Started by Kaledus, Today, 01:29 PM
                              3 responses
                              9 views
                              0 likes
                              Last Post NinjaTrader_Jesse  
                              Started by frankthearm, Yesterday, 09:08 AM
                              14 responses
                              47 views
                              0 likes
                              Last Post NinjaTrader_Clayton  
                              Started by gentlebenthebear, Today, 01:30 AM
                              2 responses
                              14 views
                              0 likes
                              Last Post gentlebenthebear  
                              Started by PaulMohn, Today, 12:36 PM
                              2 responses
                              17 views
                              0 likes
                              Last Post PaulMohn  
                              Working...
                              X