Download MetaTrader 5
To add comments, please log in or register
Make screenshots in MetaTrader and manage them in the gallery!
sunshineh
1064
sunshineh 2010.09.17 18:54 

Hello,

I have an Indicator, which use the Functions High, Low and Close.

Now I want to change it. I want to add the parameter "Timeframe", so that I can put the indicator on the H1 chart and see the indicator for the M30 oder D1 Timeframe.

Is this possible? How can I do it?!

hasayama
605
hasayama 2010.09.17 19:05  

Instead of using High[i], Close[i] etc, you need to use iHigh(...), iClose(...). These functions can return values for any TF.

Here is the book;) -> https://docs.mql4.com/series/iClose

sunshineh
1064
sunshineh 2010.09.17 19:10  

Lot's of thanks!!! That was a great help!

Demos Stogios
184
Demos Stogios 2015.11.09 14:14  
sunshineh:

Hello,

I have an Indicator, which use the Functions High, Low and Close.

Now I want to change it. I want to add the parameter "Timeframe", so that I can put the indicator on the H1 chart and see the indicator for the M30 oder D1 Timeframe.

Is this possible? How can I do it?!

hasayama:

Instead of using High[i], Close[i] etc, you need to use iHigh(...), iClose(...). These functions can return values for any TF.

Here is the book;) -> https://docs.mql4.com/series/iClose

Hello,

you can use iHigh, iClose but you should also have in mind that there are some intricacies.  For example, when you are e.g. in a 1 hour TF, calling a 30 min iHigh(), history for that TF may not be available immediately (you may see https://www.mql5.com/en/forum/157343 ). What you can possibly do is to first call all TFs in OnInit() (using, for example, iHigh() ) and Sleep() for some seconds, as to allow for history to get downloaded. Then, you may check the return values of some functions to be sure about

best regards 

honest_knave
951
honest_knave 2015.11.09 14:31  
Welcome to 2010 everyone 
Demos Stogios
184
Demos Stogios 2015.11.09 14:49  
oops :) but really, how? is this a by-product of the "similar" button that appeared beneath poster's messages?
honest_knave
951
honest_knave 2015.11.09 14:55  

No, I think a poster went on a resurrection rampage, posting solutions to very old threads. I think the intentions were good but it did bring a lot of old threads back up to the top.

Either a mod or the poster have deleted their content, but I guess a few got replied to before then. 

/
To add comments, please log in or register