MQL4 - automated forex trading   /  

Forum

Can you set a time using iATR?

Back to topics list To post a new topic, please log in or register

avatar
3
andrewdotcomau 2007.05.29 16:58 
I've been searching through the documentation and several forums. Can anyone help me on this, is there a way to calculate the Average True Range at a set time, say 1am EST? It's been driving me nuts for the past couple of days. I am using iATR(..,...,shift), current shift is set at '0' which is the current time you execute the script or AE.

Kind Regards
Andrew
article

Registration Problems

Anticipating the growth of popularity of the Automated Trading Championship, we introduced an automated system to check the submitted Expert Advisors. By now, 60% of all submitted Expert Advisors have already been checked automatically.


avatar
1514
DxdCn 2007.05.29 19:37 
use iBarShift to transfer datetime to shift

int iBarShift( string symbol, int timeframe, datetime time, bool exact=false)
Search for bar by open time. The function returns bar shift with the open time specified. If the bar having the specified open time is missing, the function will return -1 or the nearest bar shift depending on the exact.

avatar
3
andrewdotcomau 2007.05.29 22:06 
Thank you sooo much DxdCn!! Exactly what I'm looking for. I come from a C background, does metatrader have a function similar to strcpy(). Since the program requires to check Average true range every day at 1am EST, I need to create a string for variable time = "today's date + 1am EST". Or is there an easier way to do this?


Kind Regards
Andrew

avatar
3
andrewdotcomau 2007.05.29 22:29 
it's ok I found the answer. For others who are interested, it's StringConcatenate()

Andrew
Back to topics list  

To add comments, please log in or register