Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: EA31337/EA-Tester
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4.x
Choose a base ref
...
head repository: EA31337/EA-Tester
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 6,537 additions and 1,780 deletions.
  1. +28 −0 .appveyor.yml
  2. +43 −0 .editorconfig
  3. +1 −2 .gitattributes
  4. +2 −0 .github/FUNDING.yml
  5. +26 −0 .github/workflows/check.yml
  6. +54 −0 .github/workflows/compile.yml
  7. +90 −0 .github/workflows/docker.yml
  8. +114 −0 .github/workflows/platform-linux.yml
  9. +43 −0 .github/workflows/sync-fork.yml
  10. +72 −0 .github/workflows/tests-mql.yml
  11. +52 −0 .github/workflows/tests-shell.yml
  12. +3 −0 .markdownlint.yaml
  13. +7 −0 .mdlrc
  14. +62 −0 .pre-commit-config.yaml
  15. +38 −0 .shellcheckrc
  16. +0 −83 .travis.yml
  17. +11 −0 .yamllint
  18. +33 −36 Dockerfile
  19. +1 −1 Makefile
  20. +61 −157 README.md
  21. +1 −1 Vagrantfile
  22. +9 −0 ansible/galaxy-requirements.yml
  23. +7 −0 ansible/install-mt4.yml
  24. +7 −0 ansible/install-mt5.yml
  25. +25 −0 ansible/install-utils.yml
  26. +6 −0 ansible/install-wine.yml
  27. +6 −0 ansible/install-xvfb.yml
  28. +0 −26 appveyor.yml
  29. +5 −4 conf/README.md
  30. BIN conf/accounts-d4.ini
  31. BIN conf/accounts-d5.ini
  32. +7 −7 conf/mt4-tester.ini
  33. +276 −0 conf/mt5-tester.ini
  34. +56 −140 docker-compose.yml
  35. +2 −0 docs/_config.yml
  36. +11 −0 docs/index.md
  37. +1 −0 scripts/.aliases.inc.sh
  38. +512 −271 scripts/.funcs.cmds.inc.sh
  39. +186 −133 scripts/.funcs.inc.sh
  40. +45 −17 scripts/.funcs.sets.inc.sh
  41. +63 −17 scripts/.vars.inc.sh
  42. +214 −0 scripts/bt_data_get.sh
  43. +6 −3 scripts/clone_repo.sh
  44. +6 −3 scripts/dl_ea.sh
  45. +1 −1 scripts/eval.sh
  46. +0 −208 scripts/get_bt_data.sh
  47. +19 −7 scripts/get_gh_asset.sh
  48. +25 −14 scripts/install_mt4.sh
  49. +0 −36 scripts/install_mt4.verb
  50. +0 −59 scripts/install_mt4x.sh
  51. +25 −14 scripts/install_mt5.sh
  52. +0 −31 scripts/install_mt5.verb
  53. +48 −30 scripts/options.txt
  54. +242 −0 scripts/provision-colab.sh
  55. +71 −85 scripts/provision.sh
  56. +11 −5 scripts/push_repo.sh
  57. +3 −0 scripts/py/.gitignore
  58. 0 scripts/py/bstruct/__init__.py
  59. +96 −0 scripts/py/bstruct/bstruct.py
  60. +652 −0 scripts/py/bstruct/bstruct_defs.py
  61. +916 −0 scripts/py/fx-data-convert-from-csv.py
  62. +528 −0 scripts/py/fx-data-download.py
  63. +387 −0 scripts/py/fx-data-generate.py
  64. +357 −0 scripts/py/mt_modify.py
  65. +164 −0 scripts/py/mt_read.py
  66. +285 −181 scripts/run_backtest.sh
  67. +6 −3 scripts/run_terminal.sh
  68. +20 −0 scripts/tests/test_aliases.sh
  69. +46 −0 scripts/tests/test_backtest.sh
  70. +41 −0 scripts/tests/test_bt_data_gen.sh
  71. +50 −0 scripts/tests/test_cmds.sh
  72. +38 −0 scripts/tests/test_compile.sh
  73. +16 −0 scripts/tests/test_eval.sh
  74. +14 −0 scripts/tests/test_vars.sh
  75. +0 −15 tests/TestBands.mq4
  76. +0 −15 tests/TestEnvelopes.mq4
  77. +0 −15 tests/TestFXTHeader.mq4
  78. +0 −15 tests/TestHSTHeader.mq4
  79. +21 −0 tests/TestLeverage.mq4
  80. +2 −16 tests/TestLotstep.mq4
  81. +0 −15 tests/TestMargin.mq4
  82. +0 −16 tests/TestModellingQuality.mq4
  83. +1 −15 tests/TestSpread.mq4
  84. +0 −15 tests/TestSymbolsRaw.mq4
  85. +0 −15 tests/TestSymbolsSel.mq4
  86. +1 −1 tests/TestSymgroupsRaw.mq4
  87. +0 −15 tests/TestTimeframes.mq4
  88. +179 −0 tests/docker-compose.yml
  89. +1 −0 tests/requirements.pip.txt
  90. +13 −0 tests/scripts/Dummy.mq4
  91. +15 −0 tests/scripts/Dummy.mq5
  92. +3 −37 tests/scripts/PrintPaths.mq4
  93. +20 −0 tests/scripts/PrintPaths.mq5
  94. +13 −0 tests/scripts/TestInitFail.mq4
  95. +15 −0 tests/scripts/TestInitFail.mq5
