![]() |
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 |
|
Member
Join Date: Jan 2010
Posts: 44
Thanks: 0
Thanked 0 times in 0 posts
|
I want to code an Indicator which plots vertical bars with 3 different colors. The color of the bars would be based on the following: If the RSI and it's average are both above the RSI Bullish Level, color = (Say) Blue. If the RSI and it's average are both below the RSI Bearish Level, color = (Say) Red. If at least one of the RSI and it's average are between the Bearish Level and the Bullish Level, color = (Say) Khaki.
Is this 1 plot or 3 plots? Also, do I have to calculate the RSI Average or is that available in a variable?
Last edited by freeway; 10-28-2011 at 05:22 PM.
|
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Aug 2011
Location: Denver, CO, USA
Posts: 2,895
Thanks: 241
Thanked 375 times in 365 posts
|
Freeway,
I am happy to assist you. This is possible with only 1 bar plot. You just need to set the color of the bar whenever a certain condition is true. You can use the following line and adapt it for your use. Code:
if ( condition is true )
{
PlotColors[0][0] = Color.Red;
}
http://msdn.microsoft.com/en-us/libr...00(vs.71).aspx For more information on PlotColors, please see the link below. http://www.ninjatrader.com/support/h...plotcolors.htm By RSI average do you mean a moving average? Something like this would work. Code:
SMA(RSI(RSIPeriod,smooth),SMAperiod)[barsAgo]
Adam P.
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Indicator for Vertical TimeLine plotting | ScottieDog | ATM Strategies (Discretionary Trading) | 3 | 02-07-2011 09:36 AM |
| TPO and Volume Profile Chart vertical scroll bar | arodrigu | Version 7 Beta General Questions & Bug Reports | 2 | 03-25-2010 07:49 AM |
| Range bar vertical gaps ? | supertrader | Charting | 40 | 12-03-2009 02:38 PM |
| Possible to create vertical indicator panel? | Pepperdog | Indicator Development | 1 | 03-05-2009 05:26 AM |
| Drawing 2 Vertical Lines on Same Bar | ATLien | Indicator Development | 1 | 07-26-2008 12:02 PM |