![]() |
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: Jul 2007
Posts: 225
Thanks: 0
Thanked 0 times in 0 posts
|
Hi:
Probably a very simple answer to this one, so apologies for acting dumb. I would like to add a text label (e.g. VAH, POC, VAL) to each of the four lines within the Constant Lines indicator - how does one do this with via NinjaScript? Would appreciate any pointers. many thx David |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Jul 2007
Posts: 225
Thanks: 0
Thanked 0 times in 0 posts
|
Ray. I don't think that is what I am looking for??? I want something similar that the pivots indicator has, i.e. label associated with horizontal line which can vary from day to day whilst the label remains associated with it. e.g. Daily Pivot point = 13000 & there is a horizontal line at 13000 with a "Daily PP" automatically associated with it. Looking through the script for that particular indicator, it is not easy to ascertain how a label is associated with the value.
thx !!! David |
|
|
|
|
|
#4 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
The label is custom drawn by overriding the indicator's plot method which is outside what we support at this time. There is a reference indicator provided called CustomPlotSample.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Jul 2007
Posts: 225
Thanks: 0
Thanked 0 times in 0 posts
|
hmmm
was expecting this to be simple :-( what I am trying to do is the following.................... I have approx 10 lines which i want to plot on a chart as areas of support or resistance (these will vary on a daily basis) & have labels associated with each line. As part of a strategy, I will have a set of entry criteria & also criteria which if violated a trade cannot be entered. One of these will be if price is within 'x' ticks of a specific support or resistance level. I was thinking of just simply developing the Constant lines indicator to do this..........it's easy to go from 4 to 10 constant lines in the strategy & associate a variable to them - what i also want to be able to do is add a label to each line. any thoughts on how to achieve this? thx David |
|
|
|
|
|
#6 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
I don't see why you can't use DrawText to add the label onto the line. Have the text be drawn at the latest bar and have it with a y value a little bit above or below the intended line it is to label.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Senior Member
Join Date: Jul 2007
Posts: 225
Thanks: 0
Thanked 0 times in 0 posts
|
thx Josh. for the response. I will give it a go.......
as you are probably aware by now, the big difference between you & I is that you are the expert !! :-) thx David |
|
|
|
|
|
#8 |
|
Member
Join Date: Jan 2008
Posts: 48
Thanks: 0
Thanked 0 times in 0 posts
|
I also am interested. I want to add a lable to a constant line. dont want the lable over in price axis but on the chart itself. Can someone post example of how to do this? maybe the constant line indicator already developed but have the draw text code on at least one of the lines, i can go in and do it for the other lines. thanks.
|
|
|
|
|
|
#9 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
winJR,
It is doable via the DrawText() method we mentioned earlier. I am unaware of a sample that shows what you want already, but perhaps the help guide article on DrawText() can provide you with enough guidance in achieving the desired effect. http://www.ninjatrader-support.com/H.../DrawText.html
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#10 |
|
Member
Join Date: May 2007
Location: , ,
Posts: 57
Thanks: 0
Thanked 0 times in 0 posts
|
Also trying to label my lines. Anyone know how I can do this using the DrawText() Method?
|
|
|
|
|
|
#11 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
Just use the DrawText() method and for your y value, just pass in the line value + a tick? That is likely the closest you can get without it being directly on top.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#12 |
|
Member
Join Date: May 2007
Location: , ,
Posts: 57
Thanks: 0
Thanked 0 times in 0 posts
|
Still can't get it to work.
|
|
|
|
|
|
#13 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
AO76,
You are drawing 1 bar into the past. When you do this you need to first ensure you have enough bars loaded. Please see this tip: http://www.ninjatrader-support2.com/...ead.php?t=3170
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#14 |
|
Member
Join Date: May 2007
Location: , ,
Posts: 57
Thanks: 0
Thanked 0 times in 0 posts
|
Thanks Ray. Got it working.
|
|
|
|
|
|
#15 |
|
Senior Member
Join Date: May 2007
Posts: 154
Thanks: 0
Thanked 0 times in 0 posts
|
Has the ability to place labels on a line on a chart been improved/changed with NT7? If not, is DrawText still the only way to do this (or at least the best way)?
As a suggestion (assuming this hasn't been addressed already)--it would be great if a label could be added as part of the options on a plot line (with the ability to turn the text on /off and to specify where to show the text (far right, far left, center of chart, etc.)...so it is easy to label a plot on a chart... Just my 2 cents.... |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Indicator: Using StreamReader to read from a text file | NinjaTrader_Josh | Reference Samples | 0 | 09-30-2007 10:42 PM |
| Indicator: Using StreamWriter to write to a text file | NinjaTrader_Josh | Reference Samples | 0 | 09-30-2007 10:38 PM |
| Indicator price marker(s) feature request. | higler | Suggestions And Feedback | 1 | 08-08-2007 02:10 AM |
| Adding bookmarks to help text | kekkis | Suggestions And Feedback | 1 | 08-02-2007 05:53 AM |
| No text or video in help guide for adding column to Market Analyzer | daven | Market Analyzer | 6 | 06-18-2007 02:34 PM |