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 | ||
---|---|---|---|---|
Hi
by AveryFlynn
Started by AveryFlynn, Today, 04:57 AM
|
0 responses
4 views
0 likes
|
Last Post
by AveryFlynn
Today, 04:57 AM
|
||
Started by RubenCazorla, 08-30-2022, 06:36 AM
|
3 responses
77 views
0 likes
|
Last Post
by PaulMohn
Today, 04:44 AM
|
||
Started by f.saeidi, Yesterday, 12:14 PM
|
9 responses
23 views
0 likes
|
Last Post
by f.saeidi
Today, 04:39 AM
|
||
Started by Tim-c, Today, 03:54 AM
|
0 responses
3 views
0 likes
|
Last Post
by Tim-c
Today, 03:54 AM
|
||
Started by FrancisMorro, Today, 03:24 AM
|
0 responses
5 views
0 likes
|
Last Post
by FrancisMorro
Today, 03:24 AM
|
Comment