Download MetaTrader 5
To add comments, please log in or register
Deposit to your account via Visa QIWI Wallet
luo jun
142
luo jun 2015.07.21 16:22 
 void OnTick()

{

  string FileName = TerminalInfoString(TERMINAL_DATA_PATH)+"\\"+"abc.txt";

  if(MyHandle == 0)

  {

    Print(FileName);

    MyHandle=FileOpen(FileName,FILE_WRITE|FILE_TXT);

    Print("MyHandle:",MyHandle);

  }

  

  if(MyHandle > 0)

  {

    FileWrite(MyHandle, string(AccountEquity()));

    FileClose(MyHandle);     

  } 

 

The log shows bellow info. And the error code is 5002. Whats the problem? 

EURUSDpro,M5: D:\MetaTrader 4\abc.txt

EURUSDpro,M5: MyHandle:-1 

Alain Verleyen
Moderator
30299
Alain Verleyen 2015.07.22 23:37  

Forum on trading, automated trading systems and testing trading strategies


Hello,

Please use the SRC button when you post code. Thank you.


This time, I edited it for you.


Alain Verleyen
Moderator
30299
Alain Verleyen 2015.07.22 23:38  
luo jun:

The log shows bellow info. And the error code is 5002. Whats the problem? 

EURUSDpro,M5: D:\MetaTrader 4\abc.txt

EURUSDpro,M5: MyHandle:-1 

Please read the documentation more carefully.

  string FileName = "abc.txt";
/
To add comments, please log in or register