How to get candles from parent timeframe and lower contained timeframes using CopyRates() and populate them in array
These three pictures will help you:
Pic. 1. 'M12'
Pic. 2. 'M6'
Pic. 3. 'M4'
These three pictures will help you:
Pic. 1. 'M12'
Pic. 2. 'M6'
Pic. 3. 'M4'
Okay from the images lets say M12 at 06:00 just closed as in Pic.1. I want to get M12 06:00 candle, the two M6 candles within it and the three M4 candles within it using CopyRates(). That gives me a total of six elements from 3 different arrays.
Then I want to populate these 6 elements from the 3 arrays in a new array "CombinedArrays". This is what I've been trying to achieve and not sure how to fix from the code I provided.
Okay from the images lets say M12 at 06:00 just closed as in Pic.1. I want to get M12 06:00 candle, the two M6 candles within it and the three M4 candles within it using CopyRates(). That gives me a total of six elements from 3 different arrays.
Then I want to populate these 6 elements from the 3 arrays in a new array "CombinedArrays". This is what I've been trying to achieve and not sure how to fix from the code I provided.
From time to time to ...
From time to time to ...
Please, I don't understand this.
Look carefully at the picture:
Pic. 1. 'M12'
You should be interested in the 'M12' candle at 06:12 .
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I want to perform certain tasks on the open, high, low and close of the last but one (index of 1) M12 candle, and the M6 and M4 candle within it.
Since CopyRates() has this candle info I am using it to copy the candles.
How can I load exactly one M12 candle (of index 1 when M12 candle closes) and two M6 candles and three M4 candles (M6 and M4 within M12) using the CopyRates? This seems to be getting me confused and I’m loading more than I need.
Secondly, how can I populate a new array with all these elements? I tried CopyArray but that only copies 1. I need to copy multiple arrays into one.
Please see my code below: