Substituting timeframe for MA doesn't work because the Bar count is based on the current timeframe. I've tried multiplying Bars*TImeFrame and adding/removing TimeFrame from the iMA calls but nothing to seems to work. I think the key is this MTF indicator.
I figured out how to get an MTF Gann line drawn.....
Use an MTF MA in place of iMA. There's a couple of them online...Google It!
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
#MTF_RSI uses an array to push timeframes thru RSI. I'd like to do the same thing with the Gann indicator. My problem is that the Timeframe array counts up while the Gann indicator counts bars down from the lookback (period). I can't get my head around this. If anybody has got a solution for this I would be greatful.
Thanks, KJHi KJ,
I'm just a novice coder and may not understand the problem of stepping through the 'time array"...but if you look at the #MTF_RSI code you will see that it sets the time frame as an extern int and places it in the ExtMapBuffer variable...and in the time array.
ExtMapBuffer1=iRSI(NULL,TimeFrame,RSIperiod,applied_price,y) ;
ArrayCopySeries(TimeArray,MODE_TIME,Symbol(),TimeFrame);
The Gann Indicator does not seem to have a time array, so follow the #MTF_RSI code and replace all
iMA("Null,0" ...with
iMA("Null,TimeFrame"...
and place the extern int TimeFrame = 0; at the top.
This should make the Gann indicator MTF.
Hope this helps,
Robert