Please edit your post and use the code button (Alt+S) when posting code.
Post code that will compile
double MA = iMA
will not.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Ok,
I'm going to try going about this a different way. I'm trying to add an alert to a particular moving average indicator that I have come across. I want an alert to pop up when a candle opens on one side of the moving average and closes on the other side of the moving average. I have zero mql4 coding experience so this is a bit of a journey for me. But I know I can learn.
What I did is go find a different MA indicator that already has an alert coded in and try to copy/modify it to suit my indicator. Here is what I have so far:
{
double MA = iMA
if((Open[1] >= MA && Close[1] <= MA) || (Open[1] <= MA && Close[1] >= MA))
{
PlaySound(Alert_Sound_File);
Alert("MA has been crossed on ", Symbol());
}
}
}
return(0);
}
Of course that isn't working. Here are the errors I'm getting when I try to compile:
And of course I have no idea what any of that means. Can anyone kindly help me out. I've attached the mq4 file for the indicator I'm trying to add the alert to.
Thanks in advance.