Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Market Analyzer Alert Message
Collapse
X
-
Market Analyzer Alert Message
Is there a way to have this message contain a variable e.g the current value of an indicator?Tags: None
-
Not sure if this is what you need, but you could enter the trigger value into the MA message as text - http://www.ninjatrader-support.com/H...onditions.html
If you want the alert to show you the value of the indicator at the time of the alert, you should custom code this using the Alert() method in the indicator directly.
BertrandNinjaTrader Customer Service
-
Thank you,
It looks like I need to use the Alert() method.
Alert("myAlert", NinjaTrader.Cbi.Priority.High, "Reached threshold", "Alert1.wav", 10, Color.Black, Color.Yellow);
How do I embed the value of a variable into the message?
How do I set the trigger value and Indicator?
I'm obviously new to this.
Comment
-
You can try something like this in the OnBarUpdate() of your indicator -
Code:protected override void OnBarUpdate() { if (CurrentBar < 1) return; if (Close[0] > Close[1]) Alert("Up", Priority.Medium, "Up with Close value" + " " + Close[0].ToString(), "Alert1.wav", 10, Color.Black, Color.Blue); }
BertrandNinjaTrader Customer Service
Comment
-
I'm having problems:
protected override void OnBarUpdate()
{
if (CurrentBar < 1) return;
if Plot0.ContainsValue(0) > 0.5
Alert("Up", Priority.Medium, "Up with Close value" + " " + projHigh.ToString(), "Alert1.wav", 10, Color.Black, Color.Blue);
}
I want to trigger on the current value of Plot0 defined earlier in the script
I want to include the current value of the double projHigh defined earlier in the script in the message.
Comment
-
Sorry to keep bugging you.
I'm still getting errors.
protected override void OnBarUpdate()
{
if (CurrentBar < 1) return;
if (Plot0 [0] > 0.5)
Alert("Up", Priority.Medium, "Up with Close value" + " " + projHigh.ToString(), "Alert1.wav", 10, Color.Black, Color.Blue);
}
Comment
-
it's "protected override void OnBarUpdate()" is already in the code at the top.
If I delete the 2nd one I get a whole slew of errors
Indicator\GV_LynnDeesCriteria.cs Type 'NinjaTrader.Indicator.GV_LynnDeesCriteria' already defines a member called 'OnBarUpdate' with the same parameter types CS0111 - click for info 87 28
Comment
-
I did that.
NinjaScript File Error Code Line Column
Indicator\GV_LynnDeesCriteria.cs Expected class delegate enum interface or struct CS1518 - click for info 106 Indicator\GV_LynnDeesCriteria.cs Identifier expected CS1001 - click for info 108 33
Indicator\GV_LynnDeesCriteria.cs Type or namespace definition or end-of-file expected CS1022 - click for info 109 9
Indicator\GV_LynnDeesCriteria.cs The namespace 'NinjaTrader.Indicator' already contains a definition for '?' CS0101 - click for info 108 32
Comment
-
Thanks for all your help.
I don't understand but I hit F5 and it compiled with no errors. Hopefully this will work.
I really appreciate your efforts.
Comment
-
-
Do you have the Alerts window open? It should display in the 'message' field - http://www.ninjatrader-support.com/H...verview40.htmlBertrandNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by foxtrott21, Today, 08:27 AM
|
0 responses
1 view
0 likes
|
Last Post
by foxtrott21
Today, 08:27 AM
|
||
Started by jaypelle3, Today, 08:26 AM
|
0 responses
1 view
0 likes
|
Last Post
by jaypelle3
Today, 08:26 AM
|
||
Started by linkcou, Today, 07:01 AM
|
2 responses
18 views
0 likes
|
Last Post
by bltdavid
Today, 08:25 AM
|
||
Started by jaypelle3, Today, 08:25 AM
|
0 responses
1 view
0 likes
|
Last Post
by jaypelle3
Today, 08:25 AM
|
||
Started by jaypelle3, Today, 08:22 AM
|
0 responses
2 views
0 likes
|
Last Post
by jaypelle3
Today, 08:22 AM
|
Comment