Skip to content

Commit 146fe75

Browse files
authored
Merge pull request #45 from EA31337/dev-v3000
New V2 release (code refactor)
2 parents eed1c19 + 7c6aa2f commit 146fe75

16 files changed

Lines changed: 1531 additions & 1069 deletions

.github/workflows/backtest.yml

Lines changed: 24 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -6,70 +6,49 @@ on:
66
push:
77
branches:
88
- 'v*-backtest'
9+
paths:
10+
- .github/workflows/backtest.yml
911
release:
1012
types:
1113
- published
1214

1315
jobs:
1416

15-
Compile:
16-
runs-on: windows-latest
17-
steps:
18-
- uses: actions/checkout@v2
19-
with:
20-
submodules: recursive
21-
- name: List MQL files
22-
run: '(Get-ChildItem -Recurse -Path . -Include *.mq[45]).fullname'
23-
shell: powershell
24-
- name: Compiles EA (MQL4)
25-
uses: fx31337/mql-compile-action@master
26-
with:
27-
path: src\EA31337-Libre.mq4
28-
verbose: true
29-
30-
- name: Compiles EA (MQL5)
31-
uses: fx31337/mql-compile-action@master
32-
with:
33-
path: src\EA31337-Libre.mq5
34-
verbose: true
35-
- name: List compiled files
36-
run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname'
37-
38-
- name: Upload artifacts
39-
uses: actions/upload-artifact@v2
40-
with:
41-
name: EA
42-
path: 'src/*.ex?'
17+
compile:
18+
name: Compile
19+
uses: ./.github/workflows/compile.yml
4320

44-
Backtest:
21+
backtest:
4522

4623
defaults:
4724
run:
4825
shell: bash
4926

50-
needs: Compile
27+
name: Backtest
28+
needs: compile
5129
runs-on: ubuntu-latest
5230

53-
strategy:
54-
matrix:
55-
deposit: [10000, 100000]
56-
spread: [1, 10]
57-
year: [2020]
58-
5931
steps:
6032

61-
- uses: actions/download-artifact@v2
33+
- uses: actions/download-artifact@v4.1.7
6234
with:
6335
name: EA
6436

6537
- name: Test ${{ matrix.year }}.${{ matrix.month }}
66-
uses: fx31337/mql-tester-action@master
38+
uses: fx31337/mql-tester-action@dev
6739
with:
68-
BtDeposit: ${{ matrix.deposit }}
69-
BtDigits: 5
70-
BtMonths: 1-12
71-
BtSpread: ${{ matrix.spread }}
72-
BtYears: ${{ matrix.year }}
73-
RunOnError: 'show_logs && parse_results $@; exit 0'
74-
TestExpert: EA31337-Libre
40+
Login: ${{ secrets.MT5_LOGIN }}
41+
Password: ${{ secrets.MT5_PASSWORD }}
42+
Server: MetaQuotes-Demo
43+
TestDeposit: ${{ matrix.deposit }}
44+
TestExpert: EA31337-Libre.ex5
45+
TestFromDate: ${{ matrix.year }}.01.01
7546
TestPeriod: M1
47+
TestSymbol: EURUSD
48+
TestToDate: ${{ matrix.year }}.12.31
49+
UrlExpert: file://${{ github.workspace }}/EA31337-Libre.ex5
50+
51+
strategy:
52+
matrix:
53+
deposit: [10000, 100000]
54+
year: [2022, 2023]

.github/workflows/check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ jobs:
1010
Pre-commit:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v3
14-
- uses: actions/cache@v3
13+
- uses: actions/checkout@v4
14+
- uses: actions/cache@v4
1515
with:
1616
path: ~/.cache/pre-commit
1717
key: pre-commit|${{ hashFiles('.pre-commit-config.yaml') }}

.github/workflows/compile.yml

Lines changed: 91 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,116 @@
11
---
22
name: Compile
33

