The code looks ok to me but....
on the population of the array i think it is going the wrong way so the for statement should be
on the population of the array i think it is going the wrong way so the for statement should be
double aArray[] ,Ma; int i; for(i=Bars; i>=0; i--) aArray[i]=iCCI(NULL,0,CCI_period,PRICE_TYPICAL,i); Ma=iMAOnArray(aArray,0,MaF_period,0,MODE_SMA,0); // rest of EA
Hope this helps you
Array[] should be previously resized because it has initially zero length
also You can use one of unused indicator's buffer. in this case (SetIndexBuffer(nnn,Array) You need not to resize such array. it resized automatically. for instance see our custom indicators samples(OsMA, MACD etc)
also You can use one of unused indicator's buffer. in this case (SetIndexBuffer(nnn,Array) You need not to resize such array. it resized automatically. for instance see our custom indicators samples(OsMA, MACD etc)
Many thanks for your help.
EA seems to be workig fine now :)
Jax
EA seems to be workig fine now :)
Jax
![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
I'd like to repeat the question asked by Keris2112, that is :
how to create an array of indicator values inside an experadvisor.
I'm new to mt4 and i've made only few rather simple experts. Now i'd like to employ functions like iMAOnArray but i simply don't know how to create an array which is required by iMAOnArray.
I've tried to use loops which i found in custom indicators but it didn't work, for instance:
If anyone could help me out with this i'd be very grateful
Jax