C0mput3r: I am very new to MT4 coding.
Apparently if((Close[-4]<Close[-3])&&(Close[-3]<Close[-2])&&(Close[-2]<Close[-1])) // Here is your open buy rule
-
Play videoPlease edit your post.
For large amounts of code, attach it. - Bar zero is the currently forming bar. Bar one is one period back. You are trying to look at the future, so to prevent reality from being destroyed, the terminal errored you with array out of range.
-4 -3 -2 are not valid bar values you are trying to read the future not yet existing bars ?

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
Hi Guys,
Could anyone assist me with why I get an array out of range error with this code and how to fix it?
I am very new to MT4 coding.
Thanks in advance!
extern int MagicNumber=10001;