(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 Hwop38, 05-04-2026, 07:02 PM
|
0 responses
166 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|
||
|
Started by CaptainJack, 04-24-2026, 11:07 PM
|
0 responses
321 views
0 likes
|
Last Post
by CaptainJack
04-24-2026, 11:07 PM
|
||
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
246 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
350 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
179 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|

Comment