hi,
maybe someone knows how to do that correctly.
I would like to loop through different TF Intervals and pass a different Arrays to my function:
Something like that: The //Block in question
instead of the //Block in question
I would like to do something like:
I guess someone must have done something like this way before me (if it is possible in MT4)
- and hope you are kind enough to take a couple of minutes to share - thanks a lot.
maybe someone knows how to do that correctly.
I would like to loop through different TF Intervals and pass a different Arrays to my function:
Something like that: The //Block in question
PHP Code
int interval = 1;
int _PeriodM1 = 10;
int _PeriodM5 = 50;
double dArOpenPriceM1[];
double dArOpenPriceM5[];
//Somewhere
ArrayCopySeries(dArOpenPriceM1, MODE_OPEN, sPairName, PERIOD_M1);
ArrayCopySeries(dArOpenPriceM5, MODE_OPEN, sPairName, PERIOD_M5);
=====================
//Block in question
if (interval == PERIOD_M1) {
myFunc(_PeriodM1, dArOpenPriceM1);
}
else if (interval == PERIOD_M5) {
myFunc(_PeriodM5, dArOpenPriceM5);
}
=====================
//Helper function
void myFunc(int _Period, double _dArOpenPrice[]) {
//Do my thing
}
I would like to do something like:
PHP Code
int HelperArray[2];
HelperArray[0] = _PeriodM1;
HelperArray[1] = _PeriodM5;
for (int x = 0; x < 2; x++) {
myFunc(HelperArray[x], double _dArOpenPrice[])
// don't know how to pass here the correct one array
}
- and hope you are kind enough to take a couple of minutes to share - thanks a lot.
__Thanks__ MJ