I am trying to get the readings of an H4 indicator through a H1 one. I appreciate the existence of MTF indicators, but think that there should be a more appropriate way to get the indicator readings at a different timeframe. I mean, something of the sort (this code does not do the work, unfortunately, as compared to the readings of a real #MTF indicator):
int shift4H = shift/4+1;
while(Time[shift]>Time[shift4H]) {
offset4H--;
}
double value = iCustom(Symbol(),PERIOD_H4,..., offset4H);
The benefits of the above code include fewer calculations and the possibility to use it with non-custom indicators (for example, the built-in Stochastic Oscillator/CCI/RSI, etc.). It would also make the creation of multi timeframe-aware indicators much easier and effortless, I guess.
But unfortunately I cannot get it to work...
Anyone tried to do what I am? Please share your experience!
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 everyone,
I am trying to get the readings of an H4 indicator through a H1 one. I appreciate the existence of MTF indicators, but think that there should be a more appropriate way to get the indicator readings at a different timeframe. I mean, something of the sort (this code does not do the work, unfortunately, as compared to the readings of a real #MTF indicator):
int shift4H = shift/4+1;
while(Time[shift]>Time[shift4H]) {
offset4H--;
}
double value = iCustom(Symbol(),PERIOD_H4,..., offset4H);
The benefits of the above code include fewer calculations and the possibility to use it with non-custom indicators (for example, the built-in Stochastic Oscillator/CCI/RSI, etc.). It would also make the creation of multi timeframe-aware indicators much easier and effortless, I guess.
But unfortunately I cannot get it to work...
Anyone tried to do what I am? Please share your experience!