Hi all,
I'm coming along pretty well in my efforts to learn to code in mql4, but I'm stumped about something. I can't understand whether it's possible to create an indicator that references higher timeframes, and use that information to plot data on a lower timeframe chart.
For instance, I would like to plot an arrow on an hourly bar at the cross of the hourly MACD -- if the H4 MACD is already crossed in the same direction. This is for research purposes. The H4 cross would have been completed in the past, so I don't understand why there should be a problem.
However, after a great deal of searching, I have yet to find a single example of an indicator that does this correctly. Over at the MQL4 forum, I found several discussions on the topic, but all the coders who were attempting it seemed to have ended in failure.
From these discussions, I'm aware that I would need to specify the period, as in the following.
And I'm able to create a working indicator with this approach that plots arrows. But the arrows do not accurately reflect the higher timeframe MACD, only the current timeframe.
I'm not looking for someone to code my indicator for me. Just please enlighten me. This must be a well-trodden path for experienced coders. Is it possible to do this or am I on a wild goose chase?
regards,
drofwarc
I'm coming along pretty well in my efforts to learn to code in mql4, but I'm stumped about something. I can't understand whether it's possible to create an indicator that references higher timeframes, and use that information to plot data on a lower timeframe chart.
For instance, I would like to plot an arrow on an hourly bar at the cross of the hourly MACD -- if the H4 MACD is already crossed in the same direction. This is for research purposes. The H4 cross would have been completed in the past, so I don't understand why there should be a problem.
However, after a great deal of searching, I have yet to find a single example of an indicator that does this correctly. Over at the MQL4 forum, I found several discussions on the topic, but all the coders who were attempting it seemed to have ended in failure.
From these discussions, I'm aware that I would need to specify the period, as in the following.
Inserted Code
[font="]double macd = [url="http://docs.mql4.com/indicators/iMA"]iMACD [/url](NULL ,PERIOD_H4, fastema, slowema, PRICE_CLOSE, MODE_MAIN , i+1); double sig= [/font][font="][font="][url="http://docs.mql4.com/indicators/iMA"]iMACD [/url][/font](NULL, PERIOD_H1, fastema, slowema, PRICE_CLOSE, MODE_SIGNAL ,i+1);[/font]
I'm not looking for someone to code my indicator for me. Just please enlighten me. This must be a well-trodden path for experienced coders. Is it possible to do this or am I on a wild goose chase?
regards,
drofwarc