28 changes: 28 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# yamllint disable rule:line-length
---
init:
- ps: iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
install:
- appveyor DownloadFile https://github.com/EA31337/MetaEditor/raw/master/metaeditor64.exe
- scoop install ruby python
- ps: scoop install shellcheck
before_test:
- shellcheck --version
- ruby --version
- git submodule update --init
test_script:
- ruby -wc Vagrantfile
- shellcheck -e SC1004,SC1083,SC1090,SC1091,SC1117,SC2004,SC2005,SC2015,SC2027,SC2032,SC2033,SC2034,SC2035,SC2046,SC2068,SC2070,SC2071,SC2086,SC2091,SC2103,SC2116,SC2124,SC2128,SC2145,SC2154,SC2155,SC2162,SC2164,SC2166,SC2181,SC2188,SC2206,SC2221,SC2222,SC2230 ./scripts/eval.sh ./scripts/run_backtest.sh ./scripts/provision.sh ./scripts/.vars.inc.sh ./scripts/install_mt5.sh ./scripts/.aliases.inc.sh ./scripts/bt_data_get.sh ./scripts/get_gh_asset.sh ./scripts/push_repo.sh ./scripts/run_terminal.sh ./scripts/.funcs.inc.sh ./scripts/dl_ea.sh ./scripts/clone_repo.sh ./scripts/.funcs.cmds.inc.sh ./scripts/install_mt4.sh ./scripts/install_mt4x.sh
- metaeditor64 /mql4 /s /compile:tests /log:mql4.log || exit /b 0
- metaeditor64 /mql5 /s /compile:tests /log:mql5.log || exit /b 0
- type mql4.log mql5.log
- ruby -e "if File.open('mql4.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('mql4.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('mql4.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('mql4.log', mode:'rb:BOM|UTF-16LE').readlines.grep(Regexp.new '[1-9][0-9] warning'.encode(Encoding::UTF_16LE)) {exit 1}; end"
- ruby -e "if File.open('mql5.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('mql5.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('mql5.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('mql5.log', mode:'rb:BOM|UTF-16LE').readlines.grep(Regexp.new '[1-9][0-9] warning'.encode(Encoding::UTF_16LE)) {exit 1}; end"
build: off
platform: x86
43 changes: 43 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# EditorConfig
# See: https://EditorConfig.org

# Top-most EditorConfig file.
root = true

# Unix-style newlines with a newline ending every file.
[*]
charset = utf-8
end_of_line = LF
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

