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
Positioning text using DrawText()
Collapse
X
-
Positioning text using DrawText()
I am drawing an UpArrow on my chart at various locations. I would like to draw text at a fixed distance below the arrow. Can someone tell me how to do this? I am drawing the arrow at Low[0] - .5 * TickSize. If I position the text at a multiple of TickSize such as Low[0] - 2 * TickSize then the distance below the arrow varies depending on how compressed the chart gets when there are large price variations. I would like the text to be a fixed distance below the arrow always. Thanks.Tags: None
-
Please take a look at this syntax version for DrawText()
DrawText(string tag, bool autoScale, string text, int barsAgo, double y, double yPixelOffset, Color textColor, Font font, StringAlignment alignment, Color outlineColor, Color backColor, int opacity)
I think the yPixelOffest parameter can be useful in your case.Josh P.NinjaTrader Customer Service
-
hmm, please explain DrawText() positioning...
I'm using this:
DrawText("ask", false, "Ask: "+askRows[0].Price + " Vol: "+askRows[0].Volume, 0, High[0], 100, Color.Red, font, StringAlignment.Far, Color.Transparent, Color.Transparent, 50);
I want the text to be the X= 5 (five bars back from currentbar), and Y = HighestBar(High, 20) but whenever I use those values I see NO text anywhere. If I plugin the above values they show up ok.
Comment
-
Try this code instead:
Code:DrawText("test", false, "Test Text", [B][COLOR=Red]5[/COLOR][/B], [COLOR=Red][B]MAX(High, 20)[0][/B][/COLOR], Color.Red, new Font("Arial", 12), StringAlignment.Far, Color.Transparent, Color.Transparent, 50);
Josh P.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Barry Milan, Today, 10:35 PM
|
1 response
8 views
0 likes
|
Last Post Today, 10:48 PM | ||
Started by WeyldFalcon, 12-10-2020, 06:48 PM
|
14 responses
1,428 views
0 likes
|
Last Post
by Handclap0241
Today, 10:43 PM
|
||
Started by DJ888, Yesterday, 06:09 PM
|
2 responses
9 views
0 likes
|
Last Post
by DJ888
Today, 10:31 PM
|
||
Started by jeronymite, 04-12-2024, 04:26 PM
|
3 responses
40 views
0 likes
|
Last Post
by jeronymite
Today, 10:10 PM
|
||
Started by bill2023, Today, 08:51 AM
|
2 responses
16 views
0 likes
|
Last Post
by bill2023
Today, 10:10 PM
|
Comment