Skip to content

Commit

Permalink
Merge pull request #1 from EA31337/dev
Browse files Browse the repository at this point in the history
Adds initial strategy logic
  • Loading branch information
kenorb authored Sep 5, 2023
2 parents 5a6656c + 733bd26 commit 8fc79db
Show file tree
Hide file tree
Showing 8 changed files with 301 additions and 362 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/backtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ jobs:
include: .
init-platform: true
mt-version: 5.0.0.2361
path: Stg_MA_Cross_Shift.mq4
path: Stg_MA_Cross_Pivot.mq4
verbose: true
- name: Compile for MQL5
uses: fx31337/mql-compile-action@master
with:
include: .
mt-version: 5.0.0.2515
path: Stg_MA_Cross_Shift.mq5
path: Stg_MA_Cross_Pivot.mq5
verbose: true
- name: List compiled files
run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname'
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
OptFormatBrief: true
OptFormatJson: true
OptVerbose: true
TestExpert: "Stg_MA_Cross_Shift"
TestExpert: "Stg_MA_Cross_Pivot"
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_MA_Cross_Shift.mq4
path: Stg_MA_Cross_Pivot.mq4
verbose: true
- name: Compile for MQL5
uses: fx31337/mql-compile-action@master
with:
include: .
mt-version: 5.0.0.2515
path: Stg_MA_Cross_Shift.mq5
path: Stg_MA_Cross_Pivot.mq5
verbose: true
- name: List compiled files
run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname'
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Strategy MA Cross Shift
# Strategy MA Cross Pivot

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

Strategy based on the moving average price indicators
implementing shifted cross signal.
implementing daily pivot cross signal.

## Dependencies

Expand All @@ -22,12 +22,12 @@ implementing shifted cross signal.
[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-MA_Cross_Shift
[gh-edit-link]: https://github.dev/EA31337/Strategy-MA_Cross_Pivot

[gha-link-check-master]: https://github.com/EA31337/Strategy-MA_Cross_Shift/actions?query=workflow:Check+branch%3Amaster
[gha-image-check-master]: https://github.com/EA31337/Strategy-MA_Cross_Shift/workflows/Check/badge.svg?branch=master
[gha-link-compile-master]: https://github.com/EA31337/Strategy-MA_Cross_Shift/actions?query=workflow:Compile+branch%3Amaster
[gha-image-compile-master]: https://github.com/EA31337/Strategy-MA_Cross_Shift/workflows/Compile/badge.svg?branch=master
[gha-link-check-master]: https://github.com/EA31337/Strategy-MA_Cross_Pivot/actions?query=workflow:Check+branch%3Amaster
[gha-image-check-master]: https://github.com/EA31337/Strategy-MA_Cross_Pivot/workflows/Check/badge.svg?branch=master
[gha-link-compile-master]: https://github.com/EA31337/Strategy-MA_Cross_Pivot/actions?query=workflow:Compile+branch%3Amaster
[gha-image-compile-master]: https://github.com/EA31337/Strategy-MA_Cross_Pivot/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
Expand Down
4 changes: 2 additions & 2 deletions Stg_MA_Cross_Shift.mq4 → Stg_MA_Cross_Pivot.mq4
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

/**
* @file
* Implements MA Cross Shift strategy.
* Implements MA Cross Pivot strategy.
*/

// Includes the main code.
#include "Stg_MA_Cross_Shift.mq5"
#include "Stg_MA_Cross_Pivot.mq5"
12 changes: 6 additions & 6 deletions Stg_MA_Cross_Shift.mq5 → Stg_MA_Cross_Pivot.mq5
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @file
* Implements MA strategy.
* Implements MA Cross Pivot strategy.
*/

// Includes conditional compilation directives.
Expand All @@ -20,19 +20,19 @@
#include <EA31337-classes/Strategy.mqh>

// Inputs.
INPUT_GROUP("MA Cross Shift strategy: main");
INPUT_GROUP("MA Cross Pivot strategy: main");
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_MA_Cross_Shift.mqh"
#include "Stg_MA_Cross_Pivot.mqh"

// Defines.
#define ea_name "Strategy MA Cross Shift"
#define ea_name "Strategy MA Cross Pivot"
#define ea_version "2.000"
#define ea_desc "Strategy based on the moving average price indicators implementing shifted cross signal."
#define ea_desc "Strategy based on the moving average price indicators implementing daily pivot cross signal."
#define ea_link "https://github.com/EA31337/Strategy-MA"
#define ea_author "EA31337 Ltd"

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

Expand Down
Loading

0 comments on commit 8fc79db

Please sign in to comment.