So that it's Y position is fixed but moves on the X axes.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Lock text on the right side of chart
Collapse
X
-
Hello symphys,
Thank you for your post.
Unfortunately, this is not possible with the drawing tools presently as they will tied to the specific place on the chart.
I will forward your suggestion to have text move with the time axis to be added to the list of the possible future enhancements to NinjaTrader.
Another thing, is that NinjaTrader 7 will include many drawing tool enhancements. Please see the following link.
Ryan O.NinjaTrader Customer Service
-
Hey Symphys, did you ever get an indicator built to accomplish this? I have been trying but no luck. I would like to build an indicator that would display "Only Long" or "Only SHort" in the top right hand corner based on a true or false selection I make.
I have limited programming abilities..
If there is an example of an indicator that included this that I can edit I would be interetsed to be pointed in that direction.
Comment
-
I read that but as I said I have limited programming knowledge and have no idea where to place that in the code to make it wirk.
If I have a bool line I would like a true value to place an only long lable...if it is false I would like an only short label....but I can't figure out whre to put the
// Draws text in the upper right corner of panel 1
DrawTextFixed("tag1", "Text to draw", TextPosition.TopRight);
in the script to make it work.
Comment
-
Hello Stalt,
You can use the indicator wizard to create a public bool input. This is the true / false selection.
Use the wizard to add a public input called MyBool.
You can then use the snippet below to draw whether or not this is true or false.
Code:if (MyBool) DrawTextFixed("myTagTrue", "myTextTrue", TextPosition.TopRight); else DrawTextFixed("myTagFalse", "myTextFalse", TextPosition.TopRight);
Ryan M.NinjaTrader Customer Service
Comment
-
stalt,
You have to use the other method signature for this.
Example:
Code:DrawTextFixed("MYTAGTRUE", "MYTEXTTRUE", TextPosition.TopRight, Color.Green, new Font("Arial", 12), Color.Green, Color.Transparent, 0); DrawTextFixed("MYTAGFALSE", "MYTEXTFALSE", TextPosition.TopRight, Color.Red, new Font("Arial", 12), Color.Red, Color.Transparent, 0);
Ryan M.NinjaTrader Customer Service
Comment
-
Thanks a million Ryan for posting that syntax. Don't ever think a question is too simple to take the time.
Because it is posted here, I eventually found it, and although I am no programmer, if I have something that works like this, I can play around with it and eventually hack my way to what I want.
The example given in the Docs, and in the reference sample...which doesn't show DrawtText at all... are so simple they are useless.
By answering that one question, me and a hundred like me will dig deep, find your post and answer their own question.
Thanks again..... five minutes playing around with that example and now I can make that dog dance to my fiddle.
Comment
-
Hi guys this is a good thread.
However I have zero c# and I inserted the code randomly in the code generated by the wizard.
It comes up with these two errors - ") expected" and "Class Member declaration" expected.
I pasted this DrawTextFixed("tag1", "Text to draw", TextPosition.TopRight);
just above where #region properties is. (using NT 6.5) I have no clue where to paste it. Or any extra coding I need to do. (full code will help; so that i can just paste it)
Furthermore, how does it allow me to enter what text I want fixed. Do I enter it within the code or when I add the indicator it allows me to enter it then?
Thanks in advance for your help.
Comment
-
Hello nicoacademia,
Thank you for your post.
Most of the code snippets you'll see posted here belong in OnBarUpdate() method, in-between the two curly brackets { }
You can edit any existing indicator through tools > edit NinjaScript window to see how they're structured.
There is also a guide available for indicator development, which goes through the purpose of each method:
Ryan M.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by arvidvanstaey, Today, 02:19 PM
|
4 responses
11 views
0 likes
|
Last Post Today, 04:08 PM | ||
Started by samish18, 04-17-2024, 08:57 AM
|
16 responses
61 views
0 likes
|
Last Post
by samish18
Today, 03:30 PM
|
||
Started by jordanq2, Today, 03:10 PM
|
2 responses
9 views
0 likes
|
Last Post
by jordanq2
Today, 03:23 PM
|
||
Started by traderqz, Today, 12:06 AM
|
10 responses
18 views
0 likes
|
Last Post
by traderqz
Today, 02:49 PM
|
||
Started by algospoke, 04-17-2024, 06:40 PM
|
5 responses
48 views
0 likes
|
Last Post Today, 02:36 PM |
Comment