# Matches multiple files with brace expansion notation.
# Set default charset.
[*.{js,py}]
charset = utf-8

# 4 space indentation.
[*.py]
indent_style = space
indent_size = 4

[*.sh]
# like -i=4
indent_style = space
indent_size = 2

binary_next_line = true # like -bn
switch_case_indent = true # like -ci
space_redirects = true # like -sr
function_next_line = true # like -fn

# Tab indentation (no size specified).
[Makefile]
indent_style = tab

# Matches the exact files either package.json or .travis.yml.
[{package.json,.travis.yml}]
indent_style = space
indent_size = 2
3 changes: 1 addition & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -3,8 +3,7 @@
# @see http://drupal.org/node/1542048

# Define text file attributes.
*.mq4 text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.mqh text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.mq? text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.sh text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.ini text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.txt text eol=lf
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
issuehunt: EA31337/EA-Tester
26 changes: 26 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Check

# yamllint disable-line rule:truthy
on:
pull_request:
push:

jobs:
Pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Installs shfmt
run: >
sudo install /dev/stdin /usr/local/bin/shfmt
< <(curl -L "$SHFMT_URL")
env:
# yamllint disable-line rule:line-length
SHFMT_URL: https://github.com/mvdan/sh/releases/download/v3.1.1/shfmt_v3.1.1_linux_amd64
- uses: actions/setup-python@v3
- uses: pre-commit/action@v3.0.0
54 changes: 54 additions & 0 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
name: Compile

# yamllint disable-line rule:truthy
on:
pull_request:
paths:
- '**/*.mq?'
- '.github/workflows/compile.yml'
push:
branches:
- 'master'
- '*dev*'
paths:
- '**/*.mq?'
- '.github/workflows/compile.yml'

jobs:
Compile-MT4:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Installs platform
uses: dawidd6/action-ansible-playbook@v2
with:
playbook: install-mt4.yml
directory: ./ansible
options: |
--connection local
--inventory localhost,
--verbose
requirements: galaxy-requirements.yml
- uses: fx31337/mql-compile-action@dev
with:
mt-path: ${{ github.workspace }}/../../../.wine/drive_c
verbose: true
Compile-MT5:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Installs platform
uses: dawidd6/action-ansible-playbook@v2
with:
playbook: install-mt5.yml
directory: ./ansible
options: |
--connection local
--inventory localhost,
--verbose
requirements: galaxy-requirements.yml
- uses: fx31337/mql-compile-action@dev
with:
mt-path: ${{ github.workspace }}/../../../.wine/drive_c
verbose: true
90 changes: 90 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
---
name: Docker

# yamllint disable-line rule:truthy
on:
pull_request:
paths-ignore:
- '**/*.md'
- '**/*.txt'
- '.*'
push:
branches:
- "master"
- "dev*"
paths-ignore:
- '**/*.md'
- '**/*.txt'
- '.*'
- '.github/**'
# Sequence of patterns matched against refs/tags.
tags:
- 'v1.*'
release:
types:
- published

jobs:
Hadolint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: brpaz/hadolint-action@master
with:
dockerfile: Dockerfile
Docker:
runs-on: ubuntu-latest
needs: Hadolint
steps:
- uses: actions/checkout@v4
- name: Build ubuntu-base
run: docker build --target ubuntu-base -t ubuntu-base .
- name: Build ubuntu-provisioned
run: docker build --target ubuntu-provisioned -t ubuntu-provisioned .
- name: Build ea-tester
run: docker build
--build-arg BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
--build-arg VCS_REF=${GITHUB_SHA}
--build-arg VERSION=${GITHUB_REF}
--target ea-tester-base .
- run: docker images
- name: Print GitHub actor, repository and ref
run: echo "${{ github.actor }} @ ${{ github.repository }}:${{ github.ref }}"
- name: Push to Docker Hub
if: >
github.repository == 'EA31337/EA-Tester'
&& github.event_name != 'pull_request'
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: ea31337/ea-tester
tag_with_ref: true
- name: Push to GitHub Packages
if: >
github.repository == 'EA31337/EA-Tester'
&& github.event_name != 'pull_request'
uses: docker/build-push-action@v1
with:
add_git_labels: true
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: docker.pkg.github.com
repository: ea31337/ea-tester/ea-tester
tag_with_ref: true
Test-Docker:
runs-on: ubuntu-latest
needs: Docker
container:
env:
OPT_TRACE: ${{ runner.debug }}
OPT_VERBOSE: true
image: ea31337/ea-tester:dev
volumes:
- ${{ github.workspace }}/scripts/tests:/opt/scripts
steps:
- run: pwd
- run: id
- run: ls -la /opt/scripts
# - run: scripts/eval.sh help
# - run: scripts/run_backtest.sh -?
114 changes: 114 additions & 0 deletions .github/workflows/platform-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
---
name: Platform (Linux)

