Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
kenorb authored Sep 23, 2023
0 parents commit 4554ac7
Show file tree
Hide file tree
Showing 12 changed files with 653 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
Language: Cpp
BasedOnStyle: Google
ColumnLimit: 120
26 changes: 26 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# git normalization file
# @see http://www.kernel.org/pub/software/scm/git/docs/gitattributes.html

# Shorthand for text files.
# - Treat them as text.
# - Ensure no CRLF line-endings, neither on checkout nor on checkin.
# - Detect whitespace errors.
# - Exposed by default in `git diff --color` on the CLI.
# - Validate with `git diff --check`.
# - Deny applying with `git apply --whitespace=error-all`.
# - Fix automatically with `git apply --whitespace=fix`.
[attr]utf8 text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
[attr]utf16 encoding=UTF-16LE-BOM working-tree-encoding=UTF-16LE-BOM diff merge eol=CRLF

# Shorthand for binary files.
# - Do not treat them as text.
# - Include binary diff in patches instead of "binary files differ."
[attr]binary -text diff

# Define text file attributes.
*.ex? binary
*.h utf8 diff=c
*.json utf8 diff=c
*.mq? utf8 diff=c
*.mqproj utf16 diff=c
*.txt utf8 diff=c
89 changes: 89 additions & 0 deletions .github/workflows/backtest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
name: Backtest

# yamllint disable-line rule:truthy
on:
pull_request:
branches:
- 'master'
- '*dev*'
paths-ignore:
- '*.md'
push:
branches:
- 'master'
- '*dev*'
paths-ignore:
- '*.md'

