TimeCurrent shows the correct time when it's used in an EA, not when is used in a indicator dropped in a EA in backtesting. I think, it's fixed.
I also fell into this trap now, what was your way of fixing/getting around this issue?
thks,
egi
Hi,
In backtest, how to get the current time, I mean the real current time, like 2012 Aug 4 12:03pm? I use TimeLocal() and it just shows me the time of the current bar of the backtest. Thanks!
Hi,
In backtest, how to get the current time, I mean the real current time, like 2012 Aug 4 12:03pm? I use TimeLocal() and it just shows me the time of the current bar of the backtest. Thanks!
LOL well you do a backtest and you look same time at the clock in your home and you have the time of that moment then you also have to check the date of today and you get your real current time .... So forget using TimeLocal() it won't give you your real current time, like 2012 Aug 4 12:03pm (time of this moment)
TimeLocal() " Note: At the testing, local time is modelled and is the same as the modelled last known server time. "
Why would you need local time during a backtest on historic data ?
TimeLocal() " Note: At the testing, local time is modelled and is the same as the modelled last known server time. "
Why would you need local time during a backtest on historic data ?
Hi, because I want to time how long the backtest has run. Say if I the backtest with the same data has been running for 30 mins before as the benchmark, and after I've made some changes it has become 45 mins, there is something wrong.
It won't be possible for me to sit and watch and time when the backtest has finished every time.
Hi, because I want to time how long the backtest has run. Say if I the backtest with the same data has been running for 30 mins before as the benchmark, and after I've made some changes it has become 45 mins, there is something wrong.
It won't be possible for me to sit and watch and time when the backtest has finished every time.
Write a file from init() and write a different file from deinit() . . . then you have the start and finish times for the run.
int startWaitingTime = GetTickCount(), // Remember start time. : int delaySeconds = (GetTickCount() - startWaitingTime)/1000;

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello.
I can't get the correct time at backtesting, for example if I'm at 4H timeframe I only can get the datetime when the bar opened (with Time[0]) but not the current time (at the backtesting, not local or server time).
I have tried to use iTime function to get the minutes with the 1M period... but I think backtesting can't get the information of another timeframes.
Do you know if there is a way to get tick by tick the time hh:mm in the simulation?
Thank you.