We've changed sample in ArrayCopy topic in the new build. It was wrong.
double array1[][6]; double array2[10][6]; // array2 is filled with some data ArrayCopyRates(array1); ArrayCopy(array2,array1,0,0,60); // array2 is having the first 10 bars from the history now (first bar considered as bar with index [Bars-1]) ArrayCopy(array2,array1,0,Bars*6-60,60); // array2 is having the last 10 bars from the history now (last bar considered as current bar, bar wit index [0])
Use Count*10 or Count*ArrayRange(GlobalArray,1) for copying
Hello Slawa,
Thanks for the info.
This is what I have done and it works
Thanks for the info.
This is what I have done and it works
ArrayCopy(GlobalArray,Arr,Count*ArrayRange(GlobalArray,1),0,Count*ArrayRange(GlobalArray,1));
Thanks this was driving me crazy for the past 3 days
EK
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 have some test code below and it is driving me crazy because it should work but doesn't, so I must not understand how arrays functions work in MQ4
What I think I am doing;
Create a Single Index array with 10 elements
Pass that array to a function
Resize the Global Array by 1 Index
Copy the passed Array to the Global Array
Do this 10 Times, so I should have 10 Indexes of 10 Elements each when I am done in the Global Array
But That is not what is happening after Index 0 and 1 starting on Index 2 the output from the Print statement shows empty values fro the Array.
Any Ideas?
Thanks
EK