Go Back   NinjaTrader Support Forum > NinjaTrader 8 > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

NinjaTrader
Reply
 
Thread Tools Display Modes
Old 03-29-2018, 09:08 AM   #1
palinuro
Senior Member
 
Join Date: Dec 2007
Posts: 205
Thanks: 18
Thanked 14 times in 11 posts
Default 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
palinuro is offline  
Reply With Quote
Old 03-29-2018, 09:19 AM   #2
NinjaTrader_ChrisL
NinjaTrader Customer Service
 
NinjaTrader_ChrisL's Avatar
 
Join Date: Apr 2017
Location: Denver, CO
Posts: 931
Thanks: 23
Thanked 183 times in 179 posts
Default

Hello palinuro,

thanks for the post.

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

https://ninjatrader.com/support/help...volumetric.htm

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:

https://ninjatrader.com/support/help...nstruments.htm

Please let us know if we may be of any further assistance.
NinjaTrader_ChrisL is offline  
Reply With Quote
Old 03-29-2018, 09:37 AM   #3
palinuro
Senior Member
 
Join Date: Dec 2007
Posts: 205
Thanks: 18
Thanked 14 times in 11 posts
Default

Thanks, that's just what I was looking for, but I couldn't find it via navigating in Help.
palinuro is offline  
Reply With Quote
Old 04-24-2018, 04:05 AM   #4
Tiang
Junior Member
 
Join Date: Mar 2009
Location: Singapore
Posts: 23
Thanks: 0
Thanked 0 times in 0 posts
Default 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
Tiang is offline  
Reply With Quote
Old 04-24-2018, 08:29 AM   #5
NinjaTrader_ChrisL
NinjaTrader Customer Service
 
NinjaTrader_ChrisL's Avatar
 
Join Date: Apr 2017
Location: Denver, CO
Posts: 931
Thanks: 23
Thanked 183 times in 179 posts
Default

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.
NinjaTrader_ChrisL is offline  
Reply With Quote
Old 04-25-2018, 03:00 AM   #6
Tiang
Junior Member
 
Join Date: Mar 2009
Location: Singapore
Posts: 23
Thanks: 0
Thanked 0 times in 0 posts
Default

I got it working following your helpful guides. Thanks Chris.
Tiang is offline  
Reply With Quote
Old 07-05-2018, 12:32 PM   #7
music_p13
Senior Member
 
Join Date: Jan 2010
Posts: 154
Thanks: 25
Thanked 7 times in 7 posts
Default

Hello,

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

Thanks
music_p13 is offline  
Reply With Quote
Old 07-05-2018, 01:27 PM   #8
NinjaTrader_ChrisL
NinjaTrader Customer Service
 
NinjaTrader_ChrisL's Avatar
 
Join Date: Apr 2017
Location: Denver, CO
Posts: 931
Thanks: 23
Thanked 183 times in 179 posts
Default

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.
NinjaTrader_ChrisL is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing additional data series into added indicator AuroraAustralis Strategy Development 1 11-01-2017 06:39 AM
Indicator with added data series on Dom. JerryWar Indicator Development 9 09-11-2017 05:19 PM
Can strategy access dynamic data-series (not added before)? misova Version 8 Beta 4 11-05-2015 09:18 PM
Controlling the start time of bars for data series added PolarBear Strategy Development 5 01-19-2012 05:06 AM
No data for first second on added time series gomifromparis General Development 13 05-23-2011 03:02 AM


All times are GMT -6. The time now is 03:16 AM.

Futures, foreign currency and options trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Risk capital is money that can be lost without jeopardizing ones financial security or lifestyle. Only risk capital should be used for trading and only those with sufficient risk capital should consider trading. Past performance is not necessarily indicative of future results. View Full Risk Disclosure.

CFTC Rules 4.41 - Hypothetical or Simulated performance results have certain limitations, unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, such as lack of liquidity. Simulated trading programs in general are also subject to the fact that they are designed with the benefit of hindsight. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.

This website is hosted and operated by NinjaTrader, LLC (“NT”), a software development company which owns and supports all proprietary technology relating to and including the NinjaTrader trading platform. NT is an affiliated company to NinjaTrader Brokerage (“NTB”), which is a NFA registered introducing broker (NFA #0339976) providing brokerage services to traders of futures and foreign exchange products. This website is intended for educational and informational purposes only and should not be viewed as a solicitation or recommendation of any product, service or trading strategy. No offer or solicitation to buy or sell securities, securities derivative or futures products of any kind, or any type of trading or investment advice, recommendation or strategy, is made, given, or in any manner endorsed by any NT affiliate and the information made available on this Web site is not an offer or solicitation of any kind. Specific questions related to a brokerage account should be sent to your broker directly. The content and opinions expressed on this website are those of the authors and do not necessarily reflect the official policy or position of NT or any of its affiliates. 

Vendors along with their websites, products and services, collectively referred to as (“Vendor Content”), are independent persons or companies that are in no manner affiliated with NT or any if its affiliates. NT or any of its affiliates are not responsible for, do not approve, recommend or endorse any Vendor Content referenced on this website and it’s your sole responsibility to evaluate Vendor Content. Please be aware that any performance information provided by a vendor should be considered hypothetical and must contain the disclosures required by NFA Rule 2-29(c). If you are interested in learning more about, or investigating the quality of, any such Vendor Content you must contact the vendor, provider or seller of such Vendor Content. No person employed by, or associated with, NT or any of its affiliates is authorized to provide any information about any such Vendor Content.