NinjaTrader Support Forum  
X

Attention!

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


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Indicator Development

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

Reply
 
Thread Tools Display Modes
Old 10-28-2011, 05:09 PM   #1
freeway
Member
 
Join Date: Jan 2010
Posts: 44
Thanks: 0
Thanked 0 times in 0 posts
Default Vertical Bar Indicator

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.
freeway is offline  
Reply With Quote
Old 10-29-2011, 10:08 AM   #2
NinjaTrader_AdamP
NinjaTrader Customer Service
 
NinjaTrader_AdamP's Avatar
 
Join Date: Aug 2011
Location: Denver, CO, USA
Posts: 2,895
Thanks: 241
Thanked 375 times in 365 posts
Default Changing colors and RSI Average

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;
}
For more information on colors, please see the following link.

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]
Please let me know if I may assist further.
NinjaTrader_AdamP 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
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


All times are GMT -6. The time now is 04:22 PM.