![]() |
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 |
|
Senior Member
Join Date: Jan 2009
Posts: 333
Thanks: 0
Thanked 0 times in 0 posts
|
I am new to NT and the ninjascript.
I wanted to color the chart green if the close was greater than the close 5 bars ago and color the chart red if the close was less than the close 5 bars ago. Is this simple to do? Can it be done easily. Not sure where to get started. |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,409
Thanks: 252
Thanked 975 times in 958 posts
|
Hi rtj4201, first I would suggest you check out those tutorials on custom NinjaScript indicator coding - http://www.ninjatrader-support.com/H...verview18.html
For your idea, Tutorial 6 might be a good start. As example, this would be your OnBarUpdate portion for coloring the bars green if the Close is great than the Close 5 bars ago - Code:
if (CurrentBar < 5) return; if (Close[0] > Close[5]) BarColor = Color.Green;
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Chart properties - bar color | Lost Trader | Charting | 17 | 10-05-2012 07:18 AM |
| EMA Color not drawing on the chart | rnr123 | General Programming | 1 | 01-21-2009 03:41 PM |
| Chart default test color? | higler | Miscellaneous Support | 1 | 05-09-2008 05:44 AM |
| Color of background on chart | edgeliner | General Programming | 1 | 11-20-2007 04:32 AM |
| Chart Background Color | NinjaTrader_Josh | General Programming | 1 | 07-15-2007 03:36 PM |