jobs:
Compile:
defaults:
run:
shell: powershell
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
path: Include/EA31337-classes
ref: v3.000.1
repository: EA31337/EA31337-classes
- uses: actions/checkout@v3
with:
path: Include/EA31337-strategies
ref: v2.000-dev
repository: EA31337/EA31337-strategies
submodules: recursive
- name: Compile for MQL4
uses: fx31337/mql-compile-action@master
with:
include: .
init-platform: true
mt-version: 5.0.0.2361
path: Stg_Meta_Multi.mq4
verbose: true
- name: Compile for MQL5
uses: fx31337/mql-compile-action@master
with:
include: .
mt-version: 5.0.0.2515
path: Stg_Meta_Multi.mq5
verbose: true
- name: List compiled files
run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname'
- run: Get-Location
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: EA
path: '*.ex?'
Test:
needs: Compile
runs-on: ubuntu-latest
strategy:
matrix:
month: [1]
year: [2019, 2020]
steps:
- uses: actions/download-artifact@v2
with:
name: EA
- name: Run strategy
uses: ea31337/mql-tester-action@dev
with:
BtDeposit: 100000
BtDest: ${{ github.workspace }}/_results
BtMonths: ${{ matrix.month }}
BtYears: ${{ matrix.year }}
OptFormatBrief: true
OptFormatJson: true
OptVerbose: true
TestExpert: "Stg_Meta_Multi"
TestPeriod: M1
TestReportName: Report-${{ matrix.year }}-${{ matrix.month }}
- name: Upload results
uses: actions/upload-artifact@v2
with:
name: results
path: ${{ github.workspace }}/_results/*.*
21 changes: 21 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Check

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

jobs:
Pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v1
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ hashFiles('.pre-commit-config.yaml') }}
- uses: actions/setup-python@v2
with:
python-version: 3.9
- uses: pre-commit/[email protected]
62 changes: 62 additions & 0 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
name: Compile

# yamllint disable-line rule:truthy
on:
pull_request:
branches:
- 'master'
- '*dev*'
paths-ignore:
- '*.md'
- '.git*'
push:
branches:
- 'master'
- '*dev*'
paths-ignore:
- '*.md'
- '.git*'

jobs:
Compile:
defaults:
run:
shell: powershell
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
path: Include/EA31337-classes
ref: v3.000.1
repository: EA31337/EA31337-classes
- uses: actions/checkout@v3
with:
path: Include/EA31337-strategies
ref: v2.000-dev
repository: EA31337/EA31337-strategies
submodules: recursive
- name: Compile for MQL4
uses: fx31337/mql-compile-action@master
with:
include: .
init-platform: true
mt-version: 5.0.0.2361
path: Stg_Meta_Multi.mq4
verbose: true
- name: Compile for MQL5
uses: fx31337/mql-compile-action@master
with:
include: .
mt-version: 5.0.0.2515
path: Stg_Meta_Multi.mq5
verbose: true
- name: List compiled files
run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname'
- run: Get-Location
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: EA
path: '*.ex?'
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Ignores compiled binary files.
*.ex?

# Ignores temporary files.
*.swp
*~

# Ignores Finder metadata files on Mac
.DS_Store

# Ignores Python cache files.
*.pyc
__pycache__
40 changes: 40 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
repos:

- repo: https://github.com/adrienverge/yamllint.git
rev: v1.31.0
hooks:
- id: yamllint

- repo: https://github.com/igorshubovych/markdownlint-cli.git
rev: v0.27.1
hooks:
- id: markdownlint

- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 2.1.5
hooks:
- id: forbid-binary
exclude: (\.ico|\.mqproj)$
- id: git-check # Configure in .gitattributes
# - id: markdownlint # Configure in .mdlrc.style.rb
- id: require-ascii

- repo: https://github.com/thibaudcolas/curlylint
rev: v0.13.1
hooks:
- id: curlylint

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.3.0
hooks:
- id: check-added-large-files
- id: check-byte-order-marker
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-yaml
- id: end-of-file-fixer
exclude: \.txt$
- id: trailing-whitespace
exclude: \.txt$
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Strategy Meta Multi

[![Status][gha-image-check-master]][gha-link-check-master]
[![Status][gha-image-compile-master]][gha-link-compile-master]
[![Channel][tg-channel-image]][tg-channel-link]
[![Discuss][gh-discuss-badge]][gh-discuss-link]
[![License][license-image]][license-link]
[![Edit][gh-edit-badge]][gh-edit-link]

Multi meta strategy which trades with multiple strategies at once.

It is like a mini EA.

## Dependencies

| Tag | Framework | Strategies |
|:--------:|:---------:|:----------:|
| v2.000 | v3.000.1 | v2.000 |

<!-- Named links -->

[gh-discuss-badge]: https://img.shields.io/badge/Discussions-Q&A-blue.svg?logo=github
[gh-discuss-link]: https://github.com/EA31337/EA31337-Strategies/discussions

[gh-edit-badge]: https://img.shields.io/badge/GitHub-edit-purple.svg?logo=github
[gh-edit-link]: https://github.dev/EA31337/Strategy-Meta_Multi

[gha-link-check-master]: https://github.com/EA31337/Strategy-Meta_Multi/actions?query=workflow:Check+branch%3Amaster
[gha-image-check-master]: https://github.com/EA31337/Strategy-Meta_Multi/workflows/Check/badge.svg?branch=master
[gha-link-compile-master]: https://github.com/EA31337/Strategy-Meta_Multi/actions?query=workflow:Compile+branch%3Amaster
[gha-image-compile-master]: https://github.com/EA31337/Strategy-Meta_Multi/workflows/Compile/badge.svg?branch=master

[tg-channel-image]: https://img.shields.io/badge/Telegram-join-0088CC.svg?logo=telegram
[tg-channel-link]: https://t.me/EA31337

[license-image]: https://img.shields.io/github/license/EA31337/EA31337-Strategies.svg
[license-link]: https://tldrlegal.com/license/gnu-general-public-license-v3-(gpl-3)
13 changes: 13 additions & 0 deletions Stg_Meta_Multi.mq4
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//+------------------------------------------------------------------+
//| EA31337 - multi-strategy advanced trading robot |
//| Copyright 2016-2023, EA31337 Ltd |
//| https://github.com/EA31337 |
//+------------------------------------------------------------------+

/**
* @file
* Implements Multi meta strategy.
*/

// Includes the main code.
#include "Stg_Meta_Multi.mq5"
Loading

0 comments on commit 4554ac7

Please sign in to comment.