View Full Version : Volume Bar Times
08-01-2007, 12:10 PM
I have written an indicator to create a bar chart of the time durations of each bar (or average over several bars) to use with volume charts (and would probably work for tick charts). This time duration would give a way to watch the speed to volume for constant volume charts.
The indicator compiles fine but nothing shows up on my charts. I think the time calculations are right, but think I am not specifiying the plot correctly.
08-01-2007, 01:07 PM
If an indicator is not working as expected, see your Log tab for errors. Looking at your code, you are accessing Time[Periods] which for sure will throw an error since you need to make sure you have enough bars on your chart.
Add something like:
if (CurrentBar < Periods)
08-01-2007, 02:02 PM
Thanks, that got it working great. I know you told me this before and it is sinking in.
08-03-2007, 06:13 AM
In response to a request, I am posting my final indicator code for the Volume Bar Times. Note that the horizontal line level is a personal choice that can be changed in the code.
It will run as named, but if renamed, all instances of the name must be changed or the code won't work.
Hope someone else finds this useful.
Richard v W.
09-04-2007, 11:22 AM
NT wants to import only zipped files of some sort, how best to get this code into my setup? I tried making a new indicator of the same name and copying/pasting and ran into troubles.
09-04-2007, 11:24 AM
Save the .cs file in the following folder:
My Documents\NinjaTrader 6\bin\custom\indicator
Then open up this file via Tools > Edit NinjaScript and compile.