Skip to content

Commit

Permalink
Merge branch 'v3.007-dev-new' of https://github.com/EA31337/EA31337-c…
Browse files Browse the repository at this point in the history
…lasses into v3.007-dev-new
  • Loading branch information
nseam committed May 6, 2024
2 parents 8095e11 + fd565d1 commit 8e90bfc
Show file tree
Hide file tree
Showing 241 changed files with 5,305 additions and 3,504 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/test-indicator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,13 @@ jobs:
strategy:
matrix:
test:
- Indicator.test
- IndicatorBase.test
- IndicatorCandle.test
- IndicatorData.test
- IndicatorTf.test
- IndicatorTick.test
- IndicatorRenko.test
steps:
- uses: actions/download-artifact@v2
with:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/test-indicators.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ jobs:
- Indi_ColorCandlesDaily.test
- Indi_ColorLine.test
- Indi_CustomMovingAverage.test
- Indi_DEMA.test
- Indi_DeMarker.test
- Indi_Demo.test
- Indi_DetrendedPrice.test
Expand Down Expand Up @@ -101,6 +100,8 @@ jobs:
- Indi_WilliamsAD.test
- Indi_ZigZag.test
- Indi_ZigZagColor.test
# Requires refactoring:
# - Indi_DEMA.test
steps:
- uses: actions/download-artifact@v2
with:
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/test-serializer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: Test Serializer

# yamllint disable-line rule:truthy
on:
pull_request:
paths:
- 'Serializer/**'
- '.github/workflows/test-serializer.yml'
push:
paths:
- 'Serializer/**'
- '.github/workflows/test-serializer.yml'

jobs:

compile:
name: Compile
uses: ./.github/workflows/compile.yml
with:
artifact_prefix: mt
path: Exchange
skip_cleanup: true

Serializer-Tests-MQL4:
defaults:
run:
shell: bash
working-directory: serializer/tests
if: false
needs: compile
runs-on: ubuntu-latest
strategy:
matrix:
test:
- Serializer.test
steps:
- uses: actions/download-artifact@v2
with:
name: files-ex4
- name: Run ${{ matrix.test }}
uses: fx31337/mql-tester-action@master
with:
BtDays: 4-8
BtMonths: 1
BtYears: 2021
MtVersion: 4.0.0.1359
RunOnError: show_logs 200
TestExpert: ${{ matrix.test }}
timeout-minutes: 10
2 changes: 0 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ jobs:
- DatabaseTest
# - DrawIndicatorTest
- EATest
- IndicatorTest
- IndicatorsTest
- MailTest
- MarketTest
Expand Down Expand Up @@ -98,7 +97,6 @@ jobs:
- OrderQuery
- ProfilerTest
- RefsTest
- SerializerTest
- TerminalTest
- TimerTest
- ValueStorageTest
Expand Down
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
exclude: '\.md$'
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
Expand Down
6 changes: 3 additions & 3 deletions 3D/Chart3D.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
*/

#include "../Bar.struct.h"
#include "../IndicatorData.mqh"
#include "../Indicator/IndicatorData.h"
#include "../Indicators/Indi_MA.mqh"
#include "../Instances.h"
#include "../Refs.mqh"
#include "../SerializerConverter.mqh"
#include "../SerializerJson.mqh"
#include "../Serializer/SerializerConverter.h"
#include "../Serializer/SerializerJson.h"
#include "Chart3DCandles.h"
#include "Chart3DType.h"
#include "Cube.h"
Expand Down
2 changes: 1 addition & 1 deletion Account/Account.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

// Includes.
#include "../BufferStruct.mqh"
#include "../Serializer.mqh"
#include "../Serializer/Serializer.h"
#include "AccountBase.h"

/**
Expand Down
2 changes: 1 addition & 1 deletion Account/Account.struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
class Serializer;

// Includes.
#include "../Serializer.mqh"
#include "../Serializer/Serializer.h"
#include "../Terminal.define.h"

// Struct for account entries.
Expand Down
3 changes: 2 additions & 1 deletion Account/AccountBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#define ACCOUNTBASE_H

// Includes.
//#include "../Serializer.mqh"
#include "../Refs.mqh"
#include "AccountBase.struct.h"

Expand Down Expand Up @@ -57,6 +56,8 @@ class AccountBase : public Dynamic {
*/
~AccountBase() {}

