One way, which has its advantages, would be to write a data capture EA to write away the 1300 close time to a file, and have it running all the time on an H1 chart.
Then have your trading EA read the last 5 entries from the aforementioned file.
CB
It is a good ideea but it would require my computer to be on all the time running the EA (or at least everyday at 13.00) and this is a little hard to do.
I was wondering if there is a function similar to iClose where a certain time could be specified, the data is there on historical charts I just don't have any ideea how to get it automatically :)
Thanks for your answer.
And there should be another way, using the shift with (DAYS-1)*24+11+current round hour. (11 is calculated as 24-13) on H1 charts.
Now I need to find out how to get an integer of an hour :) .. at least I got to a decent point.
Try this on a H1
double closeArray[5];
int iBarShift( | string symbol, int timeframe, datetime time, bool exact=false) |
symbol | - | Symbol the data of which should be used to calculate indicator. NULL means the current symbol. |
timeframe | - | Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe. |
time | - | value to find (bar's open time). |
exact | - | Return mode when bar not found. false - iBarShift returns nearest. true - iBarShift returns -1. |
datetime some_time=D'2004.03.21 12:00'; int shift=iBarShift("EUROUSD",PERIOD_M1,some_time); Print("shift of bar with open time ",TimeToStr(some_time)," is ",shift);
It is a good ideea but it would require my computer to be on all the time running the EA (or at least everyday at 13.00) and this is a little hard to do.
Isn't this going to severely restrict your automated trading options?
CB

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I couldn't find a way to get a quote for a specific hour of the day. Let's say I need the close price for EURUSD at 13.00 for the last 5 days.
Is there a function that does something like this?
Your help would be much appreciated. Thanks.