![]() |
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: May 2007
Location: , ,
Posts: 57
Thanks: 0
Thanked 0 times in 0 posts
|
I would like to have a line at a specific location in the indicator window. For example at the 80% Grid level. Is this possible?
|
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
If you use any of the provided Draw() methods, you must put in an absolute y value. Provided that the indicator was showing a value of 0 through 100 (such as stochastics) then you would just put in a value of 80 for the y value parameter in a Draw() method.
If you want to draw a line at 80% level in reference to the overall drawing space (pixels) this can be done by overriding the Plot() method. Doing this is advanced and requires some understanding of the .NET graphics class. You can see the CustomPlotSample indicator for reference.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Member
Join Date: May 2007
Location: , ,
Posts: 57
Thanks: 0
Thanked 0 times in 0 posts
|
Fair enough.
I would like to plot on the "Zero Line" a changing line. When the Regression Channel is rising I would like to plot a "Green" Line, when the Regression Line is falling I would like to plot a "Red" Line. I'm having problems implementing this. I've attached a the indicator so you could see what I'm trying to do. edit: That's a bad example, as I don't have the zero line changing colors. But I think you get the idea. |
|
|
|
|
|
#4 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
Would just having the zero line dynamically change color be sufficient? If yes, just do something like:
if (rising) Lines[0].Pen.Color = Color.Green; else Lines[0].Pen.Color = Color.Red; Where [0] references the index where the zero line resides in the Lines collection. If you only have one line in the indicator, it would be index 0.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Member
Join Date: May 2007
Location: , ,
Posts: 57
Thanks: 0
Thanked 0 times in 0 posts
|
Thanks Ray for your help. I wish I was better at this stuff.
|
|
|
|
|
|
#6 |
|
Member
Join Date: May 2007
Location: , ,
Posts: 57
Thanks: 0
Thanked 0 times in 0 posts
|
I think I'm getting close -- but I still can't seem to get it. My indicator is very similar to Woodies CCI that's why I was asking to see the code, it would have helped immensely.
Last edited by AO76; 07-07-2007 at 03:58 PM.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Adjusting grid lines | Lupus | Charting | 10 | 09-14-2010 05:05 AM |
| Line "names" in Indicator Box change to "Line" after modification | higler | Charting | 3 | 05-02-2007 06:05 AM |
| Performance grid sorting in version 6 beta 8 | ThePatientOne | Suggestions And Feedback | 1 | 03-06-2007 01:18 AM |
| Horizontal Grid Lines at Price Intervals | Quicktrader10 | Charting | 1 | 01-05-2007 06:04 AM |
| horiz grid lines | Lupus | Suggestions And Feedback | 5 | 10-21-2006 02:02 PM |