4+
env:
5+
ARTIFACT_PREFIX: ${{ inputs.artifact_prefix || 'mt' }}
6+
REPOSITORY: EA31337/EA31337-Libre
7+
SKIP_CLEANUP: ${{ inputs.skip_cleanup || false }}
8+
49
# yamllint disable-line rule:truthy
510
on:
611
pull_request:
12+
branches:
13+
- 'master'
14+
- '*dev*'
715
paths-ignore:
8-
- '**.md'
16+
- '*.md'
17+
- '.git*'
918
push:
19+
branches:
20+
- 'master'
21+
- '*dev*'
1022
paths-ignore:
11-
- '**.md'
23+
- '*.md'
24+
- '.git*'
25+
workflow_call:
26+
inputs:
27+
artifact_prefix:
28+
default: mt
29+
description: Artifact prefix.
30+
required: false
31+
type: string
32+
skip_cleanup:
33+
default: false
34+
description: Whether to skip a clean-up job.
35+
required: false
36+
type: boolean
1237

1338
jobs:
14-
Compile:
39+
checkout:
40+
name: Checkout
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/checkout@v4
44+
with:
45+
submodules: recursive
46+
- name: Uploads source code
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: src
50+
path: src
51+
mt4:
52+
name: Installs platform (4)
53+
uses: EA31337/EA-Tester/.github/workflows/platform-linux.yml@dev
54+
with:
55+
artifact_name: ${{ inputs.artifact_prefix || 'mt' }}4
56+
artifact_overwrite: true
57+
skip_cleanup: true
58+
version: 4
59+
60+
mt5:
61+
name: Installs platform (5)
62+
uses: EA31337/EA-Tester/.github/workflows/platform-linux.yml@dev
63+
with:
64+
artifact_name: ${{ inputs.artifact_prefix || 'mt' }}5
65+
artifact_overwrite: true
66+
skip_cleanup: true
67+
version: 5
68+
69+
compile-ea:
1570
defaults:
1671
run:
1772
shell: powershell
18-
working-directory: src
73+
name: Compile EA
74+
needs: [checkout, mt4, mt5]
1975
runs-on: windows-latest
2076
steps:
21-
- uses: actions/checkout@v2
22-
- uses: actions/checkout@v2
77+
- uses: actions/download-artifact@v4
2378
with:
24-
submodules: recursive
25-
- name: List MQL files
26-
run: '(Get-ChildItem -Recurse -Path . -Include *.mq[45]).fullname'
27-
shell: powershell
28-
- name: Compiles EA (MQL4)
29-
uses: fx31337/mql-compile-action@master
79+
name: src
80+
path: src
81+
- uses: actions/download-artifact@v4
3082
with:
31-
path: src\EA31337-Libre.mq4
32-
verbose: true
33-
34-
- name: Compiles EA (MQL5)
83+
name: ${{ env.ARTIFACT_PREFIX }}${{ matrix.version }}
84+
path: .${{ env.ARTIFACT_PREFIX }}${{ matrix.version }}
85+
- name: List all source code files
86+
run: '(Get-ChildItem -Recurse -Path . -Include *.mq[45]).fullname'
87+
- name: List compiled files
88+
run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname'
89+
- name: Compiles EA
3590
uses: fx31337/mql-compile-action@master
3691
with:
37-
path: src\EA31337-Libre.mq5
92+
mt-path: .${{ env.ARTIFACT_PREFIX }}${{ matrix.version }}
93+
path: src\EA31337-Libre.mq${{ matrix.version }}
3894
verbose: true
3995
- name: List compiled files
4096
run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname'
41-
97+
- run: Get-Location
4298
- name: Upload artifacts
43-
uses: actions/upload-artifact@v2
99+
uses: actions/upload-artifact@v4
100+
with:
101+
name: EA-Libre.ex${{ matrix.version }}
102+
path: src/*.ex?
103+
strategy:
104+
matrix:
105+
version: [4, 5]
106+
timeout-minutes: 30
107+
108+
cleanup:
109+
if: inputs.skip_cleanup != true
110+
name: Clean-up
111+
needs: [compile-ea]
112+
runs-on: ubuntu-latest
113+
steps:
114+
- uses: geekyeggo/delete-artifact@v5
44115
with:
45-
name: EA
46-
path: 'src/*.ex?'
116+
name: ${{ env.ARTIFACT_PREFIX }}*
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ jobs:
1515
working-directory: src
1616
runs-on: windows-latest
1717
steps:
18-
- uses: actions/checkout@v2
19-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v4
19+
- uses: actions/checkout@v4
2020
with:
2121
submodules: recursive
2222
- name: List MQL files
@@ -50,7 +50,7 @@ jobs:
5050
sets-list: ${{ steps.get-sets.outputs.sets }}
5151
runs-on: ubuntu-latest
5252
steps:
53-
- uses: actions/checkout@v2
53+
- uses: actions/checkout@v4
5454
- name: Set output with list of sets
5555
id: get-sets
5656
run: |
@@ -73,7 +73,7 @@ jobs:
7373
matrix:
7474
setfile: ${{ fromJson(needs.Process.outputs.sets-list) }}
7575
steps:
76-
- uses: actions/download-artifact@v2
76+
- uses: actions/download-artifact@v4.1.7
7777
with:
7878
path: .
7979
- name: Display SET file
@@ -116,12 +116,12 @@ jobs:
116116
needs: Optimize
117117
runs-on: ubuntu-latest
118118
steps:
119-
- uses: actions/checkout@v2
119+
- uses: actions/checkout@v4
120120
with:
121121
persist-credentials: false
122122
# Otherwise, you will failed to push refs to dest repo.
123123
fetch-depth: 0
124-
- uses: actions/download-artifact@v2
124+
- uses: actions/download-artifact@v4.1.7
125125
with:
126126
name: results
127127
path: .results
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ jobs:
1515
working-directory: src
1616
runs-on: windows-latest
1717
steps:
18-
- uses: actions/checkout@v2
19-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v4
19+
- uses: actions/checkout@v4
2020
with:
2121
submodules: recursive
2222
- name: List MQL files
@@ -50,7 +50,7 @@ jobs:
5050
sets-list: ${{ steps.get-sets.outputs.sets }}
5151
runs-on: ubuntu-latest
5252
steps:
53-
- uses: actions/checkout@v2
53+
- uses: actions/checkout@v4
5454
- name: Set output with list of sets
5555
id: get-sets
5656
run: |
@@ -73,7 +73,7 @@ jobs:
7373
matrix:
7474
setfile: ${{ fromJson(needs.Process.outputs.sets-list) }}
7575
steps:
76-
- uses: actions/download-artifact@v2
76+
- uses: actions/download-artifact@v4.1.7
7777
with:
7878
path: .
7979
- name: Display SET file
@@ -116,12 +116,12 @@ jobs:
116116
needs: Optimize
117117
runs-on: ubuntu-latest
118118
steps:
119-
- uses: actions/checkout@v2
119+
- uses: actions/checkout@v4
120120
with:
121121
persist-credentials: false
122122
# Otherwise, you will failed to push refs to dest repo.
123123
fetch-depth: 0
124-
- uses: actions/download-artifact@v2
124+
- uses: actions/download-artifact@v4.1.7
125125
with:
126126
name: results
127127
path: .results

.github/workflows/sync-fork.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ jobs:
1414
if: github.repository != 'EA31337/EA31337-Libre'
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v4
1818
with:
1919
fetch-depth: 0
2020
persist-credentials: false
21-
- uses: actions/checkout@v2
21+
- uses: actions/checkout@v4
2222
with:
2323
fetch-depth: 0
2424
path: upstream

0 commit comments

Comments
 (0)