env:
ARTIFACT_NAME: ${{ inputs.artifact_name || 'platform' }}
ARTIFACT_OVERWRITE: ${{ inputs.artifact_overwrite || false }}
CACHE: ${{ inputs.cache || true }}
CHECKOUT_REF: ${{ inputs.ref || 'dev' }}
REPOSITORY: EA31337/EA-Tester
SKIP_CLEANUP: ${{ inputs.skip_cleanup || false }}
VERSION: ${{ inputs.version || 5 }}

# yamllint disable-line rule:truthy
on:
pull_request:
paths:
- '.github/workflows/platform-linux.yml'
push:
branches:
- 'master'
- '*dev*'
paths:
- '.github/workflows/platform-linux.yml'
workflow_call:
inputs:
artifact_name:
default: platform
description: Artifact name.
required: false
type: string
artifact_overwrite:
default: false
description: Whether to overwrite artifact.
required: false
type: boolean
cache:
default: true
description: Whether to use cache.
required: false
type: boolean
ref:
default: dev
description: The branch, tag or SHA to checkout.
required: false
type: string
skip_cleanup:
default: false
description: Whether to skip a clean-up job.
required: false
type: boolean
version:
default: 5
description: Version to install.
type: number
# Map the workflow outputs to job outputs.
outputs:
platform:
description: Platform fact output.
value: ${{ jobs.platform-linux.outputs.platform || '{}' }}

jobs:
platform-linux:
name: Platform
# Map the job outputs to step outputs.
outputs:
platform: ${{ steps.out-mt-fact.outputs.platform }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ env.CHECKOUT_REF }}
repository: ${{ env.REPOSITORY }}
- id: cache-mt
if: env.CACHE
uses: actions/cache@v4
with:
path: ~/.wine/drive_c
key: ${{ env.CHECKOUT_REF }}/${{ env.VERSION }}/${{ hashFiles('.github/workflows/platform-linux.yml') }}
- if: steps.cache-mt.outputs.cache-hit != 'true'
name: Runs playbook
uses: dawidd6/action-ansible-playbook@v2
with:
configuration: |
[defaults]
nocows = false
stdout_callback = yaml
directory: ansible
options: |
--connection local
--inventory localhost,
--verbose
playbook: install-mt${{ env.VERSION }}.yml
requirements: galaxy-requirements.yml
- id: out-mt-fact
name: Sets output
run: echo "platform=$(cat /etc/ansible/facts.d/metatrader.fact)" >> "$GITHUB_OUTPUT"
- uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: ${{ env.ARTIFACT_NAME }}
path: |
~/.wine/drive_c/Program Files*/**/*MT*
~/.wine/drive_c/Program Files*/**/*Meta*
overwrite: ${{ env.ARTIFACT_OVERWRITE }}
timeout-minutes: 20
cleanup:
if: inputs.skip_cleanup != true
name: Clean-up
needs: [platform-linux]
runs-on: ubuntu-latest
steps:
- uses: geekyeggo/delete-artifact@v5
with:
name: ${{ env.ARTIFACT_NAME }}
Loading