From 2816fb349f534683001e7e841ff1f82e4f305d0f Mon Sep 17 00:00:00 2001 From: kenorb Date: Wed, 3 Jun 2020 22:33:46 +0100 Subject: [PATCH 1/5] Copies SET file when different --- scripts/.funcs.cmds.inc.sh | 2 +- scripts/run_backtest.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/.funcs.cmds.inc.sh b/scripts/.funcs.cmds.inc.sh index f5300fc6..4c2ddae5 100644 --- a/scripts/.funcs.cmds.inc.sh +++ b/scripts/.funcs.cmds.inc.sh @@ -195,7 +195,7 @@ install_mt() { 4.0.0.* | 5.0.0.*) [ ! -d "$dir_dest" ] && mkdir $VFLAG -p "$dir_dest" [ ! -w "$dir_dest" ] && { - echo "Error: Destination folder not writable!" >&2 + echo "ERROR: Destination folder not writable!" (id && stat "$dir_dest") >&2 exit 1 } diff --git a/scripts/run_backtest.sh b/scripts/run_backtest.sh index 1df57d9d..ca126d3c 100755 --- a/scripts/run_backtest.sh +++ b/scripts/run_backtest.sh @@ -476,8 +476,8 @@ if [ -n "$SETFILE" -a ! -s "$SETFILE" ]; then } cp -f $VFLAG "$TESTER_DIR/$exported_setfile" "$SETFILE" fi -if [ -s "$SETFILE" -a ! -f "$TESTER_DIR/$EA_SETFILE" ]; then - echo "INFO: EA's SET file is missing ($EA_SETFILE), copying from $SETFILE..." +if [ -r "$SETFILE" ] && ! diff -u "$TESTER_DIR/$EA_SETFILE" "$SETFILE"; then + echo "INFO: Copying SET file..." cp -f $VFLAG "$SETFILE" "$TESTER_DIR/$EA_SETFILE" fi From be8d59be9ad45b9abcbf3bc31195b6cfd432ebc3 Mon Sep 17 00:00:00 2001 From: kenorb Date: Thu, 4 Jun 2020 00:18:50 +0100 Subject: [PATCH 2/5] Updates if condition for MT_VER --- scripts/run_backtest.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run_backtest.sh b/scripts/run_backtest.sh index ca126d3c..ddb0a79f 100755 --- a/scripts/run_backtest.sh +++ b/scripts/run_backtest.sh @@ -115,7 +115,7 @@ parse_results() { if [ -n "$OPT_OPTIMIZATION" ]; then # Parse and save the optimization test results. echo "INFO: Sorting optimization test results..." - if [ "${MT_VER%%.*}" -ne 5 ]; then + if [ "${MT_VER:0:1}" = 4 ]; then sort_opt_results "$TEST_REPORT_HTM" fi echo "INFO: Saving optimization results..." From e213a6904cd930cb271a3cb11b13748f604d5df7 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 6 Jun 2020 17:10:28 +0100 Subject: [PATCH 3/5] Better wording in options.txt --- scripts/options.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/options.txt b/scripts/options.txt index 04f8a944..bfd598d7 100644 --- a/scripts/options.txt +++ b/scripts/options.txt @@ -44,7 +44,7 @@ Supported options: Change tester INI file with custom settings (e.g. Server=MetaQuotes-Demo,Login=123). Variable (string): TEST_OPTS -j - Convert test report file into JSON format. + Converts test report file to JSON formatted file. Variable (bool): OPT_FORMAT_JSON -l (double) Specifies a lot step (e.g. 0.01). @@ -80,7 +80,7 @@ Supported options: Spread to test in points. Variable (uint): BT_SPREAD -t - Convert test report file into brief text format. + Converts test report file to brief text format. Variable (bool): OPT_FORMAT_BRIEF -T (timeframe) Timeframe (TestPeriod) to test. Default: M30 From 82083bb3da81e6a8f132731702eb6418b962b322 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 6 Jun 2020 20:58:31 +0100 Subject: [PATCH 4/5] Adds compile.yml --- .github/workflows/compile.yml | 29 +++++++++++++++++++++++++++ .github/workflows/scripts/compile.ps1 | 10 +++++++++ 2 files changed, 39 insertions(+) create mode 100644 .github/workflows/compile.yml create mode 100644 .github/workflows/scripts/compile.ps1 diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml new file mode 100644 index 00000000..ad240279 --- /dev/null +++ b/.github/workflows/compile.yml @@ -0,0 +1,29 @@ +--- +name: Compile + +on: + pull_request: + paths: + - '**/*.mq?' + - '.github/workflows/compile.yml' + - '.github/workflows/scripts/compile.ps1' + push: + branches: + - 'master' + - 'ci' + - '*dev*' + paths: + - '**/*.mq?' + - '.github/workflows/compile.yml' + - '.github/workflows/scripts/compile.ps1' + +jobs: + Compile: + runs-on: windows-2019 + steps: + - uses: actions/checkout@v2 + with: + submodules: 'recursive' + - name: Compile + run: .\.github\workflows\scripts\compile.ps1 + shell: powershell diff --git a/.github/workflows/scripts/compile.ps1 b/.github/workflows/scripts/compile.ps1 new file mode 100644 index 00000000..2df5c94a --- /dev/null +++ b/.github/workflows/scripts/compile.ps1 @@ -0,0 +1,10 @@ +Set-ExecutionPolicy RemoteSigned -scope CurrentUser +Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh') +scoop update +scoop install ruby python +Invoke-WebRequest -Uri https://github.com/EA31337/MetaEditor/raw/master/metaeditor64.exe -OutFile metaeditor64.exe +./metaeditor64.exe /s /compile:. /log:mql.log +# ruby -e "if File.open('mql.log', mode:'rb:BOM|UTF-16LE').readlines.grep(Regexp.new '[1-9] error'.encode(Encoding::UTF_16LE)) {exit 1}; end" +# ruby -e "if File.open('mql.log', mode:'rb:BOM|UTF-16LE').readlines.grep(Regexp.new '[1-9] warning'.encode(Encoding::UTF_16LE)) {exit 1}; end" +# ruby -e "if File.open('mql.log', mode:'rb:BOM|UTF-16LE').readlines.grep(Regexp.new '[1-9][0-9] error'.encode(Encoding::UTF_16LE)) {exit 1}; end" +# ruby -e "if File.open('mql.log', mode:'rb:BOM|UTF-16LE').readlines.grep(Regexp.new '[1-9][0-9] warning'.encode(Encoding::UTF_16LE)) {exit 1}; end" From 933e1da94561ad40ed789ef2c30d613a394906b3 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 7 Jun 2020 22:35:29 +0100 Subject: [PATCH 5/5] Keeps the original data as it is instead of rounding it (fixes GH-194) --- scripts/py/bt_data_dl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/py/bt_data_dl.py b/scripts/py/bt_data_dl.py index a8848c07..b4306154 100755 --- a/scripts/py/bt_data_dl.py +++ b/scripts/py/bt_data_dl.py @@ -364,8 +364,8 @@ def bt5_to_csv(self): timestamp = "%d.%02d.%02d %02d:%02d:%06.3f" % (self.year, self.month, self.day, self.hour, minute, second) askPrice = row[1]/point bidPrice = row[2]/point - bidVolume = round(row[3] * 1000000) - askVolume = round(row[4] * 1000000) + bidVolume = "%.2f" % (row[4]) + askVolume = "%.2f" % (row[3]) # Writing one row in CSV format w.writerow([timestamp, bidPrice, askPrice, bidVolume, askVolume])