![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Well, I was just adjusting the OP's code, apart from that old habits die hard :)
To be honest, I've only just learnt how to use the new arrays. Before I was trying &high[index] and I now know that they need to be set as series if one wants to use them in the way that we are used to.
There seems so much new stuff that it will take some time to change. I do try to use the SymbolInfo stuff instead of Market info as that looks pretty good.
Hope you didn't mind my question, wasn't picking on anyone, just saying, you know.
On the other hand, you seem pretty god with array out of range kind of thing and I have one that gives me trouble. Would you look at it please ?
Here is one working in an indicator similar to OPs :
and here's the one in question :
This one returns an out of range error. I miss to see why.
I've set all arrays as series including high[] and low[], the period is 20 .
Any thoughts ?
Thanks
thrdel:
This one returns an out of range error. I miss to see why.
I've set all arrays as series including high[] and low[], the period is 20 .
Any thoughts ?
Thanks
Well, I don't know what the value of CumulantPeriod is. Is it negative?
What about the array Average, is it a dynamic array? You don't re-size it. Is it also set as series?
Your comment suggests that you want to store the last 20 average prices in your array, so it is quite possible that you declared your array
if so, is it possible that
rates_total-(CumulantPeriod+1)
can be more than 20?
If this doesn't answer your question, you will probably have to show more of the code.
Well, I don't know what the value of CumulantPeriod is. Is it negative?
What about the array Average, is it a dynamic array? You don't re-size it. Is it also set as series?
Your comment suggests that you want to store the last 20 average prices in your array, so it is quite possible that you declared your array
if so, is it possible that
can be more than 20?
If this doesn't answer your question, you will probably have to show more of the code.
Thanks GumRai,
I've fixed it. My mistake was to define the arrays before OnInit()
instead of inside OnCalculate() and not used SetIndexBuffer() for them. MT4 looked at them as buffers, normally.
Quite silly, isn't it.
Thanks a bunch anyway.