You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I just started working with MQL, I am playing around with it trying to figure out how things work, and I am trying to write my account information to a CSV file.
Here is the code I have:
int start() { //---- int fnum = FileOpen("testMQ4.txt",FILE_CSV|FILE_WRITE,","); if(fnum>0){ FileWrite(fnum,TimeToStr(TimeLocal(),TIME_DATE|TIME_SECONDS), DoubleToStr(AccountBalance(),8),DoubleToStr(AccountCredit(),8),AccountCompany(),AccountCurrency(),AccountEquity(),AccountFreeMargin(),AccountLeverage(),DoubleToStr(AccountMargin(),8),AccountName(),AccountNumber(),AccountProfit(),AccountServer()); FileClose(fnum); }Now, when I attach this to a chart, it seems to run from the beginning of the chart, and ends up with a file that looks like this:
(it is currently 2007.04.13 20:23:00) and the values for AccountMargin, and AccountEquity are not accurate to what I see in the client.
it seems like such a simple thing and I can't figure out what I am doing wrong. any nudges in the right direction are certainly appreciated.
Thanks
Lance