-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from EA31337/dev
Final release updates
- Loading branch information
Showing
20 changed files
with
591 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
--- | ||
Language: Cpp | ||
BasedOnStyle: Google | ||
ColumnLimit: 120 | ||
Language: Cpp | ||
BasedOnStyle: Google | ||
ColumnLimit: 120 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
--- | ||
name: Backtest | ||
|
||
# yamllint disable-line rule:truthy | ||
on: | ||
push: | ||
branches: | ||
- 'v*-backtest' | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
|
||
Compile: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
- name: List MQL files | ||
run: '(Get-ChildItem -Recurse -Path . -Include *.mq[45]).fullname' | ||
shell: powershell | ||
- name: Compiles EA (MQL4) | ||
uses: fx31337/mql-compile-action@master | ||
with: | ||
path: src\EA31337-Libre.mq4 | ||
verbose: true | ||
|
||
- name: Compiles EA (MQL5) | ||
uses: fx31337/mql-compile-action@master | ||
with: | ||
path: src\EA31337-Libre.mq5 | ||
verbose: true | ||
- name: List compiled files | ||
run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: EA | ||
path: 'src/*.ex?' | ||
|
||
Backtest: | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
needs: Compile | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
deposit: [10000, 100000] | ||
spread: [1, 10] | ||
year: [2019] | ||
|
||
steps: | ||
|
||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: EA | ||
|
||
- name: Test ${{ matrix.year }}.${{ matrix.month }} | ||
uses: fx31337/mql-tester-action@master | ||
with: | ||
BtDeposit: ${{ matrix.deposit }} | ||
BtDigits: 5 | ||
BtMonths: 1-12 | ||
BtSpread: ${{ matrix.spread }} | ||
BtYears: ${{ matrix.year }} | ||
RunOnWarning: 'show_logs && parse_results $@' | ||
TestExpert: EA31337-Libre | ||
TestPeriod: M1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
--- | ||
name: Optimize Strategies | ||
|
||
# yamllint disable-line rule:truthy | ||
on: | ||
push: | ||
branches: | ||
- 'optimize-strats' | ||
|
||
jobs: | ||
Compile: | ||
defaults: | ||
run: | ||
shell: powershell | ||
working-directory: src | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
- name: List MQL files | ||
run: '(Get-ChildItem -Recurse -Path . -Include *.mq[45]).fullname' | ||
shell: powershell | ||
- name: Compile for MQL4 | ||
uses: fx31337/mql-compile-action@master | ||
with: | ||
path: src\EA31337-Libre.mq4 | ||
include: src | ||
mt-version: 4.0.0.1320 | ||
verbose: true | ||
- name: Compile for MQL5 | ||
uses: fx31337/mql-compile-action@master | ||
with: | ||
path: src\EA31337-Libre.mq5 | ||
include: src | ||
mt-version: 5.0.0.2766 | ||
verbose: true | ||
- name: List compiled files | ||
run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: EA | ||
path: 'src/*.ex?' | ||
Process: | ||
env: | ||
SETS_DIR: sets/optimize/strategies | ||
outputs: | ||
sets-list: ${{ steps.get-sets.outputs.sets }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set output with list of sets | ||
id: get-sets | ||
run: | | ||
import glob, json, os | ||
os.chdir(os.getenv('SETS_DIR')) | ||
files = glob.glob("*.set") | ||
print("::set-output name=sets::{}".format(json.dumps(files))) | ||
shell: python | ||
- name: Display output | ||
run: echo ${{ steps.get-sets.outputs.sets }} | ||
- name: Upload sets | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: sets | ||
path: ${{ env.SETS_DIR }} | ||
Optimize: | ||
needs: [Compile, Process] | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
setfile: ${{ fromJson(needs.Process.outputs.sets-list) }} | ||
steps: | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
path: . | ||
- name: Display SET file | ||
run: cat sets/${{ matrix.setfile }} | ||
- uses: ea31337/mql-tester-action@master | ||
with: | ||
BtDeposit: 100000 | ||
BtDest: ${{ github.workspace }}/_results | ||
BtMonths: 11-12 | ||
BtPair: EURUSD | ||
BtYears: 2019 | ||
OptFormatBrief: true | ||
OptFormatJson: true | ||
OptOptimize: true | ||
OptVerbose: true | ||
SetFile: ${{ github.workspace }}/sets/${{ matrix.setfile }} | ||
SetParams: ${{ steps.data.outputs.param }} | ||
TestExpert: "EA31337-Libre" | ||
TestPeriod: M1 | ||
TestReportName: Report | ||
- name: Upload result files | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: results | ||
path: ./_results/*.* | ||
- name: Process results | ||
run: | | ||
pwd | ||
ls | ||
jq --version | ||
jq . _results/*.json | ||
jq -r '(."Result params"/";")[0]' _results/*.json | ||
jq -r '((."Result params"/";")[0]/"=")[0]' | ||
jq -r '(."Result params"/";")[0]' _results/*.json \ | ||
>> $GITHUB_ENV | ||
jq -r '"pname="+((."Result params"/";")[0]/"=")[0]' \ | ||
_results/*.json >> $GITHUB_ENV | ||
Results: | ||
needs: Optimize | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
persist-credentials: false | ||
# Otherwise, you will failed to push refs to dest repo. | ||
fetch-depth: 0 | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: results | ||
path: .results | ||
- name: Parse results | ||
run: | | ||
cat << EOF >> $GITHUB_ENV | ||
RES_DD=$(jq -rs '.[0]|."Drawdown %"' .results/*.json) | ||
RES_PF=$(jq -rs '.[0]|."Profit factor"' .results/*.json) | ||
RES_TT=$(jq -rs '.[0]|."Total trades"' .results/*.json) | ||
EOF | ||
shell: bash -ex {0} | ||
- name: Check differences | ||
id: git-details | ||
run: echo "::set-output name=changed::$(git diff | wc -l)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
--- | ||
name: Test | ||
|
||
# yamllint disable-line rule:truthy | ||
on: | ||
pull_request: | ||
paths: | ||
- '**.h' | ||
- '**.mq?' | ||
- .github/workflows/test.yml | ||
- src/*.mq? | ||
- src/*.mq[45h] | ||
- src/include/** | ||
push: | ||
paths: | ||
- '**.h' | ||
- '**.mq?' | ||
- .github/workflows/test.yml | ||
- src/*.mq? | ||
- src/*.mq[45h] | ||
- src/include/** | ||
|
||
jobs: | ||
|
||
Compile: | ||
defaults: | ||
run: | ||
shell: powershell | ||
working-directory: src | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
- name: List MQL files | ||
run: '(Get-ChildItem -Recurse -Path . -Include *.mq[45]).fullname' | ||
shell: powershell | ||
- name: Compiles EA (MQL4) | ||
uses: fx31337/mql-compile-action@master | ||
with: | ||
path: src\EA31337-Libre.mq4 | ||
verbose: true | ||
|
||
- name: Compiles EA (MQL5) | ||
uses: fx31337/mql-compile-action@master | ||
with: | ||
path: src\EA31337-Libre.mq5 | ||
verbose: true | ||
- name: List compiled files | ||
run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: EA | ||
path: 'src/*.ex?' | ||
|
||
Test: | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
needs: Compile | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
month: [1, 2] | ||
year: [2019] | ||
|
||
steps: | ||
|
||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: EA | ||
|
||
- name: Test ${{ matrix.year }}.${{ matrix.month }} | ||
uses: fx31337/mql-tester-action@master | ||
with: | ||
BtDeposit: 10000 | ||
BtDigits: 5 | ||
BtMonths: ${{ matrix.month }} | ||
BtYears: ${{ matrix.year }} | ||
RunOnWarning: 'show_logs && parse_results $@' | ||
TestExpert: EA31337-Libre | ||
TestPeriod: M1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[submodule "EA31337-classes"] | ||
path = src/include/EA31337-classes | ||
[submodule "classes"] | ||
path = src/include/classes | ||
url = https://github.com/EA31337/EA31337-classes | ||
[submodule "EA31337-strategies"] | ||
path = src/include/EA31337-strategies | ||
[submodule "strategies"] | ||
path = src/include/strategies | ||
url = https://github.com/EA31337/EA31337-strategies |
Oops, something went wrong.