generated from EA31337/Strategy-Oscillator_Cross
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 42092cd
Showing
12 changed files
with
634 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
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,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 |
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,85 @@ | ||
--- | ||
name: Backtest | ||
|
||
# yamllint disable-line rule:truthy | ||
on: | ||
pull_request: | ||
branches: | ||
- '*dev*' | ||
- 'main' | ||
- 'master' | ||
paths-ignore: | ||
- '*.md' | ||
push: | ||
branches: | ||
- '*dev*' | ||
- 'main' | ||
- 'master' | ||
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 | ||
- name: Compile for MQL4 | ||
uses: fx31337/mql-compile-action@master | ||
with: | ||
include: . | ||
init-platform: true | ||
mt-version: 5.0.0.2361 | ||
path: Stg_Oscillator_Cross.mq4 | ||
verbose: true | ||
- name: Compile for MQL5 | ||
uses: fx31337/mql-compile-action@master | ||
with: | ||
include: . | ||
mt-version: 5.0.0.2515 | ||
path: Stg_Oscillator_Cross.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@v3 | ||
with: | ||
name: EA | ||
path: '*.ex[45]' | ||
Test: | ||
needs: Compile | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
month: [1] | ||
year: [2019, 2020] | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
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_Oscillator_Cross" | ||
TestPeriod: M1 | ||
TestReportName: Report-${{ matrix.year }}-${{ matrix.month }} | ||
- name: Upload results | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: results | ||
path: ${{ github.workspace }}/_results/*.* |
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,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@v3 | ||
with: | ||
path: ~/.cache/pre-commit | ||
key: pre-commit|${{ hashFiles('.pre-commit-config.yaml') }} | ||
- uses: actions/setup-python@v3 | ||
with: | ||
python-version: 3.9 | ||
- uses: pre-commit/[email protected] |
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,58 @@ | ||
--- | ||
name: Compile | ||
|
||
# yamllint disable-line rule:truthy | ||
on: | ||
pull_request: | ||
branches: | ||
- '*dev*' | ||
- 'main' | ||
- 'master' | ||
paths-ignore: | ||
- '*.md' | ||
- '.git*' | ||
push: | ||
branches: | ||
- '*dev*' | ||
- 'main' | ||
- 'master' | ||
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 | ||
- name: Compile for MQL4 | ||
uses: fx31337/mql-compile-action@master | ||
with: | ||
include: . | ||
init-platform: true | ||
mt-version: 5.0.0.2361 | ||
path: Stg_Oscillator_Cross.mq4 | ||
verbose: true | ||
- name: Compile for MQL5 | ||
uses: fx31337/mql-compile-action@master | ||
with: | ||
include: . | ||
mt-version: 5.0.0.2515 | ||
path: Stg_Oscillator_Cross.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@v3 | ||
with: | ||
name: EA | ||
path: '*.ex[45]' |
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,13 @@ | ||
# Ignores compiled binary files. | ||
*.ex? | ||
|
||
# Ignores temporary files. | ||
*.swp | ||
*~ | ||
|
||
# Ignores Finder metadata files on Mac | ||
.DS_Store | ||
|
||
# Ignores Python cache files. | ||
*.pyc | ||
__pycache__ |
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,38 @@ | ||
--- | ||
repos: | ||
|
||
- repo: https://github.com/adrienverge/yamllint.git | ||
rev: v1.32.0 | ||
hooks: | ||
- id: yamllint | ||
|
||
- repo: https://github.com/igorshubovych/markdownlint-cli.git | ||
rev: v0.35.0 | ||
hooks: | ||
- id: markdownlint | ||
|
||
- repo: https://github.com/jumanjihouse/pre-commit-hooks | ||
rev: 3.0.0 | ||
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/pre-commit/pre-commit-hooks | ||
rev: v4.4.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 | ||
- id: trailing-whitespace | ||
|
||
- repo: https://github.com/thibaudcolas/curlylint | ||
rev: v0.13.1 | ||
hooks: | ||
- id: curlylint |
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,42 @@ | ||
# Strategy Oscillator Cross | ||
|
||
[![Status][gha-image-check-master]][gha-link-check-master] | ||
[![Status][gha-image-compile-master]][gha-link-compile-master] | ||
[![License][license-image]][license-link] | ||
[![Channel][tg-channel-image]][tg-channel-link] | ||
[![Discuss][gh-discuss-badge]][gh-discuss-link] | ||
[![Twitter][twitter-image]][twitter-link] | ||
[![Edit][gh-edit-badge]][gh-edit-link] | ||
|
||
## Description | ||
|
||
Strategy based on selected oscillator-type line-crossable cross-valued indicators. | ||
|
||
## Dependencies | ||
|
||
| Tag | Framework | | ||
|:--------:|:---------:| | ||
| v2.000 | v3.000.1 | | ||
| v2.001 | v3.001.1 | | ||
|
||
<!-- 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-Oscillator_Cross | ||
|
||
[gha-link-check-master]: https://github.com/EA31337/Strategy-Oscillator_Cross/actions?query=workflow:Check+branch%3Amaster | ||
[gha-image-check-master]: https://github.com/EA31337/Strategy-Oscillator_Cross/workflows/Check/badge.svg?branch=master | ||
[gha-link-compile-master]: https://github.com/EA31337/Strategy-Oscillator_Cross/actions?query=workflow:Compile+branch%3Amaster | ||
[gha-image-compile-master]: https://github.com/EA31337/Strategy-Oscillator_Cross/workflows/Compile/badge.svg?branch=master | ||
|
||
[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) | ||
|
||
[tg-channel-image]: https://img.shields.io/badge/Telegram-join-0088CC.svg?logo=telegram | ||
[tg-channel-link]: https://t.me/EA31337 | ||
|
||
[twitter-image]: https://img.shields.io/badge/EA31337-Follow-1DA1F2.svg?logo=Twitter | ||
[twitter-link]: https://twitter.com/EA31337 |
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,13 @@ | ||
//+------------------------------------------------------------------+ | ||
//| EA31337 - cross-strategy advanced trading robot | | ||
//| Copyright 2016-2023, EA31337 Ltd | | ||
//| https://github.com/EA31337 | | ||
//+------------------------------------------------------------------+ | ||
|
||
/** | ||
* @file | ||
* Implements Oscillator Cross strategy. | ||
*/ | ||
|
||
// Includes the main code. | ||
#include "Stg_Oscillator_Cross.mq5" |
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,79 @@ | ||
/** | ||
* @file | ||
* Implements Oscillator Cross strategy. | ||
*/ | ||
|
||
// Includes conditional compilation directives. | ||
#include "config/define.h" | ||
|
||
// Includes EA31337 framework. | ||
#include <EA31337-classes/EA.mqh> | ||
#include <EA31337-classes/IndicatorData.mqh> | ||
#include <EA31337-classes/Indicators/Indi_ADX.mqh> | ||
#include <EA31337-classes/Indicators/Indi_ADXW.mqh> | ||
#include <EA31337-classes/Indicators/Indi_MACD.mqh> | ||
#include <EA31337-classes/Indicators/Indi_RVI.mqh> | ||
// #include <EA31337-classes/Indicators/Oscillators/includes.h> | ||
#include <EA31337-classes/Strategy.mqh> | ||
|
||
// Inputs. | ||
input int Active_Tfs = M15B + M30B + H1B + H2B + H3B + H4B + H6B + | ||
H8B; // Timeframes (M1=1,M2=2,M5=16,M15=256,M30=1024,H1=2048,H2=4096,H3,H4,H6,H8) | ||
input ENUM_LOG_LEVEL Log_Level = V_INFO; // Log level. | ||
input bool Info_On_Chart = true; // Display info on chart. | ||
|
||
// Includes strategy. | ||
#include "Stg_Oscillator_Cross.mqh" | ||
|
||
// Defines. | ||
#define ea_name "Strategy Oscillator_Cross" | ||
#define ea_version "2.000" | ||
#define ea_desc "Strategy based on EA31337 framework." | ||
#define ea_link "https://github.com/EA31337/Strategy-Oscillator_Cross" | ||
#define ea_author "EA31337 Ltd" | ||
|
||
// Properties. | ||
#property version ea_version | ||
#ifdef __MQL4__ | ||
#property description ea_name | ||
#property description ea_desc | ||
#endif | ||
#property link ea_link | ||
#property copyright "Copyright 2016-2023, EA31337 Ltd" | ||
|
||
// Class variables. | ||
EA *ea; | ||
|
||
/* EA event handler functions */ | ||
|
||
/** | ||
* Implements "Init" event handler function. | ||
* | ||
* Invoked once on EA startup. | ||
*/ | ||
int OnInit() { | ||
bool _result = true; | ||
EAParams ea_params(__FILE__, Log_Level); | ||
ea = new EA(ea_params); | ||
_result &= ea.StrategyAdd<Stg_Oscillator_Cross>(Active_Tfs); | ||
return (_result ? INIT_SUCCEEDED : INIT_FAILED); | ||
} | ||
|
||
/** | ||
* Implements "Tick" event handler function (EA only). | ||
* | ||
* Invoked when a new tick for a symbol is received, to the chart of which the Expert Advisor is attached. | ||
*/ | ||
void OnTick() { | ||
ea.ProcessTick(); | ||
if (!ea.GetTerminal().IsOptimization()) { | ||
ea.UpdateInfoOnChart(); | ||
} | ||
} | ||
|
||
/** | ||
* Implements "Deinit" event handler function. | ||
* | ||
* Invoked once on EA exit. | ||
*/ | ||
void OnDeinit(const int reason) { Object::Delete(ea); } |
Oops, something went wrong.