Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3.002-dev-new #743

Open
wants to merge 76 commits into
base: v3.001-dev-new
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
28bc1e9
Account/SymbolInfo: Adds copy constructors
kenorb Dec 5, 2021
3871dd8
Adds Exchange class and tests
kenorb Dec 5, 2021
3f09d09
Exchange: Adds Trade
kenorb Dec 5, 2021
92bb334
SymbolInfo: Adds class constructor with symbol properties
kenorb Dec 5, 2021
78323e0
Exchange: Adds methods to add/remove account and symbol
kenorb Dec 5, 2021
a94b5c4
SymbolInfo: SymbolInfoEntry: Fixes struct copy constructor
kenorb Dec 8, 2021
35af70c
Merge pull request #621 from EA31337/dev-exchange
kenorb Jan 15, 2022
af586ee
Moves Deal enums to Deal.enum.h
kenorb Jan 17, 2022
f6fb496
Moves enums and structs from Std and MQL5 to appropriate files
kenorb Jan 17, 2022
19a1a84
Adds .extern.h files
kenorb Jan 18, 2022
79e542c
Adds code page defines
kenorb Jan 18, 2022
df9180d
Adds Common and File defines
kenorb Jan 18, 2022
a70c358
Integrates extern includes
kenorb Jan 18, 2022
c3bb151
Refs: Uses PTR_ATTRIB syntax
kenorb Jan 18, 2022
fde05e4
Adds .extern.h file for DateTime
kenorb Jan 18, 2022
471e417
Adds StringSplit() as extern
kenorb Jan 18, 2022
f2142ea
Adds Compile workflow for CPP
kenorb Jan 18, 2022
e17381a
GHA: Compiles based on the file list
kenorb Jan 18, 2022
0b8be3b
Adds TradeSignal and TradeSignalManager C++ compilation tests
kenorb Jan 18, 2022
8826b3d
Trade: Fixes C++ compilation errors
kenorb Jan 18, 2022
1dc8803
Making MQL code to compile in C++. Especially the TradeSignalManager.…
nseam Jan 19, 2022
57af000
Merge pull request #634 from nseam/dev-indicator-refactor
kenorb Jan 19, 2022
1c8a2ed
State in the art of MQL/C++ compatibility.
nseam Jan 20, 2022
98f7b4e
Working compilation via GCC for TradeSignal.test.cpp and TradeSignalM…
nseam Jan 21, 2022
abf3b60
Merge pull request #636 from EA31337/dev-indicator-refactor
kenorb Jan 23, 2022
8d1e4a5
Should fix all GCC warnings.
nseam Jan 24, 2022
e76c4e5
Merge pull request #637 from nseam/dev-cpp
kenorb Jan 24, 2022
208de59
Merge remote-tracking branch 'origin/dev-cpp' into dev-v2011
kenorb Jan 25, 2022
afb673c
Should fix new issues with C++ compatibility.
nseam Jan 26, 2022
4355ade
Merge pull request #640 from nseam/dev-cpp
kenorb Jan 26, 2022
dc609ad
Merge branch 'dev-account' into dev-v2011
kenorb Jan 30, 2022
118347d
Merge tag 'v2.010' into dev-v2011
kenorb Mar 24, 2022
e61fe6c
CPP: Removes EnumToString
kenorb Mar 24, 2022
3a77d0a
Refs #337 New week detection. Added check if it's the first day of th…
nseam Apr 22, 2022
66f4342
Refactors IndicatorData class to be inherited by Indicator class
kenorb May 29, 2022
cb29a33
Splits IndicatorParams struct into IndicatorDataParams
kenorb Jun 19, 2022
2e47d5c
Indicator: Moves GetValuePrice() to IndicatorData
kenorb Jun 19, 2022
b550609
Merge pull request #650 from nseam/dev
kenorb Jun 26, 2022
17373a5
Moves indicator data related methods to IndicatorData
kenorb Jun 26, 2022
b010f5d
Indicators: Adds Indicator source type and mode to constructor's argu…
kenorb Jun 26, 2022
b26dfa5
Fixes timeframe handling
kenorb Jun 27, 2022
78a0fbd
Merge pull request #642 from EA31337/dev-v2011
kenorb Jul 2, 2022
3cdadf9
Should fix problem "'array' - constant variable cannot be passed [GH-…
nseam Dec 6, 2022
9fb1008
Refs EA31337-classes/EA31337-indicators-other#13, EA31337-classes/EA3…
nseam Dec 1, 2023
42d1880
Merge tag 'v2.011' into v3.002-dev-new
kenorb Apr 24, 2024
b847600
GHA: Fixes workflow test for Exchange using new format
kenorb Apr 24, 2024
d907ae9
GHA: Compile: Adds support for path input
kenorb Apr 24, 2024
8f3c6e9
GHA: Compile: Adds support for skip_init input
kenorb Apr 24, 2024
d32799f
GHA: Clean-up platform artifacts after the test
kenorb Apr 24, 2024
ac96c48
GHA: Compile: Fixes wrong path on missing inputs
kenorb Apr 24, 2024
5439c88
Merge branch 'v3.001-dev-new' into v3.002-dev-new
kenorb Apr 24, 2024
998d55a
GHA: Compile: Fixes init-platform boolean condition
kenorb Apr 24, 2024
6d417d6
GHA: Compile: Fixes init-platform boolean condition
kenorb Apr 24, 2024
65aa9b2
Fixes C++ const-related errors.
nseam Nov 30, 2022
7adfaf4
GHA: Compile: Fixes init-platform condition to compare with string, n…
kenorb Apr 24, 2024
f1445fb
GHA: Compile: Fixes init-platform condition to compare with string, n…
kenorb Apr 24, 2024
483bd03
Merge tag 'v2.011.1' into v3.002-dev-new
kenorb Apr 24, 2024
112b49e
Merge remote-tracking branch 'nseam/v3.000-dev' into v3.001-dev-new
kenorb Apr 24, 2024
1b9a596
Merge branch 'v3.001-dev-new' into v3.002-dev-new
kenorb Apr 24, 2024
69b6ae1
GHA: Exchange: Adds path
kenorb Apr 25, 2024
92450aa
Account/AccountMt: Fixes zero division
kenorb Feb 19, 2022
bf75e6d
EA: Fixes recent issue with error during trade request
kenorb Jul 25, 2022
0bfc38d
Trade: Disables filling modes for MQL4
kenorb Jul 25, 2022
b4e2393
Order: Refresh order after modification
kenorb Jul 21, 2023
136ab98
Order: Fixes the current volume value when data in orequest is missing
kenorb Jul 21, 2023
c363605
Trade: TradeParams: Adds max_spread
kenorb Jul 22, 2022
71089fc
Workaround for closing order conditions after orders are loaded from …
kenorb Aug 12, 2023
7ca1f82
Merge branch 'v3.001-dev-new' into v3.002-dev-new
kenorb Apr 25, 2024
460891f
Trade: Disables filling modes for MQL4
kenorb Jul 25, 2022
b14a877
GHA: Fixes compilation workflows
kenorb Feb 18, 2024
0d00fcb
GHA: Compile: Skips clean-up by default
kenorb Apr 23, 2024
31708c9
GHA: Compile: Support for workflow calls
kenorb Apr 23, 2024
35a2814
Account/AccountMt: Fixes zero division
kenorb Feb 19, 2022
01934b4
Merge tag 'v3.000.2' into v3.002-dev-new
kenorb Apr 25, 2024
efa612e
Merge remote-tracking branch 'origin/v3.001-dev-new' into v3.002-dev-new
kenorb Apr 27, 2024
03bf8a8
IndicatorData: Adds Set()
kenorb Oct 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Clean-up

