Saving AccountBalance to file

Back to topics list To post a new topic, please log in or register
avatar
10
kasio79 2014.04.17 02: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

avatar
13008
WHRoeder 2014.04.17 02:39 #
 
kasio79:Is it possible
Yes, code it.
avatar
10
kasio79 2014.04.17 03: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

avatar
Moderator
3206
angevoyageur 2014.04.17 13: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.

avatar
3134
qjol 2014.04.17 14:10 #
 
start reading about File Functions
avatar
3
awkWard 2015.05.11 00: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... 

avatar
Moderator
3423
GumRai 2015.05.11 01:34 #
 

Is anything printing in the experts tab?

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

Back to topics list  

To add comments, please log in or register