FX31337 / FX-BT-Scripts

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

Script to read srv format. #64

Closed kenorb closed 6 years ago

kenorb commented 8 years ago

Extend read_mt_formats.py to read srv format.

You can check how different formats are defined in bstruct_defs.py script (used by read_mt_formats.py), basically you need to find the type (such as double, integer or string) and size of the individual fields. You can guess the names, but it's not so important. The obvious is that the first is the name, then company name, IP, port.

Samples: srv-files.zip

Suggested command to compare two binary files:

diff -y <(xxd FXCM-EURDemo01.srv) <(xxd FXCM-GBPDemo01.srv) | colordiff

Hints: mt5demo.zip

Est. 4-8h

ghost commented 6 years ago

Do you know of some kind of reference material for this SRV file format? It appears to be a "server file" for some kind of software called Metatrader, but I am unable to find any information so far about how this data file is serialized.

ghost commented 6 years ago

I think I have finished the last of the obvious binary chunks, which all happen to be fixed sized text strings. As for the rest of the binary data, I tried using a hex viewer that could interpret the remaining bytes as various data types, but I was unable to find anything further about their intent or purpose. I could not find any floats or doubles that had a value resembling this "lot step" you mentioned. I think you are right in thinking that the remaining data chunks are obfuscated via an unknown form of data encoding.

For future reference, I was able to find some hints about the file format from the vServers.h header file from the MT5 C++ API Trial code, located here: http://mtapi.online/download/mt5demo.zip

As this is an undocumented file format, I think I am at the limit of what I can do, but I think I have been able to at least provide you with something that someone else can expand on later. Is this enough for you to consider the original bounty requirements to be satisfied? As you said, I think you will need to split this task into multiple issues to tackle different aspects of the problem, simply because we don't know what other data is lurking in these server files.

kenorb commented 6 years ago

Fixed in #93.