protected override void OnBarUpdate()
{
double MACDvalue = MACD(12, 26, 9)[0];
if (MACDvalue < 0)
{
if (MACDpos == true)
{
Print(MACDvalue);
Alert("CrossDown",Priority.High,"MACD is crossing down.","Alert2.wav",0,Color.Beige,Color.Black);
MACDpos = false;
MACDneg = true;
}
}
if (MACDvalue > 0)
{
if (MACDneg == true)
{
Print(MACDvalue);
Alert("CrossUp",Priority.High,"MACD is crossing up.","Alert2.wav",0,Color.Beige,Color.Black);
MACDneg = false;
MACDpos = true;
}
}
}
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
No alert...
Collapse
X
-
No alert...
Here is the script:
The Values are printing in output, but no Alert, what am I missing?Code:Tags: None
-
I learn something every hour, however I have changed my script as follows and am using PlaySound instead of alert... Sound is not playing and there is no error in log... ?
Code:protected override void OnBarUpdate() { double MACDvalue = MACD(12, 26, 9).Diff[0]; if (MACDvalue < 0) { if (MACDpos == true) { PlaySound("Alert2"); DrawTextFixed("MACDtext","MACD is a BEAR",TextPosition.BottomRight); MACDpos = false; MACDneg = true; } } if (MACDvalue > 0) { if (MACDneg == true) { PlaySound("Alert2"); DrawTextFixed("MACDtext","MACD is a BULL",TextPosition.BottomRight); MACDneg = false; MACDpos = true; } } }
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by sjsj2732, Yesterday, 04:31 AM
|
0 responses
38 views
0 likes
|
Last Post
by sjsj2732
Yesterday, 04:31 AM
|
||
|
Started by NullPointStrategies, 03-13-2026, 05:17 AM
|
0 responses
287 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
289 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
134 views
1 like
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
95 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|

Comment