![]() |
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Dec 2006
Location: Seattle, Washington, USA
Posts: 150
Thanks: 0
Thanked 0 times in 0 posts
|
I was comparing the Indicators that members have contributed (http://www.ninjatrader-support.com/v...1&sort=N&pp=15). In looking at the code, I've been unable to figure out how the labels are displayed differently.
In the "Floor Pivots" indicator, the labels are on top of the horizontal lines on the right side. In the "SessionPivotsDaily V4" indicator, the labels are on the left side of the horizontal lines. Where in the code do I find this? |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
I suggest contacting the author(s) for clarification.
Dierk
NinjaTrader Customer Service |
|
|
|
|
|
#3 | ||
|
Member
Join Date: Feb 2008
Posts: 47
Thanks: 0
Thanked 0 times in 0 posts
|
I was wondering the same thing, so here is my take
Session is using custom Plot Quote:
Quote:
|
||
|
|
|
|
|
#4 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
The use of custom plot is outside of the scope we can provide support for. Hint: Look for the x and y coordinate parameters on the DrawString. Those are the parameters that determine where the text will be print.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Oct 2007
Posts: 1,825
Thanks: 12
Thanked 81 times in 67 posts
|
Just used graphics.DrawString to plot date labels next to Fibonacci lines.
To do this I defined a DataSeries array (such as standard "Values" series used by the Plot method), as the date labels are supposed to change along with the values. As DataSeries does not hold DateTime values, I converted DateTime to Int (using a reference date), then converted this to double, stored it on the DataSeries array and retrieved it within the graphics.DrawString method by reconverting it back to Int, then DateTime and finally String to plot it. Is there any solution simpler than this, such as writing DateTime objects directly to a DataSeries? |
|
|
|
|
|
#6 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Please see this article: http://www.ninjatrader-support.com/H...riesClass.html
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#7 | |
|
Senior Member
Join Date: Oct 2007
Posts: 1,825
Thanks: 12
Thanked 81 times in 67 posts
|
That is exactly what I was looking for. Did not know there was a DateTimeSeries class.
Quote:
|
|
|
|
|
|
|
#8 |
|
Senior Member
Join Date: Oct 2007
Posts: 1,825
Thanks: 12
Thanked 81 times in 67 posts
|
The graphics.DrawString method of the NT Pivot indicator plots labels from the right to the left. Is there any option to do it the other way round?
Alternatively, is there any function that returns the plotted length of a string - not mystring.Length which would return the number of characters, but the length of the string as plotted to the chart? |
|
|
|
|
|
#9 |
|
NinjaTrader Customer Service
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 89 times in 81 posts
|
Harry, to answer your first question: Not sure if there is an option to do it the other way around, but it is a standard .NET method. Here are the MSDN docs for Graphics.DrawString.
Second question: This might be possible (NinjaScript/NinjaTrader is C# so anything goes), but if it is possible it is not supported. Thank you for understanding.
Austin
NinjaTrader Customer Service |
|
|
|
|
|
#10 |
|
Senior Member
Join Date: Oct 2007
Posts: 1,825
Thanks: 12
Thanked 81 times in 67 posts
|
Thanks for the hint. Digging a bit in MSDN showed that I just had to replace "StringFormatFar" with "StringFormatNear".
|
|
|
|
|
|
#11 |
|
NinjaTrader Customer Service
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 89 times in 81 posts
|
Harry, that's great to hear. A little digging can go a long way.
Austin
NinjaTrader Customer Service |
|
|
|
|
|
#12 |
|
Senior Member
Join Date: Oct 2007
Posts: 1,825
Thanks: 12
Thanked 81 times in 67 posts
|
Is there any documentation of ChartControl methods available? For quite a number of indicators it is necessary to overwrite the existing Plot Class.
|
|
|
|
|
|
#13 |
|
NinjaTrader Customer Service
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 89 times in 81 posts
|
Harry, there is not any ChartControl documentation available. Overriding the Plot class is unsupported.
Austin
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Text on horizontal lines? | Rocky Mtn Trader | Charting | 8 | 08-12-2008 04:47 PM |
| Horizontal Lines | ale la juve ale | Charting | 1 | 03-25-2008 09:55 PM |
| Label the Horizontal Line | mgbloomfield | General Programming | 1 | 10-24-2007 12:02 PM |
| Draw Horizontal Lines | Richard Von | Indicator Development | 11 | 08-02-2007 12:23 PM |
| Horizontal Lines | guym | Suggestions And Feedback | 2 | 12-07-2006 08:32 AM |