Hi,
I would like to have an EA to log:
Maximum Equity and respective time
Minimum Equity and respective time
Maximum Drawdown and respective time
My problem is that I wanted this to work, even when I re-start MT4, so the values must be written in a file and I do not know how to do it.
To get the values I can use this code:
if (MaxEq < AccountEquity() ) MaxEq = AccountEquity();
if (MinEq > AccountEquity() ) MinEq = AccountEquity();
if (MaxEq - MinEq > MaxDD ) MaxDD = MaxEq - MinEq;
But I don't know how to record the time nor to write those values in a file, so when MT4 is re-started it will read the last values (in the file).
Thank you,
JFonseca
I would like to have an EA to log:
Maximum Equity and respective time
Minimum Equity and respective time
Maximum Drawdown and respective time
My problem is that I wanted this to work, even when I re-start MT4, so the values must be written in a file and I do not know how to do it.
To get the values I can use this code:
if (MaxEq < AccountEquity() ) MaxEq = AccountEquity();
if (MinEq > AccountEquity() ) MinEq = AccountEquity();
if (MaxEq - MinEq > MaxDD ) MaxDD = MaxEq - MinEq;
But I don't know how to record the time nor to write those values in a file, so when MT4 is re-started it will read the last values (in the file).
Thank you,
JFonseca