Skip to content

Commit

Permalink
Merge pull request #1 from EA31337/v2.000-dev
Browse files Browse the repository at this point in the history
Initial implementation of Oscillator strategy
  • Loading branch information
kenorb authored Aug 28, 2023
2 parents 25259f4 + 5d289d7 commit cf895d8
Show file tree
Hide file tree
Showing 8 changed files with 240 additions and 127 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/backtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ jobs:
include: .
init-platform: true
mt-version: 5.0.0.2361
path: Stg_Demo.mq4
path: Stg_Oscillator.mq4
verbose: true
- name: Compile for MQL5
uses: fx31337/mql-compile-action@master
with:
include: .
mt-version: 5.0.0.2515
path: Stg_Demo.mq5
path: Stg_Oscillator.mq5
verbose: true
- name: List compiled files
run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname'
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
OptFormatBrief: true
OptFormatJson: true
OptVerbose: true
TestExpert: "Stg_Demo"
TestExpert: "Stg_Oscillator"
TestPeriod: M1
TestReportName: Report-${{ matrix.year }}-${{ matrix.month }}
- name: Upload results
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ jobs:
include: .
init-platform: true
mt-version: 5.0.0.2361
path: Stg_Demo.mq4
path: Stg_Oscillator.mq4
verbose: true
- name: Compile for MQL5
uses: fx31337/mql-compile-action@master
with:
include: .
mt-version: 5.0.0.2515
path: Stg_Demo.mq5
path: Stg_Oscillator.mq5
verbose: true
- name: List compiled files
run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname'
Expand Down
22 changes: 8 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Strategy Demo
# Strategy Oscillator

[![Status][gha-image-check-master]][gha-link-check-master]
[![Status][gha-image-compile-master]][gha-link-compile-master]
Expand All @@ -8,35 +8,29 @@
[![Twitter][twitter-image]][twitter-link]
[![Edit][gh-edit-badge]][gh-edit-link]

Strategy based on the Demo indicator.

## Description

This is example demo strategy for the demonstration purposes.
Strategy based on selected oscillator-type single-valued indicators.

## Dependencies

| Tag | Framework |
|:--------:|:---------:|
| v1.000 | v2.000 |
| v1.001 | v2.001 |
| ... | ... |
| v1.012 | v2.012 |
| v1.013 | v2.013 |
| 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-Demo
[gh-edit-link]: https://github.dev/EA31337/Strategy-Oscillator

[gha-link-check-master]: https://github.com/EA31337/Strategy-Demo/actions?query=workflow:Check+branch%3Amaster
[gha-image-check-master]: https://github.com/EA31337/Strategy-Demo/workflows/Check/badge.svg?branch=master
[gha-link-compile-master]: https://github.com/EA31337/Strategy-Demo/actions?query=workflow:Compile+branch%3Amaster
[gha-image-compile-master]: https://github.com/EA31337/Strategy-Demo/workflows/Compile/badge.svg?branch=master
[gha-link-check-master]: https://github.com/EA31337/Strategy-Oscillator/actions?query=workflow:Check+branch%3Amaster
[gha-image-check-master]: https://github.com/EA31337/Strategy-Oscillator/workflows/Check/badge.svg?branch=master
[gha-link-compile-master]: https://github.com/EA31337/Strategy-Oscillator/actions?query=workflow:Compile+branch%3Amaster
[gha-image-compile-master]: https://github.com/EA31337/Strategy-Oscillator/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)
Expand Down
100 changes: 0 additions & 100 deletions Stg_Demo.mqh

This file was deleted.

4 changes: 2 additions & 2 deletions Stg_Demo.mq4 → Stg_Oscillator.mq4
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

/**
* @file
* Implements Demo strategy.
* Implements Oscillator strategy.
*/

// Includes the main code.
#include "Stg_Demo.mq5"
#include "Stg_Oscillator.mq5"
17 changes: 11 additions & 6 deletions Stg_Demo.mq5 → Stg_Oscillator.mq5
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
/**
* @file
* Implements Demo strategy.
* Implements Oscillator strategy.
*/

// Includes conditional compilation directives.
#include "config/define.h"

// Includes EA31337 framework.
#include <EA31337-classes/EA.mqh>
#include <EA31337-classes/Indicators/Indi_Demo.mqh>
#include <EA31337-classes/Indicators/Indi_AC.mqh>
#include <EA31337-classes/Indicators/Indi_AD.mqh>
#include <EA31337-classes/Indicators/Indi_RSI.mqh>
#include <EA31337-classes/Indicators/Indi_Stochastic.mqh>
#include <EA31337-classes/Indicators/Indi_WPR.mqh>
// #include <EA31337-classes/Indicators/Oscillator/includes.h>
#include <EA31337-classes/Strategy.mqh>

// Inputs.
Expand All @@ -18,13 +23,13 @@ input ENUM_LOG_LEVEL Log_Level = V_INFO; // Log level.
input bool Info_On_Chart = true; // Display info on chart.

// Includes strategy.
#include "Stg_Demo.mqh"
#include "Stg_Oscillator.mqh"

// Defines.
#define ea_name "Strategy Demo"
#define ea_name "Strategy Oscillator"
#define ea_version "2.000"
#define ea_desc "Strategy based on EA31337 framework."
#define ea_link "https://github.com/EA31337/Strategy-Demo"
#define ea_link "https://github.com/EA31337/Strategy-Oscillator"
#define ea_author "EA31337 Ltd"

// Properties.
Expand All @@ -50,7 +55,7 @@ int OnInit() {
bool _result = true;
EAParams ea_params(__FILE__, Log_Level);
ea = new EA(ea_params);
_result &= ea.StrategyAdd<Stg_Demo>(Active_Tfs);
_result &= ea.StrategyAdd<Stg_Oscillator>(Active_Tfs);
return (_result ? INIT_SUCCEEDED : INIT_FAILED);
}

Expand Down
Loading

0 comments on commit cf895d8

Please sign in to comment.