Skip to content

Commit

Permalink
Merge pull request #193 from EA31337/dev
Browse files Browse the repository at this point in the history
Minor development fixes
  • Loading branch information
kenorb authored Jun 7, 2020
2 parents 1cc465a + 933e1da commit d74283c
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 8 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions .github/workflows/scripts/compile.ps1
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion scripts/.funcs.cmds.inc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions scripts/options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions scripts/py/bt_data_dl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
6 changes: 3 additions & 3 deletions scripts/run_backtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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..."
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit d74283c

Please sign in to comment.