IdeaRe: MQL4 how get the time from 00:00:00 (day start time)

#2
baraozemo wrote:Hi,

(mt5) 

I need to get the datetime 00:00 from the current day..
is this correct? (is not working)...

datetime start=D'00:00:00'
You are missing the day part in that format
You can not do that that way. Try like this :

Code: Select all

   datetime start = StringToTime(TimeToString(TimeCurrent(),TIME_DATE));

or use the specific time for specific bar instead of the TimeCurrent() to get day part for that bar


  1. Similar Topics

    1. Yes, I can predict the market (for a short time)

      2 Replies 1753 Views

      by hero447, Sun Nov 10, 2019 9:23 pm in Trading Journals

      2 Replies
      1753 Views
    2. How to adjust daily candle closing time?

      2 Replies 804 Views

      by Dan15, Sat Jun 13, 2020 5:19 pm in New Members & Common Forex Q&A's

      2 Replies
      804 Views

Return to “Coding Help”