diff --git a/.github/workflows/test-exchange-account.yml b/.github/workflows/test-exchange-account.yml index e744eb477..f1251beb4 100644 --- a/.github/workflows/test-exchange-account.yml +++ b/.github/workflows/test-exchange-account.yml @@ -3,7 +3,7 @@ name: Test Exchange/Account env: TEST_PATH: Exchange/Account/tests - TEST_SKIP: ${{ secrets.MT5_LOGIN || false }} + TEST_SKIP: ${{ secrets.MT5_LOGIN == '' }} # yamllint disable-line rule:truthy on: @@ -48,7 +48,7 @@ jobs: name: files-ex${{ matrix.version }} - name: List compiled files run: find . -name '*.ex?' -type f -print - - if: ${{ env.TEST_SKIP != true }} + - if: ${{ env.TEST_SKIP != true && env.TEST_SKIP != 'true' }} name: Run ${{ matrix.test }} uses: fx31337/mql-tester-action@master with: diff --git a/.github/workflows/test-exchange-symbolinfo.yml b/.github/workflows/test-exchange-symbolinfo.yml index abff9c520..62837373b 100644 --- a/.github/workflows/test-exchange-symbolinfo.yml +++ b/.github/workflows/test-exchange-symbolinfo.yml @@ -3,7 +3,7 @@ name: Test Exchange/SymbolInfo env: TEST_PATH: Exchange/SymbolInfo/tests - TEST_SKIP: ${{ secrets.MT5_LOGIN || false }} + TEST_SKIP: ${{ secrets.MT5_LOGIN == '' }} # yamllint disable-line rule:truthy on: @@ -46,7 +46,7 @@ jobs: name: files-ex${{ matrix.version }} - name: List compiled files run: find . -name '*.ex?' -type f -print - - if: ${{ env.TEST_SKIP != true }} + - if: ${{ env.TEST_SKIP != true && env.TEST_SKIP != 'true' }} name: Run ${{ matrix.test }} uses: fx31337/mql-tester-action@master with: diff --git a/.github/workflows/test-exchange.yml b/.github/workflows/test-exchange.yml index 687f9f64e..2132f709c 100644 --- a/.github/workflows/test-exchange.yml +++ b/.github/workflows/test-exchange.yml @@ -3,7 +3,7 @@ name: Test Exchange env: TEST_PATH: Exchange/tests - TEST_SKIP: ${{ secrets.MT5_LOGIN || false }} + TEST_SKIP: ${{ secrets.MT5_LOGIN == '' }} # yamllint disable-line rule:truthy on: @@ -48,7 +48,7 @@ jobs: name: files-ex${{ matrix.version }} - name: List compiled files run: find . -name '*.ex?' -type f -print - - if: ${{ env.TEST_SKIP != true }} + - if: ${{ env.TEST_SKIP != true && env.TEST_SKIP != 'true' }} name: Run ${{ matrix.test }} uses: fx31337/mql-tester-action@master with: diff --git a/.github/workflows/test-indicator.yml b/.github/workflows/test-indicator.yml index b63474d19..bbd27be22 100644 --- a/.github/workflows/test-indicator.yml +++ b/.github/workflows/test-indicator.yml @@ -3,7 +3,7 @@ name: Test Indicator env: TEST_PATH: Indicator/tests - TEST_SKIP: ${{ secrets.MT5_LOGIN || false }} + TEST_SKIP: ${{ secrets.MT5_LOGIN == '' }} # yamllint disable-line rule:truthy on: @@ -54,7 +54,7 @@ jobs: name: files-ex${{ matrix.version }} - name: List compiled files run: find . -name '*.ex?' -type f -print - - if: ${{ env.TEST_SKIP != true }} + - if: ${{ env.TEST_SKIP != true && env.TEST_SKIP != 'true' }} name: Run ${{ matrix.test }} uses: fx31337/mql-tester-action@master with: diff --git a/.github/workflows/test-indicators-bitwise.yml b/.github/workflows/test-indicators-bitwise.yml index 0c5120453..dc387d6b3 100644 --- a/.github/workflows/test-indicators-bitwise.yml +++ b/.github/workflows/test-indicators-bitwise.yml @@ -3,7 +3,7 @@ name: Test Indicators (Bitwise) env: TEST_PATH: Indicators/Bitwise/tests - TEST_SKIP: ${{ secrets.MT5_LOGIN || false }} + TEST_SKIP: ${{ secrets.MT5_LOGIN == '' }} # yamllint disable-line rule:truthy on: @@ -49,7 +49,7 @@ jobs: name: files-ex${{ matrix.version }} - name: List compiled files run: find . -name '*.ex?' -type f -print - - if: ${{ env.TEST_SKIP != true }} + - if: ${{ env.TEST_SKIP != true && env.TEST_SKIP != 'true' }} name: Run ${{ matrix.test }} uses: fx31337/mql-tester-action@master with: diff --git a/.github/workflows/test-indicators-ohlc.yml b/.github/workflows/test-indicators-ohlc.yml index e4d460531..7c1845d93 100644 --- a/.github/workflows/test-indicators-ohlc.yml +++ b/.github/workflows/test-indicators-ohlc.yml @@ -3,7 +3,7 @@ name: Test Indicators (OHLC) env: TEST_PATH: Indicators/OHLC/tests - TEST_SKIP: ${{ secrets.MT5_LOGIN || false }} + TEST_SKIP: ${{ secrets.MT5_LOGIN == '' }} # yamllint disable-line rule:truthy on: @@ -48,7 +48,7 @@ jobs: name: files-ex${{ matrix.version }} - name: List compiled files run: find . -name '*.ex?' -type f -print - - if: ${{ env.TEST_SKIP != true }} + - if: ${{ env.TEST_SKIP != true && env.TEST_SKIP != 'true' }} name: Run ${{ matrix.test }} uses: fx31337/mql-tester-action@master with: diff --git a/.github/workflows/test-indicators-oscillator.yml b/.github/workflows/test-indicators-oscillator.yml index 00cebf5a4..94123f76a 100644 --- a/.github/workflows/test-indicators-oscillator.yml +++ b/.github/workflows/test-indicators-oscillator.yml @@ -3,7 +3,7 @@ name: Test Indicators (Oscillator) env: TEST_PATH: Indicators/Oscillator/tests - TEST_SKIP: ${{ secrets.MT5_LOGIN || false }} + TEST_SKIP: ${{ secrets.MT5_LOGIN == '' }} # yamllint disable-line rule:truthy on: @@ -51,7 +51,7 @@ jobs: name: files-ex${{ matrix.version }} - name: List compiled files run: find . -name '*.ex?' -type f -print - - if: ${{ env.TEST_SKIP != true }} + - if: ${{ env.TEST_SKIP != true && env.TEST_SKIP != 'true' }} name: Run ${{ matrix.test }} uses: fx31337/mql-tester-action@master with: diff --git a/.github/workflows/test-indicators-price.yml b/.github/workflows/test-indicators-price.yml index 7b1f10c9a..1e3e54a50 100644 --- a/.github/workflows/test-indicators-price.yml +++ b/.github/workflows/test-indicators-price.yml @@ -3,7 +3,7 @@ name: Test Indicators (Price) env: TEST_PATH: Indicators/Price/tests - TEST_SKIP: ${{ secrets.MT5_LOGIN || false }} + TEST_SKIP: ${{ secrets.MT5_LOGIN == '' }} # yamllint disable-line rule:truthy on: @@ -50,7 +50,7 @@ jobs: name: files-ex${{ matrix.version }} - name: List compiled files run: find . -name '*.ex?' -type f -print - - if: ${{ env.TEST_SKIP != true }} + - if: ${{ env.TEST_SKIP != true && env.TEST_SKIP != 'true' }} name: Run ${{ matrix.test }} uses: fx31337/mql-tester-action@master with: diff --git a/.github/workflows/test-indicators-pricemulti.yml b/.github/workflows/test-indicators-pricemulti.yml index 6fc3ba07d..6e1e3bea0 100644 --- a/.github/workflows/test-indicators-pricemulti.yml +++ b/.github/workflows/test-indicators-pricemulti.yml @@ -3,7 +3,7 @@ name: Test Indicators (PriceMulti) env: TEST_PATH: Indicators/PriceMulti/tests - TEST_SKIP: ${{ secrets.MT5_LOGIN || false }} + TEST_SKIP: ${{ secrets.MT5_LOGIN == '' }} # yamllint disable-line rule:truthy on: @@ -48,7 +48,7 @@ jobs: name: files-ex${{ matrix.version }} - name: List compiled files run: find . -name '*.ex?' -type f -print - - if: ${{ env.TEST_SKIP != true }} + - if: ${{ env.TEST_SKIP != true && env.TEST_SKIP != 'true' }} name: Run ${{ matrix.test }} uses: fx31337/mql-tester-action@master with: diff --git a/.github/workflows/test-indicators-pricerange.yml b/.github/workflows/test-indicators-pricerange.yml index 9eb06538e..2dde68202 100644 --- a/.github/workflows/test-indicators-pricerange.yml +++ b/.github/workflows/test-indicators-pricerange.yml @@ -3,7 +3,7 @@ name: Test Indicators (PriceRange) env: TEST_PATH: Indicators/PriceRange/tests - TEST_SKIP: ${{ secrets.MT5_LOGIN || false }} + TEST_SKIP: ${{ secrets.MT5_LOGIN == '' }} # yamllint disable-line rule:truthy on: @@ -51,7 +51,7 @@ jobs: name: files-ex${{ matrix.version }} - name: List compiled files run: find . -name '*.ex?' -type f -print - - if: ${{ env.TEST_SKIP != true }} + - if: ${{ env.TEST_SKIP != true && env.TEST_SKIP != 'true' }} name: Run ${{ matrix.test }} uses: fx31337/mql-tester-action@master with: diff --git a/.github/workflows/test-indicators-special.yml b/.github/workflows/test-indicators-special.yml index 343f0a0dd..149a1de30 100644 --- a/.github/workflows/test-indicators-special.yml +++ b/.github/workflows/test-indicators-special.yml @@ -3,7 +3,7 @@ name: Test Indicators (Special) env: TEST_PATH: Indicators/Special/tests - TEST_SKIP: ${{ secrets.MT5_LOGIN || false }} + TEST_SKIP: ${{ secrets.MT5_LOGIN == '' }} # yamllint disable-line rule:truthy on: @@ -49,7 +49,7 @@ jobs: name: files-ex${{ matrix.version }} - name: List compiled files run: find . -name '*.ex?' -type f -print - - if: ${{ env.TEST_SKIP != true }} + - if: ${{ env.TEST_SKIP != true && env.TEST_SKIP != 'true' }} name: Run ${{ matrix.test }} uses: fx31337/mql-tester-action@master with: diff --git a/.github/workflows/test-indicators-tick.yml b/.github/workflows/test-indicators-tick.yml index 0f6a73fc7..2aa8d9725 100644 --- a/.github/workflows/test-indicators-tick.yml +++ b/.github/workflows/test-indicators-tick.yml @@ -3,7 +3,7 @@ name: Test Indicators (Tick) env: TEST_PATH: Indicators/Tick/tests - TEST_SKIP: ${{ secrets.MT5_LOGIN || false }} + TEST_SKIP: ${{ secrets.MT5_LOGIN == '' }} # yamllint disable-line rule:truthy on: @@ -48,7 +48,7 @@ jobs: name: files-ex${{ matrix.version }} - name: List compiled files run: find . -name '*.ex?' -type f -print - - if: ${{ env.TEST_SKIP != true }} + - if: ${{ env.TEST_SKIP != true && env.TEST_SKIP != 'true' }} name: Run ${{ matrix.test }} uses: fx31337/mql-tester-action@master with: diff --git a/.github/workflows/test-indicators.yml b/.github/workflows/test-indicators.yml index 197e194ee..fe9c796de 100644 --- a/.github/workflows/test-indicators.yml +++ b/.github/workflows/test-indicators.yml @@ -3,7 +3,7 @@ name: Test Indicators env: TEST_PATH: Indicators/tests - TEST_SKIP: ${{ secrets.MT5_LOGIN || false }} + TEST_SKIP: ${{ secrets.MT5_LOGIN == '' }} # yamllint disable-line rule:truthy on: @@ -98,7 +98,7 @@ jobs: name: files-ex${{ matrix.version }} - name: List compiled files run: find . -name '*.ex?' -type f -print - - if: ${{ env.TEST_SKIP != true }} + - if: ${{ env.TEST_SKIP != true && env.TEST_SKIP != 'true' }} name: Run ${{ matrix.test }} uses: fx31337/mql-tester-action@master with: diff --git a/.github/workflows/test-math.yml b/.github/workflows/test-math.yml index 3fb74e360..7877e6202 100644 --- a/.github/workflows/test-math.yml +++ b/.github/workflows/test-math.yml @@ -3,7 +3,7 @@ name: Test Math env: TEST_PATH: Math/tests - TEST_SKIP: ${{ secrets.MT5_LOGIN || false }} + TEST_SKIP: ${{ secrets.MT5_LOGIN == '' }} # yamllint disable-line rule:truthy on: @@ -48,7 +48,7 @@ jobs: name: files-ex${{ matrix.version }} - name: List compiled files run: find . -name '*.ex?' -type f -print - - if: ${{ env.TEST_SKIP != true }} + - if: ${{ env.TEST_SKIP != true && env.TEST_SKIP != 'true' }} name: Run ${{ matrix.test }} uses: fx31337/mql-tester-action@master with: diff --git a/.github/workflows/test-platform-chart.yml b/.github/workflows/test-platform-chart.yml index c589b98be..8709a2638 100644 --- a/.github/workflows/test-platform-chart.yml +++ b/.github/workflows/test-platform-chart.yml @@ -3,7 +3,7 @@ name: Test Platform/Chart env: TEST_PATH: Platform/Chart/tests - TEST_SKIP: ${{ secrets.MT5_LOGIN || false }} + TEST_SKIP: ${{ secrets.MT5_LOGIN == '' }} # yamllint disable-line rule:truthy on: @@ -47,7 +47,7 @@ jobs: name: files-ex${{ matrix.version }} - name: List compiled files run: find . -name '*.ex?' -type f -print - - if: ${{ env.TEST_SKIP != true }} + - if: ${{ env.TEST_SKIP != true && env.TEST_SKIP != 'true' }} name: Run ${{ matrix.test }} uses: fx31337/mql-tester-action@master with: diff --git a/.github/workflows/test-platform-chart3d.yml b/.github/workflows/test-platform-chart3d.yml index ac884c48e..cd22e17d1 100644 --- a/.github/workflows/test-platform-chart3d.yml +++ b/.github/workflows/test-platform-chart3d.yml @@ -3,7 +3,7 @@ name: Test Platform/Chart3D env: TEST_PATH: Platform/Chart3D/tests - TEST_SKIP: ${{ secrets.MT5_LOGIN || false }} + TEST_SKIP: ${{ secrets.MT5_LOGIN == '' }} # yamllint disable-line rule:truthy on: @@ -46,7 +46,7 @@ jobs: name: files-ex${{ matrix.version }} - name: List compiled files run: find . -name '*.ex?' -type f -print - - if: ${{ env.TEST_SKIP != true }} + - if: ${{ env.TEST_SKIP != true && env.TEST_SKIP != 'true' }} name: Run ${{ matrix.test }} uses: fx31337/mql-tester-action@master with: diff --git a/.github/workflows/test-platform-web.yml b/.github/workflows/test-platform-web.yml index 484e6364a..143e52e83 100644 --- a/.github/workflows/test-platform-web.yml +++ b/.github/workflows/test-platform-web.yml @@ -3,7 +3,7 @@ name: Test Platform/Web env: TEST_PATH: Platform/Web/tests - TEST_SKIP: ${{ secrets.MT5_LOGIN || false }} + TEST_SKIP: ${{ secrets.MT5_LOGIN == '' }} # yamllint disable-line rule:truthy on: @@ -47,7 +47,7 @@ jobs: name: files-ex${{ matrix.version }} - name: List compiled files run: find . -name '*.ex?' -type f -print - - if: ${{ env.TEST_SKIP != true }} + - if: ${{ env.TEST_SKIP != true && env.TEST_SKIP != 'true' }} name: Run ${{ matrix.test }} uses: fx31337/mql-tester-action@master with: diff --git a/.github/workflows/test-platform.yml b/.github/workflows/test-platform.yml index 351e4bbb6..b93eaa308 100644 --- a/.github/workflows/test-platform.yml +++ b/.github/workflows/test-platform.yml @@ -3,7 +3,7 @@ name: Test Platform env: TEST_PATH: Platform/tests - TEST_SKIP: ${{ secrets.MT5_LOGIN || false }} + TEST_SKIP: ${{ secrets.MT5_LOGIN == '' }} # yamllint disable-line rule:truthy on: @@ -51,7 +51,7 @@ jobs: name: files-ex${{ matrix.version }} - name: List compiled files run: find . -name '*.ex?' -type f -print - - if: ${{ env.TEST_SKIP != true }} + - if: ${{ env.TEST_SKIP != true && env.TEST_SKIP != 'true' }} name: Run ${{ matrix.test }} uses: fx31337/mql-tester-action@master with: diff --git a/.github/workflows/test-serializer.yml b/.github/workflows/test-serializer.yml index baa6b5271..57613112d 100644 --- a/.github/workflows/test-serializer.yml +++ b/.github/workflows/test-serializer.yml @@ -3,7 +3,7 @@ name: Test Serializer env: TEST_PATH: Serializer/tests - TEST_SKIP: ${{ secrets.MT5_LOGIN || false }} + TEST_SKIP: ${{ secrets.MT5_LOGIN == '' }} # yamllint disable-line rule:truthy on: @@ -46,7 +46,7 @@ jobs: name: files-ex${{ matrix.version }} - name: List compiled files run: find . -name '*.ex?' -type f -print - - if: ${{ env.TEST_SKIP != true }} + - if: ${{ env.TEST_SKIP != true && env.TEST_SKIP != 'true' }} name: Run ${{ matrix.test }} uses: fx31337/mql-tester-action@master with: diff --git a/.github/workflows/test-storage-cache.yml b/.github/workflows/test-storage-cache.yml index 7cc26b719..1a5371990 100644 --- a/.github/workflows/test-storage-cache.yml +++ b/.github/workflows/test-storage-cache.yml @@ -3,7 +3,7 @@ name: Test Storage/Cache env: TEST_PATH: Storage/Cache/tests - TEST_SKIP: ${{ secrets.MT5_LOGIN || false }} + TEST_SKIP: ${{ secrets.MT5_LOGIN == '' }} # yamllint disable-line rule:truthy on: @@ -47,7 +47,7 @@ jobs: name: files-ex${{ matrix.version }} - name: List compiled files run: find . -name '*.ex?' -type f -print - - if: ${{ env.TEST_SKIP != true }} + - if: ${{ env.TEST_SKIP != true && env.TEST_SKIP != 'true' }} name: Run ${{ matrix.test }} uses: fx31337/mql-tester-action@master with: diff --git a/.github/workflows/test-storage-dict-buffer.yml b/.github/workflows/test-storage-dict-buffer.yml index b71dbf9ce..032270bcd 100644 --- a/.github/workflows/test-storage-dict-buffer.yml +++ b/.github/workflows/test-storage-dict-buffer.yml @@ -3,7 +3,7 @@ name: Test Storage/Dict/Buffer env: TEST_PATH: Storage/Dict/Buffer/tests - TEST_SKIP: ${{ secrets.MT5_LOGIN || false }} + TEST_SKIP: ${{ secrets.MT5_LOGIN == '' }} # yamllint disable-line rule:truthy on: @@ -51,7 +51,7 @@ jobs: name: files-ex${{ matrix.version }} - name: List compiled files run: find . -name '*.ex?' -type f -print - - if: ${{ env.TEST_SKIP != true }} + - if: ${{ env.TEST_SKIP != true && env.TEST_SKIP != 'true' }} name: Run ${{ matrix.test }} uses: fx31337/mql-tester-action@master with: diff --git a/.github/workflows/test-storage-dict.yml b/.github/workflows/test-storage-dict.yml index 43ba26b56..ecc77bb8b 100644 --- a/.github/workflows/test-storage-dict.yml +++ b/.github/workflows/test-storage-dict.yml @@ -3,7 +3,7 @@ name: Test Storage/Dict env: TEST_PATH: Storage/Dict/tests - TEST_SKIP: ${{ secrets.MT5_LOGIN || false }} + TEST_SKIP: ${{ secrets.MT5_LOGIN == '' }} # yamllint disable-line rule:truthy on: @@ -46,7 +46,7 @@ jobs: name: files-ex${{ matrix.version }} - name: List compiled files run: find . -name '*.ex?' -type f -print - - if: ${{ env.TEST_SKIP != true }} + - if: ${{ env.TEST_SKIP != true && env.TEST_SKIP != 'true' }} name: Run ${{ matrix.test }} uses: fx31337/mql-tester-action@master with: diff --git a/.github/workflows/test-storage.yml b/.github/workflows/test-storage.yml index 8dd65e4e3..81c19879f 100644 --- a/.github/workflows/test-storage.yml +++ b/.github/workflows/test-storage.yml @@ -3,7 +3,7 @@ name: Test Storage env: TEST_PATH: Storage/tests - TEST_SKIP: ${{ secrets.MT5_LOGIN || false }} + TEST_SKIP: ${{ secrets.MT5_LOGIN == '' }} # yamllint disable-line rule:truthy on: @@ -52,7 +52,7 @@ jobs: name: files-ex${{ matrix.version }} - name: List compiled files run: find . -name '*.ex?' -type f -print - - if: ${{ env.TEST_SKIP != true }} + - if: ${{ env.TEST_SKIP != true && env.TEST_SKIP != 'true' }} name: Run ${{ matrix.test }} uses: fx31337/mql-tester-action@master with: diff --git a/.github/workflows/test-task.yml b/.github/workflows/test-task.yml index bfe1a617c..cad05bc56 100644 --- a/.github/workflows/test-task.yml +++ b/.github/workflows/test-task.yml @@ -3,7 +3,7 @@ name: Test Task env: TEST_PATH: Task/tests - TEST_SKIP: ${{ secrets.MT5_LOGIN || false }} + TEST_SKIP: ${{ secrets.MT5_LOGIN == '' }} # yamllint disable-line rule:truthy on: @@ -54,7 +54,7 @@ jobs: name: files-ex${{ matrix.version }} - name: List compiled files run: find . -name '*.ex?' -type f -print - - if: ${{ env.TEST_SKIP != true }} + - if: ${{ env.TEST_SKIP != true && env.TEST_SKIP != 'true' }} name: Run ${{ matrix.test }} uses: fx31337/mql-tester-action@master with: diff --git a/.github/workflows/test-trade.yml b/.github/workflows/test-trade.yml index f40545dd7..f3c1457c3 100644 --- a/.github/workflows/test-trade.yml +++ b/.github/workflows/test-trade.yml @@ -3,7 +3,7 @@ name: Test Trade env: TEST_PATH: Trade/tests - TEST_SKIP: ${{ secrets.MT5_LOGIN || false }} + TEST_SKIP: ${{ secrets.MT5_LOGIN == '' }} # yamllint disable-line rule:truthy on: @@ -49,7 +49,7 @@ jobs: name: files-ex${{ matrix.version }} - name: List compiled files run: find . -name '*.ex?' -type f -print - - if: ${{ env.TEST_SKIP != true }} + - if: ${{ env.TEST_SKIP != true && env.TEST_SKIP != 'true' }} name: Run ${{ matrix.test }} uses: fx31337/mql-tester-action@master with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2cf0179c2..d80482805 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,7 +3,7 @@ name: Test env: TEST_PATH: tests - TEST_SKIP: ${{ secrets.MT5_LOGIN || false }} + TEST_SKIP: ${{ secrets.MT5_LOGIN == '' }} # yamllint disable-line rule:truthy on: @@ -58,7 +58,7 @@ jobs: name: files-ex${{ matrix.version }} - name: List compiled files run: find . -name '*.ex?' -type f -print - - if: ${{ env.TEST_SKIP != true }} + - if: ${{ env.TEST_SKIP != true && env.TEST_SKIP != 'true' }} name: Run ${{ matrix.test }} uses: fx31337/mql-tester-action@master with: diff --git a/EA.mqh b/EA.mqh index 6ac61d4d7..82b5c9cb2 100644 --- a/EA.mqh +++ b/EA.mqh @@ -98,8 +98,7 @@ class EA : public Taskable { void InitTask() { // Add and process init task. TaskEntry _task_entry(eparams.GetStruct(STRUCT_ENUM(EAParams, EA_PARAM_STRUCT_TASK_ENTRY))); - TaskObject _taskobj_init(_task_entry, - THIS_PTR, THIS_PTR); + TaskObject _taskobj_init(_task_entry, THIS_PTR, THIS_PTR); estate.Set(STRUCT_ENUM(EAState, EA_STATE_FLAG_ON_INIT), true); _taskobj_init.Process(); estate.Set(STRUCT_ENUM(EAState, EA_STATE_FLAG_ON_INIT), false); @@ -163,7 +162,7 @@ class EA : public Taskable { */ template T Get(ENUM_TRADE_STATE _state, string _symbol = NULL) { - return trade.GetByKey(_symbol != "" ? _symbol : _Symbol) PTR_DEREF Get(_state); + return trade.GetByKey(_symbol != "" ? _symbol : _Symbol) REF_DEREF Get(_state); } /** @@ -221,7 +220,7 @@ class EA : public Taskable { /** * Gets EA's trade instance. */ - Trade *GetTrade(string _symbol) { return trade.GetByKey(_symbol); } + Trade *GetTrade(string _symbol) { return trade.GetByKey(_symbol).Ptr(); } /* Setters */ @@ -254,8 +253,8 @@ class EA : public Taskable { */ template void Set(ENUM_TRADE_PARAM _param, T _value) { - for (DictObjectIterator> iter = trade.Begin(); iter.IsValid(); ++iter) { - Trade *_trade = iter.Value(); + for (DictStructIterator> iter = trade.Begin(); iter.IsValid(); ++iter) { + Trade *_trade = iter.Value().Ptr(); _trade PTR_DEREF Set(_param, _value); } for (DictStructIterator> iter = strats.Begin(); iter.IsValid(); ++iter) { @@ -642,10 +641,10 @@ class EA : public Taskable { Strategy *_strat = _iter.Value().Ptr(); if (data_stg.KeyExists(_sid)) { string _key_stg = StringFormat("Strategy-%d", _sid); - BufferStruct _stg_buff = data_stg.GetByKey(_sid); - SerializerConverter _obj = SerializerConverter::FromObject(_stg_buff, _serializer_flags); + BufferStruct *_stg_buff = data_stg.GetByKey(_sid); + SerializerConverter _obj = SerializerConverter::FromObject(PTR_TO_REF(_stg_buff), _serializer_flags); - _key_stg += StringFormat("-%d-%d-%d", _sid, _stg_buff.GetMin(), _stg_buff.GetMax()); + _key_stg += StringFormat("-%d-%d-%d", _sid, _stg_buff PTR_DEREF GetMin(), _stg_buff PTR_DEREF GetMax()); if ((_methods & EA_DATA_EXPORT_CSV) != 0) { _obj.ToFile(_key_stg + ".csv", _serializer_flags, &_stub); } @@ -790,7 +789,7 @@ class EA : public Taskable { logger.Error("Strategy adding conflict!", __FUNCTION_LINE__); DebugBreak(); } - OnStrategyAdd(_strat PTR_DEREF Ptr()); + OnStrategyAdd(_strat.Ptr()); return _result; } @@ -856,8 +855,10 @@ class EA : public Taskable { ResetLastError(); for (DictStructIterator> titer = trade.Begin(); titer.IsValid(); ++titer) { Trade *_trade = titer.Value().Ptr(); - if (_trade PTR_DEREF Get(TRADE_STATE_ORDERS_ACTIVE) && !_trade PTR_DEREF Get(TRADE_STATE_MARKET_CLOSED)) { - for (DictStructIterator> oiter = _trade PTR_DEREF GetOrdersActive() PTR_DEREF Begin(); oiter.IsValid(); ++oiter) { + if (_trade PTR_DEREF Get(TRADE_STATE_ORDERS_ACTIVE) && + !_trade PTR_DEREF Get(TRADE_STATE_MARKET_CLOSED)) { + for (DictStructIterator> oiter = _trade PTR_DEREF GetOrdersActive() PTR_DEREF Begin(); + oiter.IsValid(); ++oiter) { bool _sl_valid = false, _tp_valid = false; double _sl_new = 0, _tp_new = 0; Order *_order = oiter.Value().Ptr(); @@ -1054,10 +1055,9 @@ class EA : public Taskable { // 1st (i:0) - Strategy's enum action to execute. // 2nd (i:1) - Strategy's argument to pass. TaskActionEntry _entry_strat = _entry; - _entry_strat PTR_DEREF ArgRemove(0); - for (DictStructIterator> iter_strat = strats.Begin(); iter_strat PTR_DEREF IsValid(); ++iter_strat) { - Strategy *_strat = iter_strat PTR_DEREF Value().Ptr(); - + _entry_strat.ArgRemove(0); + for (DictStructIterator> iter_strat = strats.Begin(); iter_strat.IsValid(); ++iter_strat) { + Strategy *_strat = iter_strat.Value().Ptr(); _result &= _strat PTR_DEREF Run(_entry_strat); } break; diff --git a/Exchange/Account/Account.enum.h b/Exchange/Account/Account.enum.h index 9cc31d63f..b1198b1b5 100644 --- a/Exchange/Account/Account.enum.h +++ b/Exchange/Account/Account.enum.h @@ -26,8 +26,8 @@ */ #ifndef __MQL__ -// Allows the preprocessor to include a header file when it is needed. -#pragma once + // Allows the preprocessor to include a header file when it is needed. + #pragma once #endif /* Account type of values for statistics. */ @@ -99,7 +99,7 @@ enum ENUM_ACCOUNT_INFO_DOUBLE { * https://www.mql5.com/en/docs/constants/environment_state/accountinformation */ enum ENUM_ACCOUNT_INFO_INTEGER { - ACCOUNT_CURRENCY_DIGITS = 0, // The number of decimal places in the account currency (int). + ACCOUNT_CURRENCY_DIGITS, // The number of decimal places in the account currency (int). ACCOUNT_FIFO_CLOSE, // Whether positions can only be closed by FIFO rule (bool). ACCOUNT_LEVERAGE, // Account leverage (long). ACCOUNT_LIMIT_ORDERS, // Maximum allowed number of active pending orders (int). @@ -148,8 +148,14 @@ enum ENUM_ACCOUNT_STOPOUT_MODE { ACCOUNT_STOPOUT_MODE_PERCENT, // Account stop out mode in percents. ACCOUNT_STOPOUT_MODE_MONEY, // Account stop out mode in money. }; + #endif +// C++ only enum values for ENUM_ACCOUNT_PARAM_INTEGER. Avoids conflicts. +#define ACCOUNT_MARGIN_MODE 100 +#define ACCOUNT_CURRENCY_DIGITS 101 +#define ACCOUNT_FIFO_CLOSE 102 + /** * Enumeration for the account integer param values. * @@ -167,9 +173,9 @@ enum ENUM_ACCOUNT_PARAM_INTEGER { ACCOUNT_MARGIN_SO_MODE, // Mode for setting the minimal allowed margin (ENUM_ACCOUNT_STOPOUT_MODE). ACCOUNT_PARAM_TRADE_ALLOWED = ACCOUNT_TRADE_ALLOWED, // Allowed trade for the current account (bool). ACCOUNT_PARAM_TRADE_EXPERT = ACCOUNT_TRADE_EXPERT, // Allowed trade for an Expert Advisor (bool). - ACCOUNT_PARAM_MARGIN_MODE = ACCOUNT_MARGIN_MODE, // Margin calculation mode (ENUM_ACCOUNT_MARGIN_MODE). + ACCOUNT_PARAM_MARGIN_MODE = ACCOUNT_MARGIN_MODE, // Margin calculation mode (ENUM_ACCOUNT_MARGIN_MODE). ACCOUNT_PARAM_CURRENCY_DIGITS = ACCOUNT_CURRENCY_DIGITS, // The number of decimal places in the account currency (int). ACCOUNT_PARAM_FIFO_CLOSE = - ACCOUNT_FIFO_CLOSE, // An indication showing that positions can only be closed by FIFO rule (bool). + ACCOUNT_FIFO_CLOSE // An indication showing that positions can only be closed by FIFO rule (bool). }; diff --git a/Exchange/Account/Account.h b/Exchange/Account/Account.h index 00d1f7923..a4768ee63 100644 --- a/Exchange/Account/Account.h +++ b/Exchange/Account/Account.h @@ -21,8 +21,8 @@ */ #ifndef __MQL__ -// Allows the preprocessor to include a header file when it is needed. -#pragma once + // Allows the preprocessor to include a header file when it is needed. + #pragma once #endif // Includes. @@ -77,7 +77,7 @@ class Account : public AccountBase { /** * Returns serialized representation of the object instance. */ - virtual SerializerNodeType Serialize(Serializer &_s) const { + virtual SerializerNodeType Serialize(Serializer &_s) { _s.PassStruct(THIS_REF, "state", state); return SerializerNodeObject; } diff --git a/Exchange/Account/AccountBase.h b/Exchange/Account/AccountBase.h index 4307eb2aa..6b8382c2a 100644 --- a/Exchange/Account/AccountBase.h +++ b/Exchange/Account/AccountBase.h @@ -21,8 +21,8 @@ */ #ifndef __MQL__ -// Allows the preprocessor to include a header file when it is needed. -#pragma once + // Allows the preprocessor to include a header file when it is needed. + #pragma once #endif // Includes. @@ -64,14 +64,14 @@ class AccountBase : public Dynamic { /** * Returns textual representation of the object instance. */ - virtual string ToString() const { return SerializerConverter::FromObject(THIS_REF).ToString(); } + const string ToString() override { return SerializerConverter::FromObject(THIS_REF).ToString(); } /* Serializers */ /** * Returns serialized representation of the object instance. */ - virtual SerializerNodeType Serialize(Serializer &_s) const = 0; + virtual SerializerNodeType Serialize(Serializer &_s) = 0; /* Virtual methods */ diff --git a/Exchange/Account/AccountMt.h b/Exchange/Account/AccountMt.h index 49ab6f91b..43fe0e556 100644 --- a/Exchange/Account/AccountMt.h +++ b/Exchange/Account/AccountMt.h @@ -639,7 +639,7 @@ class AccountMt : public AccountBase { /** * Returns serialized representation of the object instance. */ - SerializerNodeType Serialize(Serializer &_s) const { + SerializerNodeType Serialize(Serializer &_s) { AccountEntry _entry = GetEntry(); _s.PassStruct(THIS_REF, "account-entry", _entry, SERIALIZER_FIELD_FLAG_DYNAMIC); return SerializerNodeObject; diff --git a/Exchange/Account/tests/Account.test.mq5 b/Exchange/Account/tests/Account.test.mq5 index a50189202..2279f14ba 100644 --- a/Exchange/Account/tests/Account.test.mq5 +++ b/Exchange/Account/tests/Account.test.mq5 @@ -71,7 +71,7 @@ class AccountTest : public Account { */ int OnInit() { bool _result = true; - AccountTest acc1; + // AccountTest acc1; // ... return _result && GetLastError() == 0 ? INIT_SUCCEEDED : INIT_FAILED; } diff --git a/Exchange/Account/tests/AccountForex.test.mq5 b/Exchange/Account/tests/AccountForex.test.mq5 index ec66bc39e..c751832a7 100644 --- a/Exchange/Account/tests/AccountForex.test.mq5 +++ b/Exchange/Account/tests/AccountForex.test.mq5 @@ -71,7 +71,7 @@ class AccountForexTest : public Account { */ int OnInit() { bool _result = true; - AccountForexTest acc1; + // AccountForexTest acc1; // ... return _result && GetLastError() == 0 ? INIT_SUCCEEDED : INIT_FAILED; } diff --git a/Exchange/Exchange.h b/Exchange/Exchange.h index 1c843a209..f6a4d0aaa 100644 --- a/Exchange/Exchange.h +++ b/Exchange/Exchange.h @@ -21,8 +21,8 @@ */ #ifndef __MQL__ -// Allows the preprocessor to include a header file when it is needed. -#pragma once + // Allows the preprocessor to include a header file when it is needed. + #pragma once #endif // Includes. @@ -191,7 +191,7 @@ class Exchange : public Taskable { /** * Returns serialized representation of the object instance. */ - SerializerNodeType Serialize(Serializer &_s) const { + SerializerNodeType Serialize(Serializer &_s) { _s.PassStruct(THIS_REF, "eparams", eparams); _s.PassStruct(THIS_REF, "accounts", accounts); //_s.PassStruct(THIS_REF, "symbols", symbols); @@ -202,5 +202,5 @@ class Exchange : public Taskable { /** * Returns textual representation of the object instance. */ - string ToString() const { return SerializerConverter::FromObject(THIS_REF).ToString(); } + const string ToString() override { return SerializerConverter::FromObject(THIS_REF).ToString(); } }; diff --git a/Exchange/tests/Exchange.test.mq5 b/Exchange/tests/Exchange.test.mq5 index 92a89573b..52cdfdd96 100644 --- a/Exchange/tests/Exchange.test.mq5 +++ b/Exchange/tests/Exchange.test.mq5 @@ -74,9 +74,7 @@ class AccountDummy : public AccountBase { /** * Returns serialized representation of the object instance. */ - virtual SerializerNodeType Serialize(Serializer &_s) const { - return SerializerNodeObject; - } + virtual SerializerNodeType Serialize(Serializer &_s) { return SerializerNodeObject; } }; class ExchangeDummy : public Exchange { diff --git a/Platform/Platform.h b/Platform/Platform.h index 27630d41d..4abbc6e35 100644 --- a/Platform/Platform.h +++ b/Platform/Platform.h @@ -28,7 +28,7 @@ #include "Deal.enum.h" #include "Order.struct.h" #include "Platform.define.h" -#include "Platform.enum.h" + #include "Platform.enum.h" /** * Extern declarations for C++. @@ -622,7 +622,7 @@ class Platform : public Taskable { /** * Returns serialized representation of the object instance. */ - SerializerNodeType Serialize(Serializer &_s) const { + SerializerNodeType Serialize(Serializer &_s) { _s.PassStruct(THIS_REF, "params", pparams); //_s.PassStruct(THIS_REF, "exchanges", exchanges); return SerializerNodeObject; @@ -631,7 +631,7 @@ class Platform : public Taskable { /** * Returns textual representation of the object instance. */ - string ToString() const { return SerializerConverter::FromObject(THIS_REF).ToString(); } + const string ToString() override { return SerializerConverter::FromObject(THIS_REF).ToString(); } }; bool Platform::initialized = false; diff --git a/Platform/Platform.struct.h b/Platform/Platform.struct.h index d67260b6b..b8997e10a 100644 --- a/Platform/Platform.struct.h +++ b/Platform/Platform.struct.h @@ -26,8 +26,8 @@ */ #ifndef __MQL__ -// Allows the preprocessor to include a header file when it is needed. -#pragma once + // Allows the preprocessor to include a header file when it is needed. + #pragma once #endif // Includes. @@ -82,7 +82,7 @@ struct PlatformParams { SetUserError(ERR_INVALID_PARAMETER); } // Serializers. - SerializerNodeType Serialize(Serializer &s) const { + SerializerNodeType Serialize(Serializer &s) { s.Pass(THIS_REF, "id", id); s.Pass(THIS_REF, "name", name); return SerializerNodeObject;