Thank in advance
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Text indicator
Collapse
X
-
Hello kiss987,
You may use the DrawText() and DrawFixedText() to be able to draw text on your chart using an Indicator.
DrawText: http://www.ninjatrader.com/support/h...l?drawtext.htm
DrawFixedText: http://www.ninjatrader.com/support/h...wtextfixed.htmJCNinjaTrader Customer Service
-
Hello chema2200,
Thank you for your post.
Below is a simple example of displaying the text of the 14 period ATR on the bottom right of the chart:
Please let me know if you have any questions.Code:protected override void OnBarUpdate() { DrawTextFixed("ATR", ATR(14)[0].ToString(), TextPosition.BottomRight); }
Comment
-
thank you so much.
I have inserted inside the the ATR indicator code but I can´t see the results on the charts...Do you know what is wrong?
thank you again for your help.
....
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
if (CurrentBar == 0)
Value.Set(High[0] - Low[0]);
else
{
DrawTextFixed("ATR", ATR(14)[0].ToString(), TextPosition.BottomRight);
double trueRange = High[0] - Low[0];
trueRange = Math.Max(Math.Abs(Low[0] - Close[1]), Math.Max(trueRange, Math.Abs(High[0] - Close[1])));
Value.Set(((Math.Min(CurrentBar + 1, Period) - 1 ) * Value[1] + trueRange) / Math.Min(CurrentBar + 1, Period));
}
}
#region Properties
/// <summary>
/// </summary>
.....
Originally posted by NinjaTrader_PatrickH View PostHello chema2200,
Thank you for your post.
Below is a simple example of displaying the text of the 14 period ATR on the bottom right of the chart:
Please let me know if you have any questions.Code:protected override void OnBarUpdate() { DrawTextFixed("ATR", ATR(14)[0].ToString(), TextPosition.BottomRight); }
Comment
-
Yes, I did it. Now I cannot open the platform...
Originally posted by NinjaTrader_PatrickH View PostHello chema2200,
Thank you for your response.
Have you compiled the indicator since adding the change to the code? Right click in the NinjaScript Editor and select Compile.
I would recommend creating a new indicator with the original ATR's code and just add in the code I referred to.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
156 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
90 views
1 like
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
139 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
130 views
1 like
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
107 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment