MA Cross Alert Once - MetaTrader 4 Script | Trading Script Download - MT4/MT5 Resources




* Online and available offline period reporting for alerts, push notifications and emails:
M1, M2, M3, M3, M4, M5, M6, M7, M8, M9, M10, M11, M12, M13, M14, M15, M20, M25, M30, M40, M50, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, D1, W1, Minnesota

The following content is mostly copy-pasted from an early release download - New Bar Alert - https://www.mql5.com/en/code/11065 . For the purposes of this article, the email functionality has been proven to work using only the tunneling method. The author does not use email and does not have time to investigate further. Further investigation/research via preferred search engines should find sufficient material available as a guide. Some references are provided below.
Note: In tests related to the previously mentioned release, only 127.0.0.1:25 worked. With this testing, the 127.0.01:25 and smtp.gmail.com:25 suggested by Sangmane in the forum referenced above work across different machines and Windows operating systems.
Note: To receive emails through google mail, I have to open - access a less secure application . This may not be best practice. However, my intention is to test whether I can receive emails and edit the code in the email format. I don't have time to investigate further, if users are having difficulty this will require further investigation. Alternative email services may be more suitable.
I use the same email address for SMTP login (sender and recipient). The sender and recipient can use different email addresses. I think the SMTP login and sender must be the same email address, but I haven't tested to prove for sure.


The following indicator MA Cross codes are taken from the MQL4 book documentation - The Use of Technical Indicators.
... if ((Fast_MA_Bar_1 < Slow_MA_Bar_1) && (Fast_MA_Bar_0 > Slow_MA_Bar_0)) // MQL4 Book Example: Cross Up - if ( M_1 < S_1 && M_0 >= S_0 ) ... if ((Fast_MA_Bar_1 > Slow_MA_Bar_1) && (Fast_MA_Bar_0 < Slow_MA_Bar_0)) // MQL4 Book Example: Cross Down - if ( M_1 > S_1 && M_0 <= S_0 ) ...
MQL4 Book Documentation - Use of Technical Indicators - https://book.mql4.com/samples/indicators

Figure 107. Concurrency of the stochastic oscillator main line and signal lines.
Attachment download
📎 ma_cross_alert_once_a.mq4 (9.43 KB)
📎 ma_cross_alert_once_b.mq4 (9.46 KB)
Source: MQL5 #12448
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •