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 02-15-2012, 03:38 PM   #1
DenMan
Member
 
Join Date: Aug 2011
Posts: 52
Thanks: 13
Thanked 0 times in 0 posts
Default Drawing Hollow Candlesticks

I would like to create an indicator whose sole function is to draw hollow candlesticks that are outlined with green for up-bars, and outlined with red for down-bars. This seems so simple, yet I canít seem to get it to work, for the bar colors set by the Data Series donít get changed. Can you help me get on track?
DenMan is offline  
Reply With Quote
Old 02-15-2012, 03:52 PM   #2
NinjaTrader_Joydeep
NinjaTrader Customer Service
 
NinjaTrader_Joydeep's Avatar
 
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 553 times in 545 posts
Default

Hello DenMan,
Thanks for writing in and I am happy to assist you.
Please try the following code
Code:
if (Close[0] >= Open[0])
	CandleOutlineColorSeries[0] = Color.Green;
else CandleOutlineColorSeries[0] = Color.Red;
				
BarColorSeries[0] = Color.Transparent;
http://www.ninjatrader.com/support/h...olorseries.htm
http://www.ninjatrader.com/support/h...olorseries.htm

Please let me know if I can assist you any further.
NinjaTrader_Joydeep is offline  
Reply With Quote
The following 2 users say thank you to NinjaTrader_Joydeep for this post:
Old 02-15-2012, 04:09 PM   #3
DenMan
Member
 
Join Date: Aug 2011
Posts: 52
Thanks: 13
Thanked 0 times in 0 posts
Default

Your solution worked great. Thanks for the simple solution!
DenMan is offline  
Reply With Quote
Old 02-15-2012, 04:12 PM   #4
NinjaTrader_Joydeep
NinjaTrader Customer Service
 
NinjaTrader_Joydeep's Avatar
 
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 553 times in 545 posts
Default

Hello DenMan,
Glad it worked for you.
Please let me know if I can assist you any further.
NinjaTrader_Joydeep is offline  
Reply With Quote
Old 02-24-2012, 08:08 AM   #5
DenMan
Member
 
Join Date: Aug 2011
Posts: 52
Thanks: 13
Thanked 0 times in 0 posts
Default Color Bars Indicator

One further question. When I include this indicator in my workspace, it puts it in a new panel. Is there code to always include this in the Data Series panel, or do I have to manually change that when the indicator is included?
DenMan is offline  
Reply With Quote
Old 02-24-2012, 08:18 AM   #6
koganam
Senior Member
 
Join Date: Feb 2008
Location: http://omegasigmaindicators.com
Posts: 4,839
Thanks: 31
Thanked 2,014 times in 1,647 posts
Send a message via Skype™ to koganam
Default

Quote:
Originally Posted by DenMan View Post
One further question. When I include this indicator in my workspace, it puts it in a new panel. Is there code to always include this in the Data Series panel, or do I have to manually change that when the indicator is included?
Overlay = true;

ref: http://www.ninjatrader.com/support/h...ml?overlay.htm
koganam is offline  
Reply With Quote
The following user says thank you to koganam for this post:
Old 02-24-2012, 08:25 AM   #7
NinjaTrader_Joydeep
NinjaTrader Customer Service
 
NinjaTrader_Joydeep's Avatar
 
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 553 times in 545 posts
Default

Hello,
Thanks koganam for the code snippet.

DenMan you can use the code as suggested by koganam.

Please let me know if I can assist you any further.
NinjaTrader_Joydeep 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
candlesticks playafh69 Charting 7 04-14-2010 12:56 PM
candlesticks kaywai Charting 1 12-18-2009 08:50 AM
Hollow Renko Bars aslane Version 7 Beta General Questions & Bug Reports 8 11-26-2009 07:56 AM
candlesticks starrynight Miscellaneous Support 2 11-24-2008 07:45 AM
Drawing Candlesticks? moflaherty General Programming 3 08-23-2007 05:23 AM


All times are GMT -6. The time now is 05:34 PM.

FULL RISK DISCLOSURE: Futures trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Risk capital is money that can be lost without jeopardizing ones financial security or lifestyle. Only risk capital should be used for trading and only those with sufficient risk capital should consider trading. Past performance is not necessarily indicative of future results. View Full Risk Disclosure.