![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Oct 2007
Posts: 22
Thanks: 0
Thanked 0 times in 0 posts
|
Hi,
I wanted to code an indicator which changes the color of the volume bars based on criteria derived from the range / volume of each bar. e.g. Value2 = Volume *Range; If Value2 = Highest(Value2,20) then BarColor = ClimaxColor; BTW - This is taken from http://emini-watch.com/free-stuff/volume-indicator/ However when I try to program this in NT I can't get the Highest value of Volume * Range to compare to the current value as a result of a problem parsing the Value3 to the MAX() function. EG: double Value3 = Volume[0] * Range()[0]; if (CurrentBar < 1) // First bar? { // Yes. Values[0].Set(Volume[0]); // Plot it as an "equal" volume. return; // Done. } if (Value3[0] == MAX(Value3,20)[0]) Values[2].Set(Volume[0]); // Yes. Plot it as an "Churn" volume. else Values[0].Set(Volume[0]); // Yes. Plot it as an "equal" volume. } } Can anyone help? Thanks. TiP2012 |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
I suggest debugging your indicator as per here: http://www.ninjatrader-support.com/v...ead.php?t=3418
Dierk
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Oct 2007
Posts: 22
Thanks: 0
Thanked 0 times in 0 posts
|
OK - Found the problem and I am almost there...
One question though, how can I create an If() statement which contains two conditions, e.g.: if ((V2MAX == Value2[0]) && (V3MAX == Value3[0])) Values[4].Set(Volume[0]); Using "&&" doesn't seem to work. Sorry for the really basic question, my programming experience is somewhat limited as you can tell although growing every day. Thanks. |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Oct 2007
Posts: 22
Thanks: 0
Thanked 0 times in 0 posts
|
Cancel that, I see it was a problem with the plot order.
|
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Jul 2007
Posts: 176
Thanks: 0
Thanked 0 times in 0 posts
|
Hello,
I think someone is working on this already. Its called "Better Volume Beta" See this link: http://www.ninjatrader-support.com/v...ead.php?t=7457 |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Oct 2007
Posts: 22
Thanks: 0
Thanked 0 times in 0 posts
|
Thanks Dwalls, I found the other persons code and it is indeed the same thing.
TiP2012 |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Time histogram for tic, volume or range charts | dwalls | NinjaScript File Sharing Discussion | 13 | 11-13-2008 09:27 AM |
| Volume Color | NinjaTrader_Josh | NinjaScript File Sharing Discussion | 6 | 12-19-2007 08:36 AM |
| Problems testing for zero volume on range charts | zoltran | General Programming | 14 | 12-04-2007 12:59 PM |
| Some Range Bars have zero volume | scjohn | Historical NinjaTrader 6.5 Beta Threads | 5 | 11-09-2007 09:31 AM |
| Volume Bars color-coded according to Price change | Lost Trader | Indicator Development | 6 | 10-23-2007 11:15 PM |