-
-
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 remote-tracking branch 'nseam/dev-indicator-refactor' into v3.0…
…01-dev-new * nseam/dev-indicator-refactor: (50 commits)
- Loading branch information
Showing
118 changed files
with
4,501 additions
and
1,198 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,61 @@ | ||
--- | ||
name: Test Buffer | ||
|
||
# yamllint disable-line rule:truthy | ||
on: | ||
pull_request: | ||
paths: | ||
- 'Buffer/**' | ||
- '.github/workflows/test-buffer.yml' | ||
push: | ||
paths: | ||
- 'Buffer/**' | ||
- '.github/workflows/test-buffer.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: 'Buffer/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' | ||
|
||
Buffer-Tests-MQL4: | ||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: Buffer/tests | ||
needs: Compile | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
test: | ||
- BufferCandle.test | ||
- BufferTick.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
--- | ||
name: Test Indicator | ||
|
||
# yamllint disable-line rule:truthy | ||
on: | ||
pull_request: | ||
paths: | ||
- 'Indicator**' | ||
- 'Indicator/**' | ||
- '.github/workflows/test-indicator.yml' | ||
push: | ||
paths: | ||
- 'Indicator**' | ||
- 'Indicator/**' | ||
- '.github/workflows/test-indicator.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: 'Indicator/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' | ||
|
||
Indicator-Tests-MQL4: | ||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: Indicator/tests | ||
needs: Compile | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
test: | ||
- IndicatorCandle.test | ||
- IndicatorTf.test | ||
- IndicatorTick.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: 2020 | ||
TestExpert: ${{ 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
//+------------------------------------------------------------------+ | ||
//| EA31337 framework | | ||
//| Copyright 2016-2021, 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/>. | ||
* | ||
*/ | ||
|
||
// Prevents processing this includes file for the second time. | ||
#ifndef BUFFER_CANDLE_H | ||
#define BUFFER_CANDLE_H | ||
|
||
// Includes. | ||
#include "../BufferStruct.mqh" | ||
#include "../Candle.struct.h" | ||
|
||
/** | ||
* Class to store struct data. | ||
*/ | ||
template <typename TV> | ||
class BufferCandle : public BufferStruct<CandleOCTOHLC<TV>> { | ||
protected: | ||
protected: | ||
/* Protected methods */ | ||
|
||
/** | ||
* Initialize class. | ||
* | ||
* Called on constructor. | ||
*/ | ||
void Init() { SetOverflowListener(BufferCandleOverflowListener, 10); } | ||
|
||
public: | ||
/* Constructors */ | ||
|
||
/** | ||
* Constructor. | ||
*/ | ||
BufferCandle() { Init(); } | ||
BufferCandle(BufferCandle& _right) { | ||
THIS_REF = _right; | ||
Init(); | ||
} | ||
|
||
/* Callback methods */ | ||
|
||
/** | ||
* Function should return true if resize can be made, or false to overwrite current slot. | ||
*/ | ||
static bool BufferCandleOverflowListener(ENUM_DICT_OVERFLOW_REASON _reason, int _size, int _num_conflicts) { | ||
static int cache_limit = 86400; | ||
switch (_reason) { | ||
case DICT_OVERFLOW_REASON_FULL: | ||
// We allow resize if dictionary size is less than 86400 slots. | ||
return _size < cache_limit; | ||
case DICT_OVERFLOW_REASON_TOO_MANY_CONFLICTS: | ||
default: | ||
// When there is too many conflicts, we just reject doing resize, so first conflicting slot will be reused. | ||
break; | ||
} | ||
return false; | ||
} | ||
}; | ||
|
||
#endif // BUFFER_CANDLE_H |
Oops, something went wrong.