l have tried many code , but still can't find way to get today date.
Example Today = 10-Sep-2017
When l doing backtest on = 1-Jan-2015
How to get today date?
An indi, EA or script in mt4 you can get today's date by Time - which is the time-stamp of the most recent bar. During a weekend it is the timestamp of the last bar from Friday!
In the tester Time is the actual time-stamp of the last bar of the pointer of the tester.
Or do you want to know how to compose the date formate a string: 1-Jan-2017?
Use TimeDay(), TimeMonth() (you have to convert:1="Jan",2=..) , TimeYear().
That method got time from last candle on backtest , not get today date.
but thanks , l want to get real today date ,like check from broker.
Your questions is confusing and unclear!
During testing in the Strategy Tester, TimeLocal() is always equal to TimeCurrent() simulated server time.
Can't be done, except using DLL/Windows call.
Tested TimeCurrent() and Time no way to get real today date.
Can't be done.
it can be done)
Excuse me how to do that?
OP wants to get local time while using the Strategy Tester, hence why the Win32 API suggestion.
Obviously, when not using the Strategy Tester, but on a Live chart, you don't need to use the Win32 API.