Forum

Calculating drawdown created by running trades for a magic number

Hi, I can't seem to get this code to work. I want to know drawdown (ideally including swap+commission but I can live without those if needed) created by all running trades for a magic number. Here is the code I'm using (the EA is bigger but I think that these are the relevant lines): #include

Formatting date and time

Hi, I have an MQ4 indicator that formats date and time like this: 26.10.2023 - 09:11:45 using this code: // This will take broker time and turn it into format DD.MM.YYY string GetTime( datetime when= 0 ) { if ( when== 0 ) when= TimeCurrent (); return StringFormat ( "%02d.%02d.%04d -

mq4 using Day() Month() Year()

Hi, I'm trying to use these functions. For example this one: https://docs.mql4.com/dateandtime/day // This will take broker time and turn it into format DD.MM.YYY string GetTime() { int nday = Day(); int nmonth = Month(); int nyear = Year(); string sdate = IntegerToString (nday) + "." +