Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Drawing text in indicator panel
Collapse
X
-
Drawing text in indicator panel
I draw four horizontal dotted lines in an indicator panel (values 0, 0.5, 1, and 1.5), and I change the colors for each bar depending on price action. I would add to add a label (text) to the left on each of those lines to indicate their function. I would obviously like for the label to remain in the same place (left-most side of the indicator panel) as I scroll through time. How do I do this?Tags: None
-
Hi, unfortunately the suggestion doesn't work for what I am trying to do. I have attached a screen print to show you my indicator (http://www.screencast.com/t/Yjk1MjMwM). As you can see it displays five lines of diamonds. I would like to ask a word of text to the left of those lines of diamond to explain which study the line relates to. DrawText may be the solution and the y value is not a problem, however I don't know how to reference the x/time value to coincide with the left most side of the screen. Thanks in advance for your help.
Comment
-
You have to use DrawTextFixed() if you want it to correspond with left edge as opposed to a certain bar. DrawText() is tied to bars and as you scroll around it will move while DrawTextFixed() is "fixed" onto the chart on certain corners.
If you want it to be "fixed" but at locations of your choosing unfortunately this is not supported and you would have to override the Plot() method and custom program that in yourself.Josh P.NinjaTrader Customer Service
Comment
-
The x-coordinate value for the left side of the screen would be ChartControl.FirstBarPainted, so the value you would use for the startBarsAgo witl be (CurrentBar - ChartControl.FirstBarPainted).
Example:
Code:int LeftSideOfScreen = ChartControl.FirstBarPainted; DrawText("Test", false, "Text to show at left side of screen", (CurrentBar - LeftSideOfScreen), Close[0], 0, Color.Blue, new Font("Arial" , 12), StringAlignment.Near, Color.Transparent, Color.Transparent, 5);
Be aware that all use of ChartControl functions will not get any support from NT, so use at your own risk. It could change in the future, which I am sure, is partly why they refuse to provide any support for it.Last edited by koganam; 06-27-2011, 09:37 AM.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by yertle, Yesterday, 08:38 AM
|
7 responses
28 views
0 likes
|
Last Post
by yertle
Today, 12:15 AM
|
||
Started by bmartz, 03-12-2024, 06:12 AM
|
2 responses
20 views
0 likes
|
Last Post
by bmartz
Today, 12:11 AM
|
||
Started by funk10101, Today, 12:02 AM
|
0 responses
4 views
0 likes
|
Last Post
by funk10101
Today, 12:02 AM
|
||
Started by gravdigaz6, Yesterday, 11:40 PM
|
1 response
8 views
0 likes
|
Last Post Yesterday, 11:49 PM | ||
Started by MarianApalaghiei, Yesterday, 10:49 PM
|
3 responses
10 views
0 likes
|
Last Post Yesterday, 11:33 PM |
Comment