Hi. I am trying to cycle through a period of chart timeframes, i.e. 15, 30, 60, 240, 1440, using the array period[] = { 15, 30, 60, .....}, but also want to make a calculation of:
Where y is the bar shift. So basically im trying to find the value of 'Difference' for each bar shift for each timeframe. So i need the values of period[1] to cycle through the whole bar shift before moving onto the next period[2] and so on. But I need the values to be given in sets of timeframe. So I need a set of Difference for timeframe 15 which should include all bar shifts.
I was thinking that a 2D array would help here but i cant figure out how to implement it, because I am using 2 difference source types if you get my meaning. Surely its not possible? I was also thinking about using a calculation to get the 2D array to cycle through y for x=1. Somthing like [x,+y*5]?? This is of course wrong but maybe you no what im trying to do?
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Hi. I am trying to cycle through a period of chart timeframes, i.e. 15, 30, 60, 240, 1440, using the array period[] = { 15, 30, 60, .....}, but also want to make a calculation of:
for(int y=1;y<5,y++)
{
Difference = iHigh(Symbol(),period[x],y) - iOpen(Symbol(),period[x],y);
}
Where y is the bar shift. So basically im trying to find the value of 'Difference' for each bar shift for each timeframe. So i need the values of period[1] to cycle through the whole bar shift before moving onto the next period[2] and so on. But I need the values to be given in sets of timeframe. So I need a set of Difference for timeframe 15 which should include all bar shifts.
I was thinking that a 2D array would help here but i cant figure out how to implement it, because I am using 2 difference source types if you get my meaning. Surely its not possible? I was also thinking about using a calculation to get the 2D array to cycle through y for x=1. Somthing like [x,+y*5]?? This is of course wrong but maybe you no what im trying to do?