![]() |
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Jul 2007
Posts: 93
Thanks: 0
Thanked 0 times in 0 posts
|
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. Please help. |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
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) return;
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Member
Join Date: Jul 2007
Posts: 93
Thanks: 0
Thanked 0 times in 0 posts
|
Thanks, that got it working great. I know you told me this before and it is sinking in.
|
|
|
|
|
|
#4 |
|
Member
Join Date: Jul 2007
Posts: 93
Thanks: 0
Thanked 0 times in 0 posts
|
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. |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Jun 2007
Posts: 151
Thanks: 0
Thanked 0 times in 0 posts
|
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.
|
|
|
|
|
|
#6 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
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.
Ray
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Times & Sales | NinjaTrader_Josh | Suggestions And Feedback | 1 | 07-19-2007 06:11 AM |
| plotting pit times | knightrider123 | Charting | 1 | 06-26-2007 07:04 AM |
| Trading Times | latkinso | Automated Trading | 1 | 06-15-2007 12:23 PM |
| two symbols have different bar times | Folls | Strategy Development | 4 | 05-17-2007 06:42 AM |
| Start & end times for FOREX | bmaltz | Charting | 3 | 05-02-2007 04:50 PM |