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" 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/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 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]) diff --git a/scripts/run_backtest.sh b/scripts/run_backtest.sh index 1df57d9d..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..." @@ -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