-
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'v2.011' into v3.002-dev-new
* tag 'v2.011': (32 commits) Fixes timeframe handling Indicators: Adds Indicator source type and mode to constructor's argument. Moves indicator data related methods to IndicatorData Indicator: Moves GetValuePrice() to IndicatorData Splits IndicatorParams struct into IndicatorDataParams Refactors IndicatorData class to be inherited by Indicator class Refs #337 New week detection. Added check if it's the first day of the week (which is Monday in MQL). Previously we only checked if current day of the week has changed. CPP: Removes EnumToString Should fix new issues with C++ compatibility. Should fix all GCC warnings. Working compilation via GCC for TradeSignal.test.cpp and TradeSignalManager.test.cpp. State in the art of MQL/C++ compatibility. Making MQL code to compile in C++. Especially the TradeSignalManager.test.cpp. Trade: Fixes C++ compilation errors Adds TradeSignal and TradeSignalManager C++ compilation tests GHA: Compiles based on the file list Adds Compile workflow for CPP Adds StringSplit() as extern Adds .extern.h file for DateTime Refs: Uses PTR_ATTRIB syntax ...
- Loading branch information
Showing
184 changed files
with
4,847 additions
and
3,525 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,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 }}" |
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,62 @@ | ||
--- | ||
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: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Compile | ||
uses: fx31337/mql-compile-action@master | ||
with: | ||
init-platform: true | ||
path: 'Exchange/tests' | ||
verbose: true | ||
- name: Print compiled files | ||
run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' | ||
shell: powershell | ||
- name: Upload artifacts (MQL4) | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: files-ex4 | ||
path: '**/*.ex4' | ||
- name: Upload artifacts (MQL5) | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: files-ex5 | ||
path: '**/*.ex5' | ||
|
||
Exchange-Tests-MQL4: | ||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: Exchange/tests | ||
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 |
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
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
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,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 |
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
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
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
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
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
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,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 |
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
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
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,35 @@ | ||
//+------------------------------------------------------------------+ | ||
//| 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/>. | ||
* | ||
*/ | ||
|
||
/** | ||
* @file | ||
* Defines common defines. | ||
*/ | ||
#ifndef __MQL__ | ||
// Data types. | ||
#include <string> | ||
typedef std::string string; | ||
typedef unsigned char uchar; | ||
typedef unsigned int uint; | ||
typedef unsigned long ulong; | ||
typedef unsigned short ushort; | ||
#endif |
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,47 @@ | ||
//+------------------------------------------------------------------+ | ||
//| 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 | ||
#include "Chart.enum.h" | ||
#include "DateTime.enum.h" | ||
|
||
extern void DebugBreak(); | ||
// Errors. | ||
extern void SetUserError(ushort user_error); | ||
// Exceptions. | ||
extern int NotImplementedException(); | ||
// Print-related functions. | ||
template <typename... Args> | ||
extern std::string StringFormat(const std::string& format, Args... args); | ||
|
||
template <typename... Args> | ||
extern std::string PrintFormat(const std::string& format, Args... args); | ||
|
||
template <typename... Args> | ||
extern void Print(Args... args); | ||
|
||
template <typename... Args> | ||
extern void Alert(Args... args); | ||
|
||
#endif |
Oops, something went wrong.