/* Virtual methods */

/**
* Returns balance value of the current account.
*/
Expand Down
2 changes: 1 addition & 1 deletion Account/AccountBase.struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
class Serializer;

// Includes.
#include "../Serializer.mqh"
#include "../Serializer/Serializer.h"
#include "../Terminal.define.h"

// Struct for account entries.
Expand Down
2 changes: 1 addition & 1 deletion Account/AccountForex.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#define ACCOUNTFOREX_H

// Includes.
#include "../Serializer.mqh"
#include "../Serializer/Serializer.h"
#include "Account.h"
#include "AccountForex.struct.h"

Expand Down
2 changes: 1 addition & 1 deletion Account/AccountForex.struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
class Serializer;

// Includes.
#include "../Serializer.mqh"
#include "../Serializer/Serializer.h"
#include "../Terminal.define.h"

// Struct for account entries.
Expand Down
5 changes: 2 additions & 3 deletions Account/AccountMt.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,12 @@ class AccountMt;
// Includes.
#include "../Array.mqh"
#include "../BufferStruct.mqh"
#include "../Chart.mqh"
#include "../Convert.mqh"
#include "../Data.struct.h"
#include "../Indicator.struct.h"
#include "../Indicator/Indicator.struct.h"
#include "../Order.struct.h"
#include "../Orders.mqh"
#include "../Serializer.mqh"
#include "../Serializer/Serializer.h"
#include "../SymbolInfo.mqh"
#include "../Trade.struct.h"
#include "Account.define.h"
Expand Down
40 changes: 39 additions & 1 deletion Account/tests/Account.test.mq5
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,50 @@
#include "../../Test.mqh"
#include "../Account.h"

// Test classes.
class AccountTest : public Account<AccountBaseState, AccountBaseEntry> {
/**
* Returns balance value of the current account.
*/
float GetBalance() { return 0; }

/**
* Returns credit value of the current account.
*/
float GetCredit() { return 0; }

/**
* Returns profit value of the current account.
*/
float GetProfit() { return 0; }

/**
* Returns equity value of the current account.
*/
float GetEquity() { return 0; }

/**
* Returns margin value of the current account.
*/
float GetMarginUsed() { return 0; }

/**
* Returns free margin value of the current account.
*/
float GetMarginFree() { return 0; }

/**
* Get account available margin.
*/
float GetMarginAvail() { return 0; }
};

/**
* Implements OnInit().
*/
int OnInit() {
bool _result = true;
Account<AccountBaseState, AccountBaseEntry> acc1;
AccountTest acc1;
// ...
return _result && GetLastError() == 0 ? INIT_SUCCEEDED : INIT_FAILED;
}
Expand Down
40 changes: 39 additions & 1 deletion Account/tests/AccountForex.test.mq5
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,50 @@
#include "../../Test.mqh"
#include "../AccountForex.h"

// Test classes.
class AccountForexTest : public Account<AccountForexState, AccountForexEntry> {
/**
* Returns balance value of the current account.
*/
float GetBalance() { return 0; }

/**
* Returns credit value of the current account.
*/
float GetCredit() { return 0; }

/**
* Returns profit value of the current account.
*/
float GetProfit() { return 0; }

/**
* Returns equity value of the current account.
*/
float GetEquity() { return 0; }

/**
* Returns margin value of the current account.
*/
float GetMarginUsed() { return 0; }

/**
* Returns free margin value of the current account.
*/
float GetMarginFree() { return 0; }

/**
* Get account available margin.
*/
float GetMarginAvail() { return 0; }
};

/**
* Implements OnInit().
*/
int OnInit() {
bool _result = true;
Account<AccountForexState, AccountForexEntry> acc1;
AccountForexTest acc1;
// ...
return _result && GetLastError() == 0 ? INIT_SUCCEEDED : INIT_FAILED;
}
Expand Down
Loading

0 comments on commit 8e90bfc

Please sign in to comment.