- Frequently Asked Questions about the Signals service
- Help to resolve my 2 errors!
- Universal MA Cross EA
Please edit your post (don't create a new post) and replace your code properly (with "</>" or Alt-S), or attach the original file directly with the "+ Attach file" button below the text box.
NB! Very important! DO NOT create a new post. EDIT your original post.
Did you write the code or use an A.I. generator for it?
I ask, because it is a mix/patch of different MQL program types and versions.
You are mixing Indicator and Script event handlers and using old MQL4 with newer MQL4+ functionality.
Hi
There are a few mistakes here. First you need to remove OnStart function. Change start to “OnCalculate” (you can check syntax in mq4 documentation. Then I believe this kind of code will create a lot of alerts and it will “pop-up” may times.
You need to limit those alerts to be displayed only on the newest candles (for example add a condition before if(i==1) – this way it will display alerts only after last closed candle.
Or you can create some other condition here to limit the alerts.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use