Please use the code button (Alt + S) when posting code. I have done it for you this time.
It makes it easier for others to read your code if you avoid the huge gaps between lines.
Keith Watford:
Ok thanks. It's my first post.
Please use the code button (Alt + S) when posting code. I have done it for you this time.
It makes it easier for others to read your code if you avoid the huge gaps between lines.
Hi, im very interested by this indicator can i have it ? thanks !

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
Hello All,
I am have very basic programming skills in mql4 and I'd appreciate some help with the following code.
I'm trying to code a simple moving average that starts at daily open that has a period equal to the number of candles present on chart since the beginning of the current day (timeframe independent).
Ex. assuming we are on M1, at midnight my moving average is equal to the close (I'm computing my MA on close price), at 00:01 MA = (Close 00:00 + Close 00:01)/2, etc.
The code is fairly unsofisticated but it works fine until the last candle, when as soon as a new tick arrives "j" and "mean" are reset to zero (I saw that from Experts tab) and so my average suddenly drops to current Close/2. Indeed, if in my while
loop I put i>1 everything works ok. What am I doing wrong?
Thanks for any help.