# yamllint disable-line rule:truthy
on:
workflow_call:
inputs:
artifact_prefix:
default: mt
description: Artifact prefix to clean up.
required: false
type: string

jobs:

cleanup:
name: Clean-up
runs-on: ubuntu-latest
steps:
- uses: geekyeggo/delete-artifact@v5
with:
name: ${{ inputs.artifact_prefix }}*
timeout-minutes: 5
44 changes: 44 additions & 0 deletions .github/workflows/compile-cpp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
name: Compile C++

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

jobs:

FileList:
outputs:
filelist: ${{ steps.get-files.outputs.filelist }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set output with list of files
id: get-files
run: |
import glob, json, os
files = glob.glob("**/tests/*.cpp")
print("::set-output name=filelist::{}".format(json.dumps(files)))
shell: python
- name: Display output
run: echo ${{ steps.get-files.outputs.filelist }}

Compile:
runs-on: ubuntu-latest
needs: [FileList]
strategy:
matrix:
file: ${{ fromJson(needs.FileList.outputs.filelist) }}
steps:
- uses: actions/checkout@v2
- name: Install compiler
uses: rlalik/[email protected]
with:
compiler: gcc-latest
- name: Compile ${{ matrix.file }}
run: g++ "${{ matrix.file }}"
6 changes: 1 addition & 5 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,4 @@ jobs:
if: inputs.skip_cleanup != true
name: Clean-up
needs: [compile]
runs-on: ubuntu-latest
steps:
- uses: geekyeggo/delete-artifact@v5
with:
name: ${{ env.ARTIFACT_PREFIX }}*
uses: ./.github/workflows/cleanup.yml
5 changes: 5 additions & 0 deletions .github/workflows/test-account.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,8 @@ jobs:
with:
Script: ${{ matrix.test }}
timeout-minutes: 10

cleanup:
name: Clean-up
needs: [compile]
uses: ./.github/workflows/cleanup.yml
5 changes: 5 additions & 0 deletions .github/workflows/test-buffer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,8 @@ jobs:
with:
Script: ${{ matrix.test }}
timeout-minutes: 10

cleanup:
name: Clean-up
needs: [compile]
uses: ./.github/workflows/cleanup.yml
47 changes: 47 additions & 0 deletions .github/workflows/test-exchange.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
name: Test Exchange

# yamllint disable-line rule:truthy
on:
pull_request:
paths:
- 'Exchange/**.h'
- 'Exchange/**.mq?'
- '.github/workflows/test-exchange.yml'
push:
paths:
- 'Exchange/**.h'
- 'Exchange/**.mq?'
- '.github/workflows/test-exchange.yml'

jobs:

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

Exchange-Tests-MQL4:
defaults:
run:
shell: bash
working-directory: Exchange/tests
if: false
needs: compile
runs-on: ubuntu-latest
strategy:
matrix:
test:
- Exchange.test
steps:
- uses: actions/download-artifact@v2
with:
name: files-ex4
- name: Run ${{ matrix.test }}
uses: fx31337/mql-tester-action@master
with:
Script: ${{ matrix.test }}
timeout-minutes: 10
5 changes: 5 additions & 0 deletions .github/workflows/test-indicator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,8 @@ jobs:
BtYears: 2020
TestExpert: ${{ matrix.test }}
timeout-minutes: 10

cleanup:
name: Clean-up
needs: [compile]
uses: ./.github/workflows/cleanup.yml
5 changes: 5 additions & 0 deletions .github/workflows/test-indicators-special.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,8 @@ jobs:
BtYears: 2020
TestExpert: ${{ matrix.test }}
timeout-minutes: 10

cleanup:
name: Clean-up
needs: [compile]
uses: ./.github/workflows/cleanup.yml
5 changes: 5 additions & 0 deletions .github/workflows/test-indicators-tick.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,8 @@ jobs:
BtYears: 2020
TestExpert: ${{ matrix.test }}
timeout-minutes: 10

cleanup:
name: Clean-up
needs: [compile]
uses: ./.github/workflows/cleanup.yml
5 changes: 5 additions & 0 deletions .github/workflows/test-indicators.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,8 @@ jobs:
BtYears: 2020
TestExpert: ${{ matrix.test }}
timeout-minutes: 10

cleanup:
name: Clean-up
needs: [compile]
uses: ./.github/workflows/cleanup.yml
5 changes: 5 additions & 0 deletions .github/workflows/test-tick.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,8 @@ jobs:
uses: fx31337/mql-tester-action@master
with:
Script: ${{ matrix.test }}

cleanup:
name: Clean-up
needs: [compile]
uses: ./.github/workflows/cleanup.yml
5 changes: 5 additions & 0 deletions .github/workflows/test-trade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,8 @@ jobs:
with:
Script: ${{ matrix.test }}
timeout-minutes: 10

cleanup:
name: Clean-up
needs: [compile]
uses: ./.github/workflows/cleanup.yml
7 changes: 6 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- CompileIndicatorsTest
- ConditionTest
- DatabaseTest
- DrawIndicatorTest
# - DrawIndicatorTest
- EATest
- IndicatorDataTest
- IndicatorTest
Expand Down Expand Up @@ -163,3 +163,8 @@ jobs:
with:
Script: ${{ matrix.test }}
timeout-minutes: 10

cleanup:
name: Clean-up
needs: [compile]
uses: ./.github/workflows/cleanup.yml
6 changes: 6 additions & 0 deletions Account.mqh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class Account;
// Includes.
#include "Account/Account.define.h"
#include "Account/Account.enum.h"
#include "Account/Account.extern.h"
#include "Account/Account.struct.h"
#include "Array.mqh"
#include "BufferStruct.mqh"
Expand Down Expand Up @@ -63,6 +64,11 @@ class Account {
*/
Account() : init_balance(CalcInitDeposit()), start_balance(GetBalance()), start_credit(GetCredit()) {}

/**
* Class copy constructor.
*/
Account(const Account &_account) {}

/**
* Class deconstructor.
*/
Expand Down
29 changes: 29 additions & 0 deletions Account/Account.extern.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//+------------------------------------------------------------------+
//| EA31337 framework |
//| Copyright 2016-2022, EA31337 Ltd |
//| https://github.com/EA31337 |
//+------------------------------------------------------------------+

/*
* This file is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

// Includes.
#include "Account.enum.h"

// Define external global functions.
#ifndef __MQL__
extern string AccountInfoString(ENUM_ACCOUNT_INFO_STRING property_id);
#endif
1 change: 1 addition & 0 deletions Account/Account.struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class Serializer;

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

// Struct for account entries.
struct AccountEntry {
Expand Down
1 change: 1 addition & 0 deletions Account/AccountBase.struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class Serializer;

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

// Struct for account entries.
struct AccountBaseEntry {
Expand Down
1 change: 1 addition & 0 deletions Account/AccountForex.struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class Serializer;

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

// Struct for account entries.
struct AccountForexEntry : public AccountBaseEntry {
Expand Down
2 changes: 1 addition & 1 deletion Account/tests/Account.test.mq5
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ int OnInit() {
bool _result = true;
Account<AccountBaseState, AccountBaseEntry> acc1;
// ...
return _result && GetLastError() == ERR_NO_ERROR ? INIT_SUCCEEDED : INIT_FAILED;
return _result && GetLastError() == 0 ? INIT_SUCCEEDED : INIT_FAILED;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Account/tests/AccountForex.test.mq5
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ int OnInit() {
bool _result = true;
Account<AccountForexState, AccountForexEntry> acc1;
// ...
return _result && GetLastError() == ERR_NO_ERROR ? INIT_SUCCEEDED : INIT_FAILED;
return _result && GetLastError() == 0 ? INIT_SUCCEEDED : INIT_FAILED;
}

/**
Expand Down
57 changes: 57 additions & 0 deletions Array.extern.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
//+------------------------------------------------------------------+
//| EA31337 framework |
//| Copyright 2016-2022, EA31337 Ltd |
//| https://github.com/EA31337 |
//+------------------------------------------------------------------+

/*
* This file is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

// Define external global functions.
#ifndef __MQL__
#pragma once

template <typename T>
extern int ArraySize(const ARRAY_REF(T, _array));

template <typename T, int size>
extern constexpr int ArraySize(const T REF(_array)[size]);

template <typename T>
extern int ArrayResize(ARRAY_REF(T, _array), int _new_size, int _reserve_size = 0);

template <typename T>
extern bool ArraySetAsSeries(ARRAY_REF(T, _array), bool _flag);

template <typename T>
extern int ArrayMaximum(const ARRAY_REF(T, _array), int _start = 0, unsigned int _count = WHOLE_ARRAY);

template <typename T>
extern int ArrayMinimum(const ARRAY_REF(T, _array), int _start = 0, unsigned int _count = WHOLE_ARRAY);

template <typename T>
extern int ArrayFree(const ARRAY_REF(T, _array));

template <typename T>
extern int ArrayReverse(const ARRAY_REF(T, _array));

template <typename T>
extern int ArrayInitialize(ARRAY_REF(T, array), char value);

template <typename T>
extern int ArraySort(ARRAY_REF(T, array));

#endif
Loading
Loading