Skip to content
Rafal W edited this page Jul 17, 2020 · 1 revision

Here are the syntax how to use the scripts.

mt_read/mt_modify

Changing symbol

$ mt_read -i EURUSD1.hst -t hst-header | grep symbol
symbol = EURUSD
$ mt_modify -i EURUSD1.hst -t hst-header -m symbol=XXXYYY
$ mt_read -i EURUSD1.hst -t hst-header | grep symbol
symbol = XXXYYY

Modifying test date

$ mt_read -i EURUSD1_0.fxt -t fxt-header | grep ^testBeginDate
testBeginDate = 2018-01-01 22:00:00
$ mt_modify -i EURUSD1_0.fxt -t fxt-header -m "testBeginDate=2018-01-02 23:00:00"
$ mt_read -i EURUSD1_0.fxt -t fxt-header | grep ^testBeginDate
testBeginDate = 2018-01-02 23:00:00

Modifying float type

$ mt_read -i EURUSD1_0.fxt -t fxt-header | grep pointSize
pointSize = 1e-05
$ mt_modify -i EURUSD1_0.fxt -t fxt-header -m pointSize=0.01
$ mt_read -i EURUSD1_0.fxt -t fxt-header | grep ^pointSize
pointSize = 0.01

Modifying HCC header values

$ /opt/scripts/py/mt_read.py -i EURUSD1.hcc -t hcc-header | grep name
name = History
$ /opt/scripts/py/mt_modify.py -i EURUSD1.hcc -t hcc-header -m name=Foo
$ /opt/scripts/py/mt_read.py -i EURUSD1.hcc -t hcc-header | grep name
name = Foo

Modifying server files (.srv)

$ mt_read -i FILE.srv -t srv | grep serverName
serverName = SomeValue
$ mt_modify -i FXCM-USDDemo01.srv -t srv -m serverName=Foo
serverName = Foo

Key group param is only used for symbols.raw file format, where symbol entries are grouped.

Modifying digits for specific symbol in symbols.raw

Docker example:

% docker run -it ea31337/ea-tester bash
/opt/scripts$ source .funcs.cmds.inc.sh
$ cd ~/.wine/drive_c/MetaTrader*
$ find . -name "sym*"
./history/symbolsets
./history/default/symbols.raw
./history/symbols.raw

$ mt_read -f ./history/symbols.raw -t symbols-raw | grep ^name
... (these are group names, each pair-group have some settings) ...
name = EURAUD
name = EURCAD
name = EURCHF
name = EURGBP
name = EURJPY
name = EURNZD
name = EURUSD
...

$ mt_read -f ./history/symbols.raw -t symbols-raw | grep -A5 EURUSD
name = EURUSD
description = Euro vs US Dollar
altName =
baseCurrency = EUR
group = 0
digits = 4

$ mt_read -f ./history/symbols.raw -t symbols-raw | grep -A5 GBPUSD
name = GBPUSD
description = Great Britain Pound vs US Dollar
altName =
baseCurrency = GBP
group = 0
digits = 4

$ mt_modify -f ./history/symbols.raw -t symbols-raw -k EURUSD -m digits=5

$ mt_read -f ./history/symbols.raw -t symbols-raw | grep -A5 EURUSD
name = EURUSD
description = Euro vs US Dollar
altName =
baseCurrency = EUR
group = 0
digits = 5 // <-- We've just changed digits to 5 for EURUSD only.

Related: EA31337/EA-Tester#154