Code has errors. Not an expert in MQL4 coding at all. Any help WOULD BE APPRECIATED.

 

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.