![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Sunday May 26th at 12PM 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: Jul 2007
Posts: 176
Thanks: 0
Thanked 0 times in 0 posts
|
Hello,
I am looking for help with shading an area on the CCI. For example: Shade the area between the +50 and the -50 lines. Were I could chose a color and opacity. Thanks for any help. |
|
|
|
|
|
#2 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
dwalls,
Have you tried using DrawRegion()?
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Jul 2007
Posts: 176
Thanks: 0
Thanked 0 times in 0 posts
|
Hi,
Thx Josh. I have tried this but it wont compile. Any ideas? { DrawRegion("Shaded 50", CurrentBar, 0, CCI(14)(50), CCI(14)(-50), Color.Empty, Color.Blue, 2); } Is it close? Thanks |
|
|
|
|
|
#4 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
CCI(14)(50), CCI(14)(-50)
You will need to change these. CCI(14)[50] Not sure what you want with -50. You cannot access into the future. If you want it to stop painting within 50 bars into the future you can run an if-statement that keeps redrawing it until 50 bars have passed then stops.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Jul 2007
Posts: 176
Thanks: 0
Thanked 0 times in 0 posts
|
Thx Josh,
I am trying to shade the area between the 50's like in the attached screenshot. I just used the Rectangle tool to draw the shaded area on the screenshot to show you. Dont I need to use [-50] in there some how? Thanks |
|
|
|
|
|
#6 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
You need to input that in differently. You need to use an if-statement to determine that the CCI value is between the 50s.
Code:
if (CCI(14)[0] > -50 || CCI(14)[0] < 50)
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Senior Member
Join Date: Jul 2007
Posts: 176
Thanks: 0
Thanked 0 times in 0 posts
|
Thx Josh,
I think I'm being a little misunderstood. It doesnt really matter where the value of the CCI(14) is at. It's value would not be a factor in the shading. I'm just trying to have a permanent/set shade or color in the area between the +50 line and the -50 line on the CCI indicator, as a colored area/zone of caution for example. Does that make sense. Thanks for your help. |
|
|
|
|
|
#8 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
Use DrawOnPricePanel = false in Initialize() and then shade the range with the appropriate values.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#9 |
|
Senior Member
Join Date: Jul 2007
Posts: 176
Thanks: 0
Thanked 0 times in 0 posts
|
Thx Josh,
I'm having a hard time with this one, its probably simple and its just me. Could you please help me with a code example of how shading a range between two values of an indicator would work. Thanks for your time. |
|
|
|
|
|
#10 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
Please find the attached indicator.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#11 |
|
Senior Member
Join Date: Jul 2007
Posts: 176
Thanks: 0
Thanked 0 times in 0 posts
|
Thx Josh,
Got it to work now. Thank you so much for your help and all you guys do in this forum. dwalls |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| CCI / Stochastic combo (looking for indicator) | TheWizard | Indicator Development | 8 | 03-27-2009 01:28 PM |
| Indicator ploted on CCI zero line | dwalls | Indicator Development | 28 | 10-23-2008 11:32 AM |
| Help with code (Zone Shading) | tommyjames | Indicator Development | 16 | 04-29-2008 02:00 AM |
| Woodies CCI Indicator | KBJ | Indicator Development | 5 | 06-24-2007 10:29 AM |
| Shading areas of chart? | higler | Charting | 3 | 05-01-2007 07:58 AM |