![]() |
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 |
|
Junior Member
Join Date: Sep 2008
Posts: 10
Thanks: 0
Thanked 0 times in 0 posts
|
I am working on an indicator that draws an arrow with some text on the chart at a candle. Right now, I am calculating the lowest and highest of all of the prices and indicators (MAs and Bollinger Bands) at that bar and drawing the arrow a few pixels below or above those prices. This works but it is not pretty and the spacing varies extremely when I switch from higher "priced" instruments (like ^DJIA) to cheaper ones (like JASO).
Is there any way that I can place an arrow and text on or near the bottom (and top) edges of the price panel and have it stay in the same relative place no matter how the chart is scaled? I want the arrow to point to a specific, calculated candle but to sit on the bottom or top margin no matter how I scroll the x-axis or scale the vertical axis. I have searched all over this site and also in other indicators but I just cannot find this. I have found a few kernels of ideas, but I am stumped. If there is a property that displays the Y-axis min and max, I think that would work... I just cannot find it. Thanks in advance... |
|
|
|
|
|
#2 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Hi atangram,
First off, welcome to the NinjaTrader Support Forums. Unfortunately you cannot set the location of the arrow and text in the manner you want. The drawn arrow requires a certain y-value that correesponds with the y-axis and will move away if your y-axis moves too far. For text, you can use DrawTextFixed(), but that will just have an overlay text not correlated with your signal bar. It will just have a string of text sitting at whatever position you wanted. You can try overriding the Plot() method, but this is unfortunately too advanced programming that is outside the scope of what we can offer support for.
Josh
NinjaTrader Customer Service
Last edited by NinjaTrader_Josh; 10-02-2008 at 11:51 AM.
|
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Sep 2008
Posts: 10
Thanks: 0
Thanked 0 times in 0 posts
|
Josh, Thanks for the quick reply. I will try to override the Plot() function but I still need to know the y-scale min and max values. Can you give me a little hint on where that property lives? Or even better, can you point me to an indicator that uses this property?
|
|
|
|
|
|
#4 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Hi atangram,
The closest thing I can direct you to would be the CustomPlotSample preinstalled with your NinjaTrader as an indicator. Unfortunately I cannot provide more support than that on this endeavour. Good luck.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: May 2010
Posts: 29
Thanks: 3
Thanked 0 times in 0 posts
|
I know this is an old thread, but I believe I have exactly this same question. Maybe NT 7 has a solution to this?
I want to put an arrow corresponding to a specific bar on top of the chart panel. Basically, instead of DrawTriangleUp("My dot" + CurrentBar, true, 0, High[0], Color.Green); it would be something like DrawTriangleUp("My dot" + CurrentBar, true, 0, Top_of_frame, Color.Green); This would make it so that if I y axis, the triangle is always visible at the top of the chart. If it is possible to do that, then is it possible to "stack them". Let's say I had two indicators, and I wanted one to be underneither the other, is that possible? How? Thanks, Matt |
|
|
|
|
|
#6 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Matt,
To do this still requires the use of the Plot() method. Alternatively, you could try using DrawTextFixed() while using a font like Wingdings to draw some triangles. Those would be locked on the chart either on top or bottom of the panel. If you have multiple indicators that require stacking, you would need to add some enter lines to space them out so they don't overlap.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: May 2010
Posts: 29
Thanks: 3
Thanked 0 times in 0 posts
|
Thanks Josh for your quick response.
However, I require that the arrow or ^ or v to be directly over a specific bar. The DrawTextFixed does not allow you to position text in that manner, see below. Any other ideas? Thanks, Matt DrawTextFixed(string tag, string text, TextPosition textPosition) TextPosition TextPosition.BottomLeft TextPosition.BottomRight TextPosition.Center TextPosition.TopLeft TextPosition.TopRight |
|
|
|
|
|
#8 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Matt,
You will then have to override the Plot() method.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#9 |
|
Senior Member
Join Date: Mar 2010
Posts: 320
Thanks: 87
Thanked 5 times in 5 posts
|
Hi Josh can you please elaborate on this:
"Alternatively, you could try using DrawTextFixed() while using a font like Wingdings to draw some triangles. Those would be locked on the chart either on top or bottom of the panel. If you have multiple indicators that require stacking, you would need to add some enter lines to space them out so they don't overlap. " I am using drawtextfixed on top right corner of the hart. I want to put more text down underneath. Here is the text as an example: DrawTextFixed("Deltapos1", (GomDeltaVolume().UpVolume[0] + GomDeltaVolume().DownVolume[0]).ToString(), bPosition, Color.White, textFontMed, Color.Black, Color.Lime, 10); So how would I put this on line 2 on top right of the chart? Thanks. DJ |
|
|
|
|
|
#10 |
|
NinjaTrader Customer Service
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 89 times in 81 posts
|
djkiwi, when creating the string you wish to display, please include a line break that separetes the top line from the bottom line. To include a line break, please add this to your string at the appropriate location:
Code:
"/r/n" Please let us know if you have any other questions.
Austin
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| draw arrow based on another drawing object | duck_CA | NinjaScript File Sharing Discussion | 3 | 08-25-2008 03:18 PM |
| draw on price panel | argito | Strategy Development | 8 | 06-09-2008 10:09 AM |
| how to read top or bottom of chart? | NinjaCustomer | Indicator Development | 5 | 05-18-2008 10:20 PM |
| Volume Bar on Top/Bottom of Price Candle? | shortorlong | Indicator Development | 0 | 03-25-2008 12:20 AM |
| chart get compressed down at bottom | nkhoi | Miscellaneous Support | 2 | 01-28-2008 06:07 AM |