- Modifying an existing indicator "macd_histogram"
- chart for USDEUR........JPYUSD....... and so on
- need help formating date-time string
Hi Can we change the time format in mql4 from 2013.09.09 13:15 to 30130909 1315 Any help is appreciated and thnx in advance
ObjectCreate(".....", OBJ_LABEL, 0, 0, 0); ObjectSetText("....",DoubleToStr((..);
datetime timeformat = TimeCurrent(); Print(" Time " ,timeformat);
What output do you have this way ???
What output do you have this way ???
hi and thanks for you deVries
am not good in mql4 programming, but as i know the print function will send the output to the log file ..(am not sure as am beginner )
can we show the output on the screen of mq4 terminal ? using object creat?
oh ....what a big mistake ..................about the needed time format.......it should be.20130909 1315 not...30130909 1315.
.......
in all of my previous posts i made the same mistake.....sorry .hope any Moderator to correct it
oh ....what a big mistake ..................about the needed time format.......it should be.20130909 1315 not...30130909 1315.
.......
in all of my previous posts i made the same mistake.....sorry .hope any Moderator to correct it
You can construct the string using StringConcatenate(int, int, int, int, ) with TimeYear(TimeCurrent() ) TimeMonth(TimeCurrent) TimeDay(TimeCurrent) etc.
hi
i will tray this function ....
thanks for u RaptorUK .
- abdI: it should be.20130909 1315 not...30130909 1315. (yyyymmdd hhmm)From TimeToStr - MQL4 Documentation TimeToStr returns "yyyy.mm.dd hh:mi". So strip out the separators.Not compiled, not tested.
string TimeToStringNS(datetime when){ string withSep = TimeToStr(when), // "yyyy.mm.dd hh:mi" withOut = StringSubstr(withSep, 0, 4) // yyyy + StringSubstr(withSep, 5, 2) // mm + StringSubstr(withSep, 8, 5) // dd hh + StringSubstr(withSep, 14, 3); // mi return(withOut); // "yyyymmdd hhmi" }
Not compiled, not tested. - RaptorUK: You can construct the string using StringConcatenate(int, int, int, int, ) with TimeYear(TimeCurrent() ) TimeMonth(TimeCurrent) TimeDay(TimeCurrent) etc.Using TimeMonth(x), etc., will not result is 2 digit values but instead yyyymd hm in general.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use