Indicator notifying about the price level
-
Hello. I created a simple indicator.
link text
The principle of operation is simple:The indicator is to inform when the price exceeds the EMA 20 or EMA50 from the top or bottom, in addition, it is to inform about the arrangement of these EMAs, long or short but only once per candle to avoid continuous notifications.
The problem is that the price exceeds the EMA and does not get notification, for example in the photo, the price has exceeded the EMA 20 from the bottom and no notification.

-
I deleted the "Once per bar" blocks and it only works that the notification comes every second, it is tiring, how to make 1 notification come per candle?
-
@lomcio https://docs.mql4.com/common/alert
Alert() function does not work in the Strategy Tester. If you see in the journal it's write:

-
@miki I threw it in the tester and it also popped up.
The general problem is that when the price is close to a given EMA on the M5, the price exceeds this EMA from the bottom and top several times during those 5 minutes. I get a notification every second.
I would like during the formation of the candle, when the price exceeds the EMA, regardless of which side it came from, that one notification was sent, and the next only when the next candle formed.1 candle = 1 notification

-
@lomcio once per bar block is required
-
@miki Fixed, figured out why it wasn't working.
Well, I moved the "Once per bar" block in front of the "Alert message" block.
Previously, "Once per bar" covered all conditions, now only displaying messages. -
@lomcio well done