FX31337 / FX-BT-Scripts

:page_facing_up: Useful scripts for backtesting.
MIT License
34 stars 39 forks source link

Script to read accounts.ini binary data. #61

Open kenorb opened 8 years ago

kenorb commented 8 years ago
  1. Install MT4.
  2. Run and open folder from menu File -> Open Data Folder.
  3. Go to config/ folder, you should have accounts.ini file created.

It changes on configuration changes related to accounts (e.g. File -> Login to Trade Account) or when you create a demo account (File -> Open an Account). It remembers the account number and it's used to set the account leverage.

Could be similar encryption as used for DAT files, see: convert_dat.py.

xor each byte of data with that of key, cycling over key as needed

Examples: accounts-files.zip.

The file should be in plain text format.

Related: #62 Est. 8-16h


Details

rikhtehgaran commented 1 year ago

Hi i try your script on your sample files that you have put

Examples: accounts-files.zip.

I have get this error:

$ ./convert_dat.py -i accounts1.ini -o out
Traceback (most recent call last):
  File "/mnt/My/Temp/00/accounts-files/./convert_dat.py", line 125, in <module>
    matches = re.search(r"([a-z0-9]+)\.dat", args.input_file).groups()
AttributeError: 'NoneType' object has no attribute 'groups'

So i changed the line 125 to .ini: matches = re.search(r"([a-z0-9]+)\.ini", args.input_file).groups()

But i still get error:

$ ./convert_dat.py -i accounts1.ini -o out
Traceback (most recent call last):
  File "/mnt/My/Temp/00/accounts-files/./convert_dat.py", line 127, in <module>
    raise Exception("Error with md5 from filename")
Exception: Error with md5 from filename

I there any way to extract accounts.ini from mt4?

kenorb commented 1 year ago

The thing is, I don't know the exact format of accounts.ini, could be similar or not, so changing few lines won't help much.