(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 cmoran13, 04-16-2026, 01:02 PM
|
0 responses
46 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
28 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|
||
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
163 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
98 views
1 like
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
158 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|

Comment