(2) Can I display text only in my indicator and should I be using DrawingText. Thanks
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Text only indicator per bar / Property
Collapse
X
-
Text only indicator per bar / Property
I would like to create an indicator that displays text in its own indicator window that displays text data per bar. I have tried a couple of things, and nothing is working. I would like to be able to create a method or property in my indicator that I can set the value from my strategy. (1) What is the code to set a property, I can't seem to get set { } working.
(2) Can I display text only in my indicator and should I be using DrawingText. ThanksTags: None
-
1. Not sure what you mean by creating something that can be set by the strategy. You mean something like a parameter? If so, please open up the SMA indicator and take a look how the Period parameter is done. Please look carefully at the Variables region and Properties region of the code. Pay special attention to what is capitalized and what is not.
2. Please try using DrawOnPricePanel = false along with DrawText().Josh P.NinjaTrader Customer Service
-
Properties make sense, here is what I am trying to do with the strategy communicating back to the indicator.
Indicator property
publicstring DisplayData
{
get { return strData; }
set { strData = value; }
}
Strategy code - dynamically sets a value in the indicator
protectedoverridevoid OnBarUpdate()
{
MyCustomIndicator().DisplayData = "CS";
}
Back in the indicator code.
protectedoverridevoid OnBarUpdate()
{
if (strData == "CS")
{
Values[0].Set(100);
Plots[0].Pen = new Pen(Color.Yellow);
}
else
{
Values[0].Set(100);
Plots[0].Pen = new Pen(Color.Blue);
}
}
So if I set the property in my strategy, I am wanting it to dynamically reflect back into the indicator, and then I can have the indicator do something.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
599 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
345 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
558 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
558 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment