Download MetaTrader 5
To add comments, please log in or register
Download MQL5 library codes via MetaTrader. It is convenient!
kasio kasio
37
kasio kasio 2014.04.17 00:04 

Hi,

What I'd like to do is be able to tell what my account balance is at a certain time in the day.

I'm trying out a strategy that has numerous positions open at once. As I am at work all day I'd like to be able to come home and open a log and see what my equity was at a given point in the day.

Is it possible to create an EA that writes the account balance/equity to a file at a given time, ie:


13:00 - $12,000

13:10 - $11,783

13:15 - $12,121

etc.


If so can someone help and show me quick code for this. I have been trying to figure this out via this website's MQl4 tutorial with FileWrite and FileWriteDouble functions but alas I am no coder and can't figure it out.

Any and all help would be greatly appreciated.


Thanks,
kasio

whroeder1
13640
whroeder1 2014.04.17 00:39  
kasio79:Is it possible
Yes, code it.
kasio kasio
37
kasio kasio 2014.04.17 01:53  

Thanks WHRoeder.

That's a start. I appreciate you're not interested in writing any code and I certainly understand that. Why would you?


That said, would you be so kind as to guide me in the right direction? Am I on the write path in using FileWriteDouble as the main command in logging this info or should I be using another? Please remember I have absolutely no coding experience and all I'm doing is learning from scratch reading this website's Book, it is a very useful aid. I'm learning the basic structure of the MQL4 language and will trial and error functions until I get there.

Regards,

Kasio

Alain Verleyen
Moderator
28648
Alain Verleyen 2014.04.17 11:54  
kasio79:

Thanks WHRoeder.

That's a start. I appreciate you're not interested in writing any code and I certainly understand that. Why would you?


That said, would you be so kind as to guide me in the right direction? Am I on the write path in using FileWriteDouble as the main command in logging this info or should I be using another? Please remember I have absolutely no coding experience and all I'm doing is learning from scratch reading this website's Book, it is a very useful aid. I'm learning the basic structure of the MQL4 language and will trial and error functions until I get there.

Regards,

Kasio

Hi, you probably want to write a csv file, so you have to use FileWrite. Please post your attempt if you need help.
qjol
3243
qjol 2014.04.17 12:10  
start reading about File Functions
Herbie
8
Herbie 2015.05.10 22:06  
qjol:
start reading about File Functions

I am sitting with a similar problem...

 

I would like to see my balance on every tick, just like what is displayed on the left side of the graph screen where the values of the instrument is scrolling...

   Alert( "aaaaa1",TimeToStr(TimeCurrent()),AccountBalance() );

   Print( "1Time=",TimeToStr(TimeCurrent()),AccountBalance() );

But I cannot see any alerts or anything on my screen.

GBPUSD,M15 1.52345 1.52013 1.53219

I looked at lots of examples... but... 

Keith Watford
Moderator
7979
Keith Watford 2015.05.10 23:34  

Is anything printing in the experts tab?

Do you really want an alert every tick? Maybe you mean to use Comment() ?

/
To add comments, please log in or register