From 4d8154d60a06d4ca14c3fc9313660c8ddbbd3695 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 02:31:20 +0100 Subject: [PATCH 001/109] Renames storage related classes to Storage/ --- .github/workflows/test-account.yml | 6 +- .github/workflows/test-exchange.yml | 8 +- .github/workflows/test-indicator.yml | 2 +- .github/workflows/test-indicators-bitwise.yml | 68 +++++++++++ .github/workflows/test-indicators-ohlc.yml | 67 +++++++++++ .github/workflows/test-indicators-price.yml | 67 +++++++++++ .github/workflows/test-indicators-special.yml | 4 +- .github/workflows/test-indicators-tick.yml | 2 +- .github/workflows/test-indicators.yml | 6 +- .github/workflows/test-serializer.yml | 2 +- .../workflows/test-storage-dict-buffer.yml | 66 +++++++++++ ...{test-buffer.yml => test-storage-dict.yml} | 19 ++- .github/workflows/test-storage.yml | 67 +++++++++++ .github/workflows/test-task.yml | 2 +- .github/workflows/test-tick.yml | 2 +- .github/workflows/test-trade.yml | 12 +- .github/workflows/test.yml | 57 ++------- 3D/Mesh.h | 2 +- tests/3DTest.mq5 => 3D/tests/3D.test.mq5 | 28 ++--- {tests/3D => 3D/tests}/Shaders/pixel.hlsl | 0 {tests/3D => 3D/tests}/Shaders/vertex.hlsl | 0 Account/Account.extern.h | 2 +- Account/Account.h | 2 +- Account/AccountForex.struct.h | 2 +- Account/AccountMt.h | 6 +- Chart.struct.h | 2 +- ChartBase.h | 2 +- Common.extern.h | 2 +- Config.mqh | 4 +- Convert.basic.h | 6 +- Convert.mqh | 6 +- Draw.mqh | 6 +- EA.mqh | 6 +- EA.struct.h | 2 +- Exchange/Exchange.h | 2 +- File.extern.h | 2 +- Indicator/Indicator.h | 12 +- Indicator/Indicator.struct.h | 6 +- Indicator/IndicatorBase.h | 8 +- Indicator/IndicatorData.h | 2 +- Indicator/IndicatorTick.h | 2 +- Indicator/tests/IndicatorTf.test.mq5 | 2 +- Indicators/Bitwise/Indi_Candle.mqh | 2 +- Indicators/Bitwise/Indi_Pattern.mqh | 2 +- .../Bitwise/{indicators.h => includes.h} | 0 .../{ => Bitwise}/tests/Indi_Pattern.test.mq4 | 0 .../{ => Bitwise}/tests/Indi_Pattern.test.mq5 | 6 +- .../DrawIndicator.mqh | 6 +- Indicators/Indi_AC.mqh | 2 +- Indicators/Indi_ADXW.mqh | 2 +- Indicators/Indi_AMA.mqh | 2 +- Indicators/Indi_ASI.mqh | 2 +- Indicators/Indi_AppliedPrice.mqh | 2 +- Indicators/Indi_BWZT.mqh | 2 +- Indicators/Indi_CHO.mqh | 2 +- Indicators/Indi_CHV.mqh | 2 +- Indicators/Indi_ColorBars.mqh | 2 +- Indicators/Indi_ColorCandlesDaily.mqh | 2 +- Indicators/Indi_ColorLine.mqh | 2 +- Indicators/Indi_CustomMovingAverage.mqh | 2 +- Indicators/Indi_DEMA.mqh | 6 +- Indicators/Indi_Demo.mqh | 2 +- Indicators/Indi_DetrendedPrice.mqh | 2 +- Indicators/Indi_Drawer.mqh | 4 +- Indicators/Indi_FractalAdaptiveMA.mqh | 2 +- Indicators/Indi_MA.mqh | 6 +- Indicators/Indi_MassIndex.mqh | 2 +- Indicators/Indi_PriceChannel.mqh | 2 +- Indicators/Indi_PriceFeeder.mqh | 2 +- Indicators/Indi_PriceVolumeTrend.mqh | 2 +- Indicators/Indi_RS.mqh | 2 +- Indicators/Indi_RSI.mqh | 2 +- Indicators/Indi_RateOfChange.mqh | 2 +- Indicators/Indi_TEMA.mqh | 2 +- Indicators/Indi_TRIX.mqh | 2 +- Indicators/Indi_UltimateOscillator.mqh | 2 +- Indicators/Indi_VIDYA.mqh | 2 +- Indicators/Indi_VROC.mqh | 2 +- Indicators/Indi_Volumes.mqh | 2 +- Indicators/Indi_WilliamsAD.mqh | 2 +- Indicators/Indi_ZigZagColor.mqh | 2 +- Indicators/OHLC/Indi_OHLC.mqh | 2 +- Indicators/OHLC/{indicators.h => includes.h} | 0 .../{ => OHLC}/tests/Indi_OHLC.test.mq4 | 0 .../{ => OHLC}/tests/Indi_OHLC.test.mq5 | 6 +- Indicators/Price/Indi_Price.mqh | 2 +- Indicators/Price/{indicators.h => includes.h} | 0 .../{ => Price}/tests/Indi_Price.test.mq4 | 0 .../{ => Price}/tests/Indi_Price.test.mq5 | 6 +- Indicators/Special/Indi_Math.mqh | 2 +- .../Special/{indicators.h => includes.h} | 0 Indicators/{indicators.h => includes.h} | 0 Indicators/tests/DrawIndicator.test.mq4 | 27 +++++ .../tests/DrawIndicator.test.mq5 | 16 +-- Instances.h | 2 +- Log.mqh | 10 +- MD5.mqh | 2 +- Market.struct.h | 4 +- Math.h | 2 +- Math.struct.h | 2 +- Order.mqh | 6 +- Order.struct.h | 2 +- OrderQuery.h | 2 +- Platform.extern.h | 4 +- Platform.h | 4 +- PlatformTime.h | 4 +- Profiler.mqh | 2 +- README.md | 22 ++-- Refs.mqh | 6 +- Refs.rc.h | 2 +- Report.mqh | 4 +- Serializer/SerializerBinary.h | 4 +- Serializer/SerializerConversions.h | 4 +- Serializer/SerializerCsv.h | 8 +- Serializer/SerializerJson.h | 6 +- Serializer/SerializerObject.h | 4 +- Serializer/SerializerSqlite.h | 2 +- Serializer/tests/Serializer.test.mq5 | 10 +- Std.h | 2 +- Array.extern.h => Storage/Array.extern.h | 4 +- Array.mqh => Storage/Array.h | 8 +- Collection.mqh => Storage/Collection.h | 8 +- Data.define.h => Storage/Data.define.h | 0 Data.enum.h => Storage/Data.enum.h | 0 Data.struct.h => Storage/Data.struct.h | 8 +- .../Data.struct.serialize.h | 2 +- Database.mqh => Storage/Database.h | 94 ++------------- Storage/Database.struct.h | 109 ++++++++++++++++++ DateTime.entry.h => Storage/DateTime.entry.h | 4 +- DateTime.enum.h => Storage/DateTime.enum.h | 0 .../DateTime.extern.h | 2 +- DateTime.mqh => Storage/DateTime.h | 4 +- .../DateTime.static.h | 2 +- .../DateTime.struct.h | 2 +- Buffer.mqh => Storage/Dict/Buffer/Buffer.h | 8 +- .../Dict/Buffer}/BufferCandle.h | 8 +- .../Dict/Buffer/BufferFXT.h | 14 +-- .../Dict/Buffer/BufferStruct.h | 12 +- {Buffer => Storage/Dict/Buffer}/BufferTick.h | 8 +- .../Dict/Buffer/tests/Buffer.test.mq4 | 2 +- .../Dict/Buffer/tests/Buffer.test.mq5 | 4 +- .../Dict/Buffer}/tests/BufferCandle.test.mq4 | 0 .../Dict/Buffer}/tests/BufferCandle.test.mq5 | 2 +- .../Buffer/tests/BufferCompileAll.test.mq4 | 28 +++++ .../Buffer/tests/BufferCompileAll.test.mq5 | 38 ++++++ .../Dict/Buffer/tests/BufferFXT.test.mq4 | 2 +- .../Dict/Buffer/tests/BufferFXT.test.mq5 | 6 +- .../Dict/Buffer/tests/BufferStruct.test.mq4 | 2 +- .../Dict/Buffer/tests/BufferStruct.test.mq5 | 16 +-- .../Dict/Buffer}/tests/BufferTick.test.mq4 | 0 .../Dict/Buffer}/tests/BufferTick.test.mq5 | 2 +- Dict.enum.h => Storage/Dict/Dict.enum.h | 0 Dict.mqh => Storage/Dict/Dict.h | 18 +-- DictBase.mqh => Storage/Dict/DictBase.h | 10 +- .../Dict/DictIteratorBase.h | 4 +- DictObject.mqh => Storage/Dict/DictObject.h | 8 +- DictSlot.mqh => Storage/Dict/DictSlot.h | 6 +- DictSlotsRef.h => Storage/Dict/DictSlotsRef.h | 8 +- DictStruct.mqh => Storage/Dict/DictStruct.h | 10 +- .../Dict/tests/Dict.test.mq4 | 2 +- .../Dict/tests/Dict.test.mq5 | 16 +-- Flags.h => Storage/Flags.h | 0 Storage/ItemsHistory.h | 2 +- Storage/MemoryFileSystem.h | 4 +- Object.enum.h => Storage/Object.enum.h | 0 Object.extern.h => Storage/Object.extern.h | 0 Object.mqh => Storage/Object.h | 12 +- Storage/Objects.h | 2 +- Storage/ObjectsCache.h | 2 +- Redis.mqh => Storage/Redis.h | 12 +- Redis.struct.h => Storage/Redis.struct.h | 2 +- String.extern.h => Storage/String.extern.h | 6 +- String.mqh => Storage/String.h | 4 +- Storage/ValueStorage.h | 2 +- .../tests/Collection.test.mq4 | 2 +- .../tests/Collection.test.mq5 | 6 +- .../tests/Database.test.mq4 | 2 +- .../tests/Database.test.mq5 | 10 +- .../tests/DateTime.test.mq4 | 2 +- .../tests/DateTime.test.mq5 | 4 +- ...ItemsHistory.mq4 => ItemsHistory.test.mq4} | 2 +- ...ItemsHistory.mq5 => ItemsHistory.test.mq5} | 0 Storage/tests/Object.test.mq4 | 28 +++++ Storage/tests/Object.test.mq5 | 45 ++++++++ .../tests/Redis.test.mq4 | 2 +- .../tests/Redis.test.mq5 | 6 +- .../tests/ValueStorage.test.mq4 | 2 +- .../tests/ValueStorage.test.mq5 | 12 +- Strategy.mqh | 8 +- SymbolInfo.mqh | 6 +- Task/Task.h | 2 +- Task/TaskAction.h | 2 +- Task/TaskAction.struct.h | 2 +- Task/TaskCondition.h | 2 +- Task/TaskCondition.struct.h | 2 +- Task/TaskGetter.h | 2 +- Task/TaskGetter.struct.h | 2 +- Task/TaskManager.h | 2 +- Task/TaskSetter.struct.h | 2 +- Task/Taskable.h | 2 +- Task/tests/Task.test.cpp | 2 +- Task/tests/TaskAction.test.cpp | 2 +- Task/tests/TaskActionBase.test.cpp | 2 +- Task/tests/TaskCondition.test.cpp | 2 +- Task/tests/TaskConditionBase.test.cpp | 2 +- Task/tests/TaskGetter.test.cpp | 2 +- Task/tests/TaskGetterBase.test.cpp | 2 +- Task/tests/TaskManager.test.cpp | 2 +- Task/tests/TaskManager.test.mq5 | 2 +- Task/tests/TaskObject.test.cpp | 2 +- Task/tests/TaskSetter.test.cpp | 2 +- Task/tests/Taskable.car.test.mq5 | 2 +- Task/tests/Taskable.test.cpp | 2 +- Terminal.extern.h | 2 +- Terminal.mqh | 6 +- Tick/Tick.struct.h | 2 +- Tick/TickManager.h | 2 +- Timer.mqh | 2 +- Trade.mqh | 4 +- Trade.struct.h | 2 +- Trade/TradeSignalManager.h | 2 +- Trade/tests/TradeSignal.test.cpp | 12 +- ...adeSignalTest.mq4 => TradeSignal.test.mq4} | 2 +- ...adeSignalTest.mq5 => TradeSignal.test.mq5} | 0 Trade/tests/TradeSignalManager.test.cpp | 12 +- ...erTest.mq4 => TradeSignalManager.test.mq4} | 2 +- ...erTest.mq5 => TradeSignalManager.test.mq5} | 0 tests/CompileIndicatorsTest.mq5 | 10 +- tests/CompileTest.mq5 | 36 +++--- tests/ConfigTest.mq5 | 6 +- tests/DrawIndicatorTest.mq4 | 27 ----- tests/IndicatorsTest.mq5 | 12 +- tests/LogTest.mq5 | 2 +- tests/RefsTest.mq5 | 4 +- 234 files changed, 1085 insertions(+), 618 deletions(-) create mode 100644 .github/workflows/test-indicators-bitwise.yml create mode 100644 .github/workflows/test-indicators-ohlc.yml create mode 100644 .github/workflows/test-indicators-price.yml create mode 100644 .github/workflows/test-storage-dict-buffer.yml rename .github/workflows/{test-buffer.yml => test-storage-dict.yml} (79%) create mode 100644 .github/workflows/test-storage.yml rename tests/3DTest.mq5 => 3D/tests/3D.test.mq5 (83%) rename {tests/3D => 3D/tests}/Shaders/pixel.hlsl (100%) rename {tests/3D => 3D/tests}/Shaders/vertex.hlsl (100%) rename Indicators/Bitwise/{indicators.h => includes.h} (100%) rename Indicators/{ => Bitwise}/tests/Indi_Pattern.test.mq4 (100%) rename Indicators/{ => Bitwise}/tests/Indi_Pattern.test.mq5 (92%) rename DrawIndicator.mqh => Indicators/DrawIndicator.mqh (97%) rename Indicators/OHLC/{indicators.h => includes.h} (100%) rename Indicators/{ => OHLC}/tests/Indi_OHLC.test.mq4 (100%) rename Indicators/{ => OHLC}/tests/Indi_OHLC.test.mq5 (92%) rename Indicators/Price/{indicators.h => includes.h} (100%) rename Indicators/{ => Price}/tests/Indi_Price.test.mq4 (100%) rename Indicators/{ => Price}/tests/Indi_Price.test.mq5 (92%) rename Indicators/Special/{indicators.h => includes.h} (100%) rename Indicators/{indicators.h => includes.h} (100%) create mode 100644 Indicators/tests/DrawIndicator.test.mq4 rename tests/DrawIndicatorTest.mq5 => Indicators/tests/DrawIndicator.test.mq5 (94%) rename Array.extern.h => Storage/Array.extern.h (98%) rename Array.mqh => Storage/Array.h (99%) rename Collection.mqh => Storage/Collection.h (98%) rename Data.define.h => Storage/Data.define.h (100%) rename Data.enum.h => Storage/Data.enum.h (100%) rename Data.struct.h => Storage/Data.struct.h (98%) rename Data.struct.serialize.h => Storage/Data.struct.serialize.h (98%) rename Database.mqh => Storage/Database.h (70%) create mode 100644 Storage/Database.struct.h rename DateTime.entry.h => Storage/DateTime.entry.h (99%) rename DateTime.enum.h => Storage/DateTime.enum.h (100%) rename DateTime.extern.h => Storage/DateTime.extern.h (99%) rename DateTime.mqh => Storage/DateTime.h (99%) rename DateTime.static.h => Storage/DateTime.static.h (99%) rename DateTime.struct.h => Storage/DateTime.struct.h (98%) rename Buffer.mqh => Storage/Dict/Buffer/Buffer.h (96%) rename {Buffer => Storage/Dict/Buffer}/BufferCandle.h (91%) rename BufferFXT.mqh => Storage/Dict/Buffer/BufferFXT.h (98%) rename BufferStruct.mqh => Storage/Dict/Buffer/BufferStruct.h (95%) rename {Buffer => Storage/Dict/Buffer}/BufferTick.h (97%) rename tests/BufferTest.mq4 => Storage/Dict/Buffer/tests/Buffer.test.mq4 (97%) rename tests/BufferTest.mq5 => Storage/Dict/Buffer/tests/Buffer.test.mq5 (97%) rename {Buffer => Storage/Dict/Buffer}/tests/BufferCandle.test.mq4 (100%) rename {Buffer => Storage/Dict/Buffer}/tests/BufferCandle.test.mq5 (98%) create mode 100644 Storage/Dict/Buffer/tests/BufferCompileAll.test.mq4 create mode 100644 Storage/Dict/Buffer/tests/BufferCompileAll.test.mq5 rename tests/BufferFXTTest.mq4 => Storage/Dict/Buffer/tests/BufferFXT.test.mq4 (97%) rename tests/BufferFXTTest.mq5 => Storage/Dict/Buffer/tests/BufferFXT.test.mq5 (94%) rename tests/BufferStructTest.mq4 => Storage/Dict/Buffer/tests/BufferStruct.test.mq4 (97%) rename tests/BufferStructTest.mq5 => Storage/Dict/Buffer/tests/BufferStruct.test.mq5 (89%) rename {Buffer => Storage/Dict/Buffer}/tests/BufferTick.test.mq4 (100%) rename {Buffer => Storage/Dict/Buffer}/tests/BufferTick.test.mq5 (98%) rename Dict.enum.h => Storage/Dict/Dict.enum.h (100%) rename Dict.mqh => Storage/Dict/Dict.h (98%) rename DictBase.mqh => Storage/Dict/DictBase.h (98%) rename DictIteratorBase.mqh => Storage/Dict/DictIteratorBase.h (98%) rename DictObject.mqh => Storage/Dict/DictObject.h (99%) rename DictSlot.mqh => Storage/Dict/DictSlot.h (96%) rename DictSlotsRef.h => Storage/Dict/DictSlotsRef.h (95%) rename DictStruct.mqh => Storage/Dict/DictStruct.h (98%) rename tests/DictTest.mq4 => Storage/Dict/tests/Dict.test.mq4 (97%) rename tests/DictTest.mq5 => Storage/Dict/tests/Dict.test.mq5 (97%) rename Flags.h => Storage/Flags.h (100%) rename Object.enum.h => Storage/Object.enum.h (100%) rename Object.extern.h => Storage/Object.extern.h (100%) rename Object.mqh => Storage/Object.h (96%) rename Redis.mqh => Storage/Redis.h (97%) rename Redis.struct.h => Storage/Redis.struct.h (98%) rename String.extern.h => Storage/String.extern.h (98%) rename String.mqh => Storage/String.h (98%) rename tests/CollectionTest.mq4 => Storage/tests/Collection.test.mq4 (97%) rename tests/CollectionTest.mq5 => Storage/tests/Collection.test.mq5 (96%) rename tests/DatabaseTest.mq4 => Storage/tests/Database.test.mq4 (97%) rename tests/DatabaseTest.mq5 => Storage/tests/Database.test.mq5 (94%) rename tests/DateTimeTest.mq4 => Storage/tests/DateTime.test.mq4 (97%) rename tests/DateTimeTest.mq5 => Storage/tests/DateTime.test.mq5 (98%) rename Storage/tests/{ItemsHistory.mq4 => ItemsHistory.test.mq4} (97%) rename Storage/tests/{ItemsHistory.mq5 => ItemsHistory.test.mq5} (100%) create mode 100644 Storage/tests/Object.test.mq4 create mode 100644 Storage/tests/Object.test.mq5 rename tests/RedisTest.mq4 => Storage/tests/Redis.test.mq4 (97%) rename tests/RedisTest.mq5 => Storage/tests/Redis.test.mq5 (96%) rename tests/ValueStorageTest.mq4 => Storage/tests/ValueStorage.test.mq4 (97%) rename tests/ValueStorageTest.mq5 => Storage/tests/ValueStorage.test.mq5 (95%) rename Trade/tests/{TradeSignalTest.mq4 => TradeSignal.test.mq4} (97%) rename Trade/tests/{TradeSignalTest.mq5 => TradeSignal.test.mq5} (100%) rename Trade/tests/{TradeSignalManagerTest.mq4 => TradeSignalManager.test.mq4} (96%) rename Trade/tests/{TradeSignalManagerTest.mq5 => TradeSignalManager.test.mq5} (100%) delete mode 100644 tests/DrawIndicatorTest.mq4 diff --git a/.github/workflows/test-account.yml b/.github/workflows/test-account.yml index a9e3e351e..2e3ae233d 100644 --- a/.github/workflows/test-account.yml +++ b/.github/workflows/test-account.yml @@ -5,11 +5,11 @@ name: Test Account on: pull_request: paths: - - 'Account/**.h' + - 'Account/**' - '.github/workflows/test-account.yml' push: paths: - - 'Account/**.h' + - 'Account/**' - '.github/workflows/test-account.yml' jobs: @@ -38,7 +38,7 @@ jobs: name: files-ex5 path: '**/*.ex5' - Account-Tests-MQL4: + Tests-MQL4: defaults: run: shell: bash diff --git a/.github/workflows/test-exchange.yml b/.github/workflows/test-exchange.yml index b4c0ed3c9..b411d32bc 100644 --- a/.github/workflows/test-exchange.yml +++ b/.github/workflows/test-exchange.yml @@ -5,13 +5,11 @@ name: Test Exchange on: pull_request: paths: - - 'Exchange/**.h' - - 'Exchange/**.mq?' + - 'Exchange/**' - '.github/workflows/test-exchange.yml' push: paths: - - 'Exchange/**.h' - - 'Exchange/**.mq?' + - 'Exchange/**' - '.github/workflows/test-exchange.yml' jobs: @@ -40,7 +38,7 @@ jobs: name: files-ex5 path: '**/*.ex5' - Exchange-Tests-MQL4: + Tests-MQL4: defaults: run: shell: bash diff --git a/.github/workflows/test-indicator.yml b/.github/workflows/test-indicator.yml index bae326ed4..21f28dbed 100644 --- a/.github/workflows/test-indicator.yml +++ b/.github/workflows/test-indicator.yml @@ -40,7 +40,7 @@ jobs: name: files-ex5 path: '**/*.ex5' - Indicator-Tests-MQL4: + Tests-MQL4: defaults: run: shell: bash diff --git a/.github/workflows/test-indicators-bitwise.yml b/.github/workflows/test-indicators-bitwise.yml new file mode 100644 index 000000000..9de6f6730 --- /dev/null +++ b/.github/workflows/test-indicators-bitwise.yml @@ -0,0 +1,68 @@ +--- +name: Test Indicators (Bitwise) + +# yamllint disable-line rule:truthy +on: + pull_request: + paths: + - 'Indicator**' + - 'Indicators/Bitwise/**' + - '.github/workflows/test-indicators-bitwise.yml' + push: + paths: + - 'Indicator**' + - 'Indicators/Bitwise/**' + - '.github/workflows/test-indicators-bitwise.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: 'Indicators/Bitwise/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' + + Tests-MQL4: + defaults: + run: + shell: bash + working-directory: Indicators/Bitwise/tests + needs: Compile + runs-on: ubuntu-latest + strategy: + matrix: + test: + # - Indi_Candle.test # @todo + - Indi_Pattern.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 diff --git a/.github/workflows/test-indicators-ohlc.yml b/.github/workflows/test-indicators-ohlc.yml new file mode 100644 index 000000000..b4e0954d6 --- /dev/null +++ b/.github/workflows/test-indicators-ohlc.yml @@ -0,0 +1,67 @@ +--- +name: Test Indicators (OHLC) + +# yamllint disable-line rule:truthy +on: + pull_request: + paths: + - 'Indicator**' + - 'Indicators/OHLC/**' + - '.github/workflows/test-indicators-special.yml' + push: + paths: + - 'Indicator**' + - 'Indicators/OHLC/**' + - '.github/workflows/test-indicators-special.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: 'Indicators/OHLC/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' + + Tests-MQL4: + defaults: + run: + shell: bash + working-directory: Indicators/OHLC/tests + needs: Compile + runs-on: ubuntu-latest + strategy: + matrix: + test: + - Indi_OHLC.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 diff --git a/.github/workflows/test-indicators-price.yml b/.github/workflows/test-indicators-price.yml new file mode 100644 index 000000000..5a5c95386 --- /dev/null +++ b/.github/workflows/test-indicators-price.yml @@ -0,0 +1,67 @@ +--- +name: Test Indicators (Price) + +# yamllint disable-line rule:truthy +on: + pull_request: + paths: + - 'Indicator**' + - 'Indicators/Price/**' + - '.github/workflows/test-indicators-price.yml' + push: + paths: + - 'Indicator**' + - 'Indicators/Price/**' + - '.github/workflows/test-indicators-price.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: 'Indicators/Price/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' + + Tests-MQL4: + defaults: + run: + shell: bash + working-directory: Indicators/Price/tests + needs: Compile + runs-on: ubuntu-latest + strategy: + matrix: + test: + - Indi_Price.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 diff --git a/.github/workflows/test-indicators-special.yml b/.github/workflows/test-indicators-special.yml index 6852e8e36..9e3236582 100644 --- a/.github/workflows/test-indicators-special.yml +++ b/.github/workflows/test-indicators-special.yml @@ -40,11 +40,11 @@ jobs: name: files-ex5 path: '**/*.ex5' - Indicators-Tests-MQL4: + Tests-MQL4: defaults: run: shell: bash - working-directory: Indicators/tests + working-directory: Indicators/Special/tests needs: Compile runs-on: ubuntu-latest strategy: diff --git a/.github/workflows/test-indicators-tick.yml b/.github/workflows/test-indicators-tick.yml index 18104fd37..2b242db2b 100644 --- a/.github/workflows/test-indicators-tick.yml +++ b/.github/workflows/test-indicators-tick.yml @@ -40,7 +40,7 @@ jobs: name: files-ex5 path: '**/*.ex5' - Indicators-Tests-MQL4: + Tests-MQL4: defaults: run: shell: bash diff --git a/.github/workflows/test-indicators.yml b/.github/workflows/test-indicators.yml index 5388e7bdc..994731844 100644 --- a/.github/workflows/test-indicators.yml +++ b/.github/workflows/test-indicators.yml @@ -40,7 +40,7 @@ jobs: name: files-ex5 path: '**/*.ex5' - Indicators-Tests-MQL4: + Tests-MQL4: defaults: run: shell: bash @@ -50,6 +50,7 @@ jobs: strategy: matrix: test: + - DrawIndicator.test - Indi_AC.test - Indi_AD.test - Indi_ADX.test @@ -90,11 +91,8 @@ jobs: - Indi_MassIndex.test - Indi_Momentum.test - Indi_OBV.test - - Indi_OHLC.test - Indi_OsMA.test - - Indi_Pattern.test - Indi_Pivot.test - - Indi_Price.test - Indi_PriceChannel.test - Indi_PriceFeeder.test - Indi_PriceVolumeTrend.test diff --git a/.github/workflows/test-serializer.yml b/.github/workflows/test-serializer.yml index e4617d002..b01836f88 100644 --- a/.github/workflows/test-serializer.yml +++ b/.github/workflows/test-serializer.yml @@ -38,7 +38,7 @@ jobs: name: files-ex5 path: '**/*.ex5' - Serializer-Tests-MQL4: + Tests-MQL4: defaults: run: shell: bash diff --git a/.github/workflows/test-storage-dict-buffer.yml b/.github/workflows/test-storage-dict-buffer.yml new file mode 100644 index 000000000..7658d4c3e --- /dev/null +++ b/.github/workflows/test-storage-dict-buffer.yml @@ -0,0 +1,66 @@ +--- +name: Test Storage/Dict/Buffer + +# yamllint disable-line rule:truthy +on: + pull_request: + paths: + - 'Storage/Dict/Buffer/**' + - '.github/workflows/test-storage-dict-buffer.yml' + push: + paths: + - 'Storage/Dict/Buffer/**' + - '.github/workflows/test-storage-dict-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: 'Storage/Dict/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' + + Tests-MQL4: + defaults: + run: + shell: bash + working-directory: Storage/Dict/Buffer/tests + needs: Compile + runs-on: ubuntu-latest + strategy: + matrix: + test: + - Buffer.test + - BufferCandle.test + - BufferCompileAll.test + - BufferFXT.test + - BufferStruct.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 }} + RunOnError: show_logs 200 + timeout-minutes: 10 diff --git a/.github/workflows/test-buffer.yml b/.github/workflows/test-storage-dict.yml similarity index 79% rename from .github/workflows/test-buffer.yml rename to .github/workflows/test-storage-dict.yml index 5b75d1928..0a17daa03 100644 --- a/.github/workflows/test-buffer.yml +++ b/.github/workflows/test-storage-dict.yml @@ -1,16 +1,16 @@ --- -name: Test Buffer +name: Test Storage/Dict # yamllint disable-line rule:truthy on: pull_request: paths: - - 'Buffer/**' - - '.github/workflows/test-buffer.yml' + - 'Storage/Dict/**' + - '.github/workflows/test-storage-dict.yml' push: paths: - - 'Buffer/**' - - '.github/workflows/test-buffer.yml' + - 'Storage/Dict/**' + - '.github/workflows/test-storage-dict.yml' jobs: @@ -22,7 +22,7 @@ jobs: uses: fx31337/mql-compile-action@master with: init-platform: true - path: 'Buffer/tests' + path: 'Storage/Dict/tests' verbose: true - name: Print compiled files run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' @@ -38,18 +38,17 @@ jobs: name: files-ex5 path: '**/*.ex5' - Buffer-Tests-MQL4: + Tests-MQL4: defaults: run: shell: bash - working-directory: Buffer/tests + working-directory: Storage/Dict/tests needs: Compile runs-on: ubuntu-latest strategy: matrix: test: - - BufferCandle.test - - BufferTick.test + - Dict.test steps: - uses: actions/download-artifact@v2 with: diff --git a/.github/workflows/test-storage.yml b/.github/workflows/test-storage.yml new file mode 100644 index 000000000..822cc3f13 --- /dev/null +++ b/.github/workflows/test-storage.yml @@ -0,0 +1,67 @@ +--- +name: Test Storage + +# yamllint disable-line rule:truthy +on: + pull_request: + paths: + - 'Storage/**' + - '.github/workflows/test-storage.yml' + push: + paths: + - 'Storage/**' + - '.github/workflows/test-storage.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: 'Storage/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' + + Tests-MQL4: + defaults: + run: + shell: bash + working-directory: Storage/tests + needs: Compile + runs-on: ubuntu-latest + strategy: + matrix: + test: + - Collection.test + - Database.test + - DateTime.test + - ItemsHistory.test + - Object.test + - Redis.test + - ValueStorage.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 }} + RunOnError: show_logs 200 + timeout-minutes: 10 diff --git a/.github/workflows/test-task.yml b/.github/workflows/test-task.yml index 940571b56..8fc77ea62 100644 --- a/.github/workflows/test-task.yml +++ b/.github/workflows/test-task.yml @@ -38,7 +38,7 @@ jobs: name: files-ex5 path: '**/*.ex5' - Task-Tests-MQL4: + Tests-MQL4: defaults: run: shell: bash diff --git a/.github/workflows/test-tick.yml b/.github/workflows/test-tick.yml index e948d7e4b..55bf74be2 100644 --- a/.github/workflows/test-tick.yml +++ b/.github/workflows/test-tick.yml @@ -37,7 +37,7 @@ jobs: name: files-ex5 path: '**/*.ex5' - Tick-Tests-MQL4: + Tests-MQL4: defaults: run: shell: bash diff --git a/.github/workflows/test-trade.yml b/.github/workflows/test-trade.yml index 760fd9b6c..4810fd702 100644 --- a/.github/workflows/test-trade.yml +++ b/.github/workflows/test-trade.yml @@ -5,13 +5,11 @@ name: Test Trade on: pull_request: paths: - - 'Trade/**.h' - - 'Trade/**.mq?' + - 'Trade/**' - '.github/workflows/test-trade.yml' push: paths: - - 'Trade/**.h' - - 'Trade/**.mq?' + - 'Trade/**' - '.github/workflows/test-trade.yml' jobs: @@ -40,7 +38,7 @@ jobs: name: files-ex5 path: '**/*.ex5' - Trade-Tests-MQL4: + Tests-MQL4: defaults: run: shell: bash @@ -50,8 +48,8 @@ jobs: strategy: matrix: test: - - TradeSignalTest - - TradeSignalManagerTest + - TradeSignal.test + - TradeSignalManager.test steps: - uses: actions/download-artifact@v2 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e1c8d083f..27d9e8261 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -53,12 +53,8 @@ jobs: strategy: matrix: test: - - BufferStructTest - - BufferTest - ChartTest - CompileIndicatorsTest - - DatabaseTest - - DrawIndicatorTest - EATest - IndicatorsTest - MailTest @@ -90,43 +86,6 @@ jobs: if: always() timeout-minutes: 10 - Scripts-MQL4: - defaults: - run: - shell: bash - working-directory: tests - needs: Compile - runs-on: ubuntu-latest - strategy: - matrix: - test: - # - 3DTest - - CollectionTest - - ConfigTest - - ConvertTest - - DateTimeTest - - DictTest - - LogTest - - MD5Test - - MathTest - - OrderQuery - - ProfilerTest - - RefsTest - - TerminalTest - - TimerTest - - ValueStorageTest - max-parallel: 4 - steps: - - uses: actions/download-artifact@v2 - with: - name: files-ex4 - - name: Run ${{ matrix.test }} - uses: fx31337/mql-tester-action@master - with: - Script: ${{ matrix.test }} - if: always() - timeout-minutes: 10 - Scripts-MQL4-Ignore: defaults: run: @@ -137,8 +96,6 @@ jobs: strategy: matrix: test: - # @fixme: GH-266 - - RedisTest # @fixme: GH-266 - WebTest steps: @@ -153,7 +110,7 @@ jobs: if: always() timeout-minutes: 10 - Trade-Tests-MQL4: + Tests-MQL4: defaults: run: shell: bash @@ -163,7 +120,17 @@ jobs: strategy: matrix: test: - - TradeSignalTest + # - 3DTest + - ConfigTest + - ConvertTest + - LogTest + - MD5Test + - MathTest + - OrderQuery + - ProfilerTest + - RefsTest + - TerminalTest + - TimerTest steps: - uses: actions/download-artifact@v2 with: diff --git a/3D/Mesh.h b/3D/Mesh.h index d77c6ede8..f7e6fc523 100644 --- a/3D/Mesh.h +++ b/3D/Mesh.h @@ -25,7 +25,7 @@ * Generic graphics mesh. */ -#include "../Dict.mqh" +#include "../Storage/Dict/Dict.h" #include "../Refs.mqh" #include "../Util.h" #include "Face.h" diff --git a/tests/3DTest.mq5 b/3D/tests/3D.test.mq5 similarity index 83% rename from tests/3DTest.mq5 rename to 3D/tests/3D.test.mq5 index 9ac4d2872..89b7f588a 100644 --- a/tests/3DTest.mq5 +++ b/3D/tests/3D.test.mq5 @@ -29,22 +29,22 @@ //#define __debug__ // Resources. -#resource "3D/Shaders/vertex.hlsl" as string ShaderSourceVS; -#resource "3D/Shaders/pixel.hlsl" as string ShaderSourcePS; +#resource "Shaders/vertex.hlsl" as string ShaderSourceVS; +#resource "Shaders/pixel.hlsl" as string ShaderSourcePS; // Includes. -#include "../3D/Chart3D.h" -#include "../3D/Cube.h" -#include "../3D/Devices/MTDX/MTDXDevice.h" -#include "../3D/Devices/MTDX/MTDXIndexBuffer.h" -#include "../3D/Devices/MTDX/MTDXShader.h" -#include "../3D/Devices/MTDX/MTDXVertexBuffer.h" -#include "../3D/Frontends/MT5Frontend.h" -#include "../BufferStruct.mqh" -#include "../Chart.mqh" -#include "../Platform.h" -#include "../Serializer/Serializer.h" -#include "../Test.mqh" +#include "../Chart3D.h" +#include "../Cube.h" +#include "../Devices/MTDX/MTDXDevice.h" +#include "../Devices/MTDX/MTDXIndexBuffer.h" +#include "../Devices/MTDX/MTDXShader.h" +#include "../Devices/MTDX/MTDXVertexBuffer.h" +#include "../Frontends/MT5Frontend.h" +#include "../../Storage/Dict/Buffer/BufferStruct.h" +#include "../../Chart.mqh" +#include "../../Platform.h" +#include "../../Serializer/Serializer.h" +#include "../../Test.mqh" /** * Implements OnInit(). diff --git a/tests/3D/Shaders/pixel.hlsl b/3D/tests/Shaders/pixel.hlsl similarity index 100% rename from tests/3D/Shaders/pixel.hlsl rename to 3D/tests/Shaders/pixel.hlsl diff --git a/tests/3D/Shaders/vertex.hlsl b/3D/tests/Shaders/vertex.hlsl similarity index 100% rename from tests/3D/Shaders/vertex.hlsl rename to 3D/tests/Shaders/vertex.hlsl diff --git a/Account/Account.extern.h b/Account/Account.extern.h index e3378c4c4..293db4e3d 100644 --- a/Account/Account.extern.h +++ b/Account/Account.extern.h @@ -21,7 +21,7 @@ */ // Includes. -#include "../String.extern.h" +#include "../Storage/String.extern.h" #include "Account.enum.h" // Define external global functions. diff --git a/Account/Account.h b/Account/Account.h index bb435596c..ecba76817 100644 --- a/Account/Account.h +++ b/Account/Account.h @@ -25,7 +25,7 @@ #define ACCOUNT_H // Includes. -#include "../BufferStruct.mqh" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Serializer/Serializer.h" #include "AccountBase.h" diff --git a/Account/AccountForex.struct.h b/Account/AccountForex.struct.h index c40a4e79d..13d32c786 100644 --- a/Account/AccountForex.struct.h +++ b/Account/AccountForex.struct.h @@ -28,7 +28,7 @@ #ifndef __MQL__ // Allows the preprocessor to include a header file when it is needed. #pragma once -#include "Serializer.enum.h" +#include "../Serializer/Serializer.enum.h" #endif // Forward class declaration. diff --git a/Account/AccountMt.h b/Account/AccountMt.h index fc9d2fee1..5df1305ba 100644 --- a/Account/AccountMt.h +++ b/Account/AccountMt.h @@ -28,10 +28,10 @@ class AccountMt; // Includes. -#include "../Array.mqh" -#include "../BufferStruct.mqh" +#include "../Storage/Array.h" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Convert.mqh" -#include "../Data.struct.h" +#include "../Storage/Data.struct.h" #include "../Indicator/Indicator.struct.h" #include "../Order.struct.h" #include "../Orders.mqh" diff --git a/Chart.struct.h b/Chart.struct.h index e0c04a219..662b01e6f 100644 --- a/Chart.struct.h +++ b/Chart.struct.h @@ -35,7 +35,7 @@ class Class; struct ChartTf; // Includes. -#include "Array.mqh" +#include "Storage/Array.h" #include "Bar.struct.h" #include "Chart.define.h" #include "Chart.enum.h" diff --git a/ChartBase.h b/ChartBase.h index 99010949a..091015fe3 100644 --- a/ChartBase.h +++ b/ChartBase.h @@ -38,7 +38,7 @@ #include "Chart.struct.h" #include "Chart.symboltf.h" #include "Data.define.h" -#include "Dict.mqh" +#include "Storage/Dict/Dict.h" #include "Log.mqh" #include "Refs.mqh" #include "Task/TaskCondition.enum.h" diff --git a/Common.extern.h b/Common.extern.h index 43bc7f98f..f35cc0421 100644 --- a/Common.extern.h +++ b/Common.extern.h @@ -27,7 +27,7 @@ #include #include "Chart.enum.h" -#include "DateTime.enum.h" +#include "Storage/DateTime.enum.h" #include "Terminal.define.h" void DebugBreak() { diff --git a/Config.mqh b/Config.mqh index 840e27495..ffacec2a9 100644 --- a/Config.mqh +++ b/Config.mqh @@ -30,9 +30,9 @@ #define CONFIG_MQH // Includes. -#include "DictStruct.mqh" +#include "Storage/Dict/DictStruct.h" #include "File.mqh" -#include "Object.mqh" +#include "Storage/Object.h" #include "Serializer/Serializer.h" enum CONFIG_FORMAT { CONFIG_FORMAT_JSON, CONFIG_FORMAT_JSON_NO_WHITESPACES, CONFIG_FORMAT_INI }; diff --git a/Convert.basic.h b/Convert.basic.h index f4bd8f6df..04d83a26e 100644 --- a/Convert.basic.h +++ b/Convert.basic.h @@ -26,11 +26,11 @@ #endif // Includes. -#include "Array.mqh" +#include "Storage/Array.h" #include "Common.extern.h" -#include "DateTime.mqh" +#include "Storage/DateTime.h" #include "Std.h" -#include "String.mqh" +#include "Storage/String.h" /** * Class to provide conversion methods. diff --git a/Convert.mqh b/Convert.mqh index dbc15b87c..139cbb45f 100644 --- a/Convert.mqh +++ b/Convert.mqh @@ -28,10 +28,10 @@ // Includes. #include "Account/Account.enum.h" #include "Account/Account.extern.h" -#include "Array.mqh" +#include "Storage/Array.h" #include "Convert.extern.h" -#include "DateTime.extern.h" -#include "DateTime.mqh" +#include "Storage/DateTime.extern.h" +#include "Storage/DateTime.h" #include "Math.extern.h" #include "Order.enum.h" #include "SymbolInfo.enum.h" diff --git a/Draw.mqh b/Draw.mqh index c6c200af3..d925a51ac 100644 --- a/Draw.mqh +++ b/Draw.mqh @@ -30,9 +30,9 @@ class Chart; class Draw; // Includes. -#include "Data.define.h" -#include "Object.extern.h" -#include "Object.mqh" +#include "Storage/Data.define.h" +#include "Storage/Object.extern.h" +#include "Storage/Object.h" #include "Platform.extern.h" #include "Terminal.define.h" #include "Terminal.enum.h" diff --git a/EA.mqh b/EA.mqh index dbf04c0ff..6a05fd6b5 100644 --- a/EA.mqh +++ b/EA.mqh @@ -31,9 +31,9 @@ // Includes. #include "Chart.mqh" -#include "Data.struct.h" -#include "Dict.mqh" -#include "DictObject.mqh" +#include "Storage/Data.struct.h" +#include "Storage/Dict/Dict.h" +#include "Storage/Dict/DictObject.h" #include "EA.enum.h" #include "EA.struct.h" #include "Market.mqh" diff --git a/EA.struct.h b/EA.struct.h index 5bed4845d..bcad6fd3e 100644 --- a/EA.struct.h +++ b/EA.struct.h @@ -31,7 +31,7 @@ #endif // Includes. -#include "DateTime.mqh" +#include "Storage/DateTime.h" #include "Task/Task.struct.h" /* Defines EA config parameters. */ diff --git a/Exchange/Exchange.h b/Exchange/Exchange.h index 1610d8b6d..e20dc7a00 100644 --- a/Exchange/Exchange.h +++ b/Exchange/Exchange.h @@ -28,7 +28,7 @@ // Includes. #include "../Account/Account.h" -#include "../DictObject.mqh" +#include "../Storage/Dict/DictObject.h" #include "../SymbolInfo.mqh" #include "../Trade.mqh" #include "Exchange.struct.h" diff --git a/File.extern.h b/File.extern.h index ca4e965b5..2510fd9ec 100644 --- a/File.extern.h +++ b/File.extern.h @@ -23,7 +23,7 @@ // Includes. #include "File.define.h" #include "Storage/MemoryFileSystem.h" -#include "String.extern.h" +#include "Storage/String.extern.h" #include "Terminal.define.h" // Define external global functions. diff --git a/Indicator/Indicator.h b/Indicator/Indicator.h index 1083523a8..5b2fd50f9 100644 --- a/Indicator/Indicator.h +++ b/Indicator/Indicator.h @@ -28,13 +28,13 @@ struct IndicatorParams; // Includes. -#include "../Array.mqh" -#include "../BufferStruct.mqh" -#include "../DateTime.mqh" -#include "../DrawIndicator.mqh" -#include "../Flags.h" +#include "../Storage/Array.h" +#include "../Storage/Dict/Buffer/BufferStruct.h" +#include "../Storage/DateTime.h" +#include "../Indicators/DrawIndicator.mqh" +#include "../Storage/Flags.h" #include "../Math.h" -#include "../Object.mqh" +#include "../Storage/Object.h" #include "../Refs.mqh" #include "../Serializer/Serializer.h" #include "../Serializer/SerializerCsv.h" diff --git a/Indicator/Indicator.struct.h b/Indicator/Indicator.struct.h index d3fe759a3..59e498e1e 100644 --- a/Indicator/Indicator.struct.h +++ b/Indicator/Indicator.struct.h @@ -36,10 +36,10 @@ class Indicator; struct ChartParams; // Includes. -#include "../Array.mqh" +#include "../Storage/Array.h" #include "../Chart.struct.tf.h" -#include "../Data.struct.h" -#include "../DateTime.struct.h" +#include "../Storage/Data.struct.h" +#include "../Storage/DateTime.struct.h" #include "../Serializer/SerializerNode.enum.h" #include "Indicator.enum.h" #include "IndicatorData.struct.cache.h" diff --git a/Indicator/IndicatorBase.h b/Indicator/IndicatorBase.h index fdbdb6b17..f206e727c 100644 --- a/Indicator/IndicatorBase.h +++ b/Indicator/IndicatorBase.h @@ -31,12 +31,12 @@ #endif // Includes. -#include "../Array.mqh" -#include "../BufferStruct.mqh" +#include "../Storage/Array.h" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Chart.struct.tf.h" -#include "../DateTime.mqh" +#include "../Storage/DateTime.h" #include "../Log.mqh" -#include "../Object.mqh" +#include "../Storage/Object.h" #include "../Platform.extern.h" #include "../Refs.mqh" #include "../Serializer/Serializer.h" diff --git a/Indicator/IndicatorData.h b/Indicator/IndicatorData.h index 7d1941353..522343b43 100644 --- a/Indicator/IndicatorData.h +++ b/Indicator/IndicatorData.h @@ -41,7 +41,7 @@ struct ExternInstantiateIndicatorBufferValueStorageDouble { // Includes. #include "../Bar.struct.h" #include "../Chart.struct.tf.h" -#include "../Flags.h" +#include "../Storage/Flags.h" #include "../Storage/IValueStorage.h" #include "../Storage/ItemsHistory.h" #include "../SymbolInfo.struct.h" diff --git a/Indicator/IndicatorTick.h b/Indicator/IndicatorTick.h index 29c298696..c13a9ca09 100644 --- a/Indicator/IndicatorTick.h +++ b/Indicator/IndicatorTick.h @@ -30,7 +30,7 @@ #endif // Includes. -#include "../Buffer/BufferTick.h" +#include "../Storage/Dict/Buffer/BufferTick.h" #include "Indicator.h" #include "Indicator.struct.h" #include "IndicatorTick.provider.h" diff --git a/Indicator/tests/IndicatorTf.test.mq5 b/Indicator/tests/IndicatorTf.test.mq5 index f4db42ced..4bef5c8cd 100644 --- a/Indicator/tests/IndicatorTf.test.mq5 +++ b/Indicator/tests/IndicatorTf.test.mq5 @@ -27,7 +27,7 @@ */ // Includes. -#include "../../DictBase.mqh" +#include "../../Storage/Dict/DictBase.h" #include "../../Indicators/Indi_AMA.mqh" #include "../../Indicators/Tick/Indi_TickMt.mqh" #include "../../Log.mqh" diff --git a/Indicators/Bitwise/Indi_Candle.mqh b/Indicators/Bitwise/Indi_Candle.mqh index 949ab5d3c..34a91e90b 100644 --- a/Indicators/Bitwise/Indi_Candle.mqh +++ b/Indicators/Bitwise/Indi_Candle.mqh @@ -22,7 +22,7 @@ // Includes. #include "../../Bar.struct.h" -#include "../../BufferStruct.mqh" +#include "../../Storage/Dict/Buffer/BufferStruct.h" #include "../../Indicator/Indicator.h" #include "../../Pattern.struct.h" #include "../../Serializer/Serializer.h" diff --git a/Indicators/Bitwise/Indi_Pattern.mqh b/Indicators/Bitwise/Indi_Pattern.mqh index a1c4740e0..eab50c69e 100644 --- a/Indicators/Bitwise/Indi_Pattern.mqh +++ b/Indicators/Bitwise/Indi_Pattern.mqh @@ -22,7 +22,7 @@ // Includes. #include "../../Bar.struct.h" -#include "../../BufferStruct.mqh" +#include "../../Storage/Dict/Buffer/BufferStruct.h" #include "../../Indicator/Indicator.define.h" #include "../../Indicator/Indicator.h" #include "../../Pattern.struct.h" diff --git a/Indicators/Bitwise/indicators.h b/Indicators/Bitwise/includes.h similarity index 100% rename from Indicators/Bitwise/indicators.h rename to Indicators/Bitwise/includes.h diff --git a/Indicators/tests/Indi_Pattern.test.mq4 b/Indicators/Bitwise/tests/Indi_Pattern.test.mq4 similarity index 100% rename from Indicators/tests/Indi_Pattern.test.mq4 rename to Indicators/Bitwise/tests/Indi_Pattern.test.mq4 diff --git a/Indicators/tests/Indi_Pattern.test.mq5 b/Indicators/Bitwise/tests/Indi_Pattern.test.mq5 similarity index 92% rename from Indicators/tests/Indi_Pattern.test.mq5 rename to Indicators/Bitwise/tests/Indi_Pattern.test.mq5 index 524ac53d0..fd266e7d2 100644 --- a/Indicators/tests/Indi_Pattern.test.mq5 +++ b/Indicators/Bitwise/tests/Indi_Pattern.test.mq5 @@ -20,9 +20,9 @@ */ // Includes. -#include "../../Platform.h" -#include "../../Test.mqh" -#include "../Bitwise/Indi_Pattern.mqh" +#include "../../../Platform.h" +#include "../../../Test.mqh" +#include "../Indi_Pattern.mqh" /** * @file diff --git a/DrawIndicator.mqh b/Indicators/DrawIndicator.mqh similarity index 97% rename from DrawIndicator.mqh rename to Indicators/DrawIndicator.mqh index 02fbc3ec0..7360835ca 100644 --- a/DrawIndicator.mqh +++ b/Indicators/DrawIndicator.mqh @@ -30,9 +30,9 @@ #define DRAW_INDICATOR_MQH // Includes. -#include "DictObject.mqh" -#include "Draw.mqh" -#include "Object.mqh" +#include "../Storage/Dict/DictObject.h" +#include "../Draw.mqh" +#include "../Storage/Object.h" // Forward declaration. class IndicatorBase; diff --git a/Indicators/Indi_AC.mqh b/Indicators/Indi_AC.mqh index ce3b3fb78..4621eb410 100644 --- a/Indicators/Indi_AC.mqh +++ b/Indicators/Indi_AC.mqh @@ -26,7 +26,7 @@ #endif // Includes. -#include "../BufferStruct.mqh" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" // Structs. diff --git a/Indicators/Indi_ADXW.mqh b/Indicators/Indi_ADXW.mqh index 2263d11cc..8fcdd6813 100644 --- a/Indicators/Indi_ADXW.mqh +++ b/Indicators/Indi_ADXW.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../BufferStruct.mqh" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.applied_price.h" #include "../Storage/ValueStorage.h" diff --git a/Indicators/Indi_AMA.mqh b/Indicators/Indi_AMA.mqh index 76daa7318..f8d065015 100644 --- a/Indicators/Indi_AMA.mqh +++ b/Indicators/Indi_AMA.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../BufferStruct.mqh" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.h" #include "Price/Indi_Price.mqh" diff --git a/Indicators/Indi_ASI.mqh b/Indicators/Indi_ASI.mqh index a7c8a3fd8..e0ec2cc6a 100644 --- a/Indicators/Indi_ASI.mqh +++ b/Indicators/Indi_ASI.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../BufferStruct.mqh" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.all.h" diff --git a/Indicators/Indi_AppliedPrice.mqh b/Indicators/Indi_AppliedPrice.mqh index 0132b481f..331f0e014 100644 --- a/Indicators/Indi_AppliedPrice.mqh +++ b/Indicators/Indi_AppliedPrice.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../BufferStruct.mqh" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" #include "OHLC/Indi_OHLC.mqh" diff --git a/Indicators/Indi_BWZT.mqh b/Indicators/Indi_BWZT.mqh index 1edb82064..e30dceeeb 100644 --- a/Indicators/Indi_BWZT.mqh +++ b/Indicators/Indi_BWZT.mqh @@ -25,7 +25,7 @@ #define INDI_BWZT_DATA_LIMIT 100 // Includes. -#include "../BufferStruct.mqh" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/IndicatorTf.h" #include "../Storage/ValueStorage.all.h" #include "Indi_AC.mqh" diff --git a/Indicators/Indi_CHO.mqh b/Indicators/Indi_CHO.mqh index e3431717f..a8274b4fb 100644 --- a/Indicators/Indi_CHO.mqh +++ b/Indicators/Indi_CHO.mqh @@ -25,7 +25,7 @@ #define INDI_CHO_MIN_BARS 2 // Includes. -#include "../BufferStruct.mqh" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.all.h" #include "../Util.h" diff --git a/Indicators/Indi_CHV.mqh b/Indicators/Indi_CHV.mqh index 71f7c52ed..7e6b04e2a 100644 --- a/Indicators/Indi_CHV.mqh +++ b/Indicators/Indi_CHV.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../BufferStruct.mqh" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.all.h" #include "../Util.h" diff --git a/Indicators/Indi_ColorBars.mqh b/Indicators/Indi_ColorBars.mqh index 5035340e7..8fd78494c 100644 --- a/Indicators/Indi_ColorBars.mqh +++ b/Indicators/Indi_ColorBars.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../BufferStruct.mqh" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.all.h" diff --git a/Indicators/Indi_ColorCandlesDaily.mqh b/Indicators/Indi_ColorCandlesDaily.mqh index ceca89e37..fc0592d1e 100644 --- a/Indicators/Indi_ColorCandlesDaily.mqh +++ b/Indicators/Indi_ColorCandlesDaily.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../BufferStruct.mqh" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.all.h" diff --git a/Indicators/Indi_ColorLine.mqh b/Indicators/Indi_ColorLine.mqh index b33bb3acb..e5a9f5a2d 100644 --- a/Indicators/Indi_ColorLine.mqh +++ b/Indicators/Indi_ColorLine.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../BufferStruct.mqh" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.all.h" #include "Indi_MA.mqh" diff --git a/Indicators/Indi_CustomMovingAverage.mqh b/Indicators/Indi_CustomMovingAverage.mqh index 3dd961f02..925065b54 100644 --- a/Indicators/Indi_CustomMovingAverage.mqh +++ b/Indicators/Indi_CustomMovingAverage.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../BufferStruct.mqh" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" // Structs. diff --git a/Indicators/Indi_DEMA.mqh b/Indicators/Indi_DEMA.mqh index 982129c39..dc6561b63 100644 --- a/Indicators/Indi_DEMA.mqh +++ b/Indicators/Indi_DEMA.mqh @@ -32,13 +32,13 @@ #endif // Includes. -#include "../Dict.mqh" -#include "../DictObject.mqh" +#include "../Storage/Dict/Dict.h" +#include "../Storage/Dict/DictObject.h" #include "../Indicator/Indicator.h" #include "../Refs.mqh" #include "../Storage/Objects.h" #include "../Storage/ValueStorage.h" -#include "../String.mqh" +#include "../Storage/String.h" #include "Indi_MA.mqh" #include "Price/Indi_Price.mqh" diff --git a/Indicators/Indi_Demo.mqh b/Indicators/Indi_Demo.mqh index ca34c5186..5b552d92e 100644 --- a/Indicators/Indi_Demo.mqh +++ b/Indicators/Indi_Demo.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../BufferStruct.mqh" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" #include "Price/Indi_Price.mqh" diff --git a/Indicators/Indi_DetrendedPrice.mqh b/Indicators/Indi_DetrendedPrice.mqh index bcfe68aa9..9a52af26b 100644 --- a/Indicators/Indi_DetrendedPrice.mqh +++ b/Indicators/Indi_DetrendedPrice.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../BufferStruct.mqh" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" #include "Indi_MA.mqh" diff --git a/Indicators/Indi_Drawer.mqh b/Indicators/Indi_Drawer.mqh index 830284920..1158ab13a 100644 --- a/Indicators/Indi_Drawer.mqh +++ b/Indicators/Indi_Drawer.mqh @@ -21,9 +21,9 @@ */ // Includes. -#include "../DictStruct.mqh" +#include "../Storage/Dict/DictStruct.h" #include "../Indicator/Indicator.h" -#include "../Redis.mqh" +#include "../Storage/Redis.h" #include "../Task/TaskAction.h" #include "Indi_Drawer.struct.h" #include "Price/Indi_Price.mqh" diff --git a/Indicators/Indi_FractalAdaptiveMA.mqh b/Indicators/Indi_FractalAdaptiveMA.mqh index 5ddbed457..3dc8fd346 100644 --- a/Indicators/Indi_FractalAdaptiveMA.mqh +++ b/Indicators/Indi_FractalAdaptiveMA.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../BufferStruct.mqh" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.all.h" diff --git a/Indicators/Indi_MA.mqh b/Indicators/Indi_MA.mqh index 2fe09b214..caffb3707 100644 --- a/Indicators/Indi_MA.mqh +++ b/Indicators/Indi_MA.mqh @@ -25,13 +25,13 @@ #define INDI_MA_MQH // Includes. -#include "../Dict.mqh" -#include "../DictObject.mqh" +#include "../Storage/Dict/Dict.h" +#include "../Storage/Dict/DictObject.h" #include "../Indicator/Indicator.h" #include "../Refs.mqh" #include "../Storage/Singleton.h" #include "../Storage/ValueStorage.h" -#include "../String.mqh" +#include "../Storage/String.h" #ifndef __MQL4__ // Defines global functions (for MQL4 backward compability). diff --git a/Indicators/Indi_MassIndex.mqh b/Indicators/Indi_MassIndex.mqh index fd3e40031..1cc46f082 100644 --- a/Indicators/Indi_MassIndex.mqh +++ b/Indicators/Indi_MassIndex.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../BufferStruct.mqh" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.all.h" #include "Indi_MA.mqh" diff --git a/Indicators/Indi_PriceChannel.mqh b/Indicators/Indi_PriceChannel.mqh index 1873a01c0..690aad74b 100644 --- a/Indicators/Indi_PriceChannel.mqh +++ b/Indicators/Indi_PriceChannel.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../BufferStruct.mqh" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" #include "Indi_ZigZag.mqh" diff --git a/Indicators/Indi_PriceFeeder.mqh b/Indicators/Indi_PriceFeeder.mqh index 78cc64f16..0d94e3542 100644 --- a/Indicators/Indi_PriceFeeder.mqh +++ b/Indicators/Indi_PriceFeeder.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../BufferStruct.mqh" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" // Structs. diff --git a/Indicators/Indi_PriceVolumeTrend.mqh b/Indicators/Indi_PriceVolumeTrend.mqh index 4e79ad17f..681e14243 100644 --- a/Indicators/Indi_PriceVolumeTrend.mqh +++ b/Indicators/Indi_PriceVolumeTrend.mqh @@ -25,7 +25,7 @@ #define INDI_PVT_MIN_BARS 2 // Includes. -#include "../BufferStruct.mqh" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.all.h" diff --git a/Indicators/Indi_RS.mqh b/Indicators/Indi_RS.mqh index 975e336ac..0e07e6281 100644 --- a/Indicators/Indi_RS.mqh +++ b/Indicators/Indi_RS.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../BufferStruct.mqh" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" #include "OHLC/Indi_OHLC.mqh" #include "Special/Indi_Math.mqh" diff --git a/Indicators/Indi_RSI.mqh b/Indicators/Indi_RSI.mqh index 2b2825a90..be4b3fbab 100644 --- a/Indicators/Indi_RSI.mqh +++ b/Indicators/Indi_RSI.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../DictStruct.mqh" +#include "../Storage/Dict/DictStruct.h" #include "../Indicator/Indicator.h" #include "Price/Indi_Price.mqh" diff --git a/Indicators/Indi_RateOfChange.mqh b/Indicators/Indi_RateOfChange.mqh index f1f36c8ea..3d9695360 100644 --- a/Indicators/Indi_RateOfChange.mqh +++ b/Indicators/Indi_RateOfChange.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../BufferStruct.mqh" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" // Structs. diff --git a/Indicators/Indi_TEMA.mqh b/Indicators/Indi_TEMA.mqh index cd380ea24..3e7fc47f4 100644 --- a/Indicators/Indi_TEMA.mqh +++ b/Indicators/Indi_TEMA.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../BufferStruct.mqh" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" #include "Indi_MA.mqh" diff --git a/Indicators/Indi_TRIX.mqh b/Indicators/Indi_TRIX.mqh index 64c55f57e..1ac05d914 100644 --- a/Indicators/Indi_TRIX.mqh +++ b/Indicators/Indi_TRIX.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../BufferStruct.mqh" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" #include "Indi_MA.mqh" diff --git a/Indicators/Indi_UltimateOscillator.mqh b/Indicators/Indi_UltimateOscillator.mqh index e81ba1455..14b5ba9a8 100644 --- a/Indicators/Indi_UltimateOscillator.mqh +++ b/Indicators/Indi_UltimateOscillator.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../BufferStruct.mqh" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.all.h" #include "Indi_ATR.mqh" diff --git a/Indicators/Indi_VIDYA.mqh b/Indicators/Indi_VIDYA.mqh index 8e13b4c27..ace22e581 100644 --- a/Indicators/Indi_VIDYA.mqh +++ b/Indicators/Indi_VIDYA.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../BufferStruct.mqh" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" // Structs. diff --git a/Indicators/Indi_VROC.mqh b/Indicators/Indi_VROC.mqh index 107acf62e..db0b27575 100644 --- a/Indicators/Indi_VROC.mqh +++ b/Indicators/Indi_VROC.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../BufferStruct.mqh" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.all.h" diff --git a/Indicators/Indi_Volumes.mqh b/Indicators/Indi_Volumes.mqh index fbc34f163..3ff5212f0 100644 --- a/Indicators/Indi_Volumes.mqh +++ b/Indicators/Indi_Volumes.mqh @@ -25,7 +25,7 @@ #define INDI_VOLUMES_MIN_BARS 2 // Includes. -#include "../BufferStruct.mqh" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.all.h" diff --git a/Indicators/Indi_WilliamsAD.mqh b/Indicators/Indi_WilliamsAD.mqh index c95a8c9e7..27c8c9469 100644 --- a/Indicators/Indi_WilliamsAD.mqh +++ b/Indicators/Indi_WilliamsAD.mqh @@ -25,7 +25,7 @@ #define INDI_WAD_MIN_BARS 100 // Includes. -#include "../BufferStruct.mqh" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.all.h" diff --git a/Indicators/Indi_ZigZagColor.mqh b/Indicators/Indi_ZigZagColor.mqh index 187bf02f3..6593e8f81 100644 --- a/Indicators/Indi_ZigZagColor.mqh +++ b/Indicators/Indi_ZigZagColor.mqh @@ -25,7 +25,7 @@ #define INDI_ZIGZAG_COLOR_MIN_BARS 100 // Includes. -#include "../BufferStruct.mqh" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.all.h" #include "Indi_ZigZag.mqh" diff --git a/Indicators/OHLC/Indi_OHLC.mqh b/Indicators/OHLC/Indi_OHLC.mqh index 08ac367f2..080da645d 100644 --- a/Indicators/OHLC/Indi_OHLC.mqh +++ b/Indicators/OHLC/Indi_OHLC.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../../BufferStruct.mqh" +#include "../../Storage/Dict/Buffer/BufferStruct.h" #include "../../Indicator/Indicator.h" #include "../../Storage/Objects.h" diff --git a/Indicators/OHLC/indicators.h b/Indicators/OHLC/includes.h similarity index 100% rename from Indicators/OHLC/indicators.h rename to Indicators/OHLC/includes.h diff --git a/Indicators/tests/Indi_OHLC.test.mq4 b/Indicators/OHLC/tests/Indi_OHLC.test.mq4 similarity index 100% rename from Indicators/tests/Indi_OHLC.test.mq4 rename to Indicators/OHLC/tests/Indi_OHLC.test.mq4 diff --git a/Indicators/tests/Indi_OHLC.test.mq5 b/Indicators/OHLC/tests/Indi_OHLC.test.mq5 similarity index 92% rename from Indicators/tests/Indi_OHLC.test.mq5 rename to Indicators/OHLC/tests/Indi_OHLC.test.mq5 index 7b76c554f..043969e8c 100644 --- a/Indicators/tests/Indi_OHLC.test.mq5 +++ b/Indicators/OHLC/tests/Indi_OHLC.test.mq5 @@ -20,9 +20,9 @@ */ // Includes. -#include "../../Platform.h" -#include "../../Test.mqh" -#include "../OHLC/Indi_OHLC.mqh" +#include "../../../Platform.h" +#include "../../../Test.mqh" +#include "../Indi_OHLC.mqh" /** * @file diff --git a/Indicators/Price/Indi_Price.mqh b/Indicators/Price/Indi_Price.mqh index 91dd3811a..6000d5e3b 100644 --- a/Indicators/Price/Indi_Price.mqh +++ b/Indicators/Price/Indi_Price.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../../BufferStruct.mqh" +#include "../../Storage/Dict/Buffer/BufferStruct.h" #include "../../Indicator/Indicator.h" #include "../../Platform.h" #include "../../Storage/Objects.h" diff --git a/Indicators/Price/indicators.h b/Indicators/Price/includes.h similarity index 100% rename from Indicators/Price/indicators.h rename to Indicators/Price/includes.h diff --git a/Indicators/tests/Indi_Price.test.mq4 b/Indicators/Price/tests/Indi_Price.test.mq4 similarity index 100% rename from Indicators/tests/Indi_Price.test.mq4 rename to Indicators/Price/tests/Indi_Price.test.mq4 diff --git a/Indicators/tests/Indi_Price.test.mq5 b/Indicators/Price/tests/Indi_Price.test.mq5 similarity index 92% rename from Indicators/tests/Indi_Price.test.mq5 rename to Indicators/Price/tests/Indi_Price.test.mq5 index 3ab275649..df2042fff 100644 --- a/Indicators/tests/Indi_Price.test.mq5 +++ b/Indicators/Price/tests/Indi_Price.test.mq5 @@ -20,9 +20,9 @@ */ // Includes. -#include "../../Platform.h" -#include "../../Test.mqh" -#include "../Price/Indi_Price.mqh" +#include "../../../Platform.h" +#include "../../../Test.mqh" +#include "../Indi_Price.mqh" /** * @file diff --git a/Indicators/Special/Indi_Math.mqh b/Indicators/Special/Indi_Math.mqh index 0c8ed1d63..ef1af3837 100644 --- a/Indicators/Special/Indi_Math.mqh +++ b/Indicators/Special/Indi_Math.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../../BufferStruct.mqh" +#include "../../Storage/Dict/Buffer/BufferStruct.h" #include "../../Indicator/Indicator.h" #include "../../Math.enum.h" diff --git a/Indicators/Special/indicators.h b/Indicators/Special/includes.h similarity index 100% rename from Indicators/Special/indicators.h rename to Indicators/Special/includes.h diff --git a/Indicators/indicators.h b/Indicators/includes.h similarity index 100% rename from Indicators/indicators.h rename to Indicators/includes.h diff --git a/Indicators/tests/DrawIndicator.test.mq4 b/Indicators/tests/DrawIndicator.test.mq4 new file mode 100644 index 000000000..f2d267e93 --- /dev/null +++ b/Indicators/tests/DrawIndicator.test.mq4 @@ -0,0 +1,27 @@ +//+------------------------------------------------------------------+ +//| 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 . + */ + +/** + * @file + * Test functionality of DrawIndicator indicator class. + */ + +#include "DrawIndicator.test.mq5" diff --git a/tests/DrawIndicatorTest.mq5 b/Indicators/tests/DrawIndicator.test.mq5 similarity index 94% rename from tests/DrawIndicatorTest.mq5 rename to Indicators/tests/DrawIndicator.test.mq5 index 5081ff6f4..07c9e2b6a 100644 --- a/tests/DrawIndicatorTest.mq5 +++ b/Indicators/tests/DrawIndicator.test.mq5 @@ -28,15 +28,15 @@ //#define __debug_verbose__ // Includes. -#include "../DictStruct.mqh" +#include "../../Storage/Dict/DictStruct.h" #include "../DrawIndicator.mqh" -#include "../Indicator/Indicator.struct.serialize.h" -#include "../Indicators/Indi_Bands.mqh" -#include "../Indicators/Indi_Demo.mqh" -#include "../Indicators/Indi_MA.mqh" -#include "../Indicators/Indi_RSI.mqh" -#include "../Indicators/Price/Indi_Price.mqh" -#include "../Test.mqh" +#include "../../Indicator/Indicator.struct.serialize.h" +#include "../Indi_Bands.mqh" +#include "../Indi_Demo.mqh" +#include "../Indi_MA.mqh" +#include "../Indi_RSI.mqh" +#include "../Price/Indi_Price.mqh" +#include "../../Test.mqh" // Global variables. Ref candles; diff --git a/Instances.h b/Instances.h index 9f1812fa5..780f07bd3 100644 --- a/Instances.h +++ b/Instances.h @@ -34,7 +34,7 @@ #ifndef INSTANCES_H #define INSTANCES_H -#include "Dict.mqh" +#include "Storage/Dict/Dict.h" #include "Util.h" template diff --git a/Log.mqh b/Log.mqh index b83ca09e0..f4abc30f6 100644 --- a/Log.mqh +++ b/Log.mqh @@ -29,12 +29,12 @@ template class DictStruct; // Includes. -#include "Array.mqh" -#include "Collection.mqh" -#include "DateTime.mqh" -#include "DictStruct.mqh" +#include "Storage/Array.h" +#include "Storage/Collection.h" +#include "Storage/DateTime.h" +#include "Storage/Dict/DictStruct.h" #include "File.mqh" -#include "Object.mqh" +#include "Storage/Object.h" // Define assert macros. // Alias for function and line macros combined together. diff --git a/MD5.mqh b/MD5.mqh index c34fce753..6014cd14c 100644 --- a/MD5.mqh +++ b/MD5.mqh @@ -43,7 +43,7 @@ */ // Includes. -#include "Array.mqh" +#include "Storage/Array.h" #include "Convert.basic.h" /** diff --git a/Market.struct.h b/Market.struct.h index f7233b5ec..2d3367264 100644 --- a/Market.struct.h +++ b/Market.struct.h @@ -29,8 +29,8 @@ class Serializer; // Includes. -#include "DateTime.entry.h" -#include "DateTime.struct.h" +#include "Storage/DateTime.entry.h" +#include "Storage/DateTime.struct.h" #include "Serializer/SerializerNode.enum.h" #include "Std.h" diff --git a/Math.h b/Math.h index 2460f7e61..fb942ae34 100644 --- a/Math.h +++ b/Math.h @@ -26,7 +26,7 @@ #endif // Includes. -#include "Data.struct.h" +#include "Storage/Data.struct.h" #include "Indicator/Indicator.struct.h" #include "Math.define.h" #include "Math.enum.h" diff --git a/Math.struct.h b/Math.struct.h index c49fdb3a0..4d8f957b7 100644 --- a/Math.struct.h +++ b/Math.struct.h @@ -29,7 +29,7 @@ #pragma once #endif -#include "Data.struct.h" +#include "Storage/Data.struct.h" // Prevents processing this includes file for the second time. #ifndef MATH_STRUCT_H diff --git a/Order.mqh b/Order.mqh index fed44822a..6180d6b6c 100644 --- a/Order.mqh +++ b/Order.mqh @@ -34,8 +34,8 @@ class SymbolInfo; // Includes. #include "Convert.mqh" -#include "Data.define.h" -#include "Data.struct.h" +#include "Storage/Data.define.h" +#include "Storage/Data.struct.h" #include "Deal.enum.h" #include "Log.mqh" #include "Order.define.h" @@ -46,7 +46,7 @@ class SymbolInfo; #include "Serializer/SerializerConverter.h" #include "Serializer/SerializerJson.h" #include "Std.h" -#include "String.mqh" +#include "Storage/String.h" #include "SymbolInfo.mqh" #include "Task/TaskAction.enum.h" diff --git a/Order.struct.h b/Order.struct.h index cab1a5739..331a626a2 100644 --- a/Order.struct.h +++ b/Order.struct.h @@ -31,7 +31,7 @@ #endif // Includes. -#include "Data.struct.h" +#include "Storage/Data.struct.h" #include "Order.enum.h" #include "Platform.extern.h" #include "Serializer/Serializer.h" diff --git a/OrderQuery.h b/OrderQuery.h index a3a9c9e4b..0ea17dc84 100644 --- a/OrderQuery.h +++ b/OrderQuery.h @@ -26,7 +26,7 @@ */ // Includes. -#include "DictStruct.mqh" +#include "Storage/Dict/DictStruct.h" #include "Order.mqh" #include "Refs.mqh" #include "Std.h" diff --git a/Platform.extern.h b/Platform.extern.h index 11edea715..9489f3418 100644 --- a/Platform.extern.h +++ b/Platform.extern.h @@ -26,9 +26,9 @@ // Includes. #include "Account/Account.enum.h" -#include "Data.define.h" +#include "Storage/Data.define.h" #include "Deal.enum.h" -#include "Object.extern.h" +#include "Storage/Object.extern.h" #include "Order.define.h" #include "Terminal.enum.h" diff --git a/Platform.h b/Platform.h index b5f5a3828..7cda86930 100644 --- a/Platform.h +++ b/Platform.h @@ -46,8 +46,8 @@ extern int Bars(CONST_REF_TO(string) _symbol, ENUM_TIMEFRAMES _tf); * Current platform's static methods. */ -#include "DrawIndicator.mqh" -#include "Flags.h" +#include "Indicators/DrawIndicator.mqh" +#include "Storage/Flags.h" #include "Indicator/IndicatorData.h" #include "Indicator/tests/classes/IndicatorTfDummy.h" #include "Std.h" diff --git a/PlatformTime.h b/PlatformTime.h index 5cad5dd3c..75c1d70e6 100644 --- a/PlatformTime.h +++ b/PlatformTime.h @@ -21,7 +21,8 @@ */ // Includes. -#include "DateTime.enum.h" +#include "Storage/DateTime.enum.h" +#include "Storage/DateTime.struct.h" /** * @file @@ -34,7 +35,6 @@ #include #include -#include "DateTime.struct.h" #endif #include "Std.h" diff --git a/Profiler.mqh b/Profiler.mqh index b04bb9913..4c329ed8a 100644 --- a/Profiler.mqh +++ b/Profiler.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "Collection.mqh" +#include "Storage/Collection.h" #include "Timer.mqh" // Defines macros. diff --git a/README.md b/README.md index e620a8e6b..d8aaa6f5a 100644 --- a/README.md +++ b/README.md @@ -73,16 +73,16 @@ Find below the table of conversion (replace code on left with the right one): | MQL4 (original) | MQL4 & MQL5 (replace with) | Required include file | |:---------------------|:---------------------------|:----------------------| | `WindowRedraw()` | `Chart::WindowRedraw()` | `Chart.mqh` | -| `Day()` | `DateTime::Day()` | `DateTime.mqh` | -| `TimeDayOfWeek()` | `DateTime::DayOfWeek()` | `DateTime.mqh` | -| `DayOfWeek()` | `DateTime::DayOfWeek()` | `DateTime.mqh` | -| `DayOfYear()` | `DateTime::DayOfYear()` | `DateTime.mqh` | -| `Hour()` | `DateTime::Hour()` | `DateTime.mqh` | -| `Month()` | `DateTime::Month()` | `DateTime.mqh` | -| `TimeDay()` | `DateTime::TimeDay()` | `DateTime.mqh` | -| `TimeDayOfYear()` | `DateTime::TimeDayOfYear()` | `DateTime.mqh` | -| `TimeToStr()` | `DateTime::TimeToStr()` | `DateTime.mqh` | -| `Year()` | `DateTime::Year()` | `DateTime.mqh` | +| `Day()` | `DateTime::Day()` | `Storage/DateTime.h` | +| `TimeDayOfWeek()` | `DateTime::DayOfWeek()` | `Storage/DateTime.h` | +| `DayOfWeek()` | `DateTime::DayOfWeek()` | `Storage/DateTime.h` | +| `DayOfYear()` | `DateTime::DayOfYear()` | `Storage/DateTime.h` | +| `Hour()` | `DateTime::Hour()` | `Storage/DateTime.h` | +| `Month()` | `DateTime::Month()` | `Storage/DateTime.h` | +| `TimeDay()` | `DateTime::TimeDay()` | `Storage/DateTime.h` | +| `TimeDayOfYear()` | `DateTime::TimeDayOfYear()` | `Storage/DateTime.h` | +| `TimeToStr()` | `DateTime::TimeToStr()` | `Storage/DateTime.h` | +| `Year()` | `DateTime::Year()` | `Storage/DateTime.h` | | `iAC()` | `Indi_AC::iAC()` | `Indicators/Indi_AC.mqh` | | `iAD()` | `Indi_AD::iAD()` | `Indicators/Indi_AD.mqh` | | `iADX()` | `Indi_ADX::iADX()` | `Indicators/Indi_ADX.mqh` | @@ -112,7 +112,7 @@ Find below the table of conversion (replace code on left with the right one): | `iStochastic()` | `Indi_Stochastic::iStochastic()` | `Indicators/Indi_Stochastic.mqh` | | `iWPR()` | `Indi_WPR::iWPR()` | `Indicators/Indi_WPR.mqh` | | `RefreshRates()` | `Market::RefreshRates()` | `Market.mqh` | -| `delete object` | `Object::Delete(object)` | `Object.mqh` | +| `delete object` | `Object::Delete(object)` | `Storage/Object.h` | | `GetOrderProfit()` | `Order::GetOrderProfit()` | `Order.mqh` | | `OrderClose()` | `OrderStatic::Close()` | `Order.struct.h` | | `OrderCloseTime()` | `OrderStatic::CloseTime()` | `Order.struct.h` | diff --git a/Refs.mqh b/Refs.mqh index 4a37f4cf6..15d23704d 100644 --- a/Refs.mqh +++ b/Refs.mqh @@ -21,8 +21,8 @@ */ // Prevents processing this includes file for the second time. -#ifndef REFS_MQH -#define REFS_MQH +#ifndef REFS_H +#define REFS_H // Includes. #include "Refs.rc.h" @@ -142,4 +142,4 @@ class Dynamic { } }; -#endif +#endif // REFS_H diff --git a/Refs.rc.h b/Refs.rc.h index baf2a9153..f7fdc85c9 100644 --- a/Refs.rc.h +++ b/Refs.rc.h @@ -31,7 +31,7 @@ #endif // Includes. -#include "String.mqh" +#include "Storage/String.h" // Forward declarations. class Dynamic; diff --git a/Report.mqh b/Report.mqh index eed5ea22e..6273e65ed 100644 --- a/Report.mqh +++ b/Report.mqh @@ -21,8 +21,8 @@ */ // Includes. -#include "DateTime.mqh" -#include "String.mqh" +#include "Storage/DateTime.h" +#include "Storage/String.h" /* * Class to provide report handling methods. diff --git a/Serializer/SerializerBinary.h b/Serializer/SerializerBinary.h index a009dcc2e..2c213eee1 100644 --- a/Serializer/SerializerBinary.h +++ b/Serializer/SerializerBinary.h @@ -25,8 +25,8 @@ #define SERIALIZER_BINARY_MQH // Includes. -#include "../DictBase.mqh" -#include "../Object.mqh" +#include "../Storage/Dict/DictBase.h" +#include "../Storage/Object.h" #include "Serializer.h" #include "SerializerNode.h" diff --git a/Serializer/SerializerConversions.h b/Serializer/SerializerConversions.h index 1a2cae9d8..027928321 100644 --- a/Serializer/SerializerConversions.h +++ b/Serializer/SerializerConversions.h @@ -31,8 +31,8 @@ #endif #include "../Convert.extern.h" -#include "../DateTime.extern.h" -#include "../Object.mqh" +#include "../Storage/DateTime.extern.h" +#include "../Storage/Object.h" #include "../Refs.struct.h" class SerializerConversions { diff --git a/Serializer/SerializerCsv.h b/Serializer/SerializerCsv.h index 3390865ba..9a8b76a93 100644 --- a/Serializer/SerializerCsv.h +++ b/Serializer/SerializerCsv.h @@ -25,12 +25,12 @@ #define SERIALIZER_CSV_MQH // Includes. -#include "../Dict.mqh" -#include "../DictObject.mqh" -#include "../DictStruct.mqh" +#include "../Storage/Dict/Dict.h" +#include "../Storage/Dict/DictObject.h" +#include "../Storage/Dict/DictStruct.h" #include "../Matrix.mqh" #include "../MiniMatrix.h" -#include "../Object.mqh" +#include "../Storage/Object.h" #include "SerializerConverter.h" #include "SerializerNode.h" diff --git a/Serializer/SerializerJson.h b/Serializer/SerializerJson.h index 491954708..ad79679b0 100644 --- a/Serializer/SerializerJson.h +++ b/Serializer/SerializerJson.h @@ -25,9 +25,9 @@ #define SERIALIZER_JSON_MQH // Includes. -#include "../DictBase.mqh" -#include "../Object.mqh" -#include "../String.extern.h" +#include "../Storage/Dict/DictBase.h" +#include "../Storage/Object.h" +#include "../Storage/String.extern.h" #include "Serializer.enum.h" #include "Serializer.h" #include "SerializerNode.h" diff --git a/Serializer/SerializerObject.h b/Serializer/SerializerObject.h index c8894ae98..cb758557a 100644 --- a/Serializer/SerializerObject.h +++ b/Serializer/SerializerObject.h @@ -25,8 +25,8 @@ #define SERIALIZER_OBJECT_MQH // Includes. -#include "../DictBase.mqh" -#include "../Object.mqh" +#include "../Storage/Dict/DictBase.h" +#include "../Storage/Object.h" #include "Serializer.h" #include "SerializerConverter.h" #include "SerializerNode.h" diff --git a/Serializer/SerializerSqlite.h b/Serializer/SerializerSqlite.h index ec2b18abc..a94dbde6a 100644 --- a/Serializer/SerializerSqlite.h +++ b/Serializer/SerializerSqlite.h @@ -25,7 +25,7 @@ #define SERIALIZER_SQL_MQH // Includes. -#include "../Database.mqh" +#include "../Storage/Database.h" #include "SerializerConverter.h" #include "SerializerCsv.h" diff --git a/Serializer/tests/Serializer.test.mq5 b/Serializer/tests/Serializer.test.mq5 index a1edb66c1..0697411a5 100644 --- a/Serializer/tests/Serializer.test.mq5 +++ b/Serializer/tests/Serializer.test.mq5 @@ -27,13 +27,13 @@ */ // Includes. -#include "../../BufferStruct.mqh" +#include "../../Storage/Dict/Buffer/BufferStruct.h" #include "../../Chart.mqh" #include "../../Config.mqh" -#include "../../Data.define.h" -#include "../../Data.struct.h" -#include "../../Data.struct.serialize.h" -#include "../../DictStruct.mqh" +#include "../../Storage/Data.define.h" +#include "../../Storage/Data.struct.h" +#include "../../Storage/Data.struct.serialize.h" +#include "../../Storage/Dict/DictStruct.h" #include "../../Test.mqh" #include "../Serializer.h" #include "../SerializerBinary.h" diff --git a/Std.h b/Std.h index ecaa13dc3..61d79cb0b 100644 --- a/Std.h +++ b/Std.h @@ -27,7 +27,7 @@ #endif // Includes. -#include "Data.enum.h" +#include "Storage/Data.enum.h" // Data types. #ifdef __cplusplus diff --git a/Array.extern.h b/Storage/Array.extern.h similarity index 98% rename from Array.extern.h rename to Storage/Array.extern.h index 675b26ca1..19eaf0406 100644 --- a/Array.extern.h +++ b/Storage/Array.extern.h @@ -24,8 +24,8 @@ #ifndef __MQL__ #pragma once -#include "Common.extern.h" -#include "Std.h" +#include "../Common.extern.h" +#include "../Std.h" #include "String.extern.h" template diff --git a/Array.mqh b/Storage/Array.h similarity index 99% rename from Array.mqh rename to Storage/Array.h index c0417d65a..cd2feeaf8 100644 --- a/Array.mqh +++ b/Storage/Array.h @@ -27,10 +27,10 @@ // Includes. #include "Array.extern.h" -#include "Common.extern.h" -#include "Convert.extern.h" -#include "Math.extern.h" -#include "Std.h" +#include "../Common.extern.h" +#include "../Convert.extern.h" +#include "../Math.extern.h" +#include "../Std.h" #include "String.extern.h" // Defines. diff --git a/Collection.mqh b/Storage/Collection.h similarity index 98% rename from Collection.mqh rename to Storage/Collection.h index 875d550c3..9866a0f1d 100644 --- a/Collection.mqh +++ b/Storage/Collection.h @@ -21,11 +21,11 @@ */ // Prevents processing this includes file for the second time. -#ifndef COLLECTION_MQH -#define COLLECTION_MQH +#ifndef COLLECTION_H +#define COLLECTION_H // Includes. -#include "Object.mqh" +#include "../Storage/Object.h" /** * Class to deal with collection of objects. @@ -209,4 +209,4 @@ class Collection { return _out; } }; -#endif // COLLECTION_MQH +#endif // COLLECTION_H diff --git a/Data.define.h b/Storage/Data.define.h similarity index 100% rename from Data.define.h rename to Storage/Data.define.h diff --git a/Data.enum.h b/Storage/Data.enum.h similarity index 100% rename from Data.enum.h rename to Storage/Data.enum.h diff --git a/Data.struct.h b/Storage/Data.struct.h similarity index 98% rename from Data.struct.h rename to Storage/Data.struct.h index a73a602c8..be5239e84 100644 --- a/Data.struct.h +++ b/Storage/Data.struct.h @@ -38,10 +38,10 @@ struct MqlRates; // Includes. #include "Data.enum.h" #include "DateTime.extern.h" -#include "Serializer/Serializer.enum.h" -#include "Serializer/SerializerNode.enum.h" -#include "Std.h" -#include "String.mqh" +#include "../Serializer/Serializer.enum.h" +#include "../Serializer/SerializerNode.enum.h" +#include "../Std.h" +#include "String.h" #ifndef __MQL__ /** diff --git a/Data.struct.serialize.h b/Storage/Data.struct.serialize.h similarity index 98% rename from Data.struct.serialize.h rename to Storage/Data.struct.serialize.h index d55ad12e1..f4b6f7a07 100644 --- a/Data.struct.serialize.h +++ b/Storage/Data.struct.serialize.h @@ -32,7 +32,7 @@ // Includes. #include "Data.struct.h" -#include "Serializer/Serializer.h" +#include "../Serializer/Serializer.h" /* Method to serialize DataParamEntry struct. */ SerializerNodeType DataParamEntry::Serialize(Serializer &s) { diff --git a/Database.mqh b/Storage/Database.h similarity index 70% rename from Database.mqh rename to Storage/Database.h index 80571651c..705faaeff 100644 --- a/Database.mqh +++ b/Storage/Database.h @@ -29,12 +29,13 @@ */ // Prevents processing this includes file for the second time. -#ifndef DATABASE_MQH -#define DATABASE_MQH +#ifndef DATABASE_H +#define DATABASE_H // Includes. -#include "DictStruct.mqh" -#include "MiniMatrix.h" +#include "../Storage/Dict/DictStruct.h" +#include "../MiniMatrix.h" +#include "Database.struct.h" // Enums. enum DATABASE_COLUMN_FLAGS { @@ -43,87 +44,6 @@ enum DATABASE_COLUMN_FLAGS { DATABASE_COLUMN_FLAG_IS_NULL = 2, }; -// Structs. -struct DatabaseTableColumnEntry { - string name; - ENUM_DATATYPE type; - unsigned short flags; - unsigned short char_size; - // Getter methods; - string GetDatatype() { - switch (type) { - case TYPE_BOOL: - return "BOOL"; - case TYPE_CHAR: - return StringFormat("CHAR(%d)", char_size); - case TYPE_DOUBLE: - return "REAL"; - case TYPE_INT: - return "INT"; - case TYPE_LONG: - return "LONG"; - case TYPE_STRING: - return "TEXT"; - } - return "UNKNOWN"; - } - string GetFlags() { return GetKey() + " " + GetNull(); } - string GetName() { return name; } - string GetNull() { return !IsNull() ? "NOT NULL" : ""; } - string GetKey() { return IsKey() ? "KEY" : ""; } - // State methods. - bool IsKey() { return bool(flags & DATABASE_COLUMN_FLAG_IS_KEY); } - bool IsNull() { return bool(flags & DATABASE_COLUMN_FLAG_IS_NULL); } - - DatabaseTableColumnEntry() {} - DatabaseTableColumnEntry(const string _name, const ENUM_DATATYPE _type, unsigned short _flags = 0, - unsigned short _char_size = 0) { - name = _name; - type = _type; - flags = _flags; - char_size = _char_size; - } - DatabaseTableColumnEntry(const DatabaseTableColumnEntry &r) { - name = r.name; - type = r.type; - flags = r.flags; - char_size = r.char_size; - } -}; -struct DatabaseTableSchema { - DictStruct columns; - // Constructor. - DatabaseTableSchema() {} - DatabaseTableSchema(DatabaseTableColumnEntry &_columns[]) { - for (int i = 0; i < ArraySize(_columns); i++) { - columns.Push(_columns[i]); - } - } - DatabaseTableSchema(const DatabaseTableSchema &r) { columns = r.columns; } - // Methods. - bool AddColumn(DatabaseTableColumnEntry &column) { return columns.Push(column); } -}; -// Struct table entry for SymbolInfo. -#ifdef SYMBOLINFO_MQH -struct DbSymbolInfoEntry : public SymbolInfoEntry { - DatabaseTableSchema schema; - // Constructors. - DbSymbolInfoEntry() { DefineSchema(); } - DbSymbolInfoEntry(const DbSymbolInfoEntry &r) { schema = r.schema; } - DbSymbolInfoEntry(const MqlTick &_tick, const string _symbol = NULL) : SymbolInfoEntry(_tick, _symbol) { - DefineSchema(); - } - // Methods. - void DefineSchema() { - schema.columns.Push(DatabaseTableColumnEntry("bid", TYPE_DOUBLE)); - schema.columns.Push(DatabaseTableColumnEntry("ask", TYPE_DOUBLE)); - schema.columns.Push(DatabaseTableColumnEntry("last", TYPE_DOUBLE)); - schema.columns.Push(DatabaseTableColumnEntry("spread", TYPE_DOUBLE)); - schema.columns.Push(DatabaseTableColumnEntry("volume", TYPE_INT)); - } -}; -#endif - class Database { private: int handle; @@ -284,7 +204,7 @@ bool ImportData(const string _name, MiniMatrix2d &data) { return _result; } -#ifdef BUFFER_STRUCT_MQH +#ifdef BUFFER_STRUCT_H /** * Imports BufferStruct records into a table. */ @@ -341,4 +261,4 @@ bool SchemaExists(string _name) { return tables.KeyExists(_name); } bool SetTableSchema(string _name, DatabaseTableSchema &_schema) { return tables.Set(_name, _schema); } } ; -#endif // DATABASE_MQH +#endif // DATABASE_H diff --git a/Storage/Database.struct.h b/Storage/Database.struct.h new file mode 100644 index 000000000..45e378c99 --- /dev/null +++ b/Storage/Database.struct.h @@ -0,0 +1,109 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + * + */ + +/* + * Defines structures related to Database class. + * + */ + +// Structs. +struct DatabaseTableColumnEntry { + string name; + ENUM_DATATYPE type; + unsigned short flags; + unsigned short char_size; + // Getter methods; + string GetDatatype() { + switch (type) { + case TYPE_BOOL: + return "BOOL"; + case TYPE_CHAR: + return StringFormat("CHAR(%d)", char_size); + case TYPE_DOUBLE: + return "REAL"; + case TYPE_INT: + return "INT"; + case TYPE_LONG: + return "LONG"; + case TYPE_STRING: + return "TEXT"; + } + return "UNKNOWN"; + } + string GetFlags() { return GetKey() + " " + GetNull(); } + string GetName() { return name; } + string GetNull() { return !IsNull() ? "NOT NULL" : ""; } + string GetKey() { return IsKey() ? "KEY" : ""; } + // State methods. + bool IsKey() { return bool(flags & DATABASE_COLUMN_FLAG_IS_KEY); } + bool IsNull() { return bool(flags & DATABASE_COLUMN_FLAG_IS_NULL); } + + DatabaseTableColumnEntry() {} + DatabaseTableColumnEntry(const string _name, const ENUM_DATATYPE _type, unsigned short _flags = 0, + unsigned short _char_size = 0) { + name = _name; + type = _type; + flags = _flags; + char_size = _char_size; + } + DatabaseTableColumnEntry(const DatabaseTableColumnEntry &r) { + name = r.name; + type = r.type; + flags = r.flags; + char_size = r.char_size; + } +}; + +struct DatabaseTableSchema { + DictStruct columns; + // Constructor. + DatabaseTableSchema() {} + DatabaseTableSchema(DatabaseTableColumnEntry &_columns[]) { + for (int i = 0; i < ArraySize(_columns); i++) { + columns.Push(_columns[i]); + } + } + DatabaseTableSchema(const DatabaseTableSchema &r) { columns = r.columns; } + // Methods. + bool AddColumn(DatabaseTableColumnEntry &column) { return columns.Push(column); } +}; + +// Struct table entry for SymbolInfo. +#ifdef SYMBOLINFO_H +struct DbSymbolInfoEntry : public SymbolInfoEntry { + DatabaseTableSchema schema; + // Constructors. + DbSymbolInfoEntry() { DefineSchema(); } + DbSymbolInfoEntry(const DbSymbolInfoEntry &r) { schema = r.schema; } + DbSymbolInfoEntry(const MqlTick &_tick, const string _symbol = NULL) : SymbolInfoEntry(_tick, _symbol) { + DefineSchema(); + } + // Methods. + void DefineSchema() { + schema.columns.Push(DatabaseTableColumnEntry("bid", TYPE_DOUBLE)); + schema.columns.Push(DatabaseTableColumnEntry("ask", TYPE_DOUBLE)); + schema.columns.Push(DatabaseTableColumnEntry("last", TYPE_DOUBLE)); + schema.columns.Push(DatabaseTableColumnEntry("spread", TYPE_DOUBLE)); + schema.columns.Push(DatabaseTableColumnEntry("volume", TYPE_INT)); + } +}; +#endif diff --git a/DateTime.entry.h b/Storage/DateTime.entry.h similarity index 99% rename from DateTime.entry.h rename to Storage/DateTime.entry.h index 539ec5a45..541958100 100644 --- a/DateTime.entry.h +++ b/Storage/DateTime.entry.h @@ -32,8 +32,8 @@ // Includes. #include "DateTime.static.h" -#include "PlatformTime.h" -#include "Std.h" +#include "../PlatformTime.h" +#include "../Std.h" struct DateTimeEntry : MqlDateTime { int week_of_year; diff --git a/DateTime.enum.h b/Storage/DateTime.enum.h similarity index 100% rename from DateTime.enum.h rename to Storage/DateTime.enum.h diff --git a/DateTime.extern.h b/Storage/DateTime.extern.h similarity index 99% rename from DateTime.extern.h rename to Storage/DateTime.extern.h index 2f3bd3526..217e36d3f 100644 --- a/DateTime.extern.h +++ b/Storage/DateTime.extern.h @@ -31,7 +31,7 @@ #include #include "DateTime.enum.h" -#include "String.mqh" +#include "String.h" // Forward declarations. struct MqlDateTime; diff --git a/DateTime.mqh b/Storage/DateTime.h similarity index 99% rename from DateTime.mqh rename to Storage/DateTime.h index ab7abd69a..c284d15ec 100644 --- a/DateTime.mqh +++ b/Storage/DateTime.h @@ -37,14 +37,14 @@ struct DataParamEntry; // Includes class enum and structs. -#include "Array.mqh" +#include "Array.h" #include "Data.struct.h" #include "DateTime.entry.h" #include "DateTime.enum.h" #include "DateTime.extern.h" #include "DateTime.static.h" #include "DateTime.struct.h" -#include "PlatformTime.h" +#include "../PlatformTime.h" #ifndef __MQL4__ // Defines global functions (for MQL4 backward compatibility). diff --git a/DateTime.static.h b/Storage/DateTime.static.h similarity index 99% rename from DateTime.static.h rename to Storage/DateTime.static.h index c2ca188d8..af2170586 100644 --- a/DateTime.static.h +++ b/Storage/DateTime.static.h @@ -31,7 +31,7 @@ #endif // Includes. -#include "PlatformTime.h" +#include "../PlatformTime.h" /* * Struct to provide static date and time methods. diff --git a/DateTime.struct.h b/Storage/DateTime.struct.h similarity index 98% rename from DateTime.struct.h rename to Storage/DateTime.struct.h index f33543193..788b8dc9f 100644 --- a/DateTime.struct.h +++ b/Storage/DateTime.struct.h @@ -32,7 +32,7 @@ // Includes. #include "DateTime.enum.h" -#include "Std.h" +#include "../Std.h" #ifndef __MQLBUILD__ /** diff --git a/Buffer.mqh b/Storage/Dict/Buffer/Buffer.h similarity index 96% rename from Buffer.mqh rename to Storage/Dict/Buffer/Buffer.h index 896e5ca6a..d534befc1 100644 --- a/Buffer.mqh +++ b/Storage/Dict/Buffer/Buffer.h @@ -21,11 +21,11 @@ */ // Prevents processing this includes file for the second time. -#ifndef BUFFER_MQH -#define BUFFER_MQH +#ifndef BUFFER_H +#define BUFFER_H // Includes. -#include "Dict.mqh" +#include "../Dict.h" /** * Class to store data values. @@ -108,4 +108,4 @@ class Buffer : public Dict { return (T)median; } }; -#endif // BUFFER_MQH +#endif // BUFFER_H diff --git a/Buffer/BufferCandle.h b/Storage/Dict/Buffer/BufferCandle.h similarity index 91% rename from Buffer/BufferCandle.h rename to Storage/Dict/Buffer/BufferCandle.h index 70462a28d..7522a8a3e 100644 --- a/Buffer/BufferCandle.h +++ b/Storage/Dict/Buffer/BufferCandle.h @@ -25,10 +25,10 @@ #define BUFFER_CANDLE_H // Includes. -#include "../BufferStruct.mqh" -#include "../Candle.struct.h" -#include "../Serializer/SerializerConverter.h" -#include "../Serializer/SerializerJson.h" +#include "BufferStruct.h" +#include "../../../Candle.struct.h" +#include "../../../Serializer/SerializerConverter.h" +#include "../../../Serializer/SerializerJson.h" /** * Class to store struct data. diff --git a/BufferFXT.mqh b/Storage/Dict/Buffer/BufferFXT.h similarity index 98% rename from BufferFXT.mqh rename to Storage/Dict/Buffer/BufferFXT.h index a60dc0c02..76b5ffc7c 100644 --- a/BufferFXT.mqh +++ b/Storage/Dict/Buffer/BufferFXT.h @@ -20,14 +20,14 @@ */ // Prevents processing this includes file for the second time. -#ifndef BUFFER_FXT_MQH -#define BUFFER_FXT_MQH +#ifndef BUFFER_FXT_H +#define BUFFER_FXT_H // Includes. -#include "Account/AccountMt.h" -#include "DictStruct.mqh" -#include "Indicator/IndicatorData.h" -#include "Object.mqh" +#include "../../../Account/AccountMt.h" +#include "../DictStruct.h" +#include "../../../Indicator/IndicatorData.h" +#include "../../../Storage/Object.h" // Defines. #define FXT_VERSION 405 @@ -303,4 +303,4 @@ class BufferFXT : public DictStruct { } }; -#endif // BUFFER_FXT_MQH +#endif // BUFFER_FXT_H diff --git a/BufferStruct.mqh b/Storage/Dict/Buffer/BufferStruct.h similarity index 95% rename from BufferStruct.mqh rename to Storage/Dict/Buffer/BufferStruct.h index a43c06074..23acd6dc0 100644 --- a/BufferStruct.mqh +++ b/Storage/Dict/Buffer/BufferStruct.h @@ -21,13 +21,13 @@ */ // Prevents processing this includes file for the second time. -#ifndef BUFFER_STRUCT_MQH -#define BUFFER_STRUCT_MQH +#ifndef BUFFER_STRUCT_H +#define BUFFER_STRUCT_H // Includes. -#include "DictBase.mqh" -#include "DictStruct.mqh" -#include "Serializer/Serializer.h" +#include "../DictBase.h" +#include "../DictStruct.h" +#include "../../../Serializer/Serializer.h" /** * Implements BufferStruct's Overflow Listener. @@ -117,4 +117,4 @@ class BufferStruct : public DictStruct { long GetMin() { return min; } }; -#endif // BUFFER_STRUCT_MQH +#endif // BUFFER_STRUCT_H diff --git a/Buffer/BufferTick.h b/Storage/Dict/Buffer/BufferTick.h similarity index 97% rename from Buffer/BufferTick.h rename to Storage/Dict/Buffer/BufferTick.h index f271905a1..9573cb44b 100644 --- a/Buffer/BufferTick.h +++ b/Storage/Dict/Buffer/BufferTick.h @@ -25,10 +25,10 @@ #define BUFFER_TICK_H // Includes. -#include "../BufferStruct.mqh" -#include "../Chart.enum.h" -#include "../Storage/IValueStorage.h" -#include "../Tick/Tick.struct.h" +#include "BufferStruct.h" +#include "../../../Chart.enum.h" +#include "../../IValueStorage.h" +#include "../../../Tick/Tick.struct.h" // Forward declarations. template diff --git a/tests/BufferTest.mq4 b/Storage/Dict/Buffer/tests/Buffer.test.mq4 similarity index 97% rename from tests/BufferTest.mq4 rename to Storage/Dict/Buffer/tests/Buffer.test.mq4 index 20e88818d..e9d93924a 100644 --- a/tests/BufferTest.mq4 +++ b/Storage/Dict/Buffer/tests/Buffer.test.mq4 @@ -25,4 +25,4 @@ */ // Includes. -#include "BufferTest.mq5" +#include "Buffer.test.mq5" diff --git a/tests/BufferTest.mq5 b/Storage/Dict/Buffer/tests/Buffer.test.mq5 similarity index 97% rename from tests/BufferTest.mq5 rename to Storage/Dict/Buffer/tests/Buffer.test.mq5 index 5a97cd837..80f66b727 100644 --- a/tests/BufferTest.mq5 +++ b/Storage/Dict/Buffer/tests/Buffer.test.mq5 @@ -25,8 +25,8 @@ */ // Includes -#include "../Buffer.mqh" -#include "../Test.mqh" +#include "../Buffer.h" +#include "../../../../Test.mqh" /** * Implements OnInit(). diff --git a/Buffer/tests/BufferCandle.test.mq4 b/Storage/Dict/Buffer/tests/BufferCandle.test.mq4 similarity index 100% rename from Buffer/tests/BufferCandle.test.mq4 rename to Storage/Dict/Buffer/tests/BufferCandle.test.mq4 diff --git a/Buffer/tests/BufferCandle.test.mq5 b/Storage/Dict/Buffer/tests/BufferCandle.test.mq5 similarity index 98% rename from Buffer/tests/BufferCandle.test.mq5 rename to Storage/Dict/Buffer/tests/BufferCandle.test.mq5 index ab76d8da8..c2c47031b 100644 --- a/Buffer/tests/BufferCandle.test.mq5 +++ b/Storage/Dict/Buffer/tests/BufferCandle.test.mq5 @@ -25,7 +25,7 @@ */ // Includes -#include "../../Test.mqh" +#include "../../../../Test.mqh" #include "../BufferCandle.h" /** diff --git a/Storage/Dict/Buffer/tests/BufferCompileAll.test.mq4 b/Storage/Dict/Buffer/tests/BufferCompileAll.test.mq4 new file mode 100644 index 000000000..2902f4244 --- /dev/null +++ b/Storage/Dict/Buffer/tests/BufferCompileAll.test.mq4 @@ -0,0 +1,28 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 31337 Investments 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 . + */ + +/** + * @file + * Test functionality of BufferFXT class. + */ + +// Includes. +#include "BufferCompileAll.test.mq5" diff --git a/Storage/Dict/Buffer/tests/BufferCompileAll.test.mq5 b/Storage/Dict/Buffer/tests/BufferCompileAll.test.mq5 new file mode 100644 index 000000000..18a58a19a --- /dev/null +++ b/Storage/Dict/Buffer/tests/BufferCompileAll.test.mq5 @@ -0,0 +1,38 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test compilation of all Buffer class files. + */ + +// Includes. +#include "../../../../Test.mqh" +#include "../Buffer.h" +#include "../BufferCandle.h" +#include "../BufferFXT.h" +#include "../BufferStruct.h" +#include "../BufferTick.h" + +/** + * Implements Init event handler. + */ +int OnInit() { return (_LastError == ERR_NO_ERROR ? INIT_SUCCEEDED : INIT_FAILED); } diff --git a/tests/BufferFXTTest.mq4 b/Storage/Dict/Buffer/tests/BufferFXT.test.mq4 similarity index 97% rename from tests/BufferFXTTest.mq4 rename to Storage/Dict/Buffer/tests/BufferFXT.test.mq4 index 94bbf9cf4..498f7967a 100644 --- a/tests/BufferFXTTest.mq4 +++ b/Storage/Dict/Buffer/tests/BufferFXT.test.mq4 @@ -25,4 +25,4 @@ */ // Includes. -#include "BufferFXTTest.mq5" +#include "BufferFXT.test.mq5" diff --git a/tests/BufferFXTTest.mq5 b/Storage/Dict/Buffer/tests/BufferFXT.test.mq5 similarity index 94% rename from tests/BufferFXTTest.mq5 rename to Storage/Dict/Buffer/tests/BufferFXT.test.mq5 index 120f60725..fbf129bf0 100644 --- a/tests/BufferFXTTest.mq5 +++ b/Storage/Dict/Buffer/tests/BufferFXT.test.mq5 @@ -25,9 +25,9 @@ */ // Includes -#include "../BufferFXT.mqh" -#include "../Platform.h" -#include "../Test.mqh" +#include "../BufferFXT.h" +#include "../../../../Platform.h" +#include "../../../../Test.mqh" BufferFXT *ticks; diff --git a/tests/BufferStructTest.mq4 b/Storage/Dict/Buffer/tests/BufferStruct.test.mq4 similarity index 97% rename from tests/BufferStructTest.mq4 rename to Storage/Dict/Buffer/tests/BufferStruct.test.mq4 index 96781a568..3d6317d56 100644 --- a/tests/BufferStructTest.mq4 +++ b/Storage/Dict/Buffer/tests/BufferStruct.test.mq4 @@ -25,4 +25,4 @@ */ // Includes. -#include "BufferStructTest.mq5" +#include "BufferStruct.test.mq5" diff --git a/tests/BufferStructTest.mq5 b/Storage/Dict/Buffer/tests/BufferStruct.test.mq5 similarity index 89% rename from tests/BufferStructTest.mq5 rename to Storage/Dict/Buffer/tests/BufferStruct.test.mq5 index 4a5f19c7a..5193e7ebf 100644 --- a/tests/BufferStructTest.mq5 +++ b/Storage/Dict/Buffer/tests/BufferStruct.test.mq5 @@ -25,14 +25,14 @@ */ // Includes -#include "../BufferStruct.mqh" -#include "../Data.define.h" -#include "../Data.struct.h" -#include "../Data.struct.serialize.h" -#include "../Serializer/SerializerConverter.h" -#include "../Serializer/SerializerJSON.h" -#include "../Std.h" -#include "../Test.mqh" +#include "../BufferStruct.h" +#include "../../../Data.define.h" +#include "../../../Data.struct.h" +#include "../../../Data.struct.serialize.h" +#include "../../../../Serializer/SerializerConverter.h" +#include "../../../../Serializer/SerializerJSON.h" +#include "../../../../Std.h" +#include "../../../../Test.mqh" /** * Implements OnInit(). diff --git a/Buffer/tests/BufferTick.test.mq4 b/Storage/Dict/Buffer/tests/BufferTick.test.mq4 similarity index 100% rename from Buffer/tests/BufferTick.test.mq4 rename to Storage/Dict/Buffer/tests/BufferTick.test.mq4 diff --git a/Buffer/tests/BufferTick.test.mq5 b/Storage/Dict/Buffer/tests/BufferTick.test.mq5 similarity index 98% rename from Buffer/tests/BufferTick.test.mq5 rename to Storage/Dict/Buffer/tests/BufferTick.test.mq5 index 1daf2ea7b..d0b022e65 100644 --- a/Buffer/tests/BufferTick.test.mq5 +++ b/Storage/Dict/Buffer/tests/BufferTick.test.mq5 @@ -25,7 +25,7 @@ */ // Includes -#include "../../Test.mqh" +#include "../../../../Test.mqh" #include "../BufferTick.h" /** diff --git a/Dict.enum.h b/Storage/Dict/Dict.enum.h similarity index 100% rename from Dict.enum.h rename to Storage/Dict/Dict.enum.h diff --git a/Dict.mqh b/Storage/Dict/Dict.h similarity index 98% rename from Dict.mqh rename to Storage/Dict/Dict.h index e18268cd5..015f64e7e 100644 --- a/Dict.mqh +++ b/Storage/Dict/Dict.h @@ -21,15 +21,15 @@ */ // Prevents processing this includes file for the second time. -#ifndef DICT_MQH -#define DICT_MQH - -#include "Convert.basic.h" -#include "DictBase.mqh" -#include "DictIteratorBase.mqh" -#include "Matrix.mqh" -#include "Serializer/Serializer.h" -#include "Serializer/SerializerNodeIterator.h" +#ifndef DICT_H +#define DICT_H + +#include "../../Convert.basic.h" +#include "DictBase.h" +#include "DictIteratorBase.h" +#include "../../Matrix.mqh" +#include "../../Serializer/Serializer.h" +#include "../../Serializer/SerializerNodeIterator.h" template class DictIterator : public DictIteratorBase { diff --git a/DictBase.mqh b/Storage/Dict/DictBase.h similarity index 98% rename from DictBase.mqh rename to Storage/Dict/DictBase.h index 2d99174c2..afd19a82e 100644 --- a/DictBase.mqh +++ b/Storage/Dict/DictBase.h @@ -21,14 +21,14 @@ */ // Prevents processing this includes file for the second time. -#ifndef DICT_BASE_MQH -#define DICT_BASE_MQH +#ifndef DICT_BASE_H +#define DICT_BASE_H // Includes. -#include "Convert.mqh" +#include "../../Convert.mqh" #include "Dict.enum.h" -#include "DictIteratorBase.mqh" -#include "DictSlot.mqh" +#include "DictIteratorBase.h" +#include "DictSlot.h" /** * Dictionary overflow listener. arguments are: diff --git a/DictIteratorBase.mqh b/Storage/Dict/DictIteratorBase.h similarity index 98% rename from DictIteratorBase.mqh rename to Storage/Dict/DictIteratorBase.h index a3c955558..a73cf160d 100644 --- a/DictIteratorBase.mqh +++ b/Storage/Dict/DictIteratorBase.h @@ -29,9 +29,9 @@ template class DictBase; -#include "DictBase.mqh" +#include "DictBase.h" #include "DictSlotsRef.h" -#include "Serializer/SerializerConversions.h" +#include "../../Serializer/SerializerConversions.h" template class DictIteratorBase { diff --git a/DictObject.mqh b/Storage/Dict/DictObject.h similarity index 99% rename from DictObject.mqh rename to Storage/Dict/DictObject.h index a19078a79..0809673b8 100644 --- a/DictObject.mqh +++ b/Storage/Dict/DictObject.h @@ -25,10 +25,10 @@ #pragma once #endif -#include "Convert.basic.h" -#include "DictBase.mqh" -#include "Serializer/Serializer.h" -#include "Serializer/SerializerNodeIterator.h" +#include "../../Convert.basic.h" +#include "DictBase.h" +#include "../../Serializer/Serializer.h" +#include "../../Serializer/SerializerNodeIterator.h" template class DictObjectIterator : public DictIteratorBase { diff --git a/DictSlot.mqh b/Storage/Dict/DictSlot.h similarity index 96% rename from DictSlot.mqh rename to Storage/Dict/DictSlot.h index 1b28cea9e..74ed6838c 100644 --- a/DictSlot.mqh +++ b/Storage/Dict/DictSlot.h @@ -21,8 +21,8 @@ */ // Prevents processing this includes file for the second time. -#ifndef DICT_SLOT_MQH -#define DICT_SLOT_MQH +#ifndef DICT_SLOT_H +#define DICT_SLOT_H enum DICT_SLOT_FLAGS { DICT_SLOT_INVALID = 1, DICT_SLOT_HAS_KEY = 2, DICT_SLOT_IS_USED = 4, DICT_SLOT_WAS_USED = 8 }; @@ -61,4 +61,4 @@ class DictSlot { void RemoveFlags(unsigned char flags) { _flags &= (unsigned char)~flags; } }; -#endif // DICT_SLOT_MQH +#endif // DICT_SLOT_H diff --git a/DictSlotsRef.h b/Storage/Dict/DictSlotsRef.h similarity index 95% rename from DictSlotsRef.h rename to Storage/Dict/DictSlotsRef.h index 03fd1c9de..8b7fd651d 100644 --- a/DictSlotsRef.h +++ b/Storage/Dict/DictSlotsRef.h @@ -31,11 +31,11 @@ #endif // Includes. -#include "Array.mqh" +#include "../../Storage/Array.h" #include "Dict.enum.h" -#include "DictSlot.mqh" -#include "Std.h" -#include "Util.h" +#include "DictSlot.h" +#include "../../Std.h" +#include "../../Util.h" // Forward class declaration. template diff --git a/DictStruct.mqh b/Storage/Dict/DictStruct.h similarity index 98% rename from DictStruct.mqh rename to Storage/Dict/DictStruct.h index 229a9567c..7bc733977 100644 --- a/DictStruct.mqh +++ b/Storage/Dict/DictStruct.h @@ -26,11 +26,11 @@ #endif // Includes. -#include "Convert.basic.h" -#include "DictBase.mqh" -#include "DictIteratorBase.mqh" -#include "Serializer/Serializer.h" -#include "Serializer/SerializerNodeIterator.h" +#include "../../Convert.basic.h" +#include "DictBase.h" +#include "DictIteratorBase.h" +#include "../../Serializer/Serializer.h" +#include "../../Serializer/SerializerNodeIterator.h" // DictIterator could be used as DictStruct iterator. #define DictStructIterator DictIteratorBase diff --git a/tests/DictTest.mq4 b/Storage/Dict/tests/Dict.test.mq4 similarity index 97% rename from tests/DictTest.mq4 rename to Storage/Dict/tests/Dict.test.mq4 index 994aabf5f..b4eae2671 100644 --- a/tests/DictTest.mq4 +++ b/Storage/Dict/tests/Dict.test.mq4 @@ -25,4 +25,4 @@ */ // Includes. -#include "DictTest.mq5" +#include "Dict.test.mq5" diff --git a/tests/DictTest.mq5 b/Storage/Dict/tests/Dict.test.mq5 similarity index 97% rename from tests/DictTest.mq5 rename to Storage/Dict/tests/Dict.test.mq5 index ff8e8b400..0d25d7860 100644 --- a/tests/DictTest.mq5 +++ b/Storage/Dict/tests/Dict.test.mq5 @@ -25,14 +25,14 @@ */ // Includes. -#include "../Dict.mqh" -#include "../DictObject.mqh" -#include "../DictStruct.mqh" -#include "../Object.mqh" -#include "../Serializer/Serializer.h" -#include "../Serializer/SerializerConverter.h" -#include "../Serializer/SerializerJson.h" -#include "../Test.mqh" +#include "../Dict.h" +#include "../DictObject.h" +#include "../DictStruct.h" +#include "../../../Storage/Object.h" +#include "../../../Serializer/Serializer.h" +#include "../../../Serializer/SerializerConverter.h" +#include "../../../Serializer/SerializerJson.h" +#include "../../../Test.mqh" class DictTestClass { public: diff --git a/Flags.h b/Storage/Flags.h similarity index 100% rename from Flags.h rename to Storage/Flags.h diff --git a/Storage/ItemsHistory.h b/Storage/ItemsHistory.h index 178dca0a8..551c26f36 100644 --- a/Storage/ItemsHistory.h +++ b/Storage/ItemsHistory.h @@ -29,7 +29,7 @@ #pragma once #endif -#include "../DictStruct.mqh" +#include "../Storage/Dict/DictStruct.h" #include "../Refs.mqh" /** diff --git a/Storage/MemoryFileSystem.h b/Storage/MemoryFileSystem.h index bd84d7a68..74b08eb48 100644 --- a/Storage/MemoryFileSystem.h +++ b/Storage/MemoryFileSystem.h @@ -31,9 +31,9 @@ // Includes. #include -#include "../DictStruct.mqh" +#include "../Storage/Dict/DictStruct.h" #include "../File.define.h" -#include "../String.mqh" +#include "../Storage/String.h" class MemoryFileSystemFile : public Dynamic { public: diff --git a/Object.enum.h b/Storage/Object.enum.h similarity index 100% rename from Object.enum.h rename to Storage/Object.enum.h diff --git a/Object.extern.h b/Storage/Object.extern.h similarity index 100% rename from Object.extern.h rename to Storage/Object.extern.h diff --git a/Object.mqh b/Storage/Object.h similarity index 96% rename from Object.mqh rename to Storage/Object.h index 542c73a68..e8467cd01 100644 --- a/Object.mqh +++ b/Storage/Object.h @@ -21,15 +21,15 @@ */ // Prevents processing this includes file for the second time. -#ifndef OBJECT_MQH -#define OBJECT_MQH +#ifndef OBJECT_H +#define OBJECT_H // Includes. #include "Object.enum.h" #include "Object.extern.h" -#include "Refs.mqh" -#include "Refs.struct.h" -#include "String.mqh" +#include "../Refs.mqh" +#include "../Refs.struct.h" +#include "String.h" /** * Class to deal with objects. @@ -130,4 +130,4 @@ class Object : public Dynamic { // Initialize static global variables. // Object *Object::list = { 0 }; -#endif // OBJECT_MQH +#endif // OBJECT_H diff --git a/Storage/Objects.h b/Storage/Objects.h index 3af152e0f..523e56805 100644 --- a/Storage/Objects.h +++ b/Storage/Objects.h @@ -30,7 +30,7 @@ #endif // Includes. -#include "../DictStruct.mqh" +#include "../Storage/Dict/DictStruct.h" #include "../Refs.mqh" /** diff --git a/Storage/ObjectsCache.h b/Storage/ObjectsCache.h index bb6cf6fac..1b47c51cc 100644 --- a/Storage/ObjectsCache.h +++ b/Storage/ObjectsCache.h @@ -30,7 +30,7 @@ #endif // Includes. -#include "../DictStruct.mqh" +#include "../Storage/Dict/DictStruct.h" /** * Makes DictStruct object pointers to be deleted at the end. diff --git a/Redis.mqh b/Storage/Redis.h similarity index 97% rename from Redis.mqh rename to Storage/Redis.h index 69be06ca8..f86f5057f 100644 --- a/Redis.mqh +++ b/Storage/Redis.h @@ -24,13 +24,13 @@ * @file * Implements class for storing/retrieving Redis database data. */ -#include "Dict.mqh" -#include "Object.mqh" +#include "Dict/Dict.h" +#include "Object.h" #include "Redis.struct.h" -#include "Serializer/Serializer.h" -#include "Serializer/SerializerConversions.h" -#include "Serializer/SerializerJson.h" -#include "Socket.mqh" +#include "../Serializer/Serializer.h" +#include "../Serializer/SerializerConversions.h" +#include "../Serializer/SerializerJson.h" +#include "../Socket.mqh" enum ENUM_REDIS_VALUE_SET { REDIS_VALUE_SET_ALWAYS, REDIS_VALUE_SET_IF_NOT_EXIST, REDIS_VALUE_SET_IF_ALREADY_EXIST }; diff --git a/Redis.struct.h b/Storage/Redis.struct.h similarity index 98% rename from Redis.struct.h rename to Storage/Redis.struct.h index 19d9d7663..cddace0c1 100644 --- a/Redis.struct.h +++ b/Storage/Redis.struct.h @@ -31,7 +31,7 @@ #endif // Includes. -#include "Serializer/SerializerConversions.h" +#include "../Serializer/SerializerConversions.h" // Forward declaration. class Serializer; diff --git a/String.extern.h b/Storage/String.extern.h similarity index 98% rename from String.extern.h rename to Storage/String.extern.h index 487cde055..b142b9500 100644 --- a/String.extern.h +++ b/Storage/String.extern.h @@ -33,9 +33,9 @@ #include #include -#include "Math.extern.h" -#include "Std.h" -#include "Terminal.define.h" +#include "../Math.extern.h" +#include "../Std.h" +#include "../Terminal.define.h" // Define external global functions. double StringToDouble(string value) { return std::stod(value); } diff --git a/String.mqh b/Storage/String.h similarity index 98% rename from String.mqh rename to Storage/String.h index e29d40c7b..aeff16710 100644 --- a/String.mqh +++ b/Storage/String.h @@ -26,8 +26,8 @@ // Includes. #include "Array.extern.h" -#include "Common.extern.h" -#include "Std.h" +#include "../Common.extern.h" +#include "../Std.h" #include "String.extern.h" // Defines. diff --git a/Storage/ValueStorage.h b/Storage/ValueStorage.h index b550627b0..0747679c4 100644 --- a/Storage/ValueStorage.h +++ b/Storage/ValueStorage.h @@ -121,7 +121,7 @@ enum ENUM_IPEAK { IPEAK_LOWEST, IPEAK_HIGHEST }; #define INDICATOR_CALCULATE_POPULATED_PARAMS_SHORT _price // Includes. -#include "../Array.mqh" +#include "../Storage/Array.h" #include "../Util.h" #include "IValueStorage.h" #include "ValueStorage.accessor.h" diff --git a/tests/CollectionTest.mq4 b/Storage/tests/Collection.test.mq4 similarity index 97% rename from tests/CollectionTest.mq4 rename to Storage/tests/Collection.test.mq4 index 671a0932e..e31946256 100644 --- a/tests/CollectionTest.mq4 +++ b/Storage/tests/Collection.test.mq4 @@ -25,4 +25,4 @@ */ // Includes. -#include "CollectionTest.mq5" +#include "Collection.test.mq5" diff --git a/tests/CollectionTest.mq5 b/Storage/tests/Collection.test.mq5 similarity index 96% rename from tests/CollectionTest.mq5 rename to Storage/tests/Collection.test.mq5 index 6ed2ee3cb..23073b990 100644 --- a/tests/CollectionTest.mq5 +++ b/Storage/tests/Collection.test.mq5 @@ -25,13 +25,13 @@ */ // Includes. -#include "../Collection.mqh" -#include "../Test.mqh" +#include "../Collection.h" +#include "../../Test.mqh" // Define classes. class Stack : public Object { public: - virtual string GetName() = NULL; + virtual string GetName() = 0; }; class Foo : public Stack { public: diff --git a/tests/DatabaseTest.mq4 b/Storage/tests/Database.test.mq4 similarity index 97% rename from tests/DatabaseTest.mq4 rename to Storage/tests/Database.test.mq4 index eece18a82..e9c63ce6c 100644 --- a/tests/DatabaseTest.mq4 +++ b/Storage/tests/Database.test.mq4 @@ -25,4 +25,4 @@ */ // Includes. -#include "DatabaseTest.mq5" +#include "Database.test.mq5" diff --git a/tests/DatabaseTest.mq5 b/Storage/tests/Database.test.mq5 similarity index 94% rename from tests/DatabaseTest.mq5 rename to Storage/tests/Database.test.mq5 index 2cbc81ddf..b781f8549 100644 --- a/tests/DatabaseTest.mq5 +++ b/Storage/tests/Database.test.mq5 @@ -24,13 +24,13 @@ * Test functionality of Database class. */ -// Need to be include before Database.mqh. -#include "../SymbolInfo.mqh" // FOOBAR pragma: keep +// Need to be include before Database.h. +#include "../../SymbolInfo.mqh" // FOOBAR pragma: keep // Includes. -#include "../BufferStruct.mqh" -#include "../Database.mqh" -#include "../Test.mqh" +#include "../Dict/Buffer/BufferStruct.h" +#include "../Database.h" +#include "../../Test.mqh" // Global variables. Database *db; diff --git a/tests/DateTimeTest.mq4 b/Storage/tests/DateTime.test.mq4 similarity index 97% rename from tests/DateTimeTest.mq4 rename to Storage/tests/DateTime.test.mq4 index 5ab59afd6..75da6eeda 100644 --- a/tests/DateTimeTest.mq4 +++ b/Storage/tests/DateTime.test.mq4 @@ -25,4 +25,4 @@ */ // Includes. -#include "DateTimeTest.mq5" +#include "DateTime.test.mq5" diff --git a/tests/DateTimeTest.mq5 b/Storage/tests/DateTime.test.mq5 similarity index 98% rename from tests/DateTimeTest.mq5 rename to Storage/tests/DateTime.test.mq5 index 724208d3c..3ad92bd86 100644 --- a/tests/DateTimeTest.mq5 +++ b/Storage/tests/DateTime.test.mq5 @@ -25,8 +25,8 @@ */ // Includes. -#include "../DateTime.mqh" -#include "../Test.mqh" +#include "../DateTime.h" +#include "../../Test.mqh" /** * Implements OnInit(). diff --git a/Storage/tests/ItemsHistory.mq4 b/Storage/tests/ItemsHistory.test.mq4 similarity index 97% rename from Storage/tests/ItemsHistory.mq4 rename to Storage/tests/ItemsHistory.test.mq4 index eaed0b07c..6b106661f 100644 --- a/Storage/tests/ItemsHistory.mq4 +++ b/Storage/tests/ItemsHistory.test.mq4 @@ -25,4 +25,4 @@ */ // Includes. -#include "ItemsHistory.mq5" +#include "ItemsHistory.test.mq5" diff --git a/Storage/tests/ItemsHistory.mq5 b/Storage/tests/ItemsHistory.test.mq5 similarity index 100% rename from Storage/tests/ItemsHistory.mq5 rename to Storage/tests/ItemsHistory.test.mq5 diff --git a/Storage/tests/Object.test.mq4 b/Storage/tests/Object.test.mq4 new file mode 100644 index 000000000..db29ab091 --- /dev/null +++ b/Storage/tests/Object.test.mq4 @@ -0,0 +1,28 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test functionality of Object class. + */ + +// Includes. +#include "Object.test.mq5" diff --git a/Storage/tests/Object.test.mq5 b/Storage/tests/Object.test.mq5 new file mode 100644 index 000000000..577e27712 --- /dev/null +++ b/Storage/tests/Object.test.mq5 @@ -0,0 +1,45 @@ +//+------------------------------------------------------------------+ +//| 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 . + */ + +/** + * @file + * Test functionality of Object class. + */ + +// Includes. +#include "../../Test.mqh" +#include "../Object.h" + +/** + * Implements OnInit(). + */ +int OnInit() { + // Create a new object. + Object *obj = new Object(); + + // @todo: Add more tests. + // ... + + // Clean up. + Object::Delete(obj); + + return (GetLastError() > 0 ? INIT_FAILED : INIT_SUCCEEDED); +} diff --git a/tests/RedisTest.mq4 b/Storage/tests/Redis.test.mq4 similarity index 97% rename from tests/RedisTest.mq4 rename to Storage/tests/Redis.test.mq4 index 914b361f0..41d497228 100644 --- a/tests/RedisTest.mq4 +++ b/Storage/tests/Redis.test.mq4 @@ -26,7 +26,7 @@ // Includes. #ifdef __MQL5__ -#include "RedisTest.mq5" +#include "Redis.test.mq5" #else // Sockets are not supported on MQL4, so Redis wouldn't work for now. int OnInit() { return (INIT_SUCCEEDED); } diff --git a/tests/RedisTest.mq5 b/Storage/tests/Redis.test.mq5 similarity index 96% rename from tests/RedisTest.mq5 rename to Storage/tests/Redis.test.mq5 index b8e14c4b0..2e3b254af 100644 --- a/tests/RedisTest.mq5 +++ b/Storage/tests/Redis.test.mq5 @@ -25,9 +25,9 @@ */ // Includes. -#include "../Redis.mqh" -#include "../Socket.mqh" -#include "../Test.mqh" +#include "../Redis.h" +#include "../../Socket.mqh" +#include "../../Test.mqh" // Properties. #property strict diff --git a/tests/ValueStorageTest.mq4 b/Storage/tests/ValueStorage.test.mq4 similarity index 97% rename from tests/ValueStorageTest.mq4 rename to Storage/tests/ValueStorage.test.mq4 index c6968dc1b..ce84e4183 100644 --- a/tests/ValueStorageTest.mq4 +++ b/Storage/tests/ValueStorage.test.mq4 @@ -24,4 +24,4 @@ * Test functionality of ValueStorage class. */ -#include "ValueStorageTest.mq5" +#include "ValueStorage.test.mq5" diff --git a/tests/ValueStorageTest.mq5 b/Storage/tests/ValueStorage.test.mq5 similarity index 95% rename from tests/ValueStorageTest.mq5 rename to Storage/tests/ValueStorage.test.mq5 index ddc3b3c52..3d30a6d1c 100644 --- a/tests/ValueStorageTest.mq5 +++ b/Storage/tests/ValueStorage.test.mq5 @@ -28,12 +28,12 @@ #define __debug__ // Enables debug. // Includes. -#include "../Indicators/Indi_MA.mqh" -#include "../Indicators/Price/Indi_Price.mqh" -#include "../Serializer/SerializerConverter.h" -#include "../Serializer/SerializerJson.h" -#include "../Storage/ValueStorage.h" -#include "../Test.mqh" +#include "../../Indicators/Indi_MA.mqh" +#include "../../Indicators/Price/Indi_Price.mqh" +#include "../../Serializer/SerializerConverter.h" +#include "../../Serializer/SerializerJson.h" +#include "../ValueStorage.h" +#include "../../Test.mqh" // Global variables. double _test_values[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; diff --git a/Strategy.mqh b/Strategy.mqh index 961808aa7..806b6712a 100644 --- a/Strategy.mqh +++ b/Strategy.mqh @@ -28,14 +28,14 @@ class Trade; // Includes. -#include "Data.struct.h" -#include "Dict.mqh" +#include "Storage/Data.struct.h" +#include "Storage/Dict/Dict.h" #include "Indicator/Indicator.h" #include "Market.mqh" -#include "Object.mqh" +#include "Storage/Object.h" #include "Strategy.enum.h" #include "Strategy.struct.h" -#include "String.mqh" +#include "Storage/String.h" #include "Task/TaskManager.h" #include "Task/Taskable.h" #include "Trade.mqh" diff --git a/SymbolInfo.mqh b/SymbolInfo.mqh index 534646a66..d68a68ede 100644 --- a/SymbolInfo.mqh +++ b/SymbolInfo.mqh @@ -21,8 +21,8 @@ */ // Prevents processing this includes file for the second time. -#ifndef SYMBOLINFO_MQH -#define SYMBOLINFO_MQH +#ifndef SYMBOLINFO_H +#define SYMBOLINFO_H // Includes symbol defines, enums and structs. #include "SymbolInfo.define.h" @@ -561,4 +561,4 @@ class SymbolInfo : public Object { */ Log *GetLogger() { return GetPointer(logger); } }; -#endif // SYMBOLINFO_MQH +#endif // SYMBOLINFO_H diff --git a/Task/Task.h b/Task/Task.h index 266a60284..ab36080f6 100644 --- a/Task/Task.h +++ b/Task/Task.h @@ -31,7 +31,7 @@ #endif // Includes. -#include "../DictStruct.mqh" +#include "../Storage/Dict/DictStruct.h" #include "../Terminal.define.h" #include "Task.enum.h" #include "Task.struct.h" diff --git a/Task/TaskAction.h b/Task/TaskAction.h index 5f48a66b7..b0ecba039 100644 --- a/Task/TaskAction.h +++ b/Task/TaskAction.h @@ -35,7 +35,7 @@ #define TASK_ACTION_H // Includes. -#include "../DateTime.mqh" +#include "../Storage/DateTime.h" #include "../Std.h" #include "../Terminal.define.h" #include "TaskAction.enum.h" diff --git a/Task/TaskAction.struct.h b/Task/TaskAction.struct.h index 3d93591a2..d6d9d2b85 100644 --- a/Task/TaskAction.struct.h +++ b/Task/TaskAction.struct.h @@ -30,7 +30,7 @@ #endif // Includes. -#include "../Data.struct.h" +#include "../Storage/Data.struct.h" #include "../Serializer/Serializer.define.h" #include "../Std.h" #include "../Terminal.define.h" diff --git a/Task/TaskCondition.h b/Task/TaskCondition.h index 962c088bb..8a798aa1e 100644 --- a/Task/TaskCondition.h +++ b/Task/TaskCondition.h @@ -35,7 +35,7 @@ #define TASK_CONDITION_H // Includes. -#include "../DateTime.mqh" +#include "../Storage/DateTime.h" #include "../Std.h" #include "../Terminal.define.h" #include "TaskCondition.enum.h" diff --git a/Task/TaskCondition.struct.h b/Task/TaskCondition.struct.h index ce239fb1e..9dd0ddd0c 100644 --- a/Task/TaskCondition.struct.h +++ b/Task/TaskCondition.struct.h @@ -30,7 +30,7 @@ #endif // Includes. -#include "../Data.struct.h" +#include "../Storage/Data.struct.h" #include "../Serializer/Serializer.define.h" #include "../Serializer/Serializer.enum.h" #include "../Std.h" diff --git a/Task/TaskGetter.h b/Task/TaskGetter.h index 346add6f5..0b632899f 100644 --- a/Task/TaskGetter.h +++ b/Task/TaskGetter.h @@ -36,7 +36,7 @@ // Includes. //#include "TaskGetter.enum.h" -#include "../DateTime.mqh" +#include "../Storage/DateTime.h" #include "../Terminal.define.h" #include "TaskGetter.struct.h" #include "TaskGetterBase.h" diff --git a/Task/TaskGetter.struct.h b/Task/TaskGetter.struct.h index 78292144c..7a3c19e61 100644 --- a/Task/TaskGetter.struct.h +++ b/Task/TaskGetter.struct.h @@ -30,7 +30,7 @@ #endif // Includes. -#include "../Data.struct.h" +#include "../Storage/Data.struct.h" #include "../Serializer/Serializer.define.h" #include "../Std.h" #include "../Terminal.define.h" diff --git a/Task/TaskManager.h b/Task/TaskManager.h index 8fa594a38..d7a0dcf59 100644 --- a/Task/TaskManager.h +++ b/Task/TaskManager.h @@ -31,7 +31,7 @@ #endif // Includes. -#include "../DictObject.mqh" +#include "../Storage/Dict/DictObject.h" #include "../Serializer/SerializerConverter.h" #include "../Serializer/SerializerJson.h" #include "Task.struct.h" diff --git a/Task/TaskSetter.struct.h b/Task/TaskSetter.struct.h index 86efff237..822db9c88 100644 --- a/Task/TaskSetter.struct.h +++ b/Task/TaskSetter.struct.h @@ -30,7 +30,7 @@ #endif // Includes. -#include "../Data.struct.h" +#include "../Storage/Data.struct.h" #include "../Serializer/Serializer.h" #include "../Std.h" #include "Task.enum.h" diff --git a/Task/Taskable.h b/Task/Taskable.h index b4c733abd..9e3115543 100644 --- a/Task/Taskable.h +++ b/Task/Taskable.h @@ -35,7 +35,7 @@ #define TASKABLE_H // Includes. -#include "../Object.mqh" +#include "../Storage/Object.h" #include "TaskAction.h" #include "TaskCondition.h" #include "TaskGetter.h" diff --git a/Task/tests/Task.test.cpp b/Task/tests/Task.test.cpp index 9b12549aa..3941f0689 100644 --- a/Task/tests/Task.test.cpp +++ b/Task/tests/Task.test.cpp @@ -30,6 +30,6 @@ #include "../../Common.define.h" #include "../../Common.extern.h" #include "../../Std.h" -#include "../../String.extern.h" +#include "../../Storage/String.extern.h" int main(int argc, char **argv) {} diff --git a/Task/tests/TaskAction.test.cpp b/Task/tests/TaskAction.test.cpp index 79a16e95e..9839c3672 100644 --- a/Task/tests/TaskAction.test.cpp +++ b/Task/tests/TaskAction.test.cpp @@ -30,6 +30,6 @@ #include "../../Common.define.h" #include "../../Common.extern.h" #include "../../Std.h" -#include "../../String.extern.h" +#include "../../Storage/String.extern.h" int main(int argc, char **argv) {} diff --git a/Task/tests/TaskActionBase.test.cpp b/Task/tests/TaskActionBase.test.cpp index 8bddd771e..4cef3defe 100644 --- a/Task/tests/TaskActionBase.test.cpp +++ b/Task/tests/TaskActionBase.test.cpp @@ -30,6 +30,6 @@ #include "../../Common.define.h" #include "../../Common.extern.h" #include "../../Std.h" -#include "../../String.extern.h" +#include "../../Storage/String.extern.h" int main(int argc, char **argv) {} diff --git a/Task/tests/TaskCondition.test.cpp b/Task/tests/TaskCondition.test.cpp index 6689d9e2b..aa915e7f4 100644 --- a/Task/tests/TaskCondition.test.cpp +++ b/Task/tests/TaskCondition.test.cpp @@ -30,6 +30,6 @@ #include "../../Common.define.h" #include "../../Common.extern.h" #include "../../Std.h" -#include "../../String.extern.h" +#include "../../Storage/String.extern.h" int main(int argc, char **argv) {} diff --git a/Task/tests/TaskConditionBase.test.cpp b/Task/tests/TaskConditionBase.test.cpp index 12bc9c618..8cc28e132 100644 --- a/Task/tests/TaskConditionBase.test.cpp +++ b/Task/tests/TaskConditionBase.test.cpp @@ -30,6 +30,6 @@ #include "../../Common.define.h" #include "../../Common.extern.h" #include "../../Std.h" -#include "../../String.extern.h" +#include "../../Storage/String.extern.h" int main(int argc, char **argv) {} diff --git a/Task/tests/TaskGetter.test.cpp b/Task/tests/TaskGetter.test.cpp index e34c6dc56..794e49bf7 100644 --- a/Task/tests/TaskGetter.test.cpp +++ b/Task/tests/TaskGetter.test.cpp @@ -30,6 +30,6 @@ #include "../../Common.define.h" #include "../../Common.extern.h" #include "../../Std.h" -#include "../../String.extern.h" +#include "../../Storage/String.extern.h" int main(int argc, char **argv) {} diff --git a/Task/tests/TaskGetterBase.test.cpp b/Task/tests/TaskGetterBase.test.cpp index 7d47abf1c..219e7ded2 100644 --- a/Task/tests/TaskGetterBase.test.cpp +++ b/Task/tests/TaskGetterBase.test.cpp @@ -30,6 +30,6 @@ #include "../../Common.define.h" #include "../../Common.extern.h" #include "../../Std.h" -#include "../../String.extern.h" +#include "../../Storage/String.extern.h" int main(int argc, char **argv) {} diff --git a/Task/tests/TaskManager.test.cpp b/Task/tests/TaskManager.test.cpp index c92dbf5ba..08edcf2a1 100644 --- a/Task/tests/TaskManager.test.cpp +++ b/Task/tests/TaskManager.test.cpp @@ -30,6 +30,6 @@ #include "../../Common.define.h" #include "../../Common.extern.h" #include "../../Std.h" -#include "../../String.extern.h" +#include "../../Storage/String.extern.h" int main(int argc, char **argv) {} diff --git a/Task/tests/TaskManager.test.mq5 b/Task/tests/TaskManager.test.mq5 index 58271b300..d93e5d718 100644 --- a/Task/tests/TaskManager.test.mq5 +++ b/Task/tests/TaskManager.test.mq5 @@ -28,7 +28,7 @@ struct DataParamEntry; // Includes. -#include "../../Data.struct.serialize.h" +#include "../../Storage/Data.struct.serialize.h" #include "../../Test.mqh" #include "../TaskAction.struct.serialize.h" #include "../TaskCondition.struct.serialize.h" diff --git a/Task/tests/TaskObject.test.cpp b/Task/tests/TaskObject.test.cpp index c4d09897b..25588fd9e 100644 --- a/Task/tests/TaskObject.test.cpp +++ b/Task/tests/TaskObject.test.cpp @@ -30,6 +30,6 @@ #include "../../Common.define.h" #include "../../Common.extern.h" #include "../../Std.h" -#include "../../String.extern.h" +#include "../../Storage/String.extern.h" int main(int argc, char **argv) {} diff --git a/Task/tests/TaskSetter.test.cpp b/Task/tests/TaskSetter.test.cpp index c422842f2..0db4f7705 100644 --- a/Task/tests/TaskSetter.test.cpp +++ b/Task/tests/TaskSetter.test.cpp @@ -28,7 +28,7 @@ #include "../../Common.define.h" #include "../../Common.extern.h" #include "../../Std.h" -#include "../../String.extern.h" +#include "../../Storage/String.extern.h" #include "../TaskSetter.h" int main(int argc, char **argv) {} diff --git a/Task/tests/Taskable.car.test.mq5 b/Task/tests/Taskable.car.test.mq5 index 9deda3072..154cc0856 100644 --- a/Task/tests/Taskable.car.test.mq5 +++ b/Task/tests/Taskable.car.test.mq5 @@ -28,7 +28,7 @@ struct DataParamEntry; // Includes. -#include "../../Data.struct.h" +#include "../../Storage/Data.struct.h" #include "../../Test.mqh" #include "../Task.h" diff --git a/Task/tests/Taskable.test.cpp b/Task/tests/Taskable.test.cpp index c0063e7a8..a872db8e2 100644 --- a/Task/tests/Taskable.test.cpp +++ b/Task/tests/Taskable.test.cpp @@ -30,6 +30,6 @@ #include "../../Common.define.h" #include "../../Common.extern.h" #include "../../Std.h" -#include "../../String.extern.h" +#include "../../Storage/String.extern.h" int main(int argc, char **argv) {} diff --git a/Terminal.extern.h b/Terminal.extern.h index ecb073b2c..d39f9ff96 100644 --- a/Terminal.extern.h +++ b/Terminal.extern.h @@ -25,7 +25,7 @@ #pragma once // Includes. -#include "String.mqh" +#include "Storage/String.h" #include "Terminal.define.h" #include "Terminal.enum.h" diff --git a/Terminal.mqh b/Terminal.mqh index 3fe1a77b0..b11406cf6 100644 --- a/Terminal.mqh +++ b/Terminal.mqh @@ -38,10 +38,10 @@ class Terminal; // Includes. #include "Convert.mqh" -#include "Data.struct.h" -#include "Object.mqh" +#include "Storage/Data.struct.h" +#include "Storage/Object.h" #include "Refs.mqh" -#include "String.mqh" +#include "Storage/String.h" #include "Terminal.define.h" #include "Terminal.enum.h" #include "Terminal.extern.h" diff --git a/Tick/Tick.struct.h b/Tick/Tick.struct.h index c2edbceca..dd3ebe5ec 100644 --- a/Tick/Tick.struct.h +++ b/Tick/Tick.struct.h @@ -30,7 +30,7 @@ #endif // Includes. -#include "../DateTime.extern.h" +#include "../Storage/DateTime.extern.h" #include "../Std.h" #ifndef __MQL__ diff --git a/Tick/TickManager.h b/Tick/TickManager.h index d34239ac3..ec423bfa3 100644 --- a/Tick/TickManager.h +++ b/Tick/TickManager.h @@ -26,7 +26,7 @@ */ // Includes. -#include "../BufferStruct.mqh" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "Tick.struct.h" #include "TickManager.h" //#include "TickManager.struct.h" diff --git a/Timer.mqh b/Timer.mqh index ec86c1a7e..facaf2f9a 100644 --- a/Timer.mqh +++ b/Timer.mqh @@ -22,7 +22,7 @@ // Includes. #include "Math.h" -#include "Object.mqh" +#include "Storage/Object.h" /** * Class to provide functions to deal with the timer. diff --git a/Trade.mqh b/Trade.mqh index 2f5b81303..d1a2d6ebf 100644 --- a/Trade.mqh +++ b/Trade.mqh @@ -32,10 +32,10 @@ class Trade; // Includes. #include "Account/AccountMt.h" #include "Convert.mqh" -#include "DictStruct.mqh" +#include "Storage/Dict/DictStruct.h" #include "Indicator/IndicatorData.h" #include "Math.h" -#include "Object.mqh" +#include "Storage/Object.h" #include "Order.mqh" #include "OrderQuery.h" #include "Task/TaskManager.h" diff --git a/Trade.struct.h b/Trade.struct.h index 56919c02a..3ab728e55 100644 --- a/Trade.struct.h +++ b/Trade.struct.h @@ -34,7 +34,7 @@ struct TradeStats; // Includes. -#include "DateTime.mqh" +#include "Storage/DateTime.h" #include "Trade.enum.h" /* Structure for trade statistics. */ diff --git a/Trade/TradeSignalManager.h b/Trade/TradeSignalManager.h index b9a03fb82..26de28668 100644 --- a/Trade/TradeSignalManager.h +++ b/Trade/TradeSignalManager.h @@ -26,7 +26,7 @@ */ // Includes. -#include "../DictObject.mqh" +#include "../Storage/Dict/DictObject.h" #include "TradeSignal.h" #include "TradeSignalManager.struct.h" diff --git a/Trade/tests/TradeSignal.test.cpp b/Trade/tests/TradeSignal.test.cpp index 696ec4422..2da19c524 100644 --- a/Trade/tests/TradeSignal.test.cpp +++ b/Trade/tests/TradeSignal.test.cpp @@ -25,10 +25,12 @@ */ // Includes. -#include "../../Common.define.h" -#include "../../Common.extern.h" -#include "../../Std.h" -#include "../../String.extern.h" #include "../TradeSignal.h" +#include "../../Platform.h" -int main(int argc, char **argv) {} +int main(int argc, char **argv) { + + // @todo + + return 0; +} diff --git a/Trade/tests/TradeSignalTest.mq4 b/Trade/tests/TradeSignal.test.mq4 similarity index 97% rename from Trade/tests/TradeSignalTest.mq4 rename to Trade/tests/TradeSignal.test.mq4 index 8c80fd59a..c22f1d857 100644 --- a/Trade/tests/TradeSignalTest.mq4 +++ b/Trade/tests/TradeSignal.test.mq4 @@ -25,4 +25,4 @@ */ // Includes. -#include "TradeSignalTest.mq5" +#include "TradeSignal.test.mq5" diff --git a/Trade/tests/TradeSignalTest.mq5 b/Trade/tests/TradeSignal.test.mq5 similarity index 100% rename from Trade/tests/TradeSignalTest.mq5 rename to Trade/tests/TradeSignal.test.mq5 diff --git a/Trade/tests/TradeSignalManager.test.cpp b/Trade/tests/TradeSignalManager.test.cpp index 7ca976d9f..f37ad93cd 100644 --- a/Trade/tests/TradeSignalManager.test.cpp +++ b/Trade/tests/TradeSignalManager.test.cpp @@ -25,10 +25,12 @@ */ // Includes. -#include "../../Common.define.h" -#include "../../Common.extern.h" -#include "../../Std.h" -#include "../../String.extern.h" #include "../TradeSignalManager.h" +#include "../../Platform.h" -int main(int argc, char **argv) {} +int main(int argc, char **argv) { + + // @todo + + return 0; +} diff --git a/Trade/tests/TradeSignalManagerTest.mq4 b/Trade/tests/TradeSignalManager.test.mq4 similarity index 96% rename from Trade/tests/TradeSignalManagerTest.mq4 rename to Trade/tests/TradeSignalManager.test.mq4 index c199b1143..3309a1f63 100644 --- a/Trade/tests/TradeSignalManagerTest.mq4 +++ b/Trade/tests/TradeSignalManager.test.mq4 @@ -25,4 +25,4 @@ */ // Includes. -#include "TradeSignalManagerTest.mq5" +#include "TradeSignalManager.test.mq5" diff --git a/Trade/tests/TradeSignalManagerTest.mq5 b/Trade/tests/TradeSignalManager.test.mq5 similarity index 100% rename from Trade/tests/TradeSignalManagerTest.mq5 rename to Trade/tests/TradeSignalManager.test.mq5 diff --git a/tests/CompileIndicatorsTest.mq5 b/tests/CompileIndicatorsTest.mq5 index f39b49c68..9e106c3c2 100644 --- a/tests/CompileIndicatorsTest.mq5 +++ b/tests/CompileIndicatorsTest.mq5 @@ -25,11 +25,11 @@ */ // Includes. -#include "../Indicators/indicators.h" -#include "../Indicators/Bitwise/indicators.h" -#include "../Indicators/OHLC/indicators.h" -#include "../Indicators/Price/indicators.h" -#include "../Indicators/Special/indicators.h" +#include "../Indicators/includes.h" +#include "../Indicators/Bitwise/includes.h" +#include "../Indicators/OHLC/includes.h" +#include "../Indicators/Price/includes.h" +#include "../Indicators/Special/includes.h" /** * Implements Init event handler. diff --git a/tests/CompileTest.mq5 b/tests/CompileTest.mq5 index 6a6710f7e..b3e1d303c 100644 --- a/tests/CompileTest.mq5 +++ b/tests/CompileTest.mq5 @@ -40,26 +40,26 @@ struct IndicatorParams; // Includes. #include "../Account/AccountMt.h" -#include "../Array.mqh" +#include "../Storage/Array.h" #include "../Task/TaskAction.h" //#include "../BasicTrade.mqh" // @removeme -#include "../Buffer.mqh" -#include "../BufferFXT.mqh" -#include "../BufferStruct.mqh" +#include "../Storage/Dict/Buffer/Buffer.h" +#include "../Storage/Dict/Buffer/BufferFXT.h" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Chart.mqh" -#include "../Collection.mqh" +#include "../Storage/Collection.h" #include "../Config.mqh" #include "../Convert.mqh" -#include "../Database.mqh" -#include "../DateTime.mqh" -#include "../Dict.mqh" -#include "../DictBase.mqh" -#include "../DictIteratorBase.mqh" -#include "../DictObject.mqh" -#include "../DictSlot.mqh" -#include "../DictStruct.mqh" +#include "../Storage/Database.h" +#include "../Storage/DateTime.h" +#include "../Storage/Dict/Dict.h" +#include "../Storage/Dict/DictBase.h" +#include "../Storage/Dict/DictIteratorBase.h" +#include "../Storage/Dict/DictObject.h" +#include "../Storage/Dict/DictSlot.h" +#include "../Storage/Dict/DictStruct.h" #include "../Draw.mqh" -#include "../DrawIndicator.mqh" +#include "../Indicators/DrawIndicator.mqh" #include "../EA.mqh" #include "../File.mqh" // #include "../Inet.mqh" @@ -75,12 +75,12 @@ struct IndicatorParams; #include "../Matrix.mqh" #include "../MiniMatrix.h" #include "../Msg.mqh" -#include "../Object.mqh" +#include "../Storage/Object.h" #include "../Order.mqh" #include "../Orders.mqh" #include "../Pattern.mqh" // #include "../Profiler.mqh" -#include "../Redis.mqh" +#include "../Storage/Redis.h" #include "../Refs.mqh" #include "../Registry.mqh" #include "../RegistryBinary.mqh" @@ -95,7 +95,7 @@ struct IndicatorParams; #include "../Std.h" #include "../Storage/Singleton.h" #include "../Strategy.mqh" -#include "../String.mqh" +#include "../Storage/String.h" #include "../SummaryReport.mqh" #include "../SymbolInfo.mqh" #include "../Task/Task.h" @@ -125,7 +125,7 @@ struct IndicatorParams; #include "../Indicator/IndicatorTf.h" #include "../Indicator/IndicatorTick.h" #include "../Indicator/IndicatorTickSource.h" -#include "../Indicators/indicators.h" +#include "../Indicators/includes.h" // Includes Serializer files. #include "../Serializer/Serializable.h" diff --git a/tests/ConfigTest.mq5 b/tests/ConfigTest.mq5 index bbed5cd13..578664161 100644 --- a/tests/ConfigTest.mq5 +++ b/tests/ConfigTest.mq5 @@ -26,9 +26,9 @@ // Includes. #include "../Config.mqh" -#include "../Data.define.h" -#include "../Dict.mqh" -#include "../DictObject.mqh" +#include "../Storage/Data.define.h" +#include "../Storage/Dict/Dict.h" +#include "../Storage/Dict/DictObject.h" #include "../Serializer/SerializerConverter.h" #include "../Serializer/SerializerCsv.h" #include "../Serializer/SerializerJson.h" diff --git a/tests/DrawIndicatorTest.mq4 b/tests/DrawIndicatorTest.mq4 deleted file mode 100644 index bbfbd8c25..000000000 --- a/tests/DrawIndicatorTest.mq4 +++ /dev/null @@ -1,27 +0,0 @@ -//+------------------------------------------------------------------+ -//| 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 . - */ - -/** - * @file - * Test functionality of DrawIndicator class. - */ - -#include "DrawIndicatorTest.mq5" diff --git a/tests/IndicatorsTest.mq5 b/tests/IndicatorsTest.mq5 index c06263758..3d6ea4f4d 100644 --- a/tests/IndicatorsTest.mq5 +++ b/tests/IndicatorsTest.mq5 @@ -34,14 +34,14 @@ struct DataParamEntry; // Includes. //#include "../ChartMt.h" -#include "../Dict.mqh" -#include "../DictObject.mqh" +#include "../Storage/Dict/Dict.h" +#include "../Storage/Dict/DictObject.h" #include "../Indicator/Indicator.h" #include "../Indicator/tests/classes/IndicatorTfDummy.h" #include "../Indicator/tests/classes/Indicators.h" -#include "../Indicators/Bitwise/indicators.h" +#include "../Indicators/Bitwise/includes.h" #include "../Indicators/Tick/Indi_TickMt.mqh" -#include "../Indicators/indicators.h" +#include "../Indicators/includes.h" #include "../Platform.h" #include "../Serializer/SerializerConverter.h" #include "../Serializer/SerializerJson.h" @@ -152,7 +152,7 @@ void OnDeinit(const int reason) { } PrintFormat("%s: Indicators not tested: %d", __FUNCTION__, num_not_tested); - assertTrueOrExit(num_not_tested == 0, "Not all indicators has been tested!"); + assertTrueOrExit(num_not_tested == 0, "Not all includes.has been tested!"); } /** @@ -563,7 +563,7 @@ bool InitIndicators() { CandleParams candle_params(); indis.Add(new Indi_Candle(candle_params)); - // Push white-listed indicators here. + // Push white-listed includes.here. // whitelisted_indis.Add(_indi_test); return GetLastError() == ERR_NO_ERROR; diff --git a/tests/LogTest.mq5 b/tests/LogTest.mq5 index e28e8fe4c..0d90a83ae 100644 --- a/tests/LogTest.mq5 +++ b/tests/LogTest.mq5 @@ -25,7 +25,7 @@ */ // Includes. -#include "../DictStruct.mqh" +#include "../Storage/Dict/DictStruct.h" #include "../Log.mqh" #include "../Refs.struct.h" #include "../Test.mqh" diff --git a/tests/RefsTest.mq5 b/tests/RefsTest.mq5 index 943a22378..646fc7b23 100644 --- a/tests/RefsTest.mq5 +++ b/tests/RefsTest.mq5 @@ -25,8 +25,8 @@ */ // Includes. -#include "../DictObject.mqh" -#include "../DictStruct.mqh" +#include "../Storage/Dict/DictObject.h" +#include "../Storage/Dict/DictStruct.h" #include "../Refs.mqh" #include "../Test.mqh" From fb67ffa15d1d9b045b527b3bc479ed30c20fba46 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 14:32:57 +0100 Subject: [PATCH 002/109] GHA: Provides GitHubApiToken --- .github/workflows/test-indicator.yml | 1 + .github/workflows/test-indicators-bitwise.yml | 1 + .github/workflows/test-indicators-ohlc.yml | 1 + .github/workflows/test-indicators-price.yml | 1 + .github/workflows/test-indicators-special.yml | 1 + .github/workflows/test-indicators-tick.yml | 1 + .github/workflows/test-indicators.yml | 1 + .github/workflows/test-serializer.yml | 1 + .github/workflows/test.yml | 1 + 9 files changed, 9 insertions(+) diff --git a/.github/workflows/test-indicator.yml b/.github/workflows/test-indicator.yml index 21f28dbed..065ccf4f6 100644 --- a/.github/workflows/test-indicator.yml +++ b/.github/workflows/test-indicator.yml @@ -67,6 +67,7 @@ jobs: BtDays: 4-8 BtMonths: 1 BtYears: 2021 + GitHubApiToken: ${{ github.token }} MtVersion: 4.0.0.1359 RunOnError: show_logs 200 TestExpert: ${{ matrix.test }} diff --git a/.github/workflows/test-indicators-bitwise.yml b/.github/workflows/test-indicators-bitwise.yml index 9de6f6730..4ed8a3fc1 100644 --- a/.github/workflows/test-indicators-bitwise.yml +++ b/.github/workflows/test-indicators-bitwise.yml @@ -62,6 +62,7 @@ jobs: BtDays: 4-8 BtMonths: 1 BtYears: 2021 + GitHubApiToken: ${{ github.token }} MtVersion: 4.0.0.1359 RunOnError: show_logs 200 TestExpert: ${{ matrix.test }} diff --git a/.github/workflows/test-indicators-ohlc.yml b/.github/workflows/test-indicators-ohlc.yml index b4e0954d6..ccc7bfd0a 100644 --- a/.github/workflows/test-indicators-ohlc.yml +++ b/.github/workflows/test-indicators-ohlc.yml @@ -61,6 +61,7 @@ jobs: BtDays: 4-8 BtMonths: 1 BtYears: 2021 + GitHubApiToken: ${{ github.token }} MtVersion: 4.0.0.1359 RunOnError: show_logs 200 TestExpert: ${{ matrix.test }} diff --git a/.github/workflows/test-indicators-price.yml b/.github/workflows/test-indicators-price.yml index 5a5c95386..c1c021854 100644 --- a/.github/workflows/test-indicators-price.yml +++ b/.github/workflows/test-indicators-price.yml @@ -61,6 +61,7 @@ jobs: BtDays: 4-8 BtMonths: 1 BtYears: 2021 + GitHubApiToken: ${{ github.token }} MtVersion: 4.0.0.1359 RunOnError: show_logs 200 TestExpert: ${{ matrix.test }} diff --git a/.github/workflows/test-indicators-special.yml b/.github/workflows/test-indicators-special.yml index 9e3236582..72b995e0b 100644 --- a/.github/workflows/test-indicators-special.yml +++ b/.github/workflows/test-indicators-special.yml @@ -61,6 +61,7 @@ jobs: BtDays: 4-8 BtMonths: 1 BtYears: 2021 + GitHubApiToken: ${{ github.token }} MtVersion: 4.0.0.1359 RunOnError: show_logs 200 TestExpert: ${{ matrix.test }} diff --git a/.github/workflows/test-indicators-tick.yml b/.github/workflows/test-indicators-tick.yml index 2b242db2b..85823f61c 100644 --- a/.github/workflows/test-indicators-tick.yml +++ b/.github/workflows/test-indicators-tick.yml @@ -61,6 +61,7 @@ jobs: BtDays: 4-8 BtMonths: 1 BtYears: 2021 + GitHubApiToken: ${{ github.token }} MtVersion: 4.0.0.1359 RunOnError: show_logs 200 TestExpert: ${{ matrix.test }} diff --git a/.github/workflows/test-indicators.yml b/.github/workflows/test-indicators.yml index 994731844..197901e14 100644 --- a/.github/workflows/test-indicators.yml +++ b/.github/workflows/test-indicators.yml @@ -125,6 +125,7 @@ jobs: BtDays: 4-8 BtMonths: 1 BtYears: 2021 + GitHubApiToken: ${{ github.token }} MtVersion: 4.0.0.1359 RunOnError: show_logs 200 TestExpert: ${{ matrix.test }} diff --git a/.github/workflows/test-serializer.yml b/.github/workflows/test-serializer.yml index b01836f88..b89b31338 100644 --- a/.github/workflows/test-serializer.yml +++ b/.github/workflows/test-serializer.yml @@ -59,6 +59,7 @@ jobs: BtDays: 4-8 BtMonths: 1 BtYears: 2021 + GitHubApiToken: ${{ github.token }} MtVersion: 4.0.0.1359 RunOnError: show_logs 200 TestExpert: ${{ matrix.test }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 27d9e8261..b8c97ac62 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -80,6 +80,7 @@ jobs: BtDays: 4-12 BtMonths: 1 BtYears: 2021 + GitHubApiToken: ${{ github.token }} MtVersion: 4.0.0.1349 TestExpert: ${{ matrix.test }} RunOnError: show_logs 200 From 9c488efa9779dd142964b415e9365c60bec42eba Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 14:34:19 +0100 Subject: [PATCH 003/109] GHA: Drops MtVersion so it is run by default version --- .github/workflows/test-indicator.yml | 1 - .github/workflows/test-indicators-bitwise.yml | 1 - .github/workflows/test-indicators-ohlc.yml | 1 - .github/workflows/test-indicators-price.yml | 1 - .github/workflows/test-indicators-special.yml | 1 - .github/workflows/test-indicators-tick.yml | 1 - .github/workflows/test-indicators.yml | 1 - .github/workflows/test-serializer.yml | 1 - .github/workflows/test.yml | 1 - 9 files changed, 9 deletions(-) diff --git a/.github/workflows/test-indicator.yml b/.github/workflows/test-indicator.yml index 065ccf4f6..982d91e80 100644 --- a/.github/workflows/test-indicator.yml +++ b/.github/workflows/test-indicator.yml @@ -68,7 +68,6 @@ jobs: BtMonths: 1 BtYears: 2021 GitHubApiToken: ${{ github.token }} - MtVersion: 4.0.0.1359 RunOnError: show_logs 200 TestExpert: ${{ matrix.test }} timeout-minutes: 10 diff --git a/.github/workflows/test-indicators-bitwise.yml b/.github/workflows/test-indicators-bitwise.yml index 4ed8a3fc1..53a54f4f3 100644 --- a/.github/workflows/test-indicators-bitwise.yml +++ b/.github/workflows/test-indicators-bitwise.yml @@ -63,7 +63,6 @@ jobs: BtMonths: 1 BtYears: 2021 GitHubApiToken: ${{ github.token }} - MtVersion: 4.0.0.1359 RunOnError: show_logs 200 TestExpert: ${{ matrix.test }} timeout-minutes: 10 diff --git a/.github/workflows/test-indicators-ohlc.yml b/.github/workflows/test-indicators-ohlc.yml index ccc7bfd0a..a181f5b97 100644 --- a/.github/workflows/test-indicators-ohlc.yml +++ b/.github/workflows/test-indicators-ohlc.yml @@ -62,7 +62,6 @@ jobs: BtMonths: 1 BtYears: 2021 GitHubApiToken: ${{ github.token }} - MtVersion: 4.0.0.1359 RunOnError: show_logs 200 TestExpert: ${{ matrix.test }} timeout-minutes: 10 diff --git a/.github/workflows/test-indicators-price.yml b/.github/workflows/test-indicators-price.yml index c1c021854..06208bf70 100644 --- a/.github/workflows/test-indicators-price.yml +++ b/.github/workflows/test-indicators-price.yml @@ -62,7 +62,6 @@ jobs: BtMonths: 1 BtYears: 2021 GitHubApiToken: ${{ github.token }} - MtVersion: 4.0.0.1359 RunOnError: show_logs 200 TestExpert: ${{ matrix.test }} timeout-minutes: 10 diff --git a/.github/workflows/test-indicators-special.yml b/.github/workflows/test-indicators-special.yml index 72b995e0b..fb71a0844 100644 --- a/.github/workflows/test-indicators-special.yml +++ b/.github/workflows/test-indicators-special.yml @@ -62,7 +62,6 @@ jobs: BtMonths: 1 BtYears: 2021 GitHubApiToken: ${{ github.token }} - MtVersion: 4.0.0.1359 RunOnError: show_logs 200 TestExpert: ${{ matrix.test }} timeout-minutes: 10 diff --git a/.github/workflows/test-indicators-tick.yml b/.github/workflows/test-indicators-tick.yml index 85823f61c..f19239218 100644 --- a/.github/workflows/test-indicators-tick.yml +++ b/.github/workflows/test-indicators-tick.yml @@ -62,7 +62,6 @@ jobs: BtMonths: 1 BtYears: 2021 GitHubApiToken: ${{ github.token }} - MtVersion: 4.0.0.1359 RunOnError: show_logs 200 TestExpert: ${{ matrix.test }} timeout-minutes: 10 diff --git a/.github/workflows/test-indicators.yml b/.github/workflows/test-indicators.yml index 197901e14..816a52cca 100644 --- a/.github/workflows/test-indicators.yml +++ b/.github/workflows/test-indicators.yml @@ -126,7 +126,6 @@ jobs: BtMonths: 1 BtYears: 2021 GitHubApiToken: ${{ github.token }} - MtVersion: 4.0.0.1359 RunOnError: show_logs 200 TestExpert: ${{ matrix.test }} timeout-minutes: 10 diff --git a/.github/workflows/test-serializer.yml b/.github/workflows/test-serializer.yml index b89b31338..e532a8729 100644 --- a/.github/workflows/test-serializer.yml +++ b/.github/workflows/test-serializer.yml @@ -60,7 +60,6 @@ jobs: BtMonths: 1 BtYears: 2021 GitHubApiToken: ${{ github.token }} - MtVersion: 4.0.0.1359 RunOnError: show_logs 200 TestExpert: ${{ matrix.test }} timeout-minutes: 10 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b8c97ac62..d680f548f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -81,7 +81,6 @@ jobs: BtMonths: 1 BtYears: 2021 GitHubApiToken: ${{ github.token }} - MtVersion: 4.0.0.1349 TestExpert: ${{ matrix.test }} RunOnError: show_logs 200 if: always() From 4f73266d84ad0ea01b0e7672be027fdd563eafa0 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 14:41:36 +0100 Subject: [PATCH 004/109] Improves Compile C++ workflow by adding initial Makefile files --- .github/workflows/compile-cpp.yml | 29 ++++++++++++++++------------- Indicators/Price/tests/Makefile | 12 ++++++++++++ Makefile | 16 ++++++++++++++++ 3 files changed, 44 insertions(+), 13 deletions(-) create mode 100644 Indicators/Price/tests/Makefile create mode 100644 Makefile diff --git a/.github/workflows/compile-cpp.yml b/.github/workflows/compile-cpp.yml index 1aecc1521..b3c36af55 100644 --- a/.github/workflows/compile-cpp.yml +++ b/.github/workflows/compile-cpp.yml @@ -6,9 +6,11 @@ on: pull_request: paths-ignore: - '**.md' + - '.github/workflows/compile-cpp.yml' push: paths-ignore: - '**.md' + - '.github/workflows/compile-cpp.yml' jobs: @@ -17,7 +19,7 @@ jobs: filelist: ${{ steps.get-files.outputs.filelist }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set output with list of files id: get-files run: | @@ -27,27 +29,28 @@ jobs: shell: python - name: Display output run: echo ${{ steps.get-files.outputs.filelist }} - - Compile: + Compile-Cpp: runs-on: ubuntu-latest - needs: [FileList] + steps: + - uses: actions/checkout@v3 + - name: Install CPP compiler + uses: rlalik/setup-cpp-compiler@v1.1 + with: + compiler: gcc-latest + - name: Compile via make + run: make + Compile-Emscripten: + runs-on: ubuntu-latest + needs: [Compile-Cpp, FileList] strategy: matrix: file: ${{ fromJson(needs.FileList.outputs.filelist) }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install Emscripten toolchain uses: mymindstorm/setup-emsdk@v11 - - name: Install CPP compiler - uses: rlalik/setup-cpp-compiler@v1.1 - with: - compiler: gcc-latest - name: Compile ${{ matrix.file }} via emcc - if: always() run: > emcc -s WASM=1 -s ENVIRONMENT=node -s EXIT_RUNTIME=0 -s NO_EXIT_RUNTIME=1 -s ASSERTIONS=1 -Wall -s MODULARIZE=1 -s ERROR_ON_UNDEFINED_SYMBOLS=0 --bind -s EXPORTED_FUNCTIONS="[]" -g -std=c++17 "${{ matrix.file }}" - - name: Compile ${{ matrix.file }} via g++ - if: always() - run: g++ -g -std=c++17 -c "${{ matrix.file }}" diff --git a/Indicators/Price/tests/Makefile b/Indicators/Price/tests/Makefile new file mode 100644 index 000000000..e792364f0 --- /dev/null +++ b/Indicators/Price/tests/Makefile @@ -0,0 +1,12 @@ +CC := g++ # C++ compiler +CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags +SRCS := $(wildcard *.cpp) # Get all .cpp files in the current directory +OBJS := $(SRCS:.cpp=.o) # Object files corresponding to the source files + +all: $(OBJS) + +%.o: %.cpp + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -v $(OBJS) diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..124131f7f --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ +CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags +MAKEFILES := $(wildcard **/tests/Makefile) + +.PHONY: all + +all: $(MAKEFILES) + @for makefile in $(MAKEFILES); do \ + echo "Compiling $$makefile"; \ + $(MAKE) -C $$(dirname $$makefile) CFLAGS="$(CFLAGS)"; \ + done + +clean: $(MAKEFILES) + @for makefile in $(MAKEFILES); do \ + echo "Compiling $$makefile"; \ + $(MAKE) -C $$(dirname $$makefile) clean; \ + done From 6e63c446714f9e87d1c6f70a08755169e2abd46a Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 14:54:59 +0100 Subject: [PATCH 005/109] Renames GHA workflow from Compile to Compile MQL --- .github/workflows/{compile.yml => compile-mql.yml} | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) rename .github/workflows/{compile.yml => compile-mql.yml} (80%) diff --git a/.github/workflows/compile.yml b/.github/workflows/compile-mql.yml similarity index 80% rename from .github/workflows/compile.yml rename to .github/workflows/compile-mql.yml index ee997c3c7..9e257e22f 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile-mql.yml @@ -1,18 +1,20 @@ --- -name: Compile +name: Compile MQL # yamllint disable-line rule:truthy on: pull_request: paths-ignore: - '**.md' + - '.github/workflows/compile-mql.yml' push: paths-ignore: - '**.md' + - '.github/workflows/compile-mql.yml' jobs: - Compile: + Compile-MQL: runs-on: windows-latest steps: - uses: actions/checkout@v2 From 2e143f94391a66a184fd0a3cc80a08c112174965 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 15:09:18 +0100 Subject: [PATCH 006/109] Adds initial Makefile files --- Account/tests/Makefile | 12 ++++++++++++ Exchange/tests/Makefile | 12 ++++++++++++ Indicator/tests/Makefile | 12 ++++++++++++ Indicators/Bitwise/tests/Makefile | 12 ++++++++++++ Indicators/OHLC/tests/Makefile | 12 ++++++++++++ Indicators/Special/tests/Makefile | 12 ++++++++++++ Indicators/Tick/tests/Makefile | 12 ++++++++++++ Indicators/tests/Makefile | 12 ++++++++++++ Serializer/tests/Makefile | 12 ++++++++++++ Storage/Dict/Buffer/tests/Makefile | 12 ++++++++++++ Storage/Dict/tests/Makefile | 12 ++++++++++++ Storage/tests/Makefile | 12 ++++++++++++ Task/tests/Makefile | 12 ++++++++++++ Tick/tests/Makefile | 12 ++++++++++++ Trade/tests/Makefile | 12 ++++++++++++ tests/Makefile | 12 ++++++++++++ 16 files changed, 192 insertions(+) create mode 100644 Account/tests/Makefile create mode 100644 Exchange/tests/Makefile create mode 100644 Indicator/tests/Makefile create mode 100644 Indicators/Bitwise/tests/Makefile create mode 100644 Indicators/OHLC/tests/Makefile create mode 100644 Indicators/Special/tests/Makefile create mode 100644 Indicators/Tick/tests/Makefile create mode 100644 Indicators/tests/Makefile create mode 100644 Serializer/tests/Makefile create mode 100644 Storage/Dict/Buffer/tests/Makefile create mode 100644 Storage/Dict/tests/Makefile create mode 100644 Storage/tests/Makefile create mode 100644 Task/tests/Makefile create mode 100644 Tick/tests/Makefile create mode 100644 Trade/tests/Makefile create mode 100644 tests/Makefile diff --git a/Account/tests/Makefile b/Account/tests/Makefile new file mode 100644 index 000000000..e792364f0 --- /dev/null +++ b/Account/tests/Makefile @@ -0,0 +1,12 @@ +CC := g++ # C++ compiler +CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags +SRCS := $(wildcard *.cpp) # Get all .cpp files in the current directory +OBJS := $(SRCS:.cpp=.o) # Object files corresponding to the source files + +all: $(OBJS) + +%.o: %.cpp + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -v $(OBJS) diff --git a/Exchange/tests/Makefile b/Exchange/tests/Makefile new file mode 100644 index 000000000..e792364f0 --- /dev/null +++ b/Exchange/tests/Makefile @@ -0,0 +1,12 @@ +CC := g++ # C++ compiler +CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags +SRCS := $(wildcard *.cpp) # Get all .cpp files in the current directory +OBJS := $(SRCS:.cpp=.o) # Object files corresponding to the source files + +all: $(OBJS) + +%.o: %.cpp + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -v $(OBJS) diff --git a/Indicator/tests/Makefile b/Indicator/tests/Makefile new file mode 100644 index 000000000..e792364f0 --- /dev/null +++ b/Indicator/tests/Makefile @@ -0,0 +1,12 @@ +CC := g++ # C++ compiler +CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags +SRCS := $(wildcard *.cpp) # Get all .cpp files in the current directory +OBJS := $(SRCS:.cpp=.o) # Object files corresponding to the source files + +all: $(OBJS) + +%.o: %.cpp + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -v $(OBJS) diff --git a/Indicators/Bitwise/tests/Makefile b/Indicators/Bitwise/tests/Makefile new file mode 100644 index 000000000..e792364f0 --- /dev/null +++ b/Indicators/Bitwise/tests/Makefile @@ -0,0 +1,12 @@ +CC := g++ # C++ compiler +CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags +SRCS := $(wildcard *.cpp) # Get all .cpp files in the current directory +OBJS := $(SRCS:.cpp=.o) # Object files corresponding to the source files + +all: $(OBJS) + +%.o: %.cpp + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -v $(OBJS) diff --git a/Indicators/OHLC/tests/Makefile b/Indicators/OHLC/tests/Makefile new file mode 100644 index 000000000..e792364f0 --- /dev/null +++ b/Indicators/OHLC/tests/Makefile @@ -0,0 +1,12 @@ +CC := g++ # C++ compiler +CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags +SRCS := $(wildcard *.cpp) # Get all .cpp files in the current directory +OBJS := $(SRCS:.cpp=.o) # Object files corresponding to the source files + +all: $(OBJS) + +%.o: %.cpp + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -v $(OBJS) diff --git a/Indicators/Special/tests/Makefile b/Indicators/Special/tests/Makefile new file mode 100644 index 000000000..e792364f0 --- /dev/null +++ b/Indicators/Special/tests/Makefile @@ -0,0 +1,12 @@ +CC := g++ # C++ compiler +CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags +SRCS := $(wildcard *.cpp) # Get all .cpp files in the current directory +OBJS := $(SRCS:.cpp=.o) # Object files corresponding to the source files + +all: $(OBJS) + +%.o: %.cpp + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -v $(OBJS) diff --git a/Indicators/Tick/tests/Makefile b/Indicators/Tick/tests/Makefile new file mode 100644 index 000000000..e792364f0 --- /dev/null +++ b/Indicators/Tick/tests/Makefile @@ -0,0 +1,12 @@ +CC := g++ # C++ compiler +CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags +SRCS := $(wildcard *.cpp) # Get all .cpp files in the current directory +OBJS := $(SRCS:.cpp=.o) # Object files corresponding to the source files + +all: $(OBJS) + +%.o: %.cpp + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -v $(OBJS) diff --git a/Indicators/tests/Makefile b/Indicators/tests/Makefile new file mode 100644 index 000000000..e792364f0 --- /dev/null +++ b/Indicators/tests/Makefile @@ -0,0 +1,12 @@ +CC := g++ # C++ compiler +CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags +SRCS := $(wildcard *.cpp) # Get all .cpp files in the current directory +OBJS := $(SRCS:.cpp=.o) # Object files corresponding to the source files + +all: $(OBJS) + +%.o: %.cpp + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -v $(OBJS) diff --git a/Serializer/tests/Makefile b/Serializer/tests/Makefile new file mode 100644 index 000000000..e792364f0 --- /dev/null +++ b/Serializer/tests/Makefile @@ -0,0 +1,12 @@ +CC := g++ # C++ compiler +CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags +SRCS := $(wildcard *.cpp) # Get all .cpp files in the current directory +OBJS := $(SRCS:.cpp=.o) # Object files corresponding to the source files + +all: $(OBJS) + +%.o: %.cpp + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -v $(OBJS) diff --git a/Storage/Dict/Buffer/tests/Makefile b/Storage/Dict/Buffer/tests/Makefile new file mode 100644 index 000000000..e792364f0 --- /dev/null +++ b/Storage/Dict/Buffer/tests/Makefile @@ -0,0 +1,12 @@ +CC := g++ # C++ compiler +CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags +SRCS := $(wildcard *.cpp) # Get all .cpp files in the current directory +OBJS := $(SRCS:.cpp=.o) # Object files corresponding to the source files + +all: $(OBJS) + +%.o: %.cpp + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -v $(OBJS) diff --git a/Storage/Dict/tests/Makefile b/Storage/Dict/tests/Makefile new file mode 100644 index 000000000..e792364f0 --- /dev/null +++ b/Storage/Dict/tests/Makefile @@ -0,0 +1,12 @@ +CC := g++ # C++ compiler +CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags +SRCS := $(wildcard *.cpp) # Get all .cpp files in the current directory +OBJS := $(SRCS:.cpp=.o) # Object files corresponding to the source files + +all: $(OBJS) + +%.o: %.cpp + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -v $(OBJS) diff --git a/Storage/tests/Makefile b/Storage/tests/Makefile new file mode 100644 index 000000000..e792364f0 --- /dev/null +++ b/Storage/tests/Makefile @@ -0,0 +1,12 @@ +CC := g++ # C++ compiler +CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags +SRCS := $(wildcard *.cpp) # Get all .cpp files in the current directory +OBJS := $(SRCS:.cpp=.o) # Object files corresponding to the source files + +all: $(OBJS) + +%.o: %.cpp + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -v $(OBJS) diff --git a/Task/tests/Makefile b/Task/tests/Makefile new file mode 100644 index 000000000..e792364f0 --- /dev/null +++ b/Task/tests/Makefile @@ -0,0 +1,12 @@ +CC := g++ # C++ compiler +CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags +SRCS := $(wildcard *.cpp) # Get all .cpp files in the current directory +OBJS := $(SRCS:.cpp=.o) # Object files corresponding to the source files + +all: $(OBJS) + +%.o: %.cpp + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -v $(OBJS) diff --git a/Tick/tests/Makefile b/Tick/tests/Makefile new file mode 100644 index 000000000..e792364f0 --- /dev/null +++ b/Tick/tests/Makefile @@ -0,0 +1,12 @@ +CC := g++ # C++ compiler +CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags +SRCS := $(wildcard *.cpp) # Get all .cpp files in the current directory +OBJS := $(SRCS:.cpp=.o) # Object files corresponding to the source files + +all: $(OBJS) + +%.o: %.cpp + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -v $(OBJS) diff --git a/Trade/tests/Makefile b/Trade/tests/Makefile new file mode 100644 index 000000000..e792364f0 --- /dev/null +++ b/Trade/tests/Makefile @@ -0,0 +1,12 @@ +CC := g++ # C++ compiler +CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags +SRCS := $(wildcard *.cpp) # Get all .cpp files in the current directory +OBJS := $(SRCS:.cpp=.o) # Object files corresponding to the source files + +all: $(OBJS) + +%.o: %.cpp + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -v $(OBJS) diff --git a/tests/Makefile b/tests/Makefile new file mode 100644 index 000000000..e792364f0 --- /dev/null +++ b/tests/Makefile @@ -0,0 +1,12 @@ +CC := g++ # C++ compiler +CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags +SRCS := $(wildcard *.cpp) # Get all .cpp files in the current directory +OBJS := $(SRCS:.cpp=.o) # Object files corresponding to the source files + +all: $(OBJS) + +%.o: %.cpp + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -v $(OBJS) From 07587cf5e69cd376630ee107829368a1aa7a97a2 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 15:14:07 +0100 Subject: [PATCH 007/109] Updates badges in README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d8aaa6f5a..aa4695b24 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,8 @@ [![Tag][github-tag-image]][github-tag-link] [![License][license-image]][license-link] [![Status][gha-image-check-master]][gha-link-check-master] -[![Status][gha-image-lint-master]][gha-link-lint-master] -[![Status][gha-image-test-master]][gha-link-test-master] +[![Status][gha-image-compile-cpp-master]][gha-link-compile-cpp-master] +[![Status][gha-image-compile-mql-master]][gha-link-compile-mql-master] [![Channel][tg-channel-image]][tg-channel-link] [![Twitter][twitter-image]][twitter-link] @@ -442,11 +442,11 @@ Multiple measurements: [gha-link-check-master]: https://github.com/EA31337/EA31337-classes/actions?query=workflow%3ACheck+branch%3Amaster [gha-image-check-master]: https://github.com/EA31337/EA31337-classes/workflows/Check/badge.svg -[gha-link-lint-master]: https://github.com/EA31337/EA31337-classes/actions?query=workflow%3ALint+branch%3Amaster -[gha-image-lint-master]: https://github.com/EA31337/EA31337-classes/workflows/Lint/badge.svg +[gha-link-compile-cpp-master]: https://github.com/EA31337/EA31337-classes/actions/workflows/compile-cpp.yml?query=branch%3Amaster +[gha-image-compile-cpp-master]: https://github.com/EA31337/EA31337-classes/actions/workflows/compile-cpp.yml/badge.svg -[gha-link-test-master]: https://github.com/EA31337/EA31337-classes/actions?query=workflow%3ATest+branch%3Amaster -[gha-image-test-master]: https://github.com/EA31337/EA31337-classes/workflows/Test/badge.svg +[gha-link-compile-mql-master]: https://github.com/EA31337/EA31337-classes/actions/workflows/compile-mql.yml?query=branch%3Amaster +[gha-image-compile-mql-master]: https://github.com/EA31337/EA31337-classes/actions/workflows/compile-mql.yml/badge.svg [tg-channel-image]: https://img.shields.io/badge/Telegram-join-0088CC.svg?logo=telegram [tg-channel-link]: https://t.me/EA31337 From 022e5247820046eaad7a51487f3936161e747241 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 15:16:16 +0100 Subject: [PATCH 008/109] Adds initial .test.cpp compilation tests --- Account/tests/Account.test.cpp | 36 +++++++++++ Account/tests/AccountForex.test.cpp | 36 +++++++++++ Account/tests/AccountMt.test.cpp | 36 +++++++++++ Exchange/tests/Exchange.test.cpp | 36 +++++++++++ Indicator/tests/IndicatorBase.test.cpp | 36 +++++++++++ Indicators/Price/tests/Indi_Price.test.cpp | 36 +++++++++++ Indicators/tests/DrawIndicator.test.cpp | 36 +++++++++++ Serializer/tests/Serializable.test.cpp | 36 +++++++++++ Storage/tests/Collection.test.cpp | 73 ++++++++++++++++++++++ Tick/tests/TickManager.test.cpp | 31 +++++++++ 10 files changed, 392 insertions(+) create mode 100644 Account/tests/Account.test.cpp create mode 100644 Account/tests/AccountForex.test.cpp create mode 100644 Account/tests/AccountMt.test.cpp create mode 100644 Exchange/tests/Exchange.test.cpp create mode 100644 Indicator/tests/IndicatorBase.test.cpp create mode 100644 Indicators/Price/tests/Indi_Price.test.cpp create mode 100644 Indicators/tests/DrawIndicator.test.cpp create mode 100644 Serializer/tests/Serializable.test.cpp create mode 100644 Storage/tests/Collection.test.cpp create mode 100644 Tick/tests/TickManager.test.cpp diff --git a/Account/tests/Account.test.cpp b/Account/tests/Account.test.cpp new file mode 100644 index 000000000..2a21e9711 --- /dev/null +++ b/Account/tests/Account.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test C++ compilation of Account class. + */ + +// Includes. +#include "../Account.h" +#include "../../Platform.h" + +int main(int argc, char **argv) { + + // @todo + + return 0; +} diff --git a/Account/tests/AccountForex.test.cpp b/Account/tests/AccountForex.test.cpp new file mode 100644 index 000000000..2e1cdf4ad --- /dev/null +++ b/Account/tests/AccountForex.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test C++ compilation of AccountForex class. + */ + +// Includes. +#include "../AccountForex.h" +#include "../../Platform.h" + +int main(int argc, char **argv) { + + // @todo + + return 0; +} diff --git a/Account/tests/AccountMt.test.cpp b/Account/tests/AccountMt.test.cpp new file mode 100644 index 000000000..79707d3c6 --- /dev/null +++ b/Account/tests/AccountMt.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test C++ compilation of AccountMt class. + */ + +// Includes. +#include "../AccountMt.h" +#include "../../Platform.h" + +int main(int argc, char **argv) { + + // @todo + + return 0; +} diff --git a/Exchange/tests/Exchange.test.cpp b/Exchange/tests/Exchange.test.cpp new file mode 100644 index 000000000..91dd1310f --- /dev/null +++ b/Exchange/tests/Exchange.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test C++ compilation of Exchange class. + */ + +// Includes. +#include "../Exchange.h" +#include "../../Platform.h" + +int main(int argc, char **argv) { + + // @todo + + return 0; +} diff --git a/Indicator/tests/IndicatorBase.test.cpp b/Indicator/tests/IndicatorBase.test.cpp new file mode 100644 index 000000000..94d03caa3 --- /dev/null +++ b/Indicator/tests/IndicatorBase.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test C++ compilation of IndicatorBase class. + */ + +// Includes. +#include "../IndicatorBase.h" +#include "../../Platform.h" + +int main(int argc, char **argv) { + + // @todo + + return 0; +} diff --git a/Indicators/Price/tests/Indi_Price.test.cpp b/Indicators/Price/tests/Indi_Price.test.cpp new file mode 100644 index 000000000..bb20bc606 --- /dev/null +++ b/Indicators/Price/tests/Indi_Price.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_Price indicator class. + */ + +// Includes. +#include "../Indi_Price.mqh" +#include "../../../Platform.h" + +int main(int argc, char **argv) { + + // @todo + + return 0; +} diff --git a/Indicators/tests/DrawIndicator.test.cpp b/Indicators/tests/DrawIndicator.test.cpp new file mode 100644 index 000000000..7c79b9f35 --- /dev/null +++ b/Indicators/tests/DrawIndicator.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test C++ compilation of DrawIndicator class. + */ + +// Includes. +#include "../DrawIndicator.mqh" +#include "../../Platform.h" + +int main(int argc, char **argv) { + + // @todo + + return 0; +} diff --git a/Serializer/tests/Serializable.test.cpp b/Serializer/tests/Serializable.test.cpp new file mode 100644 index 000000000..5d4c20047 --- /dev/null +++ b/Serializer/tests/Serializable.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test C++ compilation of Serializable class. + */ + +// Includes. +#include "../Serializable.h" +#include "../../Platform.h" + +int main(int argc, char **argv) { + + // @todo + + return 0; +} diff --git a/Storage/tests/Collection.test.cpp b/Storage/tests/Collection.test.cpp new file mode 100644 index 000000000..7096c99da --- /dev/null +++ b/Storage/tests/Collection.test.cpp @@ -0,0 +1,73 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test C++ compilation of Collection class. + */ + +// Includes. +#include "../Collection.h" + +// Define classes. +class Stack : public Object { + public: + virtual string GetName() = 0; +}; +class Foo : public Stack { + public: + string GetName() { return "Foo"; }; + double GetWeight() { return 0; }; +}; +class Bar : public Stack { + public: + string GetName() { return "Bar"; }; + double GetWeight() { return 1; }; +}; +class Baz : public Stack { + public: + string GetName() { return "Baz"; }; + double GetWeight() { return 2; }; +}; + +int main(int argc, char **argv) { + // Define and add items. + Collection *stack = new Collection(); + /* @fixme + stack.Add(new Foo); + stack.Add(new Bar); + stack.Add(new Baz); + + // Print the lowest and the highest items. + Print("Lowest: ", ((Stack *)stack.GetLowest()).GetName()); + Print("Highest: ", ((Stack *)stack.GetHighest()).GetName()); + // Print all items. + int i; + for (i = 0; i < stack.GetSize(); i++) { + Print(i, ": ", ((Stack *)stack.GetByIndex(i)).GetName()); + } + */ + + // Clean up. + Object::Delete(stack); + + return 0; +} diff --git a/Tick/tests/TickManager.test.cpp b/Tick/tests/TickManager.test.cpp new file mode 100644 index 000000000..e0872beaa --- /dev/null +++ b/Tick/tests/TickManager.test.cpp @@ -0,0 +1,31 @@ +//+------------------------------------------------------------------+ +//| 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 . + */ + +/** + * @file + * Test C++ compilation of TickManager class. + */ + +// Includes. +#include "../TickManager.h" +#include "../../Platform.h" + +int main(int argc, char **argv) {} From 8af95cd1d0da5bf368f90dc144cd9ef43e771c72 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 15:19:26 +0100 Subject: [PATCH 009/109] Adds pragma once to Tick/TickManager.h --- Tick/TickManager.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Tick/TickManager.h b/Tick/TickManager.h index ec423bfa3..dde71ff9d 100644 --- a/Tick/TickManager.h +++ b/Tick/TickManager.h @@ -25,6 +25,11 @@ * Implements TickManager class. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Storage/Dict/Buffer/BufferStruct.h" #include "Tick.struct.h" From 9c7489d8a7ee8955eb0d49bf1a04de33b0d9dc9b Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 15:19:41 +0100 Subject: [PATCH 010/109] Adds .o files to Git ignore list --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 3883ac4b4..d21efcaed 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ docs/api/build # Ignores compiled binary files. *.ex? +*.o # Ignores log files. *.log From 319c7da397ae9174e14b84f036a12870534b38c1 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 16:13:03 +0100 Subject: [PATCH 011/109] Renames MA, Price, Bands, Envelopes and SAR indicators to sub directories --- .github/workflows/test-indicators-price.yml | 1 + .../workflows/test-indicators-pricerange.yml | 69 +++++++++++++++++++ .github/workflows/test-indicators.yml | 3 - 3D/Chart3D.h | 2 +- Indicator/tests/IndicatorRenko.test.mq5 | 2 +- Indicator/tests/IndicatorTf.test.mq5 | 2 +- Indicators/Bitwise/Indi_Candle.mqh | 2 +- Indicators/Bitwise/Indi_Pattern.mqh | 2 +- Indicators/Indi_ADX.mqh | 2 +- Indicators/Indi_ADXW.mqh | 2 +- Indicators/Indi_AMA.mqh | 2 +- Indicators/Indi_CCI.mqh | 4 +- Indicators/Indi_CHO.mqh | 2 +- Indicators/Indi_CHV.mqh | 2 +- Indicators/Indi_ColorLine.mqh | 2 +- Indicators/Indi_DEMA.mqh | 4 +- Indicators/Indi_Demo.mqh | 2 +- Indicators/Indi_DetrendedPrice.mqh | 2 +- Indicators/Indi_Drawer.mqh | 2 +- Indicators/Indi_MassIndex.mqh | 2 +- Indicators/Indi_RSI.mqh | 2 +- Indicators/Indi_StdDev.mqh | 2 +- Indicators/Indi_TEMA.mqh | 2 +- Indicators/Indi_TRIX.mqh | 2 +- Indicators/Indi_UltimateOscillator.mqh | 2 +- Indicators/{Indi_MA.mqh => Price/Indi_MA.h} | 20 +++--- .../Price/{Indi_Price.mqh => Indi_Price.h} | 0 Indicators/Price/includes.h | 3 +- Indicators/{ => Price}/tests/Indi_MA.test.mq4 | 0 Indicators/{ => Price}/tests/Indi_MA.test.mq5 | 6 +- Indicators/Price/tests/Indi_Price.test.cpp | 2 +- Indicators/Price/tests/Indi_Price.test.mq5 | 2 +- .../Indi_Bands.h} | 16 ++--- .../Indi_Envelopes.h} | 10 +-- .../{Indi_SAR.mqh => PriceRange/Indi_SAR.h} | 2 +- Indicators/PriceRange/includes.h | 31 +++++++++ .../tests/Indi_Bands.test.mq4 | 0 .../tests/Indi_Bands.test.mq5 | 6 +- .../tests/Indi_Envelopes.test.mq4 | 0 .../tests/Indi_Envelopes.test.mq5 | 6 +- .../{ => PriceRange}/tests/Indi_SAR.test.mq4 | 0 .../{ => PriceRange}/tests/Indi_SAR.test.mq5 | 6 +- .../Tick/{Indi_TickMt.mqh => Indi_TickMt.h} | 0 ...{Indi_TickRandom.mqh => Indi_TickRandom.h} | 0 Indicators/Tick/includes.h | 31 +++++++++ Indicators/Tick/tests/Indi_TickMt.test.mq5 | 2 +- Indicators/includes.h | 11 +-- Indicators/tests/DrawIndicator.test.mq5 | 6 +- Indicators/tests/Indi_AppliedPrice.test.mq5 | 2 +- Platform.h | 2 +- README.md | 8 +-- Storage/tests/ValueStorage.test.mq5 | 4 +- tests/CompileIndicatorsTest.mq5 | 1 + tests/IndicatorsTest.mq5 | 2 +- tests/StrategyTest-RSI.mq5 | 2 +- tests/TickerTest.mq5 | 2 +- tests/TradeTest.mq5 | 2 +- 57 files changed, 220 insertions(+), 86 deletions(-) create mode 100644 .github/workflows/test-indicators-pricerange.yml rename Indicators/{Indi_MA.mqh => Price/Indi_MA.h} (98%) rename Indicators/Price/{Indi_Price.mqh => Indi_Price.h} (100%) rename Indicators/{ => Price}/tests/Indi_MA.test.mq4 (100%) rename Indicators/{ => Price}/tests/Indi_MA.test.mq5 (93%) rename Indicators/{Indi_Bands.mqh => PriceRange/Indi_Bands.h} (98%) rename Indicators/{Indi_Envelopes.mqh => PriceRange/Indi_Envelopes.h} (98%) rename Indicators/{Indi_SAR.mqh => PriceRange/Indi_SAR.h} (99%) create mode 100644 Indicators/PriceRange/includes.h rename Indicators/{ => PriceRange}/tests/Indi_Bands.test.mq4 (100%) rename Indicators/{ => PriceRange}/tests/Indi_Bands.test.mq5 (92%) rename Indicators/{ => PriceRange}/tests/Indi_Envelopes.test.mq4 (100%) rename Indicators/{ => PriceRange}/tests/Indi_Envelopes.test.mq5 (92%) rename Indicators/{ => PriceRange}/tests/Indi_SAR.test.mq4 (100%) rename Indicators/{ => PriceRange}/tests/Indi_SAR.test.mq5 (93%) rename Indicators/Tick/{Indi_TickMt.mqh => Indi_TickMt.h} (100%) rename Indicators/Tick/{Indi_TickRandom.mqh => Indi_TickRandom.h} (100%) create mode 100644 Indicators/Tick/includes.h diff --git a/.github/workflows/test-indicators-price.yml b/.github/workflows/test-indicators-price.yml index 06208bf70..758c0ab45 100644 --- a/.github/workflows/test-indicators-price.yml +++ b/.github/workflows/test-indicators-price.yml @@ -50,6 +50,7 @@ jobs: strategy: matrix: test: + - Indi_MA.test - Indi_Price.test steps: - uses: actions/download-artifact@v2 diff --git a/.github/workflows/test-indicators-pricerange.yml b/.github/workflows/test-indicators-pricerange.yml new file mode 100644 index 000000000..df8578743 --- /dev/null +++ b/.github/workflows/test-indicators-pricerange.yml @@ -0,0 +1,69 @@ +--- +name: Test Indicators (PriceRange) + +# yamllint disable-line rule:truthy +on: + pull_request: + paths: + - 'Indicator**' + - 'Indicators/PriceRange/**' + - '.github/workflows/test-indicators-pricerange.yml' + push: + paths: + - 'Indicator**' + - 'Indicators/Price/**' + - '.github/workflows/test-indicators-pricerange.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: 'Indicators/PriceRange/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' + + Tests-MQL4: + defaults: + run: + shell: bash + working-directory: Indicators/Price/tests + needs: Compile + runs-on: ubuntu-latest + strategy: + matrix: + test: + - Indi_Bands.test + - Indi_Envelopes.test + - Indi_SAR.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 + GitHubApiToken: ${{ github.token }} + RunOnError: show_logs 200 + TestExpert: ${{ matrix.test }} + timeout-minutes: 10 diff --git a/.github/workflows/test-indicators.yml b/.github/workflows/test-indicators.yml index 816a52cca..994bee491 100644 --- a/.github/workflows/test-indicators.yml +++ b/.github/workflows/test-indicators.yml @@ -63,7 +63,6 @@ jobs: - Indi_AppliedPrice.test - Indi_BWMFI.test - Indi_BWZT.test - - Indi_Bands.test - Indi_BearsPower.test - Indi_BullsPower.test - Indi_CCI.test @@ -77,7 +76,6 @@ jobs: - Indi_Demo.test - Indi_DetrendedPrice.test - Indi_Drawer.test - - Indi_Envelopes.test - Indi_Force.test - Indi_FractalAdaptiveMA.test - Indi_Fractals.test @@ -100,7 +98,6 @@ jobs: - Indi_RSI.test - Indi_RVI.test - Indi_RateOfChange.test - - Indi_SAR.test - Indi_StdDev.test - Indi_Stochastic.test - Indi_TEMA.test diff --git a/3D/Chart3D.h b/3D/Chart3D.h index 6dc5e3c42..051a3e12d 100644 --- a/3D/Chart3D.h +++ b/3D/Chart3D.h @@ -27,7 +27,7 @@ #include "../Bar.struct.h" #include "../Indicator/IndicatorData.h" -#include "../Indicators/Indi_MA.mqh" +#include "../Indicators/Price/Indi_MA.h" #include "../Instances.h" #include "../Refs.mqh" #include "../Serializer/SerializerConverter.h" diff --git a/Indicator/tests/IndicatorRenko.test.mq5 b/Indicator/tests/IndicatorRenko.test.mq5 index 80ff7d3b5..c54d2cfcc 100644 --- a/Indicator/tests/IndicatorRenko.test.mq5 +++ b/Indicator/tests/IndicatorRenko.test.mq5 @@ -28,7 +28,7 @@ // Includes. #include "../../Indicators/Indi_AMA.mqh" -#include "../../Indicators/Tick/Indi_TickMt.mqh" +#include "../../Indicators/Tick/Indi_TickMt.h" #include "../../Platform.h" #include "../../Test.mqh" #include "../../Util.h" diff --git a/Indicator/tests/IndicatorTf.test.mq5 b/Indicator/tests/IndicatorTf.test.mq5 index 4bef5c8cd..a5982ce46 100644 --- a/Indicator/tests/IndicatorTf.test.mq5 +++ b/Indicator/tests/IndicatorTf.test.mq5 @@ -29,7 +29,7 @@ // Includes. #include "../../Storage/Dict/DictBase.h" #include "../../Indicators/Indi_AMA.mqh" -#include "../../Indicators/Tick/Indi_TickMt.mqh" +#include "../../Indicators/Tick/Indi_TickMt.h" #include "../../Log.mqh" #include "../../Platform.h" #include "../../SymbolInfo.mqh" diff --git a/Indicators/Bitwise/Indi_Candle.mqh b/Indicators/Bitwise/Indi_Candle.mqh index 34a91e90b..d6f81947e 100644 --- a/Indicators/Bitwise/Indi_Candle.mqh +++ b/Indicators/Bitwise/Indi_Candle.mqh @@ -26,7 +26,7 @@ #include "../../Indicator/Indicator.h" #include "../../Pattern.struct.h" #include "../../Serializer/Serializer.h" -#include "../Price/Indi_Price.mqh" +#include "../Price/Indi_Price.h" #include "../Special/Indi_Math.mqh" // Structs. diff --git a/Indicators/Bitwise/Indi_Pattern.mqh b/Indicators/Bitwise/Indi_Pattern.mqh index eab50c69e..12f313ff2 100644 --- a/Indicators/Bitwise/Indi_Pattern.mqh +++ b/Indicators/Bitwise/Indi_Pattern.mqh @@ -27,7 +27,7 @@ #include "../../Indicator/Indicator.h" #include "../../Pattern.struct.h" #include "../../Serializer/Serializer.h" -#include "../Price/Indi_Price.mqh" +#include "../Price/Indi_Price.h" #include "../Special/Indi_Math.mqh" // Structs. diff --git a/Indicators/Indi_ADX.mqh b/Indicators/Indi_ADX.mqh index 4719f9835..d68d0f8be 100644 --- a/Indicators/Indi_ADX.mqh +++ b/Indicators/Indi_ADX.mqh @@ -22,7 +22,7 @@ // Includes. #include "../Indicator/Indicator.h" -#include "Price/Indi_Price.mqh" +#include "Price/Indi_Price.h" #ifndef __MQL4__ // Defines global functions (for MQL4 backward compability). diff --git a/Indicators/Indi_ADXW.mqh b/Indicators/Indi_ADXW.mqh index 8fcdd6813..9a1049a3c 100644 --- a/Indicators/Indi_ADXW.mqh +++ b/Indicators/Indi_ADXW.mqh @@ -31,7 +31,7 @@ #include "../Storage/ValueStorage.volume.h" #include "../Util.h" #include "Indi_ADX.mqh" -#include "Price/Indi_Price.mqh" +#include "Price/Indi_Price.h" // Structs. struct IndiADXWParams : IndiADXParams { diff --git a/Indicators/Indi_AMA.mqh b/Indicators/Indi_AMA.mqh index f8d065015..3187f1736 100644 --- a/Indicators/Indi_AMA.mqh +++ b/Indicators/Indi_AMA.mqh @@ -24,7 +24,7 @@ #include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.h" -#include "Price/Indi_Price.mqh" +#include "Price/Indi_Price.h" // Structs. struct IndiAMAParams : IndicatorParams { diff --git a/Indicators/Indi_CCI.mqh b/Indicators/Indi_CCI.mqh index 70a2e28fd..d185935b2 100644 --- a/Indicators/Indi_CCI.mqh +++ b/Indicators/Indi_CCI.mqh @@ -22,9 +22,9 @@ // Includes. #include "../Indicator/Indicator.h" -#include "Indi_MA.mqh" +#include "Price/Indi_MA.h" #include "Indi_PriceFeeder.mqh" -#include "Price/Indi_Price.mqh" +#include "Price/Indi_Price.h" #ifndef __MQL4__ // Defines global functions (for MQL4 backward compability). diff --git a/Indicators/Indi_CHO.mqh b/Indicators/Indi_CHO.mqh index a8274b4fb..896a647a8 100644 --- a/Indicators/Indi_CHO.mqh +++ b/Indicators/Indi_CHO.mqh @@ -29,7 +29,7 @@ #include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.all.h" #include "../Util.h" -#include "Indi_MA.mqh" +#include "Price/Indi_MA.h" // Structs. struct IndiCHOParams : IndicatorParams { diff --git a/Indicators/Indi_CHV.mqh b/Indicators/Indi_CHV.mqh index 7e6b04e2a..ddd5dcb83 100644 --- a/Indicators/Indi_CHV.mqh +++ b/Indicators/Indi_CHV.mqh @@ -25,7 +25,7 @@ #include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.all.h" #include "../Util.h" -#include "Indi_MA.mqh" +#include "Price/Indi_MA.h" // Enums. enum ENUM_CHV_SMOOTH_METHOD { CHV_SMOOTH_METHOD_SMA = 0, CHV_SMOOTH_METHOD_EMA = 1 }; diff --git a/Indicators/Indi_ColorLine.mqh b/Indicators/Indi_ColorLine.mqh index e5a9f5a2d..991dda0af 100644 --- a/Indicators/Indi_ColorLine.mqh +++ b/Indicators/Indi_ColorLine.mqh @@ -24,7 +24,7 @@ #include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.all.h" -#include "Indi_MA.mqh" +#include "Price/Indi_MA.h" // Structs. struct IndiColorLineParams : IndicatorParams { diff --git a/Indicators/Indi_DEMA.mqh b/Indicators/Indi_DEMA.mqh index dc6561b63..0f052d214 100644 --- a/Indicators/Indi_DEMA.mqh +++ b/Indicators/Indi_DEMA.mqh @@ -39,8 +39,8 @@ #include "../Storage/Objects.h" #include "../Storage/ValueStorage.h" #include "../Storage/String.h" -#include "Indi_MA.mqh" -#include "Price/Indi_Price.mqh" +#include "Price/Indi_MA.h" +#include "Price/Indi_Price.h" // Structs. struct IndiDEMAParams : IndicatorParams { diff --git a/Indicators/Indi_Demo.mqh b/Indicators/Indi_Demo.mqh index 5b552d92e..c6e48a786 100644 --- a/Indicators/Indi_Demo.mqh +++ b/Indicators/Indi_Demo.mqh @@ -23,7 +23,7 @@ // Includes. #include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" -#include "Price/Indi_Price.mqh" +#include "Price/Indi_Price.h" /** * @file diff --git a/Indicators/Indi_DetrendedPrice.mqh b/Indicators/Indi_DetrendedPrice.mqh index 9a52af26b..528e356a9 100644 --- a/Indicators/Indi_DetrendedPrice.mqh +++ b/Indicators/Indi_DetrendedPrice.mqh @@ -23,7 +23,7 @@ // Includes. #include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" -#include "Indi_MA.mqh" +#include "Price/Indi_MA.h" // Structs. struct IndiDetrendedPriceParams : IndicatorParams { diff --git a/Indicators/Indi_Drawer.mqh b/Indicators/Indi_Drawer.mqh index 1158ab13a..90db2d859 100644 --- a/Indicators/Indi_Drawer.mqh +++ b/Indicators/Indi_Drawer.mqh @@ -26,7 +26,7 @@ #include "../Storage/Redis.h" #include "../Task/TaskAction.h" #include "Indi_Drawer.struct.h" -#include "Price/Indi_Price.mqh" +#include "Price/Indi_Price.h" /** * Implements the Relative Strength Index indicator. diff --git a/Indicators/Indi_MassIndex.mqh b/Indicators/Indi_MassIndex.mqh index 1cc46f082..60adeb55e 100644 --- a/Indicators/Indi_MassIndex.mqh +++ b/Indicators/Indi_MassIndex.mqh @@ -24,7 +24,7 @@ #include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.all.h" -#include "Indi_MA.mqh" +#include "Price/Indi_MA.h" // Structs. struct IndiMassIndexParams : IndicatorParams { diff --git a/Indicators/Indi_RSI.mqh b/Indicators/Indi_RSI.mqh index be4b3fbab..37947741e 100644 --- a/Indicators/Indi_RSI.mqh +++ b/Indicators/Indi_RSI.mqh @@ -23,7 +23,7 @@ // Includes. #include "../Storage/Dict/DictStruct.h" #include "../Indicator/Indicator.h" -#include "Price/Indi_Price.mqh" +#include "Price/Indi_Price.h" // Structs. struct IndiRSIParams : IndicatorParams { diff --git a/Indicators/Indi_StdDev.mqh b/Indicators/Indi_StdDev.mqh index 7de50a928..7c0dec8af 100644 --- a/Indicators/Indi_StdDev.mqh +++ b/Indicators/Indi_StdDev.mqh @@ -30,7 +30,7 @@ // Includes. #include "../Indicator/Indicator.h" #include "../Storage/ObjectsCache.h" -#include "Indi_MA.mqh" +#include "Price/Indi_MA.h" #include "Indi_PriceFeeder.mqh" #ifndef __MQL4__ diff --git a/Indicators/Indi_TEMA.mqh b/Indicators/Indi_TEMA.mqh index 3e7fc47f4..45947c466 100644 --- a/Indicators/Indi_TEMA.mqh +++ b/Indicators/Indi_TEMA.mqh @@ -23,7 +23,7 @@ // Includes. #include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" -#include "Indi_MA.mqh" +#include "Price/Indi_MA.h" // Structs. struct IndiTEMAParams : IndicatorParams { diff --git a/Indicators/Indi_TRIX.mqh b/Indicators/Indi_TRIX.mqh index 1ac05d914..4ec734618 100644 --- a/Indicators/Indi_TRIX.mqh +++ b/Indicators/Indi_TRIX.mqh @@ -23,7 +23,7 @@ // Includes. #include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" -#include "Indi_MA.mqh" +#include "Price/Indi_MA.h" // Structs. struct IndiTRIXParams : IndicatorParams { diff --git a/Indicators/Indi_UltimateOscillator.mqh b/Indicators/Indi_UltimateOscillator.mqh index 14b5ba9a8..65f408fd7 100644 --- a/Indicators/Indi_UltimateOscillator.mqh +++ b/Indicators/Indi_UltimateOscillator.mqh @@ -25,7 +25,7 @@ #include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.all.h" #include "Indi_ATR.mqh" -#include "Indi_MA.mqh" +#include "Price/Indi_MA.h" // Structs. struct IndiUltimateOscillatorParams : IndicatorParams { diff --git a/Indicators/Indi_MA.mqh b/Indicators/Price/Indi_MA.h similarity index 98% rename from Indicators/Indi_MA.mqh rename to Indicators/Price/Indi_MA.h index caffb3707..42da27dbd 100644 --- a/Indicators/Indi_MA.mqh +++ b/Indicators/Price/Indi_MA.h @@ -21,17 +21,17 @@ */ // Prevents processing this includes file for the second time. -#ifndef INDI_MA_MQH -#define INDI_MA_MQH +#ifndef INDI_MA_H +#define INDI_MA_H // Includes. -#include "../Storage/Dict/Dict.h" -#include "../Storage/Dict/DictObject.h" -#include "../Indicator/Indicator.h" -#include "../Refs.mqh" -#include "../Storage/Singleton.h" -#include "../Storage/ValueStorage.h" -#include "../Storage/String.h" +#include "../../Storage/Dict/Dict.h" +#include "../../Storage/Dict/DictObject.h" +#include "../../Indicator/Indicator.h" +#include "../../Refs.mqh" +#include "../../Storage/Singleton.h" +#include "../../Storage/ValueStorage.h" +#include "../../Storage/String.h" #ifndef __MQL4__ // Defines global functions (for MQL4 backward compability). @@ -776,4 +776,4 @@ class Indi_MA : public Indicator { iparams.applied_array = _applied_price; } }; -#endif // INDI_MA_MQH +#endif // INDI_MA_H diff --git a/Indicators/Price/Indi_Price.mqh b/Indicators/Price/Indi_Price.h similarity index 100% rename from Indicators/Price/Indi_Price.mqh rename to Indicators/Price/Indi_Price.h diff --git a/Indicators/Price/includes.h b/Indicators/Price/includes.h index 2186dee41..58a1789de 100644 --- a/Indicators/Price/includes.h +++ b/Indicators/Price/includes.h @@ -26,4 +26,5 @@ */ // Price indicators. -#include "Indi_Price.mqh" +#include "Indi_MA.h" +#include "Indi_Price.h" diff --git a/Indicators/tests/Indi_MA.test.mq4 b/Indicators/Price/tests/Indi_MA.test.mq4 similarity index 100% rename from Indicators/tests/Indi_MA.test.mq4 rename to Indicators/Price/tests/Indi_MA.test.mq4 diff --git a/Indicators/tests/Indi_MA.test.mq5 b/Indicators/Price/tests/Indi_MA.test.mq5 similarity index 93% rename from Indicators/tests/Indi_MA.test.mq5 rename to Indicators/Price/tests/Indi_MA.test.mq5 index 0ae0f3292..530b9b4e2 100644 --- a/Indicators/tests/Indi_MA.test.mq5 +++ b/Indicators/Price/tests/Indi_MA.test.mq5 @@ -20,9 +20,9 @@ */ // Includes. -#include "../../Platform.h" -#include "../../Test.mqh" -#include "../Indi_MA.mqh" +#include "../../../Platform.h" +#include "../../../Test.mqh" +#include "../Indi_MA.h" /** * @file diff --git a/Indicators/Price/tests/Indi_Price.test.cpp b/Indicators/Price/tests/Indi_Price.test.cpp index bb20bc606..7883c7202 100644 --- a/Indicators/Price/tests/Indi_Price.test.cpp +++ b/Indicators/Price/tests/Indi_Price.test.cpp @@ -25,7 +25,7 @@ */ // Includes. -#include "../Indi_Price.mqh" +#include "../Indi_Price.h" #include "../../../Platform.h" int main(int argc, char **argv) { diff --git a/Indicators/Price/tests/Indi_Price.test.mq5 b/Indicators/Price/tests/Indi_Price.test.mq5 index df2042fff..602355ec6 100644 --- a/Indicators/Price/tests/Indi_Price.test.mq5 +++ b/Indicators/Price/tests/Indi_Price.test.mq5 @@ -22,7 +22,7 @@ // Includes. #include "../../../Platform.h" #include "../../../Test.mqh" -#include "../Indi_Price.mqh" +#include "../Indi_Price.h" /** * @file diff --git a/Indicators/Indi_Bands.mqh b/Indicators/PriceRange/Indi_Bands.h similarity index 98% rename from Indicators/Indi_Bands.mqh rename to Indicators/PriceRange/Indi_Bands.h index d3caadf02..9d057f236 100644 --- a/Indicators/Indi_Bands.mqh +++ b/Indicators/PriceRange/Indi_Bands.h @@ -21,14 +21,14 @@ */ // Includes. -#include "../Indicator/Indicator.h" -#include "Indi_CCI.mqh" -#include "Indi_Envelopes.mqh" -#include "Indi_MA.mqh" -#include "Indi_Momentum.mqh" -#include "Indi_RSI.mqh" -#include "Indi_StdDev.mqh" -#include "Price/Indi_Price.mqh" +#include "../../Indicator/Indicator.h" +#include "../Indi_CCI.mqh" +#include "Indi_Envelopes.h" +#include "../Price/Indi_MA.h" +#include "../Indi_Momentum.mqh" +#include "../Indi_RSI.mqh" +#include "../Indi_StdDev.mqh" +#include "../Price/Indi_Price.h" #ifndef __MQL4__ // Defines global functions (for MQL4 backward compability). diff --git a/Indicators/Indi_Envelopes.mqh b/Indicators/PriceRange/Indi_Envelopes.h similarity index 98% rename from Indicators/Indi_Envelopes.mqh rename to Indicators/PriceRange/Indi_Envelopes.h index 2eac502d7..0f2740111 100644 --- a/Indicators/Indi_Envelopes.mqh +++ b/Indicators/PriceRange/Indi_Envelopes.h @@ -21,11 +21,11 @@ */ // Includes. -#include "../Indicator/Indicator.h" -#include "../Storage/Singleton.h" -#include "Indi_MA.mqh" -#include "Indi_PriceFeeder.mqh" -#include "Price/Indi_Price.mqh" +#include "../../Indicator/Indicator.h" +#include "../../Storage/Singleton.h" +#include "../Price/Indi_MA.h" +#include "../Indi_PriceFeeder.mqh" +#include "../Price/Indi_Price.h" #ifndef __MQL4__ // Defines global functions (for MQL4 backward compability). diff --git a/Indicators/Indi_SAR.mqh b/Indicators/PriceRange/Indi_SAR.h similarity index 99% rename from Indicators/Indi_SAR.mqh rename to Indicators/PriceRange/Indi_SAR.h index 9c4be3413..b5638f345 100644 --- a/Indicators/Indi_SAR.mqh +++ b/Indicators/PriceRange/Indi_SAR.h @@ -21,7 +21,7 @@ */ // Includes. -#include "../Indicator/Indicator.h" +#include "../../Indicator/Indicator.h" #ifndef __MQL4__ // Defines global functions (for MQL4 backward compability). diff --git a/Indicators/PriceRange/includes.h b/Indicators/PriceRange/includes.h new file mode 100644 index 000000000..3fe123383 --- /dev/null +++ b/Indicators/PriceRange/includes.h @@ -0,0 +1,31 @@ +//+------------------------------------------------------------------+ +//| 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 . + * + */ + +/** + * @file + * Include file to include all price range indicators. + */ + +// Price indicators. +#include "Indi_Bands.h" +#include "Indi_Envelopes.h" +#include "Indi_SAR.h" diff --git a/Indicators/tests/Indi_Bands.test.mq4 b/Indicators/PriceRange/tests/Indi_Bands.test.mq4 similarity index 100% rename from Indicators/tests/Indi_Bands.test.mq4 rename to Indicators/PriceRange/tests/Indi_Bands.test.mq4 diff --git a/Indicators/tests/Indi_Bands.test.mq5 b/Indicators/PriceRange/tests/Indi_Bands.test.mq5 similarity index 92% rename from Indicators/tests/Indi_Bands.test.mq5 rename to Indicators/PriceRange/tests/Indi_Bands.test.mq5 index 406aec82f..ffa0a91dd 100644 --- a/Indicators/tests/Indi_Bands.test.mq5 +++ b/Indicators/PriceRange/tests/Indi_Bands.test.mq5 @@ -20,9 +20,9 @@ */ // Includes. -#include "../../Platform.h" -#include "../../Test.mqh" -#include "../Indi_Bands.mqh" +#include "../../../Platform.h" +#include "../../../Test.mqh" +#include "../Indi_Bands.h" /** * @file diff --git a/Indicators/tests/Indi_Envelopes.test.mq4 b/Indicators/PriceRange/tests/Indi_Envelopes.test.mq4 similarity index 100% rename from Indicators/tests/Indi_Envelopes.test.mq4 rename to Indicators/PriceRange/tests/Indi_Envelopes.test.mq4 diff --git a/Indicators/tests/Indi_Envelopes.test.mq5 b/Indicators/PriceRange/tests/Indi_Envelopes.test.mq5 similarity index 92% rename from Indicators/tests/Indi_Envelopes.test.mq5 rename to Indicators/PriceRange/tests/Indi_Envelopes.test.mq5 index 06d63848f..ed787e9dd 100644 --- a/Indicators/tests/Indi_Envelopes.test.mq5 +++ b/Indicators/PriceRange/tests/Indi_Envelopes.test.mq5 @@ -20,9 +20,9 @@ */ // Includes. -#include "../../Platform.h" -#include "../../Test.mqh" -#include "../Indi_Envelopes.mqh" +#include "../../../Platform.h" +#include "../../../Test.mqh" +#include "../Indi_Envelopes.h" /** * @file diff --git a/Indicators/tests/Indi_SAR.test.mq4 b/Indicators/PriceRange/tests/Indi_SAR.test.mq4 similarity index 100% rename from Indicators/tests/Indi_SAR.test.mq4 rename to Indicators/PriceRange/tests/Indi_SAR.test.mq4 diff --git a/Indicators/tests/Indi_SAR.test.mq5 b/Indicators/PriceRange/tests/Indi_SAR.test.mq5 similarity index 93% rename from Indicators/tests/Indi_SAR.test.mq5 rename to Indicators/PriceRange/tests/Indi_SAR.test.mq5 index 75414e87b..7dcdf3ed0 100644 --- a/Indicators/tests/Indi_SAR.test.mq5 +++ b/Indicators/PriceRange/tests/Indi_SAR.test.mq5 @@ -20,9 +20,9 @@ */ // Includes. -#include "../../Platform.h" -#include "../../Test.mqh" -#include "../Indi_SAR.mqh" +#include "../../../Platform.h" +#include "../../../Test.mqh" +#include "../Indi_SAR.h" /** * @file diff --git a/Indicators/Tick/Indi_TickMt.mqh b/Indicators/Tick/Indi_TickMt.h similarity index 100% rename from Indicators/Tick/Indi_TickMt.mqh rename to Indicators/Tick/Indi_TickMt.h diff --git a/Indicators/Tick/Indi_TickRandom.mqh b/Indicators/Tick/Indi_TickRandom.h similarity index 100% rename from Indicators/Tick/Indi_TickRandom.mqh rename to Indicators/Tick/Indi_TickRandom.h diff --git a/Indicators/Tick/includes.h b/Indicators/Tick/includes.h new file mode 100644 index 000000000..5af8b3d50 --- /dev/null +++ b/Indicators/Tick/includes.h @@ -0,0 +1,31 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + * + */ + +/** + * @file + * Include file to include all tick indicators. + */ + +// Tick indicators. +#include "Indi_TickMt.h" +//#include "Indi_TickProvider.h" // @fixme +#include "Indi_TickRandom.h" diff --git a/Indicators/Tick/tests/Indi_TickMt.test.mq5 b/Indicators/Tick/tests/Indi_TickMt.test.mq5 index ba48e4f9d..d5213aa4f 100644 --- a/Indicators/Tick/tests/Indi_TickMt.test.mq5 +++ b/Indicators/Tick/tests/Indi_TickMt.test.mq5 @@ -22,7 +22,7 @@ // Includes. #include "../../../Platform.h" #include "../../../Test.mqh" -#include "../Indi_TickMt.mqh" +#include "../Indi_TickMt.h" /** * @file diff --git a/Indicators/includes.h b/Indicators/includes.h index 027140284..836be1806 100644 --- a/Indicators/includes.h +++ b/Indicators/includes.h @@ -38,7 +38,6 @@ #include "Indi_AppliedPrice.mqh" #include "Indi_BWMFI.mqh" #include "Indi_BWZT.mqh" -#include "Indi_Bands.mqh" #include "Indi_BearsPower.mqh" #include "Indi_BullsPower.mqh" #include "Indi_CCI.mqh" @@ -53,7 +52,6 @@ #include "Indi_Demo.mqh" #include "Indi_DetrendedPrice.mqh" #include "Indi_Drawer.mqh" -#include "Indi_Envelopes.mqh" #include "Indi_Force.mqh" #include "Indi_FractalAdaptiveMA.mqh" #include "Indi_Fractals.mqh" @@ -61,7 +59,6 @@ #include "Indi_HeikenAshi.mqh" #include "Indi_Ichimoku.mqh" #include "Indi_Killzones.mqh" -#include "Indi_MA.mqh" #include "Indi_MACD.mqh" #include "Indi_MFI.mqh" #include "Indi_MassIndex.mqh" @@ -76,7 +73,6 @@ #include "Indi_RSI.mqh" #include "Indi_RVI.mqh" #include "Indi_RateOfChange.mqh" -#include "Indi_SAR.mqh" #include "Indi_StdDev.mqh" #include "Indi_Stochastic.mqh" #include "Indi_TEMA.mqh" @@ -89,3 +85,10 @@ #include "Indi_WilliamsAD.mqh" #include "Indi_ZigZag.mqh" #include "Indi_ZigZagColor.mqh" + +// Includes indicators per each type. +#include "Bitwise/includes.h" +#include "OHLC/includes.h" +#include "Price/includes.h" +#include "PriceRange/includes.h" +#include "Special/includes.h" diff --git a/Indicators/tests/DrawIndicator.test.mq5 b/Indicators/tests/DrawIndicator.test.mq5 index 07c9e2b6a..5d67b48f2 100644 --- a/Indicators/tests/DrawIndicator.test.mq5 +++ b/Indicators/tests/DrawIndicator.test.mq5 @@ -31,11 +31,11 @@ #include "../../Storage/Dict/DictStruct.h" #include "../DrawIndicator.mqh" #include "../../Indicator/Indicator.struct.serialize.h" -#include "../Indi_Bands.mqh" +#include "../PriceRange/Indi_Bands.h" #include "../Indi_Demo.mqh" -#include "../Indi_MA.mqh" +#include "../Price/Indi_MA.h" #include "../Indi_RSI.mqh" -#include "../Price/Indi_Price.mqh" +#include "../Price/Indi_Price.h" #include "../../Test.mqh" // Global variables. diff --git a/Indicators/tests/Indi_AppliedPrice.test.mq5 b/Indicators/tests/Indi_AppliedPrice.test.mq5 index 5686e3b6c..99ebd3fa2 100644 --- a/Indicators/tests/Indi_AppliedPrice.test.mq5 +++ b/Indicators/tests/Indi_AppliedPrice.test.mq5 @@ -23,7 +23,7 @@ #include "../../Platform.h" #include "../../Test.mqh" #include "../Indi_AppliedPrice.mqh" -#include "../Price/Indi_Price.mqh" +#include "../Price/Indi_Price.h" /** * @file diff --git a/Platform.h b/Platform.h index 7cda86930..0bd49058f 100644 --- a/Platform.h +++ b/Platform.h @@ -53,7 +53,7 @@ extern int Bars(CONST_REF_TO(string) _symbol, ENUM_TIMEFRAMES _tf); #include "Std.h" #ifdef __MQLBUILD__ -#include "Indicators/Tick/Indi_TickMt.mqh" +#include "Indicators/Tick/Indi_TickMt.h" #define PLATFORM_DEFAULT_INDICATOR_TICK Indi_TickMt #else #include "Indicators/Tick/Indi_TickProvider.h" diff --git a/README.md b/README.md index aa4695b24..5b90900ac 100644 --- a/README.md +++ b/README.md @@ -89,17 +89,17 @@ Find below the table of conversion (replace code on left with the right one): | `iAO()` | `Indi_AO::iAO()` | `Indicators/Indi_AO.mqh` | | `iATR()` | `Indi_ATR::iATR()` | `Indicators/Indi_ATR.mqh` | | `iBWMFI()` | `Indi_BWMFI::iBWMFI()` | `Indicators/Indi_BWMFI.mqh` | -| `iBands()` | `Indi_Bands::iBands()` | `Indicators/Indi_Bands.mqh` | +| `iBands()` | `Indi_Bands::iBands()` | `Indicators/PriceRange/Indi_Bands.h` | | `iBearsPower()` | `Indi_BearsPower::iBearsPower()` | `Indicators/Indi_BearsPower.mqh` | | `iBullsPower()` | `Indi_BullsPower::iBullsPower()` | `Indicators/Indi_BullsPower.mqh` | | `iCCI()` | `Indi_CCI::iCCI()` | `Indicators/Indi_CCI.mqh` | | `iDeMarker()` | `Indi_DeMarker::iDeMarker()` | `Indicators/Indi_DeMarker.mqh` | -| `iEnvelopes()` | `Indi_Envelopes::iEnvelopes()` | `Indicators/Indi_Envelopes.mqh` | +| `iEnvelopes()` | `Indi_Envelopes::iEnvelopes()` | `Indicators/PriceRange/Indi_Envelopes.h` | | `iForce()` | `Indi_Force::iForce()` | `Indicators/Indi_Force.mqh` | | `iFractals()` | `Indi_Fractals::iFractals()` | `Indicators/Indi_Fractals.mqh` | | `iGator()` | `Indi_Gator::iGator()` | `Indicators/Indi_Gator.mqh` | | `iIchimoku()` | `Indi_Ichimoku::iIchimoku()` | `Indicators/Indi_Ichimoku.mqh` | -| `iMA()` | `Indi_MA::iMA()` | `Indicators/Indi_MA.mqh` | +| `iMA()` | `Indi_MA::iMA()` | `Indicators/Price/Indi_MA.h` | | `iMACD()` | `Indi_MAcD::iMACD()` | `Indicators/Indi_MACD.mqh` | | `iMFI()` | `Indi_MFI::iMFI()` | `Indicators/Indi_MFI.mqh` | | `iMomentum()` | `Indi_Momentum::iMomentum()` | `Indicators/Indi_Momentum.mqh` | @@ -107,7 +107,7 @@ Find below the table of conversion (replace code on left with the right one): | `iOsMA()` | `Indi_OsMA::iOsMA()` | `Indicators/Indi_OsMA.mqh` | | `iRSI()` | `Indi_RSI::iRSI()` | `Indicators/Indi_RSI.mqh` | | `iRVI()` | `Indi_RVI::iRVI()` | `Indicators/Indi_RVI.mqh` | -| `iSAR()` | `Indi_SAR::iSAR()` | `Indicators/Indi_SAR.mqh` | +| `iSAR()` | `Indi_SAR::iSAR()` | `Indicators/PriceRange/Indi_SAR.h` | | `iStdDev()` | `Indi_StdDev::iStdDev()` | `Indicators/Indi_StdDev.mqh` | | `iStochastic()` | `Indi_Stochastic::iStochastic()` | `Indicators/Indi_Stochastic.mqh` | | `iWPR()` | `Indi_WPR::iWPR()` | `Indicators/Indi_WPR.mqh` | diff --git a/Storage/tests/ValueStorage.test.mq5 b/Storage/tests/ValueStorage.test.mq5 index 3d30a6d1c..69e3a08ae 100644 --- a/Storage/tests/ValueStorage.test.mq5 +++ b/Storage/tests/ValueStorage.test.mq5 @@ -28,8 +28,8 @@ #define __debug__ // Enables debug. // Includes. -#include "../../Indicators/Indi_MA.mqh" -#include "../../Indicators/Price/Indi_Price.mqh" +#include "../../Indicators/Price/Indi_MA.h" +#include "../../Indicators/Price/Indi_Price.h" #include "../../Serializer/SerializerConverter.h" #include "../../Serializer/SerializerJson.h" #include "../ValueStorage.h" diff --git a/tests/CompileIndicatorsTest.mq5 b/tests/CompileIndicatorsTest.mq5 index 9e106c3c2..ed5e8a78d 100644 --- a/tests/CompileIndicatorsTest.mq5 +++ b/tests/CompileIndicatorsTest.mq5 @@ -29,6 +29,7 @@ #include "../Indicators/Bitwise/includes.h" #include "../Indicators/OHLC/includes.h" #include "../Indicators/Price/includes.h" +#include "../Indicators/PriceRange/includes.h" #include "../Indicators/Special/includes.h" /** diff --git a/tests/IndicatorsTest.mq5 b/tests/IndicatorsTest.mq5 index 3d6ea4f4d..194f18321 100644 --- a/tests/IndicatorsTest.mq5 +++ b/tests/IndicatorsTest.mq5 @@ -40,7 +40,7 @@ struct DataParamEntry; #include "../Indicator/tests/classes/IndicatorTfDummy.h" #include "../Indicator/tests/classes/Indicators.h" #include "../Indicators/Bitwise/includes.h" -#include "../Indicators/Tick/Indi_TickMt.mqh" +#include "../Indicators/Tick/includes.h" #include "../Indicators/includes.h" #include "../Platform.h" #include "../Serializer/SerializerConverter.h" diff --git a/tests/StrategyTest-RSI.mq5 b/tests/StrategyTest-RSI.mq5 index 7dd710dc3..1cb4140ef 100644 --- a/tests/StrategyTest-RSI.mq5 +++ b/tests/StrategyTest-RSI.mq5 @@ -31,7 +31,7 @@ #include "../ChartMt.h" #include "../Indicator/tests/classes/IndicatorTfDummy.h" #include "../Indicators/Indi_RSI.mqh" -#include "../Indicators/Tick/Indi_TickMt.mqh" +#include "../Indicators/Tick/Indi_TickMt.h" #include "../Strategy.mqh" #include "../Test.mqh" diff --git a/tests/TickerTest.mq5 b/tests/TickerTest.mq5 index 517272054..73383609a 100644 --- a/tests/TickerTest.mq5 +++ b/tests/TickerTest.mq5 @@ -25,7 +25,7 @@ */ // Includes. -#include "../Indicators/Tick/Indi_TickMt.mqh" +#include "../Indicators/Tick/Indi_TickMt.h" #include "../Test.mqh" #include "../Ticker.mqh" diff --git a/tests/TradeTest.mq5 b/tests/TradeTest.mq5 index cc828bdd7..6859f757f 100644 --- a/tests/TradeTest.mq5 +++ b/tests/TradeTest.mq5 @@ -32,7 +32,7 @@ struct DataParamEntry; // Includes. #include "../ChartMt.h" -#include "../Indicators/Tick/Indi_TickMt.mqh" +#include "../Indicators/Tick/Indi_TickMt.h" #include "../Platform.h" #include "../Test.mqh" #include "../Trade.mqh" From fd0c2da2a04e041362d5dbd84a33509bedc30468 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 17:00:44 +0100 Subject: [PATCH 012/109] Moves Details docs to README --- .pre-commit-config.yaml | 1 - Indicator/Details.md | 90 --------------------------- Indicator/README.md | 131 +++++++++++++++++++++++++++++++++++++++- README.md | 9 --- 4 files changed, 130 insertions(+), 101 deletions(-) delete mode 100644 Indicator/Details.md diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f9e1999f3..b73b0ad64 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,4 @@ --- -exclude: '\.md$' repos: - repo: https://github.com/pre-commit/pre-commit-hooks diff --git a/Indicator/Details.md b/Indicator/Details.md deleted file mode 100644 index bc258f7b7..000000000 --- a/Indicator/Details.md +++ /dev/null @@ -1,90 +0,0 @@ - #Explanation of shift parameters in Indicator / IndicatorData / other classes for following methods: -- `GetEntryValue(int _mode = 0, int _abs_shift = 0)` -- `GetEntryAlter(IndicatorDataEntry &_entry, int _rel_shift)` -- `GetValue(int _mode = 0, int _rel_shift = 0)` -- `GetEntry(int _rel_shift = 0)` -- `GetBarTime(int _rel_shift = 0)` - -## GetEntryValue(int _mode, int _abs_shift) - overridable method - -Method must be overriden in any new indicator and MUST NOT apply shift from `iparams.shift`/`iparams.GetShift()`! Shift 0 must always point to the value for the current tick. - -Returns indicators's value for a given mode and absolute shift (the shift is directly passed to built-in methods such as iATR(), OnCalculate methods such as `iVIDyAOnIndicator()` and also to `iCustom()`). - -For `OnCalculate()` methods such as iVIDyAOnIndicator(), the shift is passed to `return _cache.GetTailValue(_mode, _shift);` so we can return value calculated in the past (or just retrieve **DBL_MAX** in case the value was not yet calculated). -Note that `OnCalculate()` methods uses single/multiple price buffers, e.g., applied price or OHLCs from base indicator. - -In scenario of `VIDyA[shift = 2] <- Candle <- TickMt` call hierarchy looks like: -```cpp -- VIDyA::GetEntry(_rel_shift = 1) // Then per each mode: -- entry.values[_mode] = Indicator::GetValue(_mode, _rel_shift = 1) -- VIDyA::GetEntryValue(_mode, _abs_shift = iparams.shift + 1) -- VIDyA::iVIDyAOnIndicator(..., _mode, _shift = 3) then: // Shift is absolute. -- VIDyA::iVIDyAOnArray(..., _mode, _shift = 3) then: // Shift is absolute. - return _cache.GetTailValue(_mode, _shift = 3); // Shift is absolute. -``` -Last line means that we will retrieve **VIDyA** value shifted by 3 (2 from `iparams.shift` + 1 from `GetEntry()`). It is correct. - -## GetEntryAlter(IndicatorDataEntry &_entry, int _rel_shift) - overridable method - -Shift passed is relative to the shift from `IndicatorParams::shift` (read via `Indicator::iparams.shift`). - -Method calls (seen in **MWMFI**, **CCI**, **Envelopes**, **Momentum**, **Pivot**): -```cpp -- GetValue(_mode, _rel_shift) // GetValue() takes relative shift. -``` - -## GetValue(int _mode = 0, int _rel_shift = 0) - non-overridable method - -Shift passed is relative to the shift from `IndicatorParams::shift` (read via `Indicator::iparams.shift`). - -Method calls: -```cpp -- GetEntryValue(_mode, _abs_shift = iparams.shift + _rel_shift) -``` - -## GetEntry(int _rel_shift = 0) - overridable method - -Shift passed is relative to the shift from `IndicatorParams::shift` (read via `Indicator::iparams.shift`). - -If you need to access entries from absolute shift, use `GetEntryByAbsShift(int _abs_shift)`. - -Note that values accessed via index operator `storage[rel_shift]` e.g., inside `OnCalculate()` methods like `double _o = open[rel_shift = 4].Get()` will take relative shift and retrieve open price shifted by (in this scenario) `4 + iparams.shift` set in base indicator: -```cpp -- double _o = open[_rel_shift = 4] -- IndicatorBufferValueStorage::Fetch(_rel_shift = 4) -- IndicatorData::GetValue(_mode, _rel_shift = 4) -- Indicator::GetEntryValue(_mode, _abs_shift = iparams.shift + 4) // As GetEntryValue() takes absolute shift, we add shift from iparams.shift. -- Indicator::GetEntry(_rel_shift = _abs_shift - iparams.shift)... // Converting absolute shift into relative one for GetEntry(). -- ...[_mode]; // IndicatorDataEntry.values[_mode].Get(...); -``` - -## GetBarTime(int _rel_shift = 0) - -Shift passed is relative to the shift from `IndicatorParams::shift` (read via `Indicator::iparams.shift`). - -## GetPrice(ENUM_APPLIED_PRICE _ap, int _rel_shift = 0) - -Shift passed is relative to the shift from `IndicatorParams::shift` (read via `Indicator::iparams.shift`). - -## GetBars() - -Number of returned bars is decremented by `IndicatorParams::shift` (read via `Indicator::iparams.shift`). Thus if there are **10** bars and *shift* is **8** then `GetBars()` will return **2**. That means that you can safely do `GetEntry()` for relative shifts **0** or **1**. There won't be any value in other relative shifts. - -## HistoryValueStorage::Fetch(int _rel_shift) - -Shift passed is relative to the shift from `IndicatorParams::shift` (read via `Indicator::iparams.shift`). - -## Indi_\*::\*OnIndicator(..., _shift, [_shift1], [_shift2]) - -All shifts passed are relative to the shift from `IndicatorParams::shift` (read via `Indicator::iparams.shift`). - -## IndicatorCalculateCache::GetValue()/GetTailValue(int _buffer_index, int _shift) - -Shift passed may be relative or absolute. It depends on the ValueStorage specialization. - -E.g., `HistoryValueStorage` operates on relative shifts, but `NativeValueStorage` operates on absolute shift, because it is unaware for which indicator values are stored. - -Thus way, `IndicatorCalculateCache::GetValue()` and `IndicatorCalculateCache::GetTailValue()` also don't know which type of shift was passed. However, all current indicators uses `NativeValueStorage` for storing indicator values, so shift passed must is treated as absolute. - -In scenario where indicator (shift **2**) has **8** values in the buffer with (assuming **10** candles have passed), `GetEntry(0)` would retrieve cache value from shift \ No newline at end of file diff --git a/Indicator/README.md b/Indicator/README.md index 83aa4e568..5504ed17a 100644 --- a/Indicator/README.md +++ b/Indicator/README.md @@ -9,7 +9,8 @@ They can help with storing and accessing values and indicator parameters. ```mermaid classDiagram Object <|-- IndicatorBase - IndicatorBase <|-- Indicator + IndicatorBase <|-- IndicatorData + IndicatorData <|-- Indicator Indicator <|-- IndicatorCandle Indicator <|-- IndicatorCandleSource Indicator <|-- IndicatorTick @@ -22,6 +23,134 @@ classDiagram An abstract class for all type of indicators (a base class). +### `IndicatorData` class + +The purpose of `IndicatorData` class is to store indicator data. +It is basically alternative implementation of `Indicator` class. + +For more details, please read: +[Class to hold indicator values](https://github.com/EA31337/EA31337-classes/issues/23). + +For implementation example, +check [`tests/IndicatorDataTest.mq5`](tests/IndicatorDataTest.mq5). + +### `GetEntryValue(int _mode, int _abs_shift)` - overridable method + +Method must be overriden in any new indicator +and MUST NOT apply shift from `iparams.shift`/`iparams.GetShift()`! +Shift 0 must always point to the value for the current tick. + +Returns indicators's value for a given mode and absolute shift +(the shift is directly passed to built-in methods such as iATR(), + OnCalculate methods such as `iVIDyAOnIndicator()` and also to `iCustom()`). + +For `OnCalculate()` methods such as iVIDyAOnIndicator(), +the shift is passed to `return _cache.GetTailValue(_mode, _shift);` +so we can return value calculated in the past +(or just retrieve **DBL_MAX** in case the value was not yet calculated). +Note that `OnCalculate()` methods uses single/multiple price buffers, +e.g., applied price or OHLCs from base indicator. + +In scenario of `VIDyA[shift = 2] <- Candle <- TickMt` call hierarchy looks like: + +```cpp +- VIDyA::GetEntry(_rel_shift = 1) // Then per each mode: +- entry.values[_mode] = Indicator::GetValue(_mode, _rel_shift = 1) +- VIDyA::GetEntryValue(_mode, _abs_shift = iparams.shift + 1) +- VIDyA::iVIDyAOnIndicator(..., _mode, _shift = 3) then: // Shift is absolute. +- VIDyA::iVIDyAOnArray(..., _mode, _shift = 3) then: // Shift is absolute. + return _cache.GetTailValue(_mode, _shift = 3); // Shift is absolute. +``` + +Last line means that we will retrieve **VIDyA** value shifted by 3 +(2 from `iparams.shift` + 1 from `GetEntry()`). +It is correct. + +### `GetEntryAlter(IndicatorDataEntry &_entry, int _rel_shift)` - overridable method + +Shift passed is relative to the shift from `IndicatorParams::shift` (read via `Indicator::iparams.shift`). + +Method calls (seen in **MWMFI**, **CCI**, **Envelopes**, **Momentum**, **Pivot**): + +```cpp +- GetValue(_mode, _rel_shift) // GetValue() takes relative shift. +``` + +### `GetValue(int _mode = 0, int _rel_shift = 0)` - non-overridable method + +Shift passed is relative to the shift from `IndicatorParams::shift` (read via `Indicator::iparams.shift`). + +Method calls: + +```cpp +- GetEntryValue(_mode, _abs_shift = iparams.shift + _rel_shift) +``` + +### `GetEntry(int _rel_shift = 0)` - overridable method + +Shift passed is relative to the shift from `IndicatorParams::shift` (read via `Indicator::iparams.shift`). + +If you need to access entries from absolute shift, use `GetEntryByAbsShift(int _abs_shift)`. + +Note that values accessed via index operator `storage[rel_shift]` e.g., +inside `OnCalculate()` methods like `double _o = open[rel_shift = 4].Get()` +will take relative shift and retrieve open price shifted by (in this scenario) +`4 + iparams.shift` set in base indicator: + +- `double _o = open[_rel_shift = 4]` +- `IndicatorBufferValueStorage::Fetch(_rel_shift = 4)` +- `IndicatorData::GetValue(_mode, _rel_shift = 4)` +- `Indicator::GetEntryValue(_mode, _abs_shift = iparams.shift + 4)` + // As GetEntryValue() takes absolute shift, we add shift from iparams.shift. +- `Indicator::GetEntry(_rel_shift = _abs_shift - iparams.shift)...` + // Converting absolute shift into relative one for GetEntry(). +- `...[_mode]; // IndicatorDataEntry.values[_mode].Get(...);` + +### `GetBarTime(int _rel_shift = 0)` + +Shift passed is relative to the shift from `IndicatorParams::shift` +(read via `Indicator::iparams.shift`). + +### `GetPrice(ENUM_APPLIED_PRICE _ap, int _rel_shift = 0)` + +Shift passed is relative to the shift from `IndicatorParams::shift` +(read via `Indicator::iparams.shift`). + +### GetBars() + +Number of returned bars is decremented by `IndicatorParams::shift` +(read via `Indicator::iparams.shift`). +Thus if there are **10** bars and *shift* is **8** then `GetBars()` will return **2**. +That means that you can safely do `GetEntry()` for relative shifts **0** or **1**. +There won't be any value in other relative shifts. + +### HistoryValueStorage::Fetch(int _rel_shift) + +Shift passed is relative to the shift from `IndicatorParams::shift` +(read via `Indicator::iparams.shift`). + +### `Indi_*::*OnIndicator(..., _shift, [_shift1], [_shift2])` + +All shifts passed are relative to the shift from `IndicatorParams::shift` +(read via `Indicator::iparams.shift`). + +### IndicatorCalculateCache::GetValue()/GetTailValue(int _buffer_index, int _shift) + +Shift passed may be relative or absolute. It depends on the ValueStorage specialization. + +E.g., `HistoryValueStorage` operates on relative shifts, +but `NativeValueStorage` operates on absolute shift, +because it is unaware for which indicator values are stored. + +Thus way, `IndicatorCalculateCache::GetValue()` and `IndicatorCalculateCache::GetTailValue()` +also don't know which type of shift was passed. +However, all current indicators uses `NativeValueStorage` for storing indicator values, +so shift passed must is treated as absolute. + +In scenario where indicator (shift **2**) has **8** values in the buffer +with (assuming **10** candles have passed), +`GetEntry(0)` would retrieve cache value from shift + ## `Indicator` An abstract class (subclass of `IndicatorBase`) to implement all type of indicators. diff --git a/README.md b/README.md index 5b90900ac..740a952e2 100644 --- a/README.md +++ b/README.md @@ -300,15 +300,6 @@ The example reading values from `Alligator` indicator: delete alli; } -### `IndicatorData` class - -The purpose of `IndicatorData` class is to store indicator data. -It is basically alternative implementation of `Indicator` class. - -For more details, please read: [Class to hold indicator values](https://github.com/EA31337/EA31337-classes/issues/23). - -For implementation example, check [`tests/IndicatorDataTest.mq4`](tests/IndicatorDataTest.mq4). - ### `Profiler` class The purpose of `Profiler` class is to profile functions by measuring its time of execution. From a47998c0d2c6bb5d116ae3d1779ded86e0c6a9c5 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 17:01:17 +0100 Subject: [PATCH 013/109] GHA: Updates Indicator paths --- .github/workflows/test-indicator.yml | 2 +- .github/workflows/test-indicators-bitwise.yml | 2 +- .github/workflows/test-indicators-ohlc.yml | 2 +- .github/workflows/test-indicators-price.yml | 2 +- .github/workflows/test-indicators-pricerange.yml | 2 +- .github/workflows/test-indicators-special.yml | 2 +- .github/workflows/test-indicators-tick.yml | 2 +- .github/workflows/test-indicators.yml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-indicator.yml b/.github/workflows/test-indicator.yml index 982d91e80..cf498bcff 100644 --- a/.github/workflows/test-indicator.yml +++ b/.github/workflows/test-indicator.yml @@ -5,7 +5,7 @@ name: Test Indicator on: pull_request: paths: - - 'Indicator**' + - 'Indicator/**' - 'Indicator/**' - '.github/workflows/test-indicator.yml' push: diff --git a/.github/workflows/test-indicators-bitwise.yml b/.github/workflows/test-indicators-bitwise.yml index 53a54f4f3..effa905a9 100644 --- a/.github/workflows/test-indicators-bitwise.yml +++ b/.github/workflows/test-indicators-bitwise.yml @@ -5,7 +5,7 @@ name: Test Indicators (Bitwise) on: pull_request: paths: - - 'Indicator**' + - 'Indicator/**' - 'Indicators/Bitwise/**' - '.github/workflows/test-indicators-bitwise.yml' push: diff --git a/.github/workflows/test-indicators-ohlc.yml b/.github/workflows/test-indicators-ohlc.yml index a181f5b97..920465049 100644 --- a/.github/workflows/test-indicators-ohlc.yml +++ b/.github/workflows/test-indicators-ohlc.yml @@ -5,7 +5,7 @@ name: Test Indicators (OHLC) on: pull_request: paths: - - 'Indicator**' + - 'Indicator/**' - 'Indicators/OHLC/**' - '.github/workflows/test-indicators-special.yml' push: diff --git a/.github/workflows/test-indicators-price.yml b/.github/workflows/test-indicators-price.yml index 758c0ab45..6261a61ca 100644 --- a/.github/workflows/test-indicators-price.yml +++ b/.github/workflows/test-indicators-price.yml @@ -5,7 +5,7 @@ name: Test Indicators (Price) on: pull_request: paths: - - 'Indicator**' + - 'Indicator/**' - 'Indicators/Price/**' - '.github/workflows/test-indicators-price.yml' push: diff --git a/.github/workflows/test-indicators-pricerange.yml b/.github/workflows/test-indicators-pricerange.yml index df8578743..b424ddd2c 100644 --- a/.github/workflows/test-indicators-pricerange.yml +++ b/.github/workflows/test-indicators-pricerange.yml @@ -5,7 +5,7 @@ name: Test Indicators (PriceRange) on: pull_request: paths: - - 'Indicator**' + - 'Indicator/**' - 'Indicators/PriceRange/**' - '.github/workflows/test-indicators-pricerange.yml' push: diff --git a/.github/workflows/test-indicators-special.yml b/.github/workflows/test-indicators-special.yml index fb71a0844..0ebc76d3a 100644 --- a/.github/workflows/test-indicators-special.yml +++ b/.github/workflows/test-indicators-special.yml @@ -5,7 +5,7 @@ name: Test Indicators (Special) on: pull_request: paths: - - 'Indicator**' + - 'Indicator/**' - 'Indicators/Special/**' - '.github/workflows/test-indicators-special.yml' push: diff --git a/.github/workflows/test-indicators-tick.yml b/.github/workflows/test-indicators-tick.yml index f19239218..c3da06c85 100644 --- a/.github/workflows/test-indicators-tick.yml +++ b/.github/workflows/test-indicators-tick.yml @@ -5,7 +5,7 @@ name: Test Indicators (Tick) on: pull_request: paths: - - 'Indicator**' + - 'Indicator/**' - 'Indicators/Tick/**' - '.github/workflows/test-indicators-tick.yml' push: diff --git a/.github/workflows/test-indicators.yml b/.github/workflows/test-indicators.yml index 994bee491..f269234fa 100644 --- a/.github/workflows/test-indicators.yml +++ b/.github/workflows/test-indicators.yml @@ -5,7 +5,7 @@ name: Test Indicators on: pull_request: paths: - - 'Indicator**' + - 'Indicator/**' - 'Indicators/**' - '.github/workflows/test-indicators.yml' push: From ff94ef0c5f9f2fee41ac1584fef8cd61a4bb37ad Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 17:07:09 +0100 Subject: [PATCH 014/109] README clean-up --- Indicator/README.md | 3 +++ README.md | 41 +++++++---------------------------------- 2 files changed, 10 insertions(+), 34 deletions(-) diff --git a/Indicator/README.md b/Indicator/README.md index 5504ed17a..17420b37c 100644 --- a/Indicator/README.md +++ b/Indicator/README.md @@ -155,6 +155,9 @@ with (assuming **10** candles have passed), An abstract class (subclass of `IndicatorBase`) to implement all type of indicators. +The purpose of `Indicator` class is to provide common functionality +across all indicators such as storing and searching for values. + It implements structure for storing input parameters and buffer for accessing cached values by a given timestamp. diff --git a/README.md b/README.md index 740a952e2..77218489b 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,13 @@ [![Channel][tg-channel-image]][tg-channel-link] [![Twitter][twitter-image]][twitter-link] -EA31337 framework is designed for writing trading robots for MetaTrader 4 and 5 platforms. +EA31337 framework is designed for writing software +for popular trading platforms such as MetaTrader (4 & 5). + It can be also used to convert your MQL4 code into MQL5 with minimum code changes. +The code is compatible with MQL4, MQL5 and C++ programming languages. + ## Table of contents @@ -33,7 +37,6 @@ It can be also used to convert your MQL4 code into MQL5 with minimum code change - [`Indicators/` classes](#indicators-classes) - [Example 1 - `AC` indicator](#example-1---ac-indicator) - [Example 2 - `Alligator` indicator](#example-2---alligator-indicator) - - [`IndicatorData` class](#indicatordata-class) - [`Profiler` class](#profiler-class) - [Example 1 - Measure execution time of function multiple times](#example-1---measure-execution-time-of-function-multiple-times) - [Example 2 - Measure execution time of function multiple times](#example-2---measure-execution-time-of-function-multiple-times) @@ -262,44 +265,14 @@ Example sending e-mail on trade execution: delete mail; } -### `Indicator` class +### `Indicator/` -The purpose of `Indicator` class is to provide common functionality -across all indicators such as storing and searching for values. - -This class is used as a base class to handle technical indicator classes -which can be found in [`Indicators/`](Indicators/) folder. +Collection of indicator base classes used to implement technical indicators. ### `Indicators/` classes In [`Indicators/`](Indicators/) folder there is collection of indicator classes. -#### Example 1 - `AC` indicator - -The example reading value from `AC` indicator: - - #include - int OnInit() { - Indi_AC ac = new Indi_AC(); - PrintFormat("%g", ac.GetValue()); - delete ac; - } - -#### Example 2 - `Alligator` indicator - -The example reading values from `Alligator` indicator: - - #include - int OnInit() { - AlligatorParams alli_params(13, 8, 8, 5, 5, 3, MODE_SMMA, PRICE_MEDIAN); - Indi_Alligator alli = new Indi_Alligator(alli_params)); - AlligatorEntry values = alli.GetEntry(0); - if (alli.GetFlag(INDI_ENTRY_FLAG_IS_VALID)) { - Print("Alligator values: ", values.ToString()); - } - delete alli; - } - ### `Profiler` class The purpose of `Profiler` class is to profile functions by measuring its time of execution. From 6cbe1ae223e8c3100190e47c00b199aa7886dffa Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 17:25:10 +0100 Subject: [PATCH 015/109] Improves syntax for C++ compatibility --- Indicator/Indicator.define.h | 2 +- Indicator/IndicatorData.struct.cache.h | 2 +- Indicators/Price/Indi_MA.h | 31 ++++++++++++++++++-------- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/Indicator/Indicator.define.h b/Indicator/Indicator.define.h index 26d7142ea..9eb31cca6 100644 --- a/Indicator/Indicator.define.h +++ b/Indicator/Indicator.define.h @@ -109,7 +109,7 @@ SetUserError(ERR_USER_INVALID_HANDLE); \ return EMPTY_VALUE; \ } else if (Object::IsValid(_obj)) { \ - _obj.SetHandle(_handle); \ + _obj PTR_DEREF SetHandle(_handle); \ } \ } \ if (Terminal::IsVisualMode()) { \ diff --git a/Indicator/IndicatorData.struct.cache.h b/Indicator/IndicatorData.struct.cache.h index 492b305a9..610646d0b 100644 --- a/Indicator/IndicatorData.struct.cache.h +++ b/Indicator/IndicatorData.struct.cache.h @@ -244,7 +244,7 @@ class IndicatorCalculateCache : public Dynamic { D GetTailValue(int _buffer_index, int _shift) { ValueStorage *_buff = GetBuffer(_buffer_index); int _index = _buff PTR_DEREF IsSeries() ? _shift : (ArraySize(_buff) - _shift - 1); - return _buff[_index].Get(); + return _buff[_index] PTR_DEREF Get(); } /** diff --git a/Indicators/Price/Indi_MA.h b/Indicators/Price/Indi_MA.h index 42da27dbd..d14b8338c 100644 --- a/Indicators/Price/Indi_MA.h +++ b/Indicators/Price/Indi_MA.h @@ -33,6 +33,17 @@ #include "../../Storage/ValueStorage.h" #include "../../Storage/String.h" +#ifndef __MQL__ +// Enums. +// @see: https://www.mql5.com/en/docs/constants/indicatorconstants/enum_ma_method +enum ENUM_MA_METHOD { + MODE_SMA = 0, + MODE_EMA, + MODE_SMMA, + MODE_LWMA, +}; +#endif + #ifndef __MQL4__ // Defines global functions (for MQL4 backward compability). double iMA(string _symbol, int _tf, int _ma_period, int _ma_shift, int _ma_method, int _ap, int _shift) { @@ -40,7 +51,7 @@ double iMA(string _symbol, int _tf, int _ma_period, int _ma_shift, int _ma_metho return Indi_MA::iMA(_symbol, (ENUM_TIMEFRAMES)_tf, _ma_period, _ma_shift, (ENUM_MA_METHOD)_ma_method, (ENUM_APPLIED_PRICE)_ap, _shift); } -double iMAOnArray(double &_arr[], int _total, int _period, int _ma_shift, int _ma_method, int _abs_shift, +double iMAOnArray(ARRAY_REF(double, _arr), int _total, int _period, int _ma_shift, int _ma_method, int _abs_shift, IndicatorCalculateCache *_cache = NULL) { ResetLastError(); return Indi_MA::iMAOnArray(_arr, _total, _period, _ma_shift, _ma_method, _abs_shift, _cache); @@ -143,14 +154,14 @@ class Indi_MA : public Indicator { /** * Calculates MA on the array of values. Cache is optional. */ - static double iMAOnArray(double &price[], int total, int ma_period, int ma_shift, int ma_method, int shift, + static double iMAOnArray(ARRAY_REF(double, price), int total, int ma_period, int ma_shift, int ma_method, int shift, IndicatorCalculateCache *cache = NULL) { #ifdef __MQL4__ return ::iMAOnArray(price, total, ma_period, ma_shift, ma_method, shift); #else // We're reusing the same native array for each consecutive calculation. NativeValueStorage *_array_storage = Singleton>::Get(); - _array_storage.SetData(price); + _array_storage PTR_DEREF SetData(price); return iMAOnArray((ValueStorage *)_array_storage, total, ma_period, ma_shift, ma_method, shift, cache); #endif @@ -164,8 +175,8 @@ class Indi_MA : public Indicator { if (_cache != NULL) { _cache.SetPriceBuffer(price); - if (!_cache.HasBuffers()) { - _cache.AddBuffer>(); + if (!_cache PTR_DEREF HasBuffers()) { + _cache PTR_DEREF AddBuffer>(); } if (recalculate) { @@ -177,10 +188,12 @@ class Indi_MA : public Indicator { // Returns value from the first calculation buffer. // Returns first value for as-series array or last value for non-as-series array. - return _cache.GetTailValue(0, shift + ma_shift); + return _cache PTR_DEREF GetTailValue(0, shift + ma_shift); } - double buf[], arr[], _result, pr, _array; + ARRAY(double, arr); + ARRAY(double, buf); + double _array, _result, pr; int pos, i, k, weight; double sum, lsum; if (total == 0) total = ArraySize(price); @@ -613,7 +626,7 @@ class Indi_MA : public Indicator { return (rates_total); } - static double SimpleMA(const int position, const int period, const double &price[]) { + static double SimpleMA(const int position, const int period, const ARRAY_REF(double, price)) { double result = 0.0; for (int i = 0; i < period; i++) { result += price[i]; @@ -671,7 +684,7 @@ class Indi_MA : public Indicator { IndiMAParams _p(_period, _ma_shift, _ma_method, _ap); _ptr = Objects::Set(_key, new Indi_MA(_p)); // Assigning the same candle indicator for MA as in _indi. - _ptr.SetDataSource(_indi PTR_DEREF GetCandle()); + _ptr PTR_DEREF SetDataSource(_indi PTR_DEREF GetCandle()); } return _ptr; } From 64bfdef369fc3d6bfde7aaf24dcd12166965a417 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 17:41:20 +0100 Subject: [PATCH 016/109] Moves Indi_Alligator to PriceMulti/ --- .../workflows/test-indicators-pricemulti.yml | 67 +++++++++++++++++++ .github/workflows/test-indicators.yml | 1 - .../Indi_Alligator.h} | 3 +- Indicators/PriceMulti/includes.h | 29 ++++++++ .../tests/Indi_Alligator.test.mq4 | 0 .../tests/Indi_Alligator.test.mq5 | 6 +- Indicators/PriceMulti/tests/Makefile | 12 ++++ Indicators/includes.h | 2 +- 8 files changed, 114 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/test-indicators-pricemulti.yml rename Indicators/{Indi_Alligator.mqh => PriceMulti/Indi_Alligator.h} (99%) create mode 100644 Indicators/PriceMulti/includes.h rename Indicators/{ => PriceMulti}/tests/Indi_Alligator.test.mq4 (100%) rename Indicators/{ => PriceMulti}/tests/Indi_Alligator.test.mq5 (92%) create mode 100644 Indicators/PriceMulti/tests/Makefile diff --git a/.github/workflows/test-indicators-pricemulti.yml b/.github/workflows/test-indicators-pricemulti.yml new file mode 100644 index 000000000..7d635e280 --- /dev/null +++ b/.github/workflows/test-indicators-pricemulti.yml @@ -0,0 +1,67 @@ +--- +name: Test Indicators (PriceMulti) + +# yamllint disable-line rule:truthy +on: + pull_request: + paths: + - 'Indicator/**' + - 'Indicators/PriceMulti/**' + - '.github/workflows/test-indicators-pricemulti.yml' + push: + paths: + - 'Indicator**' + - 'Indicators/Price/**' + - '.github/workflows/test-indicators-pricemulti.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: 'Indicators/PriceMulti/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' + + Tests-MQL4: + defaults: + run: + shell: bash + working-directory: Indicators/Price/tests + needs: Compile + runs-on: ubuntu-latest + strategy: + matrix: + test: + - Indi_Alligator.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 + GitHubApiToken: ${{ github.token }} + RunOnError: show_logs 200 + TestExpert: ${{ matrix.test }} + timeout-minutes: 10 diff --git a/.github/workflows/test-indicators.yml b/.github/workflows/test-indicators.yml index f269234fa..66b63d2f2 100644 --- a/.github/workflows/test-indicators.yml +++ b/.github/workflows/test-indicators.yml @@ -59,7 +59,6 @@ jobs: - Indi_AO.test - Indi_ASI.test - Indi_ATR.test - - Indi_Alligator.test - Indi_AppliedPrice.test - Indi_BWMFI.test - Indi_BWZT.test diff --git a/Indicators/Indi_Alligator.mqh b/Indicators/PriceMulti/Indi_Alligator.h similarity index 99% rename from Indicators/Indi_Alligator.mqh rename to Indicators/PriceMulti/Indi_Alligator.h index 9d50e545a..1a6416c12 100644 --- a/Indicators/Indi_Alligator.mqh +++ b/Indicators/PriceMulti/Indi_Alligator.h @@ -21,7 +21,8 @@ */ // Includes. -#include "../Indicator/Indicator.h" +#include "../../Indicator/Indicator.h" +#include "../Price/Indi_MA.h" #ifndef __MQL4__ // Defines global functions (for MQL4 backward compability). diff --git a/Indicators/PriceMulti/includes.h b/Indicators/PriceMulti/includes.h new file mode 100644 index 000000000..e221ee7c4 --- /dev/null +++ b/Indicators/PriceMulti/includes.h @@ -0,0 +1,29 @@ +//+------------------------------------------------------------------+ +//| 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 . + * + */ + +/** + * @file + * Include file to include all price multi indicators. + */ + +// Price multi indicators. +#include "Indi_Alligator.h" diff --git a/Indicators/tests/Indi_Alligator.test.mq4 b/Indicators/PriceMulti/tests/Indi_Alligator.test.mq4 similarity index 100% rename from Indicators/tests/Indi_Alligator.test.mq4 rename to Indicators/PriceMulti/tests/Indi_Alligator.test.mq4 diff --git a/Indicators/tests/Indi_Alligator.test.mq5 b/Indicators/PriceMulti/tests/Indi_Alligator.test.mq5 similarity index 92% rename from Indicators/tests/Indi_Alligator.test.mq5 rename to Indicators/PriceMulti/tests/Indi_Alligator.test.mq5 index 436adf838..e885a0e16 100644 --- a/Indicators/tests/Indi_Alligator.test.mq5 +++ b/Indicators/PriceMulti/tests/Indi_Alligator.test.mq5 @@ -20,9 +20,9 @@ */ // Includes. -#include "../../Platform.h" -#include "../../Test.mqh" -#include "../Indi_Alligator.mqh" +#include "../../../Platform.h" +#include "../../../Test.mqh" +#include "../Indi_Alligator.h" /** * @file diff --git a/Indicators/PriceMulti/tests/Makefile b/Indicators/PriceMulti/tests/Makefile new file mode 100644 index 000000000..e792364f0 --- /dev/null +++ b/Indicators/PriceMulti/tests/Makefile @@ -0,0 +1,12 @@ +CC := g++ # C++ compiler +CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags +SRCS := $(wildcard *.cpp) # Get all .cpp files in the current directory +OBJS := $(SRCS:.cpp=.o) # Object files corresponding to the source files + +all: $(OBJS) + +%.o: %.cpp + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -v $(OBJS) diff --git a/Indicators/includes.h b/Indicators/includes.h index 836be1806..ab3cfabe6 100644 --- a/Indicators/includes.h +++ b/Indicators/includes.h @@ -34,7 +34,6 @@ #include "Indi_AO.mqh" #include "Indi_ASI.mqh" #include "Indi_ATR.mqh" -#include "Indi_Alligator.mqh" #include "Indi_AppliedPrice.mqh" #include "Indi_BWMFI.mqh" #include "Indi_BWZT.mqh" @@ -90,5 +89,6 @@ #include "Bitwise/includes.h" #include "OHLC/includes.h" #include "Price/includes.h" +#include "PriceMulti/includes.h" #include "PriceRange/includes.h" #include "Special/includes.h" From 7cb8b72cc6ed0d06694cf15aef8049add8d38f06 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 18:29:01 +0100 Subject: [PATCH 017/109] Renames MACD, RSI, Stochastic and WPR to Oscillator/ --- .../workflows/test-indicators-oscillator.yml | 70 +++++++++++++++++++ .github/workflows/test-indicators.yml | 2 - .../{Indi_MACD.mqh => Oscillator/Indi_MACD.h} | 13 +++- .../{Indi_RSI.mqh => Oscillator/Indi_RSI.h} | 6 +- .../Indi_Stochastic.h} | 3 +- .../{Indi_WPR.mqh => Oscillator/Indi_WPR.h} | 2 +- Indicators/Oscillator/README.md | 27 +++++++ Indicators/Oscillator/includes.h | 32 +++++++++ .../{ => Oscillator}/tests/Indi_MACD.test.mq4 | 0 .../{ => Oscillator}/tests/Indi_MACD.test.mq5 | 6 +- .../{ => Oscillator}/tests/Indi_RSI.test.mq4 | 0 .../{ => Oscillator}/tests/Indi_RSI.test.mq5 | 6 +- .../tests/Indi_Stochastic.test.mq4 | 0 .../tests/Indi_Stochastic.test.mq5 | 6 +- .../{ => Oscillator}/tests/Indi_WPR.test.mq4 | 0 .../{ => Oscillator}/tests/Indi_WPR.test.mq5 | 6 +- Indicators/Price/Indi_MA.h | 5 +- Indicators/PriceRange/Indi_Bands.h | 2 +- Indicators/includes.h | 5 +- Indicators/tests/DrawIndicator.test.mq5 | 2 +- README.md | 8 +-- Storage/ValueStorage.h | 2 +- tests/CompileIndicatorsTest.mq5 | 1 + tests/StrategyTest-RSI.mq5 | 2 +- 24 files changed, 171 insertions(+), 35 deletions(-) create mode 100644 .github/workflows/test-indicators-oscillator.yml rename Indicators/{Indi_MACD.mqh => Oscillator/Indi_MACD.h} (97%) rename Indicators/{Indi_RSI.mqh => Oscillator/Indi_RSI.h} (99%) rename Indicators/{Indi_Stochastic.mqh => Oscillator/Indi_Stochastic.h} (99%) rename Indicators/{Indi_WPR.mqh => Oscillator/Indi_WPR.h} (99%) create mode 100644 Indicators/Oscillator/README.md create mode 100644 Indicators/Oscillator/includes.h rename Indicators/{ => Oscillator}/tests/Indi_MACD.test.mq4 (100%) rename Indicators/{ => Oscillator}/tests/Indi_MACD.test.mq5 (92%) rename Indicators/{ => Oscillator}/tests/Indi_RSI.test.mq4 (100%) rename Indicators/{ => Oscillator}/tests/Indi_RSI.test.mq5 (93%) rename Indicators/{ => Oscillator}/tests/Indi_Stochastic.test.mq4 (100%) rename Indicators/{ => Oscillator}/tests/Indi_Stochastic.test.mq5 (92%) rename Indicators/{ => Oscillator}/tests/Indi_WPR.test.mq4 (100%) rename Indicators/{ => Oscillator}/tests/Indi_WPR.test.mq5 (93%) diff --git a/.github/workflows/test-indicators-oscillator.yml b/.github/workflows/test-indicators-oscillator.yml new file mode 100644 index 000000000..40bb2944a --- /dev/null +++ b/.github/workflows/test-indicators-oscillator.yml @@ -0,0 +1,70 @@ +--- +name: Test Indicators (Oscillator) + +# yamllint disable-line rule:truthy +on: + pull_request: + paths: + - 'Indicator/**' + - 'Indicators/Oscillator/**' + - '.github/workflows/test-indicators-oscillator.yml' + push: + paths: + - 'Indicator**' + - 'Indicators/Oscillator/**' + - '.github/workflows/test-indicators-oscillator.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: 'Indicators/Oscillator/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' + + Tests-MQL4: + defaults: + run: + shell: bash + working-directory: Indicators/Oscillator/tests + needs: Compile + runs-on: ubuntu-latest + strategy: + matrix: + test: + - Indi_MACD.test + - Indi_RSI.test + - Indi_Stochastic.test + - Indi_WPR.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 + GitHubApiToken: ${{ github.token }} + RunOnError: show_logs 200 + TestExpert: ${{ matrix.test }} + timeout-minutes: 10 diff --git a/.github/workflows/test-indicators.yml b/.github/workflows/test-indicators.yml index 66b63d2f2..00c53829f 100644 --- a/.github/workflows/test-indicators.yml +++ b/.github/workflows/test-indicators.yml @@ -82,8 +82,6 @@ jobs: - Indi_HeikenAshi.test - Indi_Ichimoku.test - Indi_Killzones.test - - Indi_MA.test - - Indi_MACD.test - Indi_MFI.test - Indi_MassIndex.test - Indi_Momentum.test diff --git a/Indicators/Indi_MACD.mqh b/Indicators/Oscillator/Indi_MACD.h similarity index 97% rename from Indicators/Indi_MACD.mqh rename to Indicators/Oscillator/Indi_MACD.h index f2b74ebd6..aeefab160 100644 --- a/Indicators/Indi_MACD.mqh +++ b/Indicators/Oscillator/Indi_MACD.h @@ -21,9 +21,12 @@ */ // Includes. -#include "../Indicator/Indicator.h" +#include "../../Indicator/Indicator.h" + +#ifdef __MQL5__ +// Forward declaration. +class Indi_MACD; -#ifndef __MQL4__ // Defines global functions (for MQL4 backward compability). double iMACD(string _symbol, int _tf, int _ema_fp, int _ema_sp, int _signal_period, int _ap, int _mode, int _shift) { ResetLastError(); @@ -94,11 +97,15 @@ class Indi_MACD : public Indicator { unsigned int _signal_period, ENUM_APPLIED_PRICE _applied_price, ENUM_SIGNAL_LINE _mode = LINE_MAIN, // (MT4/MT5 _mode): 0 - MODE_MAIN/MAIN_LINE, 1 - MODE_SIGNAL/SIGNAL_LINE int _shift = 0, IndicatorData *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL4__ return ::iMACD(_symbol, _tf, _ema_fast_period, _ema_slow_period, _signal_period, _applied_price, _mode, _shift); -#else // __MQL5__ +#else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN( ::iMACD(_symbol, _tf, _ema_fast_period, _ema_slow_period, _signal_period, _applied_price), _mode, _shift); +#endif +#else // Non-MQL. + // @todo: Use Platform class. #endif } diff --git a/Indicators/Indi_RSI.mqh b/Indicators/Oscillator/Indi_RSI.h similarity index 99% rename from Indicators/Indi_RSI.mqh rename to Indicators/Oscillator/Indi_RSI.h index 37947741e..3079e5bdb 100644 --- a/Indicators/Indi_RSI.mqh +++ b/Indicators/Oscillator/Indi_RSI.h @@ -21,9 +21,9 @@ */ // Includes. -#include "../Storage/Dict/DictStruct.h" -#include "../Indicator/Indicator.h" -#include "Price/Indi_Price.h" +#include "../../Storage/Dict/DictStruct.h" +#include "../../Indicator/Indicator.h" +#include "../Price/Indi_Price.h" // Structs. struct IndiRSIParams : IndicatorParams { diff --git a/Indicators/Indi_Stochastic.mqh b/Indicators/Oscillator/Indi_Stochastic.h similarity index 99% rename from Indicators/Indi_Stochastic.mqh rename to Indicators/Oscillator/Indi_Stochastic.h index 1ca6a0ea9..6dfb8f171 100644 --- a/Indicators/Indi_Stochastic.mqh +++ b/Indicators/Oscillator/Indi_Stochastic.h @@ -21,7 +21,8 @@ */ // Includes. -#include "../Indicator/Indicator.h" +#include "../../Indicator/Indicator.h" +#include "../Price/Indi_MA.h" #ifndef __MQL4__ // Defines global functions (for MQL4 backward compability). diff --git a/Indicators/Indi_WPR.mqh b/Indicators/Oscillator/Indi_WPR.h similarity index 99% rename from Indicators/Indi_WPR.mqh rename to Indicators/Oscillator/Indi_WPR.h index 192b9d378..33cd848a8 100644 --- a/Indicators/Indi_WPR.mqh +++ b/Indicators/Oscillator/Indi_WPR.h @@ -21,7 +21,7 @@ */ // Includes. -#include "../Indicator/Indicator.h" +#include "../../Indicator/Indicator.h" #ifndef __MQL4__ // Defines global functions (for MQL4 backward compability). diff --git a/Indicators/Oscillator/README.md b/Indicators/Oscillator/README.md new file mode 100644 index 000000000..f142a2b66 --- /dev/null +++ b/Indicators/Oscillator/README.md @@ -0,0 +1,27 @@ +# Oscillator indicators + +Oscillators are a category of technical indicators used in financial markets analysis. +They are designed to identify overbought or oversold conditions and potential trend reversals. +Oscillators typically oscillate within a specific range or between certain values, +indicating the momentum or strength of a price movement. + +Oscillators are considered a subset of indicators since they are technical tools +used to analyze price data and generate signals. +They differ from other types of indicators +like trend-following or volume-based indicators +because oscillators are designed to provide information +about the short-term price behavior rather than long-term trends or volume patterns. + +Common examples of oscillators include the Relative Strength Index (RSI), +Stochastic Oscillator, Moving Average Convergence Divergence (MACD), and the Williams %R. +These indicators generate values that fluctuate within predefined boundaries, +typically between 0 and 100 or -100 and +100, +indicating the relative strength or weakness of price movements. + +Traders and analysts use oscillators to identify potential buying or selling opportunities, +divergences, and to gauge market conditions such as overbought or oversold levels. +They can be helpful in identifying potential trend reversals or determining the strength of an ongoing trend. + +In summary, oscillators are a type of indicator used in technical analysis +that measure price momentum and provide insights into overbought or oversold conditions. +They are considered a subset of indicators due to their specific function and characteristics. diff --git a/Indicators/Oscillator/includes.h b/Indicators/Oscillator/includes.h new file mode 100644 index 000000000..f3a79636d --- /dev/null +++ b/Indicators/Oscillator/includes.h @@ -0,0 +1,32 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + * + */ + +/** + * @file + * Include file to include all oscillator indicators. + */ + +// Oscillator indicators. +#include "Indi_MACD.h" +#include "Indi_RSI.h" +#include "Indi_Stochastic.h" +#include "Indi_WPR.h" diff --git a/Indicators/tests/Indi_MACD.test.mq4 b/Indicators/Oscillator/tests/Indi_MACD.test.mq4 similarity index 100% rename from Indicators/tests/Indi_MACD.test.mq4 rename to Indicators/Oscillator/tests/Indi_MACD.test.mq4 diff --git a/Indicators/tests/Indi_MACD.test.mq5 b/Indicators/Oscillator/tests/Indi_MACD.test.mq5 similarity index 92% rename from Indicators/tests/Indi_MACD.test.mq5 rename to Indicators/Oscillator/tests/Indi_MACD.test.mq5 index 4833d753b..af458e5c9 100644 --- a/Indicators/tests/Indi_MACD.test.mq5 +++ b/Indicators/Oscillator/tests/Indi_MACD.test.mq5 @@ -20,9 +20,9 @@ */ // Includes. -#include "../../Platform.h" -#include "../../Test.mqh" -#include "../Indi_MACD.mqh" +#include "../../../Platform.h" +#include "../../../Test.mqh" +#include "../Indi_MACD.h" /** * @file diff --git a/Indicators/tests/Indi_RSI.test.mq4 b/Indicators/Oscillator/tests/Indi_RSI.test.mq4 similarity index 100% rename from Indicators/tests/Indi_RSI.test.mq4 rename to Indicators/Oscillator/tests/Indi_RSI.test.mq4 diff --git a/Indicators/tests/Indi_RSI.test.mq5 b/Indicators/Oscillator/tests/Indi_RSI.test.mq5 similarity index 93% rename from Indicators/tests/Indi_RSI.test.mq5 rename to Indicators/Oscillator/tests/Indi_RSI.test.mq5 index 122c0b138..51d55d51d 100644 --- a/Indicators/tests/Indi_RSI.test.mq5 +++ b/Indicators/Oscillator/tests/Indi_RSI.test.mq5 @@ -20,9 +20,9 @@ */ // Includes. -#include "../../Platform.h" -#include "../../Test.mqh" -#include "../Indi_RSI.mqh" +#include "../../../Platform.h" +#include "../../../Test.mqh" +#include "../Indi_RSI.h" /** * @file diff --git a/Indicators/tests/Indi_Stochastic.test.mq4 b/Indicators/Oscillator/tests/Indi_Stochastic.test.mq4 similarity index 100% rename from Indicators/tests/Indi_Stochastic.test.mq4 rename to Indicators/Oscillator/tests/Indi_Stochastic.test.mq4 diff --git a/Indicators/tests/Indi_Stochastic.test.mq5 b/Indicators/Oscillator/tests/Indi_Stochastic.test.mq5 similarity index 92% rename from Indicators/tests/Indi_Stochastic.test.mq5 rename to Indicators/Oscillator/tests/Indi_Stochastic.test.mq5 index 51fd68b54..846e09034 100644 --- a/Indicators/tests/Indi_Stochastic.test.mq5 +++ b/Indicators/Oscillator/tests/Indi_Stochastic.test.mq5 @@ -20,9 +20,9 @@ */ // Includes. -#include "../../Platform.h" -#include "../../Test.mqh" -#include "../Indi_Stochastic.mqh" +#include "../../../Platform.h" +#include "../../../Test.mqh" +#include "../Indi_Stochastic.h" /** * @file diff --git a/Indicators/tests/Indi_WPR.test.mq4 b/Indicators/Oscillator/tests/Indi_WPR.test.mq4 similarity index 100% rename from Indicators/tests/Indi_WPR.test.mq4 rename to Indicators/Oscillator/tests/Indi_WPR.test.mq4 diff --git a/Indicators/tests/Indi_WPR.test.mq5 b/Indicators/Oscillator/tests/Indi_WPR.test.mq5 similarity index 93% rename from Indicators/tests/Indi_WPR.test.mq5 rename to Indicators/Oscillator/tests/Indi_WPR.test.mq5 index a212f755e..ec0f19b19 100644 --- a/Indicators/tests/Indi_WPR.test.mq5 +++ b/Indicators/Oscillator/tests/Indi_WPR.test.mq5 @@ -20,9 +20,9 @@ */ // Includes. -#include "../../Platform.h" -#include "../../Test.mqh" -#include "../Indi_WPR.mqh" +#include "../../../Platform.h" +#include "../../../Test.mqh" +#include "../Indi_WPR.h" /** * @file diff --git a/Indicators/Price/Indi_MA.h b/Indicators/Price/Indi_MA.h index d14b8338c..9ac3c856a 100644 --- a/Indicators/Price/Indi_MA.h +++ b/Indicators/Price/Indi_MA.h @@ -44,7 +44,10 @@ enum ENUM_MA_METHOD { }; #endif -#ifndef __MQL4__ +#ifdef __MQL5__ +// Forward declaration. +class Indi_MA; + // Defines global functions (for MQL4 backward compability). double iMA(string _symbol, int _tf, int _ma_period, int _ma_shift, int _ma_method, int _ap, int _shift) { ResetLastError(); diff --git a/Indicators/PriceRange/Indi_Bands.h b/Indicators/PriceRange/Indi_Bands.h index 9d057f236..542ecebbd 100644 --- a/Indicators/PriceRange/Indi_Bands.h +++ b/Indicators/PriceRange/Indi_Bands.h @@ -26,7 +26,7 @@ #include "Indi_Envelopes.h" #include "../Price/Indi_MA.h" #include "../Indi_Momentum.mqh" -#include "../Indi_RSI.mqh" +#include "../Oscillator/Indi_RSI.h" #include "../Indi_StdDev.mqh" #include "../Price/Indi_Price.h" diff --git a/Indicators/includes.h b/Indicators/includes.h index ab3cfabe6..f12d74e06 100644 --- a/Indicators/includes.h +++ b/Indicators/includes.h @@ -58,7 +58,6 @@ #include "Indi_HeikenAshi.mqh" #include "Indi_Ichimoku.mqh" #include "Indi_Killzones.mqh" -#include "Indi_MACD.mqh" #include "Indi_MFI.mqh" #include "Indi_MassIndex.mqh" #include "Indi_Momentum.mqh" @@ -69,18 +68,15 @@ #include "Indi_PriceFeeder.mqh" #include "Indi_PriceVolumeTrend.mqh" #include "Indi_RS.mqh" -#include "Indi_RSI.mqh" #include "Indi_RVI.mqh" #include "Indi_RateOfChange.mqh" #include "Indi_StdDev.mqh" -#include "Indi_Stochastic.mqh" #include "Indi_TEMA.mqh" #include "Indi_TRIX.mqh" #include "Indi_UltimateOscillator.mqh" #include "Indi_VIDYA.mqh" #include "Indi_VROC.mqh" #include "Indi_Volumes.mqh" -#include "Indi_WPR.mqh" #include "Indi_WilliamsAD.mqh" #include "Indi_ZigZag.mqh" #include "Indi_ZigZagColor.mqh" @@ -88,6 +84,7 @@ // Includes indicators per each type. #include "Bitwise/includes.h" #include "OHLC/includes.h" +#include "Oscillator/includes.h" #include "Price/includes.h" #include "PriceMulti/includes.h" #include "PriceRange/includes.h" diff --git a/Indicators/tests/DrawIndicator.test.mq5 b/Indicators/tests/DrawIndicator.test.mq5 index 5d67b48f2..e83e18aba 100644 --- a/Indicators/tests/DrawIndicator.test.mq5 +++ b/Indicators/tests/DrawIndicator.test.mq5 @@ -34,7 +34,7 @@ #include "../PriceRange/Indi_Bands.h" #include "../Indi_Demo.mqh" #include "../Price/Indi_MA.h" -#include "../Indi_RSI.mqh" +#include "../Oscillator/Indi_RSI.h" #include "../Price/Indi_Price.h" #include "../../Test.mqh" diff --git a/README.md b/README.md index 77218489b..a0b0cc423 100644 --- a/README.md +++ b/README.md @@ -103,17 +103,17 @@ Find below the table of conversion (replace code on left with the right one): | `iGator()` | `Indi_Gator::iGator()` | `Indicators/Indi_Gator.mqh` | | `iIchimoku()` | `Indi_Ichimoku::iIchimoku()` | `Indicators/Indi_Ichimoku.mqh` | | `iMA()` | `Indi_MA::iMA()` | `Indicators/Price/Indi_MA.h` | -| `iMACD()` | `Indi_MAcD::iMACD()` | `Indicators/Indi_MACD.mqh` | +| `iMACD()` | `Indi_MACD::iMACD()` | `Indicators/Oscillator/Indi_MACD.h` | | `iMFI()` | `Indi_MFI::iMFI()` | `Indicators/Indi_MFI.mqh` | | `iMomentum()` | `Indi_Momentum::iMomentum()` | `Indicators/Indi_Momentum.mqh` | | `iOBV()` | `Indi_OBV::iOBV()` | `Indicators/Indi_OBV.mqh` | | `iOsMA()` | `Indi_OsMA::iOsMA()` | `Indicators/Indi_OsMA.mqh` | -| `iRSI()` | `Indi_RSI::iRSI()` | `Indicators/Indi_RSI.mqh` | +| `iRSI()` | `Indi_RSI::iRSI()` | `Indicators/Oscillator/Indi_RSI.h` | | `iRVI()` | `Indi_RVI::iRVI()` | `Indicators/Indi_RVI.mqh` | | `iSAR()` | `Indi_SAR::iSAR()` | `Indicators/PriceRange/Indi_SAR.h` | | `iStdDev()` | `Indi_StdDev::iStdDev()` | `Indicators/Indi_StdDev.mqh` | -| `iStochastic()` | `Indi_Stochastic::iStochastic()` | `Indicators/Indi_Stochastic.mqh` | -| `iWPR()` | `Indi_WPR::iWPR()` | `Indicators/Indi_WPR.mqh` | +| `iStochastic()` | `Indi_Stochastic::iStochastic()` | `Indicators/Oscillator/Indi_Stochastic.h` | +| `iWPR()` | `Indi_WPR::iWPR()` | `Indicators/Oscillator/Indi_WPR.h` | | `RefreshRates()` | `Market::RefreshRates()` | `Market.mqh` | | `delete object` | `Object::Delete(object)` | `Storage/Object.h` | | `GetOrderProfit()` | `Order::GetOrderProfit()` | `Order.mqh` | diff --git a/Storage/ValueStorage.h b/Storage/ValueStorage.h index 0747679c4..7cabfce1f 100644 --- a/Storage/ValueStorage.h +++ b/Storage/ValueStorage.h @@ -121,7 +121,7 @@ enum ENUM_IPEAK { IPEAK_LOWEST, IPEAK_HIGHEST }; #define INDICATOR_CALCULATE_POPULATED_PARAMS_SHORT _price // Includes. -#include "../Storage/Array.h" +#include "Array.h" #include "../Util.h" #include "IValueStorage.h" #include "ValueStorage.accessor.h" diff --git a/tests/CompileIndicatorsTest.mq5 b/tests/CompileIndicatorsTest.mq5 index ed5e8a78d..e528fe7c0 100644 --- a/tests/CompileIndicatorsTest.mq5 +++ b/tests/CompileIndicatorsTest.mq5 @@ -28,6 +28,7 @@ #include "../Indicators/includes.h" #include "../Indicators/Bitwise/includes.h" #include "../Indicators/OHLC/includes.h" +#include "../Indicators/Oscillator/includes.h" #include "../Indicators/Price/includes.h" #include "../Indicators/PriceRange/includes.h" #include "../Indicators/Special/includes.h" diff --git a/tests/StrategyTest-RSI.mq5 b/tests/StrategyTest-RSI.mq5 index 1cb4140ef..e7d8c1bd4 100644 --- a/tests/StrategyTest-RSI.mq5 +++ b/tests/StrategyTest-RSI.mq5 @@ -30,7 +30,7 @@ // Includes. #include "../ChartMt.h" #include "../Indicator/tests/classes/IndicatorTfDummy.h" -#include "../Indicators/Indi_RSI.mqh" +#include "../Indicators/Oscillator/Indi_RSI.h" #include "../Indicators/Tick/Indi_TickMt.h" #include "../Strategy.mqh" #include "../Test.mqh" From 505431868f8a93ea78933995c3dcc1e8bacafb98 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 19:31:02 +0100 Subject: [PATCH 018/109] Adds Indi_Candle test --- .github/workflows/test-indicators-bitwise.yml | 2 +- Indicators/Bitwise/tests/Indi_Candle.test.mq4 | 27 ++++++++++++++++ Indicators/Bitwise/tests/Indi_Candle.test.mq5 | 31 +++++++++++++++++++ 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 Indicators/Bitwise/tests/Indi_Candle.test.mq4 create mode 100644 Indicators/Bitwise/tests/Indi_Candle.test.mq5 diff --git a/.github/workflows/test-indicators-bitwise.yml b/.github/workflows/test-indicators-bitwise.yml index effa905a9..32493baaa 100644 --- a/.github/workflows/test-indicators-bitwise.yml +++ b/.github/workflows/test-indicators-bitwise.yml @@ -50,7 +50,7 @@ jobs: strategy: matrix: test: - # - Indi_Candle.test # @todo + - Indi_Candle.test - Indi_Pattern.test steps: - uses: actions/download-artifact@v2 diff --git a/Indicators/Bitwise/tests/Indi_Candle.test.mq4 b/Indicators/Bitwise/tests/Indi_Candle.test.mq4 new file mode 100644 index 000000000..29583b3a8 --- /dev/null +++ b/Indicators/Bitwise/tests/Indi_Candle.test.mq4 @@ -0,0 +1,27 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test functionality of Indi_Candle indicator class. + */ + +#include "Indi_Candle.test.mq5" diff --git a/Indicators/Bitwise/tests/Indi_Candle.test.mq5 b/Indicators/Bitwise/tests/Indi_Candle.test.mq5 new file mode 100644 index 000000000..703cd2851 --- /dev/null +++ b/Indicators/Bitwise/tests/Indi_Candle.test.mq5 @@ -0,0 +1,31 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +// Includes. +#include "../../../Platform.h" +#include "../../../Test.mqh" +#include "../Indi_Candle.mqh" + +/** + * @file + * Test functionality of Indi_Candle indicator class. + */ +TEST_INDICATOR_DEFAULT_BINDINGS(Indi_Candle); From 366384e4dc30ca9a274838db8f5643a86ce47ed8 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 19:34:13 +0100 Subject: [PATCH 019/109] GHA: Improves Indicator paths for indicator tests --- .github/workflows/test-indicator.yml | 2 +- .github/workflows/test-indicators-ohlc.yml | 2 +- .github/workflows/test-indicators-oscillator.yml | 2 +- .github/workflows/test-indicators-price.yml | 2 +- .github/workflows/test-indicators-pricemulti.yml | 2 +- .github/workflows/test-indicators-pricerange.yml | 2 +- .github/workflows/test-indicators-special.yml | 2 +- .github/workflows/test-indicators-tick.yml | 2 +- .github/workflows/test-indicators.yml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test-indicator.yml b/.github/workflows/test-indicator.yml index cf498bcff..54c12dfcd 100644 --- a/.github/workflows/test-indicator.yml +++ b/.github/workflows/test-indicator.yml @@ -10,7 +10,7 @@ on: - '.github/workflows/test-indicator.yml' push: paths: - - 'Indicator**' + - 'Indicator/**' - 'Indicator/**' - '.github/workflows/test-indicator.yml' diff --git a/.github/workflows/test-indicators-ohlc.yml b/.github/workflows/test-indicators-ohlc.yml index 920465049..ce6c7c8a6 100644 --- a/.github/workflows/test-indicators-ohlc.yml +++ b/.github/workflows/test-indicators-ohlc.yml @@ -10,7 +10,7 @@ on: - '.github/workflows/test-indicators-special.yml' push: paths: - - 'Indicator**' + - 'Indicator/**' - 'Indicators/OHLC/**' - '.github/workflows/test-indicators-special.yml' diff --git a/.github/workflows/test-indicators-oscillator.yml b/.github/workflows/test-indicators-oscillator.yml index 40bb2944a..6b4142dd3 100644 --- a/.github/workflows/test-indicators-oscillator.yml +++ b/.github/workflows/test-indicators-oscillator.yml @@ -10,7 +10,7 @@ on: - '.github/workflows/test-indicators-oscillator.yml' push: paths: - - 'Indicator**' + - 'Indicator/**' - 'Indicators/Oscillator/**' - '.github/workflows/test-indicators-oscillator.yml' diff --git a/.github/workflows/test-indicators-price.yml b/.github/workflows/test-indicators-price.yml index 6261a61ca..026872630 100644 --- a/.github/workflows/test-indicators-price.yml +++ b/.github/workflows/test-indicators-price.yml @@ -10,7 +10,7 @@ on: - '.github/workflows/test-indicators-price.yml' push: paths: - - 'Indicator**' + - 'Indicator/**' - 'Indicators/Price/**' - '.github/workflows/test-indicators-price.yml' diff --git a/.github/workflows/test-indicators-pricemulti.yml b/.github/workflows/test-indicators-pricemulti.yml index 7d635e280..287e7fc3c 100644 --- a/.github/workflows/test-indicators-pricemulti.yml +++ b/.github/workflows/test-indicators-pricemulti.yml @@ -10,7 +10,7 @@ on: - '.github/workflows/test-indicators-pricemulti.yml' push: paths: - - 'Indicator**' + - 'Indicator/**' - 'Indicators/Price/**' - '.github/workflows/test-indicators-pricemulti.yml' diff --git a/.github/workflows/test-indicators-pricerange.yml b/.github/workflows/test-indicators-pricerange.yml index b424ddd2c..77baddd93 100644 --- a/.github/workflows/test-indicators-pricerange.yml +++ b/.github/workflows/test-indicators-pricerange.yml @@ -10,7 +10,7 @@ on: - '.github/workflows/test-indicators-pricerange.yml' push: paths: - - 'Indicator**' + - 'Indicator/**' - 'Indicators/Price/**' - '.github/workflows/test-indicators-pricerange.yml' diff --git a/.github/workflows/test-indicators-special.yml b/.github/workflows/test-indicators-special.yml index 0ebc76d3a..228407782 100644 --- a/.github/workflows/test-indicators-special.yml +++ b/.github/workflows/test-indicators-special.yml @@ -10,7 +10,7 @@ on: - '.github/workflows/test-indicators-special.yml' push: paths: - - 'Indicator**' + - 'Indicator/**' - 'Indicators/Special/**' - '.github/workflows/test-indicators-special.yml' diff --git a/.github/workflows/test-indicators-tick.yml b/.github/workflows/test-indicators-tick.yml index c3da06c85..ee7deebfa 100644 --- a/.github/workflows/test-indicators-tick.yml +++ b/.github/workflows/test-indicators-tick.yml @@ -10,7 +10,7 @@ on: - '.github/workflows/test-indicators-tick.yml' push: paths: - - 'Indicator**' + - 'Indicator/**' - 'Indicators/Tick/**' - '.github/workflows/test-indicators-tick.yml' diff --git a/.github/workflows/test-indicators.yml b/.github/workflows/test-indicators.yml index 00c53829f..badd88b5e 100644 --- a/.github/workflows/test-indicators.yml +++ b/.github/workflows/test-indicators.yml @@ -10,7 +10,7 @@ on: - '.github/workflows/test-indicators.yml' push: paths: - - 'Indicator**' + - 'Indicator/**' - 'Indicators/**' - '.github/workflows/test-indicators.yml' From 6529f0725af4c8b2491ba2d327edd44635cc1ddf Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 19:34:51 +0100 Subject: [PATCH 020/109] Adds Indicators' READMEs --- Indicators/Bitwise/README.md | 35 +++++++++++++++++++++++++++++++++ Indicators/OHLC/README.md | 28 ++++++++++++++++++++++++++ Indicators/Price/README.md | 24 ++++++++++++++++++++++ Indicators/PriceMulti/README.md | 23 ++++++++++++++++++++++ 4 files changed, 110 insertions(+) create mode 100644 Indicators/Bitwise/README.md create mode 100644 Indicators/OHLC/README.md create mode 100644 Indicators/Price/README.md create mode 100644 Indicators/PriceMulti/README.md diff --git a/Indicators/Bitwise/README.md b/Indicators/Bitwise/README.md new file mode 100644 index 000000000..929d5a81f --- /dev/null +++ b/Indicators/Bitwise/README.md @@ -0,0 +1,35 @@ +# Bitwise indicators + +Bitwise indicators are a specialized category of technical indicators +in which information is stored and represented using binary bits instead of numerical values. +These indicators utilize a binary system, +with each bit representing a specific condition or pattern that is being analyzed. + +One example of a bitwise indicator is the Pattern indicator. +This indicator focuses on identifying various chart patterns, +such as bullish or bearish candles, doji patterns, +double top or bottom formations, reversals, or other candlestick patterns. +Instead of providing numerical values or calculations, +the Pattern indicator uses activation bits to store information +about the presence or absence of specific chart patterns. + +When a particular pattern is detected and considered active, +the corresponding bit or bits associated with that pattern are set to "1" (as active). +Conversely, if the pattern is not present or not active, +the associated bits are set to "0" (as inactive). + +By using the Pattern indicator or similar bitwise indicators, +traders can streamline their analysis and focus on specific patterns +that may indicate potential trading opportunities. + +By using bitwise representation, the Bitwise indicators can efficiently store information +about multiple conditions within a compact binary format. +Traders can then interpret the activated bits to identify +and analyze the occurrence of specific conditions in the market. + +These bitwise indicators can be helpful for traders who rely on pattern recognition +and want to automate the identification process. + +In summary, bitwise indicators in Forex utilize binary bits +to store and represent information about specific conditions or patterns. +This allows traders to efficiently automate pattern recognition and enhance their trading analysis. diff --git a/Indicators/OHLC/README.md b/Indicators/OHLC/README.md new file mode 100644 index 000000000..68b1081b0 --- /dev/null +++ b/Indicators/OHLC/README.md @@ -0,0 +1,28 @@ +# OHLC indicators + +OHLC (Open-High-Low-Close) indicators are a specific category of technical indicators +used to generate values based on the open, high, low, and close prices of an asset. +The OHLC values can be used to construct candlestick charts, +which visually represent the price movements in the market. + +One example of an OHLC indicator is the Heikin-Ashi (HA) indicator. +Heikin-Ashi is known for its ability to filter out the noise +of day-to-day price fluctuations and provide a smoother representation of price data. +It achieves this by using a modified formula based on average price values. + +The Heikin-Ashi method calculates the open, high, low, and close values +based on the average of the previous candle's OHLC values. +This averaging technique helps to reduce the impact of sudden price spikes or gaps, +resulting in smoother candlestick patterns. +The modified candlestick charts generated by the Heikin-Ashi indicator +can provide clearer signals for identifying market trends and forecasting price movements. + +OHLC indicators, can be used in conjunction with other indicators or analysis techniques. +The OHLC values they produce can serve as input for other indicators +allowing traders to derive additional insights or develop trading strategies based on the price data. + +By utilizing OHLC indicators, traders can gain a better understanding of price dynamics, +identify key support and resistance levels, and recognize patterns +that may indicate potential trading opportunities. +The visual representation of OHLC values through candlestick charts +facilitates the interpretation of market sentiment and price action. diff --git a/Indicators/Price/README.md b/Indicators/Price/README.md new file mode 100644 index 000000000..0a2243397 --- /dev/null +++ b/Indicators/Price/README.md @@ -0,0 +1,24 @@ +# Price indicators + +Price indicators in Forex are a specific category of technical indicators that +generate a single price value as their output. +These indicators focus on analyzing and representing specific aspects of price data +to provide insights into market trends, momentum, or other relevant information. + +These price indicators are commonly used to identify trends, support and resistance levels, +and potential entry or exit points in the market. +By focusing on the single price value generated by these indicators, +traders can gain insights into the overall price direction +based on the average price over a specific period +and make informed trading decisions. + +Popular examples of price indicators include: + +- Moving Average (MA): + A widely used price indicator that calculates the average price over a specified period. + It smoothes out price fluctuations and provides a single value that represents the average price. + +- DEMA (Double Exponential Moving Average): + Similar to a traditional moving average, DEMA applies a double smoothing technique + to provide a single price value. + It aims to reduce lag and provide more responsive signals compared to standard moving averages. diff --git a/Indicators/PriceMulti/README.md b/Indicators/PriceMulti/README.md new file mode 100644 index 000000000..6faa71a96 --- /dev/null +++ b/Indicators/PriceMulti/README.md @@ -0,0 +1,23 @@ +# Price Multi indicators + +Price multi indicators are a specific type of technical indicators in the Forex market +that generate multiple price values as their outputs. +These indicators go beyond providing a single value and offer a range of price information, +typically representing different aspects of price behavior. + +One example is the Alligator indicator developed by Bill Williams. +It consists of three lines, known as the jaw, teeth, and lips, +which mimic the structure of an alligator. +Each line represents a moving average with specific parameters and is shifted forward in time. +The values of these lines change as new price data is incorporated, +reflecting the dynamics of the market. + +These type of indicators provide traders with a more comprehensive perspective +on price movements by offering multiple price values instead of a single value. +This can help traders make more informed decisions +by considering different aspects of price behavior simultaneously. + +In summary, price multi indicators in Forex produce multiple price values as their outputs, +providing a broader view of price behavior. +These indicators offer traders a more comprehensive understanding of the market +and can assist in identifying trends and potential trading opportunities. From 56e3748daf283398195cdb61eeb4c2e6c5c2ffbb Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 19:59:31 +0100 Subject: [PATCH 021/109] Adds runtime error when calling builtin function for indicators which are not implemented yet --- Indicators/Indi_AC.mqh | 8 ++++++++ Indicators/Indi_AD.mqh | 8 ++++++++ Indicators/Indi_ADX.mqh | 8 ++++++++ Indicators/Indi_ADXW.mqh | 10 +++++++++- Indicators/Indi_AMA.mqh | 8 ++++++++ Indicators/Indi_AO.mqh | 8 ++++++++ Indicators/Indi_ATR.mqh | 8 ++++++++ Indicators/Indi_BWMFI.mqh | 8 ++++++++ Indicators/Indi_BearsPower.mqh | 8 ++++++++ Indicators/Indi_BullsPower.mqh | 8 ++++++++ Indicators/Indi_CCI.mqh | 8 ++++++++ Indicators/Indi_CHO.mqh | 10 +++++++++- Indicators/Indi_DEMA.mqh | 10 +++++++++- Indicators/Indi_DeMarker.mqh | 8 ++++++++ Indicators/Indi_Force.mqh | 8 ++++++++ Indicators/Indi_FractalAdaptiveMA.mqh | 10 +++++++++- Indicators/Indi_Fractals.mqh | 8 ++++++++ Indicators/Indi_Gator.mqh | 8 ++++++++ Indicators/Indi_HeikenAshi.mqh | 8 ++++++++ Indicators/Indi_Ichimoku.mqh | 8 ++++++++ Indicators/Indi_MFI.mqh | 16 ++++++++++++++++ Indicators/Indi_Momentum.mqh | 8 ++++++++ Indicators/Indi_OBV.mqh | 8 ++++++++ Indicators/Indi_OsMA.mqh | 8 ++++++++ Indicators/Indi_RVI.mqh | 8 ++++++++ Indicators/Indi_StdDev.mqh | 8 ++++++++ Indicators/Indi_TEMA.mqh | 10 +++++++++- Indicators/Indi_TRIX.mqh | 10 +++++++++- Indicators/Indi_VIDYA.mqh | 10 +++++++++- Indicators/Oscillator/Indi_MACD.h | 4 ++++ Indicators/Oscillator/Indi_RSI.h | 11 ++++++----- Indicators/Oscillator/Indi_Stochastic.h | 10 +++++++++- Indicators/Oscillator/Indi_WPR.h | 10 +++++++++- Indicators/Price/Indi_MA.h | 16 ++++++++++++---- Indicators/PriceMulti/Indi_Alligator.h | 8 ++++++++ Indicators/PriceRange/Indi_Bands.h | 8 ++++++++ Indicators/PriceRange/Indi_Envelopes.h | 8 ++++++++ Indicators/PriceRange/Indi_SAR.h | 8 ++++++++ 38 files changed, 319 insertions(+), 18 deletions(-) diff --git a/Indicators/Indi_AC.mqh b/Indicators/Indi_AC.mqh index 4621eb410..b055758c4 100644 --- a/Indicators/Indi_AC.mqh +++ b/Indicators/Indi_AC.mqh @@ -95,10 +95,18 @@ class Indi_AC : public Indicator { */ static double iAC(string _symbol = NULL, ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0, IndicatorData *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL4__ return ::iAC(_symbol, _tf, _shift); #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iAC(_symbol, _tf), 0, _shift); +#endif +#else // Non-MQL. + // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } diff --git a/Indicators/Indi_AD.mqh b/Indicators/Indi_AD.mqh index de2dcc19c..3fffd899b 100644 --- a/Indicators/Indi_AD.mqh +++ b/Indicators/Indi_AD.mqh @@ -86,10 +86,18 @@ class Indi_AD : public Indicator { */ static double iAD(string _symbol = NULL, ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0, IndicatorData *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL4__ return ::iAD(_symbol, _tf, _shift); #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iAD(_symbol, _tf, VOLUME_TICK), 0, _shift); +#endif +#else // Non-MQL. + // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } diff --git a/Indicators/Indi_ADX.mqh b/Indicators/Indi_ADX.mqh index d68d0f8be..865cec1d4 100644 --- a/Indicators/Indi_ADX.mqh +++ b/Indicators/Indi_ADX.mqh @@ -106,10 +106,18 @@ class Indi_ADX : public Indicator { int _mode = LINE_MAIN_ADX, // (MT4/MT5): 0 - MODE_MAIN/MAIN_LINE, 1 - // MODE_PLUSDI/PLUSDI_LINE, 2 - MODE_MINUSDI/MINUSDI_LINE int _shift = 0, IndicatorData *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL4__ return ::iADX(_symbol, _tf, _period, _applied_price, _mode, _shift); #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iADX(_symbol, _tf, _period), _mode, _shift); +#endif +#else // Non-MQL. + // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } diff --git a/Indicators/Indi_ADXW.mqh b/Indicators/Indi_ADXW.mqh index 9a1049a3c..c5a82f0b2 100644 --- a/Indicators/Indi_ADXW.mqh +++ b/Indicators/Indi_ADXW.mqh @@ -105,9 +105,10 @@ class Indi_ADXW : public Indicator { */ static double iADXWilder(string _symbol, ENUM_TIMEFRAMES _tf, int _ma_period, int _mode = LINE_MAIN_ADX, int _shift = 0, IndicatorData *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iADXWilder(_symbol, _tf, _ma_period), _mode, _shift); -#else +#else // __MQL5__ if (_obj == nullptr) { Print( "Indi_ADXW::iADXWilder() can work without supplying pointer to IndicatorData only in MQL5. In this platform " @@ -116,6 +117,13 @@ class Indi_ADXW : public Indicator { return 0; } return iADXWilder(_obj, _ma_period, _mode, _shift); +#endif +#else // Non-MQL. + // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } diff --git a/Indicators/Indi_AMA.mqh b/Indicators/Indi_AMA.mqh index 3187f1736..6acbf831d 100644 --- a/Indicators/Indi_AMA.mqh +++ b/Indicators/Indi_AMA.mqh @@ -93,6 +93,7 @@ class Indi_AMA : public Indicator { static double iAMA(string _symbol, ENUM_TIMEFRAMES _tf, int _ama_period, int _fast_ema_period, int _slow_ema_period, int _ama_shift, ENUM_APPLIED_PRICE _ap, int _mode = 0, int _shift = 0, IndicatorData *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN( ::iAMA(_symbol, _tf, _ama_period, _fast_ema_period, _slow_ema_period, _ama_shift, _ap), _mode, _shift); @@ -105,6 +106,13 @@ class Indi_AMA : public Indicator { return 0; } return iAMAOnIndicator(_obj, _ama_period, _fast_ema_period, _slow_ema_period, _ama_shift, _ap, _mode, _shift); +#endif +#else // Non-MQL. + // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } diff --git a/Indicators/Indi_AO.mqh b/Indicators/Indi_AO.mqh index eeb9c4661..d7b606107 100644 --- a/Indicators/Indi_AO.mqh +++ b/Indicators/Indi_AO.mqh @@ -96,11 +96,19 @@ class Indi_AO : public Indicator { */ static double iAO(string _symbol = NULL, ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0, int _mode = 0, IndicatorData *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL4__ // Note: In MQL4 _mode is not supported. return ::iAO(_symbol, _tf, _shift); #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iAO(_symbol, _tf), _mode, _shift); +#endif +#else // Non-MQL. + // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } diff --git a/Indicators/Indi_ATR.mqh b/Indicators/Indi_ATR.mqh index 9f94ab076..289c80b6c 100644 --- a/Indicators/Indi_ATR.mqh +++ b/Indicators/Indi_ATR.mqh @@ -80,10 +80,18 @@ class Indi_ATR : public Indicator { */ static double iATR(string _symbol, ENUM_TIMEFRAMES _tf, unsigned int _period, int _shift = 0, IndicatorData *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL4__ return ::iATR(_symbol, _tf, _period, _shift); #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iATR(_symbol, _tf, _period), 0, _shift); +#endif +#else // Non-MQL. + // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } diff --git a/Indicators/Indi_BWMFI.mqh b/Indicators/Indi_BWMFI.mqh index aa18f3b17..d0e6cc5aa 100644 --- a/Indicators/Indi_BWMFI.mqh +++ b/Indicators/Indi_BWMFI.mqh @@ -107,10 +107,18 @@ class Indi_BWMFI : public Indicator { */ static double iBWMFI(string _symbol = NULL, ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0, ENUM_BWMFI_BUFFER _mode = BWMFI_BUFFER, IndicatorData *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL4__ return ::iBWMFI(_symbol, _tf, _shift); #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iBWMFI(_symbol, _tf, VOLUME_TICK), _mode, _shift); +#endif +#else // Non-MQL. + // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } diff --git a/Indicators/Indi_BearsPower.mqh b/Indicators/Indi_BearsPower.mqh index aab484fac..a287be519 100644 --- a/Indicators/Indi_BearsPower.mqh +++ b/Indicators/Indi_BearsPower.mqh @@ -81,10 +81,18 @@ class Indi_BearsPower : public Indicator { static double iBearsPower(string _symbol, ENUM_TIMEFRAMES _tf, unsigned int _period, ENUM_APPLIED_PRICE _applied_price, // (MT5): not used int _shift = 0, IndicatorData *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL4__ return ::iBearsPower(_symbol, _tf, _period, _applied_price, _shift); #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iBearsPower(_symbol, _tf, _period), 0, _shift); +#endif +#else // Non-MQL. + // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } diff --git a/Indicators/Indi_BullsPower.mqh b/Indicators/Indi_BullsPower.mqh index bb9bf2d6f..d5cf365dd 100644 --- a/Indicators/Indi_BullsPower.mqh +++ b/Indicators/Indi_BullsPower.mqh @@ -81,10 +81,18 @@ class Indi_BullsPower : public Indicator { static double iBullsPower(string _symbol, ENUM_TIMEFRAMES _tf, unsigned int _period, ENUM_APPLIED_PRICE _applied_price, // (MT5): not used int _shift = 0, IndicatorData *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL4__ return ::iBullsPower(_symbol, _tf, _period, _applied_price, _shift); #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iBullsPower(_symbol, _tf, _period), 0, _shift); +#endif +#else // Non-MQL. + // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } diff --git a/Indicators/Indi_CCI.mqh b/Indicators/Indi_CCI.mqh index d185935b2..1a7e757d4 100644 --- a/Indicators/Indi_CCI.mqh +++ b/Indicators/Indi_CCI.mqh @@ -91,10 +91,18 @@ class Indi_CCI : public Indicator { */ static double iCCI(string _symbol, ENUM_TIMEFRAMES _tf, unsigned int _period, ENUM_APPLIED_PRICE _applied_price, int _shift = 0, IndicatorData *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL4__ return ::iCCI(_symbol, _tf, _period, _applied_price, _shift); #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iCCI(_symbol, _tf, _period, _applied_price), 0, _shift); +#endif +#else // Non-MQL. + // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } diff --git a/Indicators/Indi_CHO.mqh b/Indicators/Indi_CHO.mqh index 896a647a8..3d4102a4d 100644 --- a/Indicators/Indi_CHO.mqh +++ b/Indicators/Indi_CHO.mqh @@ -86,10 +86,11 @@ class Indi_CHO : public Indicator { static double iChaikin(string _symbol, ENUM_TIMEFRAMES _tf, int _fast_ma_period, int _slow_ma_period, ENUM_MA_METHOD _ma_method, ENUM_APPLIED_VOLUME _av, int _mode = 0, int _shift = 0, IndicatorData *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iChaikin(_symbol, _tf, _fast_ma_period, _slow_ma_period, _ma_method, _av), _mode, _shift); -#else +#else // __MQL5__ if (_obj == nullptr) { Print( "Indi_CHO::iChaikin() can work without supplying pointer to IndicatorData only in MQL5. In this platform the " @@ -102,6 +103,13 @@ class Indi_CHO : public Indicator { _obj, Util::MakeKey(_fast_ma_period, _slow_ma_period, (int)_ma_method, (int)_av)); return iChaikinOnArray(INDICATOR_CALCULATE_POPULATED_PARAMS_LONG, _fast_ma_period, _slow_ma_period, _ma_method, _av, _mode, _shift, _cache); +#endif +#else // Non-MQL. + // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } diff --git a/Indicators/Indi_DEMA.mqh b/Indicators/Indi_DEMA.mqh index 0f052d214..10b00d9d3 100644 --- a/Indicators/Indi_DEMA.mqh +++ b/Indicators/Indi_DEMA.mqh @@ -103,9 +103,10 @@ class Indi_DEMA : public Indicator { */ static double iDEMA(string _symbol, ENUM_TIMEFRAMES _tf, unsigned int _period, unsigned int _ma_shift, ENUM_APPLIED_PRICE _applied_price, int _shift = 0, int _mode = 0, IndicatorData *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iDEMA(_symbol, _tf, _period, _ma_shift, _applied_price), _mode, _shift); -#else +#else // __MQL5__ if (_obj == nullptr) { Print( "Indi_DEMA::iDEMA() can work without supplying pointer to IndicatorData only in MQL5. In this platform the " @@ -115,6 +116,13 @@ class Indi_DEMA : public Indicator { } return iDEMAOnIndicator(_obj, _period, _ma_shift, _applied_price, _mode, _shift); +#endif +#else // Non-MQL. + // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } diff --git a/Indicators/Indi_DeMarker.mqh b/Indicators/Indi_DeMarker.mqh index 690909d80..745f62e6c 100644 --- a/Indicators/Indi_DeMarker.mqh +++ b/Indicators/Indi_DeMarker.mqh @@ -78,10 +78,18 @@ class Indi_DeMarker : public Indicator { */ static double iDeMarker(string _symbol, ENUM_TIMEFRAMES _tf, unsigned int _period, int _shift = 0, IndicatorData *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL4__ return ::iDeMarker(_symbol, _tf, _period, _shift); #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iDeMarker(_symbol, _tf, _period), 0, _shift); +#endif +#else // Non-MQL. + // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } diff --git a/Indicators/Indi_Force.mqh b/Indicators/Indi_Force.mqh index a60b03669..bab7d7314 100644 --- a/Indicators/Indi_Force.mqh +++ b/Indicators/Indi_Force.mqh @@ -95,10 +95,18 @@ class Indi_Force : public Indicator { */ static double iForce(string _symbol, ENUM_TIMEFRAMES _tf, unsigned int _period, ENUM_MA_METHOD _ma_method, ENUM_APPLIED_PRICE _applied_price, int _shift = 0, IndicatorData *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL4__ return ::iForce(_symbol, _tf, _period, _ma_method, _applied_price, _shift); #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iForce(_symbol, _tf, _period, _ma_method, VOLUME_TICK), 0, _shift); +#endif +#else // Non-MQL. + // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } diff --git a/Indicators/Indi_FractalAdaptiveMA.mqh b/Indicators/Indi_FractalAdaptiveMA.mqh index 3dc8fd346..3ca51ca89 100644 --- a/Indicators/Indi_FractalAdaptiveMA.mqh +++ b/Indicators/Indi_FractalAdaptiveMA.mqh @@ -92,10 +92,11 @@ class Indi_FrAMA : public Indicator { */ static double iFrAMA(string _symbol, ENUM_TIMEFRAMES _tf, int _ma_period, int _ma_shift, ENUM_APPLIED_PRICE _ap, int _mode = 0, int _rel_shift = 0, IndicatorData *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iFrAMA(_symbol, _tf, _ma_period, _ma_shift, _ap), _mode, _obj PTR_DEREF ToAbsShift(_rel_shift)); -#else +#else // __MQL5__ if (_obj == nullptr) { Print( "Indi_FrAMA::iFrAMA() can work without supplying pointer to IndicatorData only in MQL5. In this platform the " @@ -107,6 +108,13 @@ class Indi_FrAMA : public Indicator { INDICATOR_CALCULATE_POPULATE_PARAMS_AND_CACHE_LONG(_obj, Util::MakeKey(_ma_period, _ma_shift, (int)_ap)); return iFrAMAOnArray(INDICATOR_CALCULATE_POPULATED_PARAMS_LONG, _ma_period, _ma_shift, _ap, _mode, _obj PTR_DEREF ToAbsShift(_rel_shift), _cache); +#endif +#else // Non-MQL. + // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } diff --git a/Indicators/Indi_Fractals.mqh b/Indicators/Indi_Fractals.mqh index 6f93e25f1..75551bf05 100644 --- a/Indicators/Indi_Fractals.mqh +++ b/Indicators/Indi_Fractals.mqh @@ -94,10 +94,18 @@ class Indi_Fractals : public Indicator { ENUM_LO_UP_LINE _mode, // (MT4 _mode): 1 - MODE_UPPER, 2 - MODE_LOWER int _shift = 0, // (MT5 _mode): 0 - UPPER_LINE, 1 - LOWER_LINE IndicatorData *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL4__ return ::iFractals(_symbol, _tf, _mode, _shift); #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iFractals(_symbol, _tf), _mode, _shift); +#endif +#else // Non-MQL. + // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } diff --git a/Indicators/Indi_Gator.mqh b/Indicators/Indi_Gator.mqh index 712fc8108..c3a909365 100644 --- a/Indicators/Indi_Gator.mqh +++ b/Indicators/Indi_Gator.mqh @@ -162,6 +162,7 @@ class Indi_Gator : public Indicator { int _teeth_shift, int _lips_period, int _lips_shift, ENUM_MA_METHOD _ma_method, ENUM_APPLIED_PRICE _applied_price, ENUM_GATOR_HISTOGRAM _mode, int _shift = 0, IndicatorData *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL4__ return ::iGator(_symbol, _tf, _jaw_period, _jaw_shift, _teeth_period, _teeth_shift, _lips_period, _lips_shift, _ma_method, _applied_price, _mode, _shift); @@ -169,6 +170,13 @@ class Indi_Gator : public Indicator { INDICATOR_BUILTIN_CALL_AND_RETURN(::iGator(_symbol, _tf, _jaw_period, _jaw_shift, _teeth_period, _teeth_shift, _lips_period, _lips_shift, _ma_method, _applied_price), _mode, _shift); +#endif +#else // Non-MQL. + // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } diff --git a/Indicators/Indi_HeikenAshi.mqh b/Indicators/Indi_HeikenAshi.mqh index 0f161c549..5f451d479 100644 --- a/Indicators/Indi_HeikenAshi.mqh +++ b/Indicators/Indi_HeikenAshi.mqh @@ -127,6 +127,7 @@ class Indi_HeikenAshi : public Indicator { */ static double iCustomLegacyHeikenAshi(string _symbol, ENUM_TIMEFRAMES _tf, string _name, int _mode, int _shift = 0, IndicatorData *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL4__ // Low and High prices could be in reverse order when using MT4's built-in indicator, so we need to retrieve both // and return correct one. @@ -144,6 +145,13 @@ class Indi_HeikenAshi : public Indicator { return ::iCustom(_symbol, _tf, "Heiken Ashi", _mode, _shift); #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iCustom(_symbol, _tf, "Examples\\Heiken_Ashi"), _mode, _shift); +#endif +#else // Non-MQL. + // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } diff --git a/Indicators/Indi_Ichimoku.mqh b/Indicators/Indi_Ichimoku.mqh index 32c546990..8155ebf4f 100644 --- a/Indicators/Indi_Ichimoku.mqh +++ b/Indicators/Indi_Ichimoku.mqh @@ -133,11 +133,19 @@ class Indi_Ichimoku : public Indicator { */ static double iIchimoku(string _symbol, ENUM_TIMEFRAMES _tf, int _tenkan_sen, int _kijun_sen, int _senkou_span_b, int _mode, int _shift = 0, IndicatorData *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL4__ return ::iIchimoku(_symbol, _tf, _tenkan_sen, _kijun_sen, _senkou_span_b, _mode, _shift); #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iIchimoku(_symbol, _tf, _tenkan_sen, _kijun_sen, _senkou_span_b), _mode, _shift); +#endif +#else // Non-MQL. + // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } diff --git a/Indicators/Indi_MFI.mqh b/Indicators/Indi_MFI.mqh index c53a7dcd8..8fe9bf484 100644 --- a/Indicators/Indi_MFI.mqh +++ b/Indicators/Indi_MFI.mqh @@ -80,19 +80,35 @@ class Indi_MFI : public Indicator { */ static double iMFI(string _symbol, ENUM_TIMEFRAMES _tf, unsigned int _period, int _shift = 0, IndicatorData *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL4__ return ::iMFI(_symbol, _tf, _period, _shift); #else // __MQL5__ return Indi_MFI::iMFI(_symbol, _tf, _period, VOLUME_TICK, _shift, _obj); +#endif +#else // Non-MQL. + // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } static double iMFI(string _symbol, ENUM_TIMEFRAMES _tf, unsigned int _period, ENUM_APPLIED_VOLUME _applied_volume, // Not used in MT4. int _shift = 0, Indi_MFI *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL4__ return ::iMFI(_symbol, _tf, _period, _shift); #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iMFI(_symbol, _tf, _period, VOLUME_TICK), 0, _shift); +#endif +#else // Non-MQL. + // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } diff --git a/Indicators/Indi_Momentum.mqh b/Indicators/Indi_Momentum.mqh index 4b7602ee7..1eaf88d98 100644 --- a/Indicators/Indi_Momentum.mqh +++ b/Indicators/Indi_Momentum.mqh @@ -95,10 +95,18 @@ class Indi_Momentum : public Indicator { */ static double iMomentum(string _symbol, ENUM_TIMEFRAMES _tf, unsigned int _period, ENUM_APPLIED_PRICE _ap, int _shift = 0, IndicatorData *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL4__ return ::iMomentum(_symbol, _tf, _period, _ap, _shift); #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iMomentum(_symbol, _tf, _period, _ap), 0, _shift); +#endif +#else // Non-MQL. + // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } diff --git a/Indicators/Indi_OBV.mqh b/Indicators/Indi_OBV.mqh index 9ab6c931c..42c9378dc 100644 --- a/Indicators/Indi_OBV.mqh +++ b/Indicators/Indi_OBV.mqh @@ -104,10 +104,18 @@ class Indi_OBV : public Indicator { ENUM_APPLIED_VOLUME _applied = VOLUME_TICK, // MT5 only. #endif int _shift = 0, IndicatorData *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL4__ return ::iOBV(_symbol, _tf, _applied, _shift); #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iOBV(_symbol, _tf, _applied), 0, _shift); +#endif +#else // Non-MQL. + // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } diff --git a/Indicators/Indi_OsMA.mqh b/Indicators/Indi_OsMA.mqh index 86017ceeb..5c13e6a84 100644 --- a/Indicators/Indi_OsMA.mqh +++ b/Indicators/Indi_OsMA.mqh @@ -88,11 +88,19 @@ class Indi_OsMA : public Indicator { static double iOsMA(string _symbol, ENUM_TIMEFRAMES _tf, int _ema_fast_period, int _ema_slow_period, int _signal_period, ENUM_APPLIED_PRICE _applied_price, int _shift = 0, IndicatorData *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL4__ return ::iOsMA(_symbol, _tf, _ema_fast_period, _ema_slow_period, _signal_period, _applied_price, _shift); #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN( ::iOsMA(_symbol, _tf, _ema_fast_period, _ema_slow_period, _signal_period, _applied_price), 0, _shift); +#endif +#else // Non-MQL. + // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } diff --git a/Indicators/Indi_RVI.mqh b/Indicators/Indi_RVI.mqh index 2c70f66fd..463afa97c 100644 --- a/Indicators/Indi_RVI.mqh +++ b/Indicators/Indi_RVI.mqh @@ -84,10 +84,18 @@ class Indi_RVI : public Indicator { string _symbol = NULL, ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, unsigned int _period = 10, ENUM_SIGNAL_LINE _mode = LINE_MAIN, // (MT4/MT5): 0 - MODE_MAIN/MAIN_LINE, 1 - MODE_SIGNAL/SIGNAL_LINE int _shift = 0, IndicatorData *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL4__ return ::iRVI(_symbol, _tf, _period, _mode, _shift); #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iRVI(_symbol, _tf, _period), _mode, _shift); +#endif +#else // Non-MQL. + // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } diff --git a/Indicators/Indi_StdDev.mqh b/Indicators/Indi_StdDev.mqh index 7c0dec8af..253eb4c95 100644 --- a/Indicators/Indi_StdDev.mqh +++ b/Indicators/Indi_StdDev.mqh @@ -104,11 +104,19 @@ class Indi_StdDev : public Indicator { */ static double iStdDev(string _symbol, ENUM_TIMEFRAMES _tf, int _ma_period, int _ma_shift, ENUM_MA_METHOD _ma_method, ENUM_APPLIED_PRICE _applied_price, int _shift = 0, IndicatorData *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL4__ return ::iStdDev(_symbol, _tf, _ma_period, _ma_shift, _ma_method, _applied_price, _shift); #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iStdDev(_symbol, _tf, _ma_period, _ma_shift, _ma_method, _applied_price), 0, _shift); +#endif +#else // Non-MQL. + // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } diff --git a/Indicators/Indi_TEMA.mqh b/Indicators/Indi_TEMA.mqh index 45947c466..519ba7b57 100644 --- a/Indicators/Indi_TEMA.mqh +++ b/Indicators/Indi_TEMA.mqh @@ -76,9 +76,10 @@ class Indi_TEMA : public Indicator { */ static double iTEMA(string _symbol, ENUM_TIMEFRAMES _tf, int _ma_period, int _ma_shift, ENUM_APPLIED_PRICE _ap, int _mode = 0, int _shift = 0, Indi_TEMA *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iTEMA(_symbol, _tf, _ma_period, _ma_shift, _ap), _mode, _shift); -#else +#else // __MQL5__ if (_obj == nullptr) { Print( "Indi_TEMA::iTEMA() can work without supplying pointer to IndicatorData only in MQL5. In this platform " @@ -88,6 +89,13 @@ class Indi_TEMA : public Indicator { } return iTEMAOnIndicator(_obj, _ma_period, _ma_shift, _ap, _mode, _shift); +#endif +#else // Non-MQL. + // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } diff --git a/Indicators/Indi_TRIX.mqh b/Indicators/Indi_TRIX.mqh index 4ec734618..357da9088 100644 --- a/Indicators/Indi_TRIX.mqh +++ b/Indicators/Indi_TRIX.mqh @@ -74,9 +74,10 @@ class Indi_TRIX : public Indicator { */ static double iTriX(string _symbol, ENUM_TIMEFRAMES _tf, int _ma_period, ENUM_APPLIED_PRICE _ap, int _mode = 0, int _shift = 0, IndicatorData *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iTriX(_symbol, _tf, _ma_period, _ap), _mode, _shift); -#else +#else // __MQL5__ if (_obj == nullptr) { Print( "Indi_TRIX::iTriX() can work without supplying pointer to IndicatorData only in MQL5. In this platform " @@ -86,6 +87,13 @@ class Indi_TRIX : public Indicator { } return iTriXOnIndicator(_obj, _ma_period, _ap, _mode, _shift); +#endif +#else // Non-MQL. + // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } diff --git a/Indicators/Indi_VIDYA.mqh b/Indicators/Indi_VIDYA.mqh index ace22e581..0d3b4d033 100644 --- a/Indicators/Indi_VIDYA.mqh +++ b/Indicators/Indi_VIDYA.mqh @@ -79,9 +79,10 @@ class Indi_VIDYA : public Indicator { */ static double iVIDyA(string _symbol, ENUM_TIMEFRAMES _tf, int _cmo_period, int _ema_period, int _ma_shift, ENUM_APPLIED_PRICE _ap, int _mode = 0, int _shift = 0, IndicatorData *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iVIDyA(_symbol, _tf, _cmo_period, _ema_period, _ma_shift, _ap), _mode, _shift); -#else +#else // __MQL5__ if (_obj == nullptr) { Print( "Indi_VIDYA::iVIDyA() can work without supplying pointer to IndicatorData only in MQL5. In this platform " @@ -91,6 +92,13 @@ class Indi_VIDYA : public Indicator { } return iVIDyAOnIndicator(_obj, _symbol, _tf, _cmo_period, _ema_period, _ma_shift, _ap, _mode, _shift); +#endif +#else // Non-MQL. + // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } diff --git a/Indicators/Oscillator/Indi_MACD.h b/Indicators/Oscillator/Indi_MACD.h index aeefab160..756b3e161 100644 --- a/Indicators/Oscillator/Indi_MACD.h +++ b/Indicators/Oscillator/Indi_MACD.h @@ -106,6 +106,10 @@ class Indi_MACD : public Indicator { #endif #else // Non-MQL. // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } diff --git a/Indicators/Oscillator/Indi_RSI.h b/Indicators/Oscillator/Indi_RSI.h index 3079e5bdb..2be6ae675 100644 --- a/Indicators/Oscillator/Indi_RSI.h +++ b/Indicators/Oscillator/Indi_RSI.h @@ -110,17 +110,18 @@ class Indi_RSI : public Indicator { */ static double iRSI(string _symbol = NULL, ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, unsigned int _period = 14, ENUM_APPLIED_PRICE _applied_price = PRICE_CLOSE, int _shift = 0, IndicatorData *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL4__ return ::iRSI(_symbol, _tf, _period, _applied_price, _shift); -#else -#ifdef __MQL5__ +#else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iRSI(_symbol, _tf, _period, _applied_price), 0, _shift); -#else +#endif +#else // Non-MQL. + // @todo: Use Platform class. RUNTIME_ERROR( - "In C++ Indi_RSI::iRSI() method couldn't be used directly. Please use an On-Indicator mode and attach " + "Not implemented. Please use an On-Indicator mode and attach " "indicator via Platform::Add/AddWithDefaultBindings()."); return DBL_MAX; -#endif #endif } diff --git a/Indicators/Oscillator/Indi_Stochastic.h b/Indicators/Oscillator/Indi_Stochastic.h index 6dfb8f171..118ca23a7 100644 --- a/Indicators/Oscillator/Indi_Stochastic.h +++ b/Indicators/Oscillator/Indi_Stochastic.h @@ -100,11 +100,19 @@ class Indi_Stochastic : public Indicator { // (MT5 _price_field): STO_LOWHIGH - Low/High, STO_CLOSECLOSE - Close/Close int _mode, // (MT4): 0 - MODE_MAIN/MAIN_LINE, 1 - MODE_SIGNAL/SIGNAL_LINE int _shift = 0, IndicatorData *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL4__ return ::iStochastic(_symbol, _tf, _kperiod, _dperiod, _slowing, _ma_method, _price_field, _mode, _shift); -#else // __MQL5__ +#else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN( ::iStochastic(_symbol, _tf, _kperiod, _dperiod, _slowing, _ma_method, _price_field), _mode, _shift); +#endif +#else // Non-MQL. + // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } diff --git a/Indicators/Oscillator/Indi_WPR.h b/Indicators/Oscillator/Indi_WPR.h index 33cd848a8..fdcb55e72 100644 --- a/Indicators/Oscillator/Indi_WPR.h +++ b/Indicators/Oscillator/Indi_WPR.h @@ -83,9 +83,10 @@ class Indi_WPR : public Indicator { */ static double iWPR(string _symbol = NULL, ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, unsigned int _period = 14, int _shift = 0, IndicatorData *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL4__ return ::iWPR(_symbol, _tf, _period, _shift); -#else // __MQL5__ +#else // __MQL5__ int _handle = Object::IsValid(_obj) ? _obj.Get(IndicatorState::INDICATOR_STATE_PROP_HANDLE) : NULL; double _res[]; if (_handle == NULL || _handle == INVALID_HANDLE) { @@ -111,6 +112,13 @@ class Indi_WPR : public Indicator { return ArraySize(_res) > 0 ? _res[0] : EMPTY_VALUE; } return _res[0]; +#endif +#else // Non-MQL. + // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } diff --git a/Indicators/Price/Indi_MA.h b/Indicators/Price/Indi_MA.h index 9ac3c856a..c3222a25b 100644 --- a/Indicators/Price/Indi_MA.h +++ b/Indicators/Price/Indi_MA.h @@ -37,10 +37,10 @@ // Enums. // @see: https://www.mql5.com/en/docs/constants/indicatorconstants/enum_ma_method enum ENUM_MA_METHOD { - MODE_SMA = 0, - MODE_EMA, - MODE_SMMA, - MODE_LWMA, + MODE_SMA = 0, // Simple averaging. + MODE_EMA, // Exponential averaging. + MODE_SMMA, // Smoothed averaging. + MODE_LWMA, // Linear-weighted averaging. }; #endif @@ -133,11 +133,19 @@ class Indi_MA : public Indicator { static double iMA(string _symbol, ENUM_TIMEFRAMES _tf, unsigned int _ma_period, unsigned int _ma_shift, ENUM_MA_METHOD _ma_method, ENUM_APPLIED_PRICE _applied_price, int _shift = 0, IndicatorData *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL4__ return ::iMA(_symbol, _tf, _ma_period, _ma_shift, _ma_method, _applied_price, _shift); #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iMA(_symbol, _tf, _ma_period, _ma_shift, _ma_method, _applied_price), 0, _shift); +#endif +#else // Non-MQL. + // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } diff --git a/Indicators/PriceMulti/Indi_Alligator.h b/Indicators/PriceMulti/Indi_Alligator.h index 1a6416c12..eb79041bb 100644 --- a/Indicators/PriceMulti/Indi_Alligator.h +++ b/Indicators/PriceMulti/Indi_Alligator.h @@ -140,6 +140,7 @@ class Indi_Alligator : public Indicator { int _teeth_shift, int _lips_period, int _lips_shift, ENUM_MA_METHOD _ma_method, ENUM_APPLIED_PRICE _applied_price, ENUM_ALLIGATOR_LINE _mode, int _shift = 0, IndicatorData *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL4__ return ::iAlligator(_symbol, _tf, _jaw_period, _jaw_shift, _teeth_period, _teeth_shift, _lips_period, _lips_shift, _ma_method, _applied_price, _mode, _shift); @@ -147,6 +148,13 @@ class Indi_Alligator : public Indicator { INDICATOR_BUILTIN_CALL_AND_RETURN(::iAlligator(_symbol, _tf, _jaw_period, _jaw_shift, _teeth_period, _teeth_shift, _lips_period, _lips_shift, _ma_method, _applied_price), _mode, _shift); +#endif +#else // Non-MQL. + // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } diff --git a/Indicators/PriceRange/Indi_Bands.h b/Indicators/PriceRange/Indi_Bands.h index 542ecebbd..a06a0ffeb 100644 --- a/Indicators/PriceRange/Indi_Bands.h +++ b/Indicators/PriceRange/Indi_Bands.h @@ -128,11 +128,19 @@ class Indi_Bands : public Indicator { static double iBands(string _symbol, ENUM_TIMEFRAMES _tf, unsigned int _period, double _deviation, int _bands_shift, ENUM_APPLIED_PRICE _applied_price, ENUM_BANDS_LINE _mode = BAND_BASE, int _shift = 0, IndicatorData *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL4__ return ::iBands(_symbol, _tf, _period, _deviation, _bands_shift, _applied_price, _mode, _shift); #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iBands(_symbol, _tf, _period, _bands_shift, _deviation, _applied_price), _mode, _shift); +#endif +#else // Non-MQL. + // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } diff --git a/Indicators/PriceRange/Indi_Envelopes.h b/Indicators/PriceRange/Indi_Envelopes.h index 0f2740111..e58acf46e 100644 --- a/Indicators/PriceRange/Indi_Envelopes.h +++ b/Indicators/PriceRange/Indi_Envelopes.h @@ -126,6 +126,7 @@ class Indi_Envelopes : public Indicator { int _mode, // (MT4 _mode): 0 - MODE_MAIN, 1 - MODE_UPPER, 2 - MODE_LOWER; (MT5 _mode): 0 - // UPPER_LINE, 1 - LOWER_LINE int _shift = 0, IndicatorData *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL4__ return ::iEnvelopes(_symbol, _tf, _ma_period, _ma_method, _ma_shift, _ap, _deviation, _mode, _shift); #else // __MQL5__ @@ -140,6 +141,13 @@ class Indi_Envelopes : public Indicator { INDICATOR_BUILTIN_CALL_AND_RETURN(::iEnvelopes(_symbol, _tf, _ma_period, _ma_shift, _ma_method, _ap, _deviation), _mode, _shift); +#endif +#else // Non-MQL. + // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } diff --git a/Indicators/PriceRange/Indi_SAR.h b/Indicators/PriceRange/Indi_SAR.h index b5638f345..4e5c7ca57 100644 --- a/Indicators/PriceRange/Indi_SAR.h +++ b/Indicators/PriceRange/Indi_SAR.h @@ -80,10 +80,18 @@ class Indi_SAR : public Indicator { */ static double iSAR(string _symbol = NULL, ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, double _step = 0.02, double _max = 0.2, int _shift = 0, IndicatorData *_obj = NULL) { +#ifdef __MQL__ #ifdef __MQL4__ return ::iSAR(_symbol, _tf, _step, _max, _shift); #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iSAR(_symbol, _tf, _step, _max), 0, _shift); +#endif +#else // Non-MQL. + // @todo: Use Platform class. + RUNTIME_ERROR( + "Not implemented. Please use an On-Indicator mode and attach " + "indicator via Platform::Add/AddWithDefaultBindings()."); + return DBL_MAX; #endif } From 12433989cfbd19d42c1fa6de914335be73e427a8 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 20:00:56 +0100 Subject: [PATCH 022/109] Removes Indi_Stochastic.test from the main indicator test as it is already tested --- .github/workflows/test-indicators.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test-indicators.yml b/.github/workflows/test-indicators.yml index badd88b5e..0c1856cd0 100644 --- a/.github/workflows/test-indicators.yml +++ b/.github/workflows/test-indicators.yml @@ -96,7 +96,6 @@ jobs: - Indi_RVI.test - Indi_RateOfChange.test - Indi_StdDev.test - - Indi_Stochastic.test - Indi_TEMA.test - Indi_TRIX.test - Indi_UltimateOscillator.test From 9676225972c6c3886aa4fbfd5c47fe067b6068ca Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 20:01:06 +0100 Subject: [PATCH 023/109] Adds ENUM_STO_PRICE for non-MQL --- Indicators/Oscillator/Indi_Stochastic.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Indicators/Oscillator/Indi_Stochastic.h b/Indicators/Oscillator/Indi_Stochastic.h index 118ca23a7..b89c29069 100644 --- a/Indicators/Oscillator/Indi_Stochastic.h +++ b/Indicators/Oscillator/Indi_Stochastic.h @@ -24,6 +24,15 @@ #include "../../Indicator/Indicator.h" #include "../Price/Indi_MA.h" +#ifndef __MQL__ +// Enums. +// @see: https://www.mql5.com/en/docs/constants/indicatorconstants/prices +enum ENUM_STO_PRICE { + STO_LOWHIGH = 0, // Calculation is based on Low/High prices. + STO_CLOSECLOSE, // Calculation is based on Close/Close prices. +}; +#endif + #ifndef __MQL4__ // Defines global functions (for MQL4 backward compability). double iStochastic(string _symbol, int _tf, int _kperiod, int _dperiod, int _slowing, int _ma_method, int _pf, From dcc55cb746dae1868d2a8d3ad194a630cd021b35 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 20:02:06 +0100 Subject: [PATCH 024/109] Adds Indi_OHLC.test.cpp --- Indicators/OHLC/tests/Indi_OHLC.test.cpp | 35 ++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Indicators/OHLC/tests/Indi_OHLC.test.cpp diff --git a/Indicators/OHLC/tests/Indi_OHLC.test.cpp b/Indicators/OHLC/tests/Indi_OHLC.test.cpp new file mode 100644 index 000000000..c24d48bdb --- /dev/null +++ b/Indicators/OHLC/tests/Indi_OHLC.test.cpp @@ -0,0 +1,35 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_OHLC indicator class. + */ + +// Includes. +#include "../Indi_OHLC.mqh" +#include "../../../Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} From 9a43c0ee874575e5ce70043a958450c0450d8e4f Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 20:03:46 +0100 Subject: [PATCH 025/109] Adds CPP tests for MACD and RSI --- .../Oscillator/tests/Indi_MACD.test.cpp | 65 +++++++++++++++++++ Indicators/Oscillator/tests/Indi_RSI.test.cpp | 36 ++++++++++ Indicators/Oscillator/tests/Makefile | 12 ++++ 3 files changed, 113 insertions(+) create mode 100644 Indicators/Oscillator/tests/Indi_MACD.test.cpp create mode 100644 Indicators/Oscillator/tests/Indi_RSI.test.cpp create mode 100644 Indicators/Oscillator/tests/Makefile diff --git a/Indicators/Oscillator/tests/Indi_MACD.test.cpp b/Indicators/Oscillator/tests/Indi_MACD.test.cpp new file mode 100644 index 000000000..cd5a2a498 --- /dev/null +++ b/Indicators/Oscillator/tests/Indi_MACD.test.cpp @@ -0,0 +1,65 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_MACD class. + */ + +// Include enumerations. +#include "../../../Chart.enum.h" + +// Define external functions. + +// Calculates the Moving Averages Convergence/Divergence indicator and returns its value. +// @docs +// - https://docs.mql4.com/indicators/imacd +// - https://www.mql5.com/en/docs/indicators/imacd +/* +extern double iMACD( + string symbol, // Symbol. + int timeframe, // Timeframe> + int fast_ema_period, // Fast EMA period. + int slow_ema_period, // Slow EMA period. + int signal_period, // Signal line period. + int applied_price, // Applied price. + int mode, // Line index. + int shift // Shift. + ); +extern int iMACD( + string symbol, // Symbol name. + ENUM_TIMEFRAMES period, // Period. + int fast_ema_period, // Period for Fast average calculation. + int slow_ema_period, // Period for Slow average calculation. + int signal_period, // Period for their difference averaging. + ENUM_APPLIED_PRICE applied_price // Type of price or handle. + ); +*/ + +// Includes. +#include "../../../Platform.h" +#include "../Indi_MACD.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/Oscillator/tests/Indi_RSI.test.cpp b/Indicators/Oscillator/tests/Indi_RSI.test.cpp new file mode 100644 index 000000000..c0632c853 --- /dev/null +++ b/Indicators/Oscillator/tests/Indi_RSI.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_RSI class. + */ + +// Includes. +#include "../Indi_RSI.h" + +#include "../../../Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/Oscillator/tests/Makefile b/Indicators/Oscillator/tests/Makefile new file mode 100644 index 000000000..e792364f0 --- /dev/null +++ b/Indicators/Oscillator/tests/Makefile @@ -0,0 +1,12 @@ +CC := g++ # C++ compiler +CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags +SRCS := $(wildcard *.cpp) # Get all .cpp files in the current directory +OBJS := $(SRCS:.cpp=.o) # Object files corresponding to the source files + +all: $(OBJS) + +%.o: %.cpp + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -v $(OBJS) From d8a9e400b3d4390468f786d7d0ecc30f2ce9da5a Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 20:19:05 +0100 Subject: [PATCH 026/109] Adds Chart.test.cpp with fixes --- Chart.enum.h | 4 ++-- Chart.mqh | 2 ++ Chart.struct.h | 2 +- Market.mqh | 2 +- Platform.extern.h | 1 + tests/Chart.test.cpp | 36 ++++++++++++++++++++++++++++++++++++ 6 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 tests/Chart.test.cpp diff --git a/Chart.enum.h b/Chart.enum.h index da71f9581..23feefcc9 100644 --- a/Chart.enum.h +++ b/Chart.enum.h @@ -55,8 +55,8 @@ enum ENUM_APPLIED_PRICE { enum ENUM_CHART_PARAM { CHART_PARAM_NONE = 0, // None CHART_PARAM_ID, // Chart ID - // CHART_PARAM_SYMBOL, // Symbol - // CHART_PARAM_TF, // Timeframe + CHART_PARAM_SYMBOL, // Symbol + CHART_PARAM_TF, // Timeframe CHART_PARAM_TFI, // Timeframe index FINAL_ENUM_CHART_PARAM }; diff --git a/Chart.mqh b/Chart.mqh index ef20cd5f8..0555f444f 100644 --- a/Chart.mqh +++ b/Chart.mqh @@ -123,10 +123,12 @@ class Chart : public Market { * _hide bool Flag for hiding indicators when testing. Set true to hide created indicators, otherwise false. */ static void HideTestIndicators(bool _hide = false) { +#ifdef __MQL__ #ifdef __MQL4__ ::HideTestIndicators(_hide); #else // __MQL5__ ::TesterHideIndicators(_hide); +#endif #endif } diff --git a/Chart.struct.h b/Chart.struct.h index 662b01e6f..66bb1ab39 100644 --- a/Chart.struct.h +++ b/Chart.struct.h @@ -113,4 +113,4 @@ struct ChartParams { } // Serializers. SerializerNodeType Serialize(Serializer& s); -} chart_params_defaults(PERIOD_CURRENT, _Symbol); +} chart_params_defaults(PERIOD_CURRENT, Symbol()); diff --git a/Market.mqh b/Market.mqh index 996c83456..538a57319 100644 --- a/Market.mqh +++ b/Market.mqh @@ -270,7 +270,7 @@ class Market : public SymbolInfo { case MARKET_COND_SPREAD_GT_20: return GetSpreadInPts() > 20; default: - GetLogger().Error(StringFormat("Invalid market condition: %s!", EnumToString(_cond), __FUNCTION_LINE__)); + logger.Error(StringFormat("Invalid market condition: %s!", EnumToString(_cond), __FUNCTION_LINE__)); return false; } } diff --git a/Platform.extern.h b/Platform.extern.h index 9489f3418..0b163d817 100644 --- a/Platform.extern.h +++ b/Platform.extern.h @@ -30,6 +30,7 @@ #include "Deal.enum.h" #include "Storage/Object.extern.h" #include "Order.define.h" +#include "Order.enum.h" #include "Terminal.enum.h" // Forward declarations. diff --git a/tests/Chart.test.cpp b/tests/Chart.test.cpp new file mode 100644 index 000000000..8af455686 --- /dev/null +++ b/tests/Chart.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test C++ compilation of ChartTest class. + */ + +// Includes. +#include "../Chart.mqh" +#include "../Platform.h" + +int main(int argc, char **argv) { + + // @todo + + return 0; +} From 246b1ec6a103f20b78abb369e79fee2f6b1c3636 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 20:23:25 +0100 Subject: [PATCH 027/109] Renames Flags.h to Flags.struct.h (GH-556) --- Indicator/Indicator.h | 2 +- Indicator/IndicatorData.h | 2 +- Platform.h | 2 +- Storage/{Flags.h => Flags.struct.h} | 0 4 files changed, 3 insertions(+), 3 deletions(-) rename Storage/{Flags.h => Flags.struct.h} (100%) diff --git a/Indicator/Indicator.h b/Indicator/Indicator.h index 5b2fd50f9..095320158 100644 --- a/Indicator/Indicator.h +++ b/Indicator/Indicator.h @@ -32,7 +32,7 @@ struct IndicatorParams; #include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Storage/DateTime.h" #include "../Indicators/DrawIndicator.mqh" -#include "../Storage/Flags.h" +#include "../Storage/Flags.struct.h" #include "../Math.h" #include "../Storage/Object.h" #include "../Refs.mqh" diff --git a/Indicator/IndicatorData.h b/Indicator/IndicatorData.h index 522343b43..35ef21b00 100644 --- a/Indicator/IndicatorData.h +++ b/Indicator/IndicatorData.h @@ -41,7 +41,7 @@ struct ExternInstantiateIndicatorBufferValueStorageDouble { // Includes. #include "../Bar.struct.h" #include "../Chart.struct.tf.h" -#include "../Storage/Flags.h" +#include "../Storage/Flags.struct.h" #include "../Storage/IValueStorage.h" #include "../Storage/ItemsHistory.h" #include "../SymbolInfo.struct.h" diff --git a/Platform.h b/Platform.h index 0bd49058f..8f5d43521 100644 --- a/Platform.h +++ b/Platform.h @@ -47,7 +47,7 @@ extern int Bars(CONST_REF_TO(string) _symbol, ENUM_TIMEFRAMES _tf); */ #include "Indicators/DrawIndicator.mqh" -#include "Storage/Flags.h" +#include "Storage/Flags.struct.h" #include "Indicator/IndicatorData.h" #include "Indicator/tests/classes/IndicatorTfDummy.h" #include "Std.h" diff --git a/Storage/Flags.h b/Storage/Flags.struct.h similarity index 100% rename from Storage/Flags.h rename to Storage/Flags.struct.h From 3f374f7c08f3fe0f2042c46f50277ae0163c011a Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 20:37:08 +0100 Subject: [PATCH 028/109] Moves Indi_AppliedPrice to Price/ with code fixes (GH-556) --- .github/workflows/test-indicators-price.yml | 1 + .github/workflows/test-indicators.yml | 2 -- CONTRIBUTING.md | 1 + .../{Indi_AppliedPrice.mqh => Price/Indi_AppliedPrice.h} | 8 ++++---- Indicators/Price/includes.h | 1 + Indicators/{ => Price}/tests/Indi_AppliedPrice.test.mq4 | 0 Indicators/{ => Price}/tests/Indi_AppliedPrice.test.mq5 | 8 ++++---- Indicators/includes.h | 1 - 8 files changed, 11 insertions(+), 11 deletions(-) rename Indicators/{Indi_AppliedPrice.mqh => Price/Indi_AppliedPrice.h} (95%) rename Indicators/{ => Price}/tests/Indi_AppliedPrice.test.mq4 (100%) rename Indicators/{ => Price}/tests/Indi_AppliedPrice.test.mq5 (90%) diff --git a/.github/workflows/test-indicators-price.yml b/.github/workflows/test-indicators-price.yml index 026872630..ea5271c4e 100644 --- a/.github/workflows/test-indicators-price.yml +++ b/.github/workflows/test-indicators-price.yml @@ -50,6 +50,7 @@ jobs: strategy: matrix: test: + - Indi_AppliedPrice.test - Indi_MA.test - Indi_Price.test steps: diff --git a/.github/workflows/test-indicators.yml b/.github/workflows/test-indicators.yml index 0c1856cd0..e69133e32 100644 --- a/.github/workflows/test-indicators.yml +++ b/.github/workflows/test-indicators.yml @@ -59,7 +59,6 @@ jobs: - Indi_AO.test - Indi_ASI.test - Indi_ATR.test - - Indi_AppliedPrice.test - Indi_BWMFI.test - Indi_BWZT.test - Indi_BearsPower.test @@ -92,7 +91,6 @@ jobs: - Indi_PriceFeeder.test - Indi_PriceVolumeTrend.test - Indi_RS.test - - Indi_RSI.test - Indi_RVI.test - Indi_RateOfChange.test - Indi_StdDev.test diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dc3d3847c..59ca2257e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -37,6 +37,7 @@ To improve code compatibility, please use the following syntax: | `T name[]` | `_cpp_array name` | `ARRAY(T, name)` | | `T N[]` | `_cpp_array> N` | `ARRAY(T, N)` | | `obj.Method()` | `obj->Method()` | `obj PTR_DEREF Method()` | +| `obj.Ptr().a` | `obj.Ptr()->a` | `obj REF_DEREF a` | | `obj.a1.a2` | `obj->a1->a2` | `PTR_ATTRIB2(obj, a1, a2)` | | `obj.attr` | `obj->attr` | `PTR_ATTRIB(obj, attr)` | | `str == NULL` | `str == NULL` | `IsNull(str)` | diff --git a/Indicators/Indi_AppliedPrice.mqh b/Indicators/Price/Indi_AppliedPrice.h similarity index 95% rename from Indicators/Indi_AppliedPrice.mqh rename to Indicators/Price/Indi_AppliedPrice.h index 331f0e014..a0d561549 100644 --- a/Indicators/Indi_AppliedPrice.mqh +++ b/Indicators/Price/Indi_AppliedPrice.h @@ -21,9 +21,9 @@ */ // Includes. -#include "../Storage/Dict/Buffer/BufferStruct.h" -#include "../Indicator/Indicator.h" -#include "OHLC/Indi_OHLC.mqh" +#include "../../Storage/Dict/Buffer/BufferStruct.h" +#include "../../Indicator/Indicator.h" +#include "../OHLC/Indi_OHLC.mqh" // Structs. struct IndiAppliedPriceParams : IndicatorParams { @@ -114,7 +114,7 @@ class Indi_AppliedPrice : public Indicator { switch (Get(STRUCT_ENUM(IndicatorDataParams, IDATA_PARAM_IDSTYPE))) { case IDATA_INDICATOR: if (!HasDataSource()) { - GetLogger().Error("Indi_AppliedPrice requires source indicator to be set via SetDataSource()!"); + logger REF_DEREF Error("Indi_AppliedPrice requires source indicator to be set via SetDataSource()!"); _is_valid &= false; } break; diff --git a/Indicators/Price/includes.h b/Indicators/Price/includes.h index 58a1789de..c021ad24a 100644 --- a/Indicators/Price/includes.h +++ b/Indicators/Price/includes.h @@ -26,5 +26,6 @@ */ // Price indicators. +#include "Indi_AppliedPrice.h" #include "Indi_MA.h" #include "Indi_Price.h" diff --git a/Indicators/tests/Indi_AppliedPrice.test.mq4 b/Indicators/Price/tests/Indi_AppliedPrice.test.mq4 similarity index 100% rename from Indicators/tests/Indi_AppliedPrice.test.mq4 rename to Indicators/Price/tests/Indi_AppliedPrice.test.mq4 diff --git a/Indicators/tests/Indi_AppliedPrice.test.mq5 b/Indicators/Price/tests/Indi_AppliedPrice.test.mq5 similarity index 90% rename from Indicators/tests/Indi_AppliedPrice.test.mq5 rename to Indicators/Price/tests/Indi_AppliedPrice.test.mq5 index 99ebd3fa2..edfa281f4 100644 --- a/Indicators/tests/Indi_AppliedPrice.test.mq5 +++ b/Indicators/Price/tests/Indi_AppliedPrice.test.mq5 @@ -20,10 +20,10 @@ */ // Includes. -#include "../../Platform.h" -#include "../../Test.mqh" -#include "../Indi_AppliedPrice.mqh" -#include "../Price/Indi_Price.h" +#include "../../../Platform.h" +#include "../../../Test.mqh" +#include "../Indi_AppliedPrice.h" +#include "../Indi_Price.h" /** * @file diff --git a/Indicators/includes.h b/Indicators/includes.h index f12d74e06..6d397c882 100644 --- a/Indicators/includes.h +++ b/Indicators/includes.h @@ -34,7 +34,6 @@ #include "Indi_AO.mqh" #include "Indi_ASI.mqh" #include "Indi_ATR.mqh" -#include "Indi_AppliedPrice.mqh" #include "Indi_BWMFI.mqh" #include "Indi_BWZT.mqh" #include "Indi_BearsPower.mqh" From 65ab85fcffdaf83a5b786c956c697f061d820893 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 21:30:57 +0100 Subject: [PATCH 029/109] Indicator: Removes unused ENUM_INDI_DS_MODE_KIND --- Indicator/Indicator.enum.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Indicator/Indicator.enum.h b/Indicator/Indicator.enum.h index f67244456..fcbf71f51 100644 --- a/Indicator/Indicator.enum.h +++ b/Indicator/Indicator.enum.h @@ -213,11 +213,3 @@ enum ENUM_INDI_SUITABLE_DS_TYPE { INDI_SUITABLE_DS_TYPE_BASE_ONLY = 1 << 6, // Required data source must be directly connected to this data source. INDI_SUITABLE_DS_TYPE_EXPECT_ANY = 1 << 7, // Requires data source of any kind. }; - -// Type of data source mode. Required to determine what "mode" means for the user. -enum ENUM_INDI_DS_MODE_KIND { - INDI_DS_MODE_KIND_INDEX, // Mode is a buffer index. - INDI_DS_MODE_KIND_VS_TYPE, // Mode is a value from ENUM_INDI_VS_TYPE enumeration, e.g., ENUM_INDI_VS_PRICE_OPEN. - INDI_DS_MODE_KIND_AP, // Mode is a value from ENUM_APPLIED_PRICE enumeration. It is used to retrieve value storage - // based on ENUM_INDI_VS_TYPE enumeration, e.g., PRICE_OPEN becomes ENUM_INDI_VS_PRICE_OPEN. -}; From 218834af42dc0e9d4845a016ecfe2398c0076303 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 21:32:19 +0100 Subject: [PATCH 030/109] Renames INDI_VS_TYPE to INDI_DATA_VS_TYPE (GH-556) --- Indicator/IndicatorCandle.h | 48 ++++++------- Indicator/IndicatorData.enum.h | 52 +++++++------- Indicator/IndicatorData.h | 112 ++++++++++++++--------------- Indicator/IndicatorTick.h | 24 +++---- Indicator/IndicatorTickSource.h | 18 ++--- Indicators/Indi_ColorLine.mqh | 2 +- Indicators/Indi_DetrendedPrice.mqh | 2 +- Indicators/Indi_OBV.mqh | 2 +- Indicators/Indi_VROC.mqh | 2 +- Indicators/Indi_Volumes.mqh | 2 +- Indicators/Price/Indi_MA.h | 14 ++-- Indicators/Price/Indi_Price.h | 40 +++++------ Storage/Dict/Buffer/BufferTick.h | 28 ++++---- Storage/ValueStorage.h | 16 ++--- tests/IndicatorsTest.mq5 | 2 +- 15 files changed, 182 insertions(+), 182 deletions(-) diff --git a/Indicator/IndicatorCandle.h b/Indicator/IndicatorCandle.h index d9fe084a2..77917b081 100644 --- a/Indicator/IndicatorCandle.h +++ b/Indicator/IndicatorCandle.h @@ -349,29 +349,29 @@ class IndicatorCandle : public Indicator { /** * Returns value storage of given kind. */ - IValueStorage* GetSpecificValueStorage(ENUM_INDI_VS_TYPE _type) override { + IValueStorage* GetSpecificValueStorage(ENUM_INDI_DATA_VS_TYPE _type) override { switch (_type) { - case INDI_VS_TYPE_PRICE_OPEN: + case INDI_DATA_VS_TYPE_PRICE_OPEN: return GetValueStorage(INDI_CANDLE_MODE_PRICE_OPEN); - case INDI_VS_TYPE_PRICE_HIGH: + case INDI_DATA_VS_TYPE_PRICE_HIGH: return GetValueStorage(INDI_CANDLE_MODE_PRICE_HIGH); - case INDI_VS_TYPE_PRICE_LOW: + case INDI_DATA_VS_TYPE_PRICE_LOW: return GetValueStorage(INDI_CANDLE_MODE_PRICE_LOW); - case INDI_VS_TYPE_PRICE_CLOSE: + case INDI_DATA_VS_TYPE_PRICE_CLOSE: return GetValueStorage(INDI_CANDLE_MODE_PRICE_CLOSE); - case INDI_VS_TYPE_PRICE_MEDIAN: + case INDI_DATA_VS_TYPE_PRICE_MEDIAN: return GetValueStorage(INDI_CANDLE_MODE_PRICE_MEDIAN); - case INDI_VS_TYPE_PRICE_TYPICAL: + case INDI_DATA_VS_TYPE_PRICE_TYPICAL: return GetValueStorage(INDI_CANDLE_MODE_PRICE_TYPICAL); - case INDI_VS_TYPE_PRICE_WEIGHTED: + case INDI_DATA_VS_TYPE_PRICE_WEIGHTED: return GetValueStorage(INDI_CANDLE_MODE_PRICE_WEIGHTED); - case INDI_VS_TYPE_SPREAD: + case INDI_DATA_VS_TYPE_SPREAD: return GetValueStorage(INDI_CANDLE_MODE_SPREAD); - case INDI_VS_TYPE_TICK_VOLUME: + case INDI_DATA_VS_TYPE_TICK_VOLUME: return GetValueStorage(INDI_CANDLE_MODE_TICK_VOLUME); - case INDI_VS_TYPE_TIME: + case INDI_DATA_VS_TYPE_TIME: return GetValueStorage(INDI_CANDLE_MODE_TIME); - case INDI_VS_TYPE_VOLUME: + case INDI_DATA_VS_TYPE_VOLUME: return GetValueStorage(INDI_CANDLE_MODE_VOLUME); default: // Trying in parent class. @@ -382,19 +382,19 @@ class IndicatorCandle : public Indicator { /** * Checks whether indicator support given value storage type. */ - bool HasSpecificValueStorage(ENUM_INDI_VS_TYPE _type) override { + bool HasSpecificValueStorage(ENUM_INDI_DATA_VS_TYPE _type) override { switch (_type) { - case INDI_VS_TYPE_PRICE_OPEN: - case INDI_VS_TYPE_PRICE_HIGH: - case INDI_VS_TYPE_PRICE_LOW: - case INDI_VS_TYPE_PRICE_CLOSE: - case INDI_VS_TYPE_PRICE_MEDIAN: - case INDI_VS_TYPE_PRICE_TYPICAL: - case INDI_VS_TYPE_PRICE_WEIGHTED: - case INDI_VS_TYPE_SPREAD: - case INDI_VS_TYPE_TICK_VOLUME: - case INDI_VS_TYPE_TIME: - case INDI_VS_TYPE_VOLUME: + case INDI_DATA_VS_TYPE_PRICE_OPEN: + case INDI_DATA_VS_TYPE_PRICE_HIGH: + case INDI_DATA_VS_TYPE_PRICE_LOW: + case INDI_DATA_VS_TYPE_PRICE_CLOSE: + case INDI_DATA_VS_TYPE_PRICE_MEDIAN: + case INDI_DATA_VS_TYPE_PRICE_TYPICAL: + case INDI_DATA_VS_TYPE_PRICE_WEIGHTED: + case INDI_DATA_VS_TYPE_SPREAD: + case INDI_DATA_VS_TYPE_TICK_VOLUME: + case INDI_DATA_VS_TYPE_TIME: + case INDI_DATA_VS_TYPE_VOLUME: return true; default: // Trying in parent class. diff --git a/Indicator/IndicatorData.enum.h b/Indicator/IndicatorData.enum.h index 9c22d82af..b29b52e49 100644 --- a/Indicator/IndicatorData.enum.h +++ b/Indicator/IndicatorData.enum.h @@ -52,33 +52,33 @@ enum ENUM_INDICATOR_INDEX { }; // Storage type for IndicatorBase::GetSpecificValueStorage(). -enum ENUM_INDI_VS_TYPE { - INDI_VS_TYPE_NONE, // Not set. - INDI_VS_TYPE_TIME, // Candle. - INDI_VS_TYPE_TICK_VOLUME, // Candle. - INDI_VS_TYPE_VOLUME, // Candle. - INDI_VS_TYPE_SPREAD, // Candle. - INDI_VS_TYPE_PRICE_OPEN, // Candle. - INDI_VS_TYPE_PRICE_HIGH, // Candle. - INDI_VS_TYPE_PRICE_LOW, // Candle. - INDI_VS_TYPE_PRICE_CLOSE, // Candle. - INDI_VS_TYPE_PRICE_MEDIAN, // Candle. - INDI_VS_TYPE_PRICE_TYPICAL, // Candle. - INDI_VS_TYPE_PRICE_WEIGHTED, // Candle. - INDI_VS_TYPE_PRICE_BID, // Tick. - INDI_VS_TYPE_PRICE_ASK, // Tick. +enum ENUM_INDI_DATA_VS_TYPE { + INDI_DATA_VS_TYPE_NONE, // Not set. + INDI_DATA_VS_TYPE_TIME, // Candle. + INDI_DATA_VS_TYPE_TICK_VOLUME, // Candle. + INDI_DATA_VS_TYPE_VOLUME, // Candle. + INDI_DATA_VS_TYPE_SPREAD, // Candle. + INDI_DATA_VS_TYPE_PRICE_OPEN, // Candle. + INDI_DATA_VS_TYPE_PRICE_HIGH, // Candle. + INDI_DATA_VS_TYPE_PRICE_LOW, // Candle. + INDI_DATA_VS_TYPE_PRICE_CLOSE, // Candle. + INDI_DATA_VS_TYPE_PRICE_MEDIAN, // Candle. + INDI_DATA_VS_TYPE_PRICE_TYPICAL, // Candle. + INDI_DATA_VS_TYPE_PRICE_WEIGHTED, // Candle. + INDI_DATA_VS_TYPE_PRICE_BID, // Tick. + INDI_DATA_VS_TYPE_PRICE_ASK, // Tick. // Indexed value storages, available if indicator have buffer at this index: - INDI_VS_TYPE_INDEX_0, - INDI_VS_TYPE_INDEX_1, - INDI_VS_TYPE_INDEX_2, - INDI_VS_TYPE_INDEX_4, - INDI_VS_TYPE_INDEX_5, - INDI_VS_TYPE_INDEX_6, - INDI_VS_TYPE_INDEX_7, - INDI_VS_TYPE_INDEX_8, - INDI_VS_TYPE_INDEX_9, - INDI_VS_TYPE_INDEX_FIRST = INDI_VS_TYPE_INDEX_0, - INDI_VS_TYPE_INDEX_LAST = INDI_VS_TYPE_INDEX_9 + INDI_DATA_VS_TYPE_INDEX_0, + INDI_DATA_VS_TYPE_INDEX_1, + INDI_DATA_VS_TYPE_INDEX_2, + INDI_DATA_VS_TYPE_INDEX_4, + INDI_DATA_VS_TYPE_INDEX_5, + INDI_DATA_VS_TYPE_INDEX_6, + INDI_DATA_VS_TYPE_INDEX_7, + INDI_DATA_VS_TYPE_INDEX_8, + INDI_DATA_VS_TYPE_INDEX_9, + INDI_DATA_VS_TYPE_INDEX_FIRST = INDI_DATA_VS_TYPE_INDEX_0, + INDI_DATA_VS_TYPE_INDEX_LAST = INDI_DATA_VS_TYPE_INDEX_9 }; /* Defines type of source data for. Also used for Indicator::GetPossibleDataModes(). */ diff --git a/Indicator/IndicatorData.h b/Indicator/IndicatorData.h index 35ef21b00..55de3f3bb 100644 --- a/Indicator/IndicatorData.h +++ b/Indicator/IndicatorData.h @@ -68,7 +68,7 @@ class IndicatorData : public IndicatorBase { long first_tick_time_ms; // Time of the first ask/bid tick. void* mydata; bool last_tick_result; // Result of the last Tick() invocation. - ENUM_INDI_VS_TYPE retarget_ap_av; // Value storage type to be used as applied price/volume. + ENUM_INDI_DATA_VS_TYPE retarget_ap_av; // Value storage type to be used as applied price/volume. ARRAY(Ref, value_storages); ARRAY(WeakRef, listeners); // List of indicators that listens for events from this one. BufferStruct idata; @@ -111,7 +111,7 @@ class IndicatorData : public IndicatorBase { flags = INDI_FLAG_INDEXABLE_BY_SHIFT | INDI_FLAG_SOURCE_REQ_INDEXABLE_BY_SHIFT; calc_start_bar = 0; last_tick_index = -1; - retarget_ap_av = INDI_VS_TYPE_NONE; + retarget_ap_av = INDI_DATA_VS_TYPE_NONE; InitDraw(); return true; } @@ -653,7 +653,7 @@ class IndicatorData : public IndicatorBase { /** * Gets value storage type previously set by SetDataSourceAppliedPrice() or SetDataSourceAppliedVolume(). */ - ENUM_INDI_VS_TYPE GetDataSourceAppliedType() { return retarget_ap_av; } + ENUM_INDI_DATA_VS_TYPE GetDataSourceAppliedType() { return retarget_ap_av; } // int GetDataSourceMode() { return indi_src_mode; } @@ -833,7 +833,7 @@ class IndicatorData : public IndicatorBase { /** * Uses custom value storage type as applied price. */ - void SetDataSourceAppliedPrice(ENUM_INDI_VS_TYPE _vs_type) { + void SetDataSourceAppliedPrice(ENUM_INDI_DATA_VS_TYPE _vs_type) { // @todo Check if given value storage is of compatible type (double)! retarget_ap_av = _vs_type; } @@ -854,10 +854,10 @@ class IndicatorData : public IndicatorBase { * Checks whether current indicator has all buffers required to be a Candle-compatible indicator. */ bool IsCandleIndicator() { - return HasSpecificValueStorage(INDI_VS_TYPE_PRICE_OPEN) && HasSpecificValueStorage(INDI_VS_TYPE_PRICE_HIGH) && - HasSpecificValueStorage(INDI_VS_TYPE_PRICE_LOW) && HasSpecificValueStorage(INDI_VS_TYPE_PRICE_CLOSE) && - HasSpecificValueStorage(INDI_VS_TYPE_SPREAD) && HasSpecificValueStorage(INDI_VS_TYPE_TICK_VOLUME) && - HasSpecificValueStorage(INDI_VS_TYPE_TIME) && HasSpecificValueStorage(INDI_VS_TYPE_VOLUME); + return HasSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_OPEN) && HasSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_HIGH) && + HasSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_LOW) && HasSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_CLOSE) && + HasSpecificValueStorage(INDI_DATA_VS_TYPE_SPREAD) && HasSpecificValueStorage(INDI_DATA_VS_TYPE_TICK_VOLUME) && + HasSpecificValueStorage(INDI_DATA_VS_TYPE_TIME) && HasSpecificValueStorage(INDI_DATA_VS_TYPE_VOLUME); } /* Tick methods */ @@ -866,9 +866,9 @@ class IndicatorData : public IndicatorBase { * Checks whether current indicator has all buffers required to be a Tick-compatible indicator. */ bool IsTickIndicator() { - return HasSpecificValueStorage(INDI_VS_TYPE_PRICE_ASK) && HasSpecificValueStorage(INDI_VS_TYPE_PRICE_BID) && - HasSpecificValueStorage(INDI_VS_TYPE_SPREAD) && HasSpecificValueStorage(INDI_VS_TYPE_VOLUME) && - HasSpecificValueStorage(INDI_VS_TYPE_TICK_VOLUME); + return HasSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_ASK) && HasSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_BID) && + HasSpecificValueStorage(INDI_DATA_VS_TYPE_SPREAD) && HasSpecificValueStorage(INDI_DATA_VS_TYPE_VOLUME) && + HasSpecificValueStorage(INDI_DATA_VS_TYPE_TICK_VOLUME); } bool Tick(int _global_tick_index) { @@ -1072,38 +1072,38 @@ class IndicatorData : public IndicatorBase { * Returns value storage's buffer type from this indicator's applied price (indicator must override GetAppliedPrice() * method!). */ - virtual ENUM_INDI_VS_TYPE GetAppliedPriceValueStorageType() { - if (retarget_ap_av != INDI_VS_TYPE_NONE) { + virtual ENUM_INDI_DATA_VS_TYPE GetAppliedPriceValueStorageType() { + if (retarget_ap_av != INDI_DATA_VS_TYPE_NONE) { // User wants to use custom value storage type as applied price. return retarget_ap_av; } switch (GetAppliedPrice()) { case PRICE_OPEN: - return INDI_VS_TYPE_PRICE_OPEN; + return INDI_DATA_VS_TYPE_PRICE_OPEN; case PRICE_HIGH: - return INDI_VS_TYPE_PRICE_HIGH; + return INDI_DATA_VS_TYPE_PRICE_HIGH; case PRICE_LOW: - return INDI_VS_TYPE_PRICE_LOW; + return INDI_DATA_VS_TYPE_PRICE_LOW; case PRICE_CLOSE: - return INDI_VS_TYPE_PRICE_CLOSE; + return INDI_DATA_VS_TYPE_PRICE_CLOSE; case PRICE_MEDIAN: - return INDI_VS_TYPE_PRICE_MEDIAN; + return INDI_DATA_VS_TYPE_PRICE_MEDIAN; case PRICE_TYPICAL: - return INDI_VS_TYPE_PRICE_TYPICAL; + return INDI_DATA_VS_TYPE_PRICE_TYPICAL; case PRICE_WEIGHTED: - return INDI_VS_TYPE_PRICE_WEIGHTED; + return INDI_DATA_VS_TYPE_PRICE_WEIGHTED; default: if ((int)GetAppliedPrice() == (int)PRICE_ASK) { - return INDI_VS_TYPE_PRICE_ASK; + return INDI_DATA_VS_TYPE_PRICE_ASK; } else if ((int)GetAppliedPrice() == (int)PRICE_BID) { - return INDI_VS_TYPE_PRICE_BID; + return INDI_DATA_VS_TYPE_PRICE_BID; } } Print("Error: ", GetFullName(), " has not supported applied price set: ", EnumToString(GetAppliedPrice()), "!"); DebugBreak(); - return (ENUM_INDI_VS_TYPE)-1; + return (ENUM_INDI_DATA_VS_TYPE)-1; } /** @@ -1119,22 +1119,22 @@ class IndicatorData : public IndicatorBase { * Returns value storage's buffer type from this indicator's applied volume (indicator must override * GetAppliedVolume() method!). */ - virtual ENUM_INDI_VS_TYPE GetAppliedVolumeValueStorageType() { - if (retarget_ap_av != INDI_VS_TYPE_NONE) { + virtual ENUM_INDI_DATA_VS_TYPE GetAppliedVolumeValueStorageType() { + if (retarget_ap_av != INDI_DATA_VS_TYPE_NONE) { // User wants to use custom value storage type as applied volume. return retarget_ap_av; } switch (GetAppliedVolume()) { case VOLUME_TICK: - return INDI_VS_TYPE_TICK_VOLUME; + return INDI_DATA_VS_TYPE_TICK_VOLUME; case VOLUME_REAL: - return INDI_VS_TYPE_VOLUME; + return INDI_DATA_VS_TYPE_VOLUME; } Print("Error: ", GetFullName(), " has not supported applied volume set: ", EnumToString(GetAppliedVolume()), "!"); DebugBreak(); - return (ENUM_INDI_VS_TYPE)-1; + return (ENUM_INDI_DATA_VS_TYPE)-1; } /** @@ -1338,7 +1338,7 @@ class IndicatorData : public IndicatorBase { virtual bool HasSpecificAppliedPriceValueStorage(ENUM_APPLIED_PRICE _ap, IndicatorData* _target = nullptr) { if (_target != nullptr) { - if (_target PTR_DEREF GetDataSourceAppliedType() != INDI_VS_TYPE_NONE) { + if (_target PTR_DEREF GetDataSourceAppliedType() != INDI_DATA_VS_TYPE_NONE) { // User wants to use custom value storage type as applied price, so we forcefully override AP given as the // parameter. // @todo Check for value storage compatibility (double). @@ -1348,24 +1348,24 @@ class IndicatorData : public IndicatorBase { switch (_ap) { case PRICE_OPEN: - return HasSpecificValueStorage(INDI_VS_TYPE_PRICE_OPEN); + return HasSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_OPEN); case PRICE_HIGH: - return HasSpecificValueStorage(INDI_VS_TYPE_PRICE_HIGH); + return HasSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_HIGH); case PRICE_LOW: - return HasSpecificValueStorage(INDI_VS_TYPE_PRICE_LOW); + return HasSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_LOW); case PRICE_CLOSE: - return HasSpecificValueStorage(INDI_VS_TYPE_PRICE_CLOSE); + return HasSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_CLOSE); case PRICE_MEDIAN: - return HasSpecificValueStorage(INDI_VS_TYPE_PRICE_MEDIAN); + return HasSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_MEDIAN); case PRICE_TYPICAL: - return HasSpecificValueStorage(INDI_VS_TYPE_PRICE_TYPICAL); + return HasSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_TYPICAL); case PRICE_WEIGHTED: - return HasSpecificValueStorage(INDI_VS_TYPE_PRICE_WEIGHTED); + return HasSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_WEIGHTED); default: if ((int)GetAppliedPrice() == (int)PRICE_ASK) { - return HasSpecificValueStorage(INDI_VS_TYPE_PRICE_ASK); + return HasSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_ASK); } else if ((int)GetAppliedPrice() == (int)PRICE_BID) { - return HasSpecificValueStorage(INDI_VS_TYPE_PRICE_BID); + return HasSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_BID); } Print("Error: Invalid applied price " + EnumToString(_ap) + ", only PRICE_(OPEN|HIGH|LOW|CLOSE|MEDIAN|TYPICAL|WEIGHTED) are currently supported by " @@ -1381,7 +1381,7 @@ class IndicatorData : public IndicatorBase { */ ValueStorage* GetSpecificAppliedPriceValueStorage(ENUM_APPLIED_PRICE _ap, IndicatorData* _target = nullptr) { if (_target != nullptr) { - if (_target PTR_DEREF GetDataSourceAppliedType() != INDI_VS_TYPE_NONE) { + if (_target PTR_DEREF GetDataSourceAppliedType() != INDI_DATA_VS_TYPE_NONE) { // User wants to use custom value storage type as applied price, so we forcefully override AP given as the // parameter. // @todo Check for value storage compatibility (double). @@ -1391,24 +1391,24 @@ class IndicatorData : public IndicatorBase { switch (_ap) { case PRICE_OPEN: - return (ValueStorage*)GetSpecificValueStorage(INDI_VS_TYPE_PRICE_OPEN); + return (ValueStorage*)GetSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_OPEN); case PRICE_HIGH: - return (ValueStorage*)GetSpecificValueStorage(INDI_VS_TYPE_PRICE_HIGH); + return (ValueStorage*)GetSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_HIGH); case PRICE_LOW: - return (ValueStorage*)GetSpecificValueStorage(INDI_VS_TYPE_PRICE_LOW); + return (ValueStorage*)GetSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_LOW); case PRICE_CLOSE: - return (ValueStorage*)GetSpecificValueStorage(INDI_VS_TYPE_PRICE_CLOSE); + return (ValueStorage*)GetSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_CLOSE); case PRICE_MEDIAN: - return (ValueStorage*)GetSpecificValueStorage(INDI_VS_TYPE_PRICE_MEDIAN); + return (ValueStorage*)GetSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_MEDIAN); case PRICE_TYPICAL: - return (ValueStorage*)GetSpecificValueStorage(INDI_VS_TYPE_PRICE_TYPICAL); + return (ValueStorage*)GetSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_TYPICAL); case PRICE_WEIGHTED: - return (ValueStorage*)GetSpecificValueStorage(INDI_VS_TYPE_PRICE_WEIGHTED); + return (ValueStorage*)GetSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_WEIGHTED); default: if ((int)GetAppliedPrice() == (int)PRICE_ASK) { - return (ValueStorage*)GetSpecificValueStorage(INDI_VS_TYPE_PRICE_ASK); + return (ValueStorage*)GetSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_ASK); } else if ((int)GetAppliedPrice() == (int)PRICE_BID) { - return (ValueStorage*)GetSpecificValueStorage(INDI_VS_TYPE_PRICE_BID); + return (ValueStorage*)GetSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_BID); } Print("Error: Invalid applied price " + EnumToString(_ap) + ", only PRICE_(OPEN|HIGH|LOW|CLOSE|MEDIAN|TYPICAL|WEIGHTED) are currently supported by " @@ -1560,7 +1560,7 @@ class IndicatorData : public IndicatorBase { /** * Returns value storage of given kind. */ - virtual IValueStorage* GetSpecificValueStorage(ENUM_INDI_VS_TYPE _type) { + virtual IValueStorage* GetSpecificValueStorage(ENUM_INDI_DATA_VS_TYPE _type) { Print("Error: ", GetFullName(), " indicator has no storage type ", EnumToString(_type), "!"); DebugBreak(); return NULL; @@ -1672,7 +1672,7 @@ class IndicatorData : public IndicatorBase { } } - ENUM_INDI_VS_TYPE _requested_vs_type; + ENUM_INDI_DATA_VS_TYPE _requested_vs_type; // Requires a single buffered or OHLC-compatible indicator (targetted via applied price) in the hierarchy. if (_suitable_types.HasFlag(INDI_SUITABLE_DS_TYPE_AP)) { @@ -1708,7 +1708,7 @@ class IndicatorData : public IndicatorBase { // Requires a single buffered or OHLC-compatible indicator (targetted via applied price or volume) in the hierarchy. if (_suitable_types.HasAnyFlag(INDI_SUITABLE_DS_TYPE_AP | INDI_SUITABLE_DS_TYPE_AV)) { - _requested_vs_type = (ENUM_INDI_VS_TYPE)-1; + _requested_vs_type = (ENUM_INDI_DATA_VS_TYPE)-1; if (_suitable_types.HasFlag(INDI_SUITABLE_DS_TYPE_AP)) { // Applied price is defined by this indicator, so it must override GetAppliedPrice(). @@ -1812,10 +1812,10 @@ class IndicatorData : public IndicatorBase { /** * Checks whether indicator support given value storage type. */ - virtual bool HasSpecificValueStorage(ENUM_INDI_VS_TYPE _type) { - // Maybe indexed value storage? E.g., INDI_VS_TYPE_INDEX_0. - if ((int)_type >= INDI_VS_TYPE_INDEX_FIRST && (int)_type <= INDI_VS_TYPE_INDEX_LAST) { - return HasValueStorage((int)_type - INDI_VS_TYPE_INDEX_FIRST); + virtual bool HasSpecificValueStorage(ENUM_INDI_DATA_VS_TYPE _type) { + // Maybe indexed value storage? E.g., INDI_DATA_VS_TYPE_INDEX_0. + if ((int)_type >= INDI_DATA_VS_TYPE_INDEX_FIRST && (int)_type <= INDI_DATA_VS_TYPE_INDEX_LAST) { + return HasValueStorage((int)_type - INDI_DATA_VS_TYPE_INDEX_FIRST); } return false; } @@ -1840,7 +1840,7 @@ class IndicatorData : public IndicatorBase { return false; } - ENUM_INDI_VS_TYPE _requested_vs_type; + ENUM_INDI_DATA_VS_TYPE _requested_vs_type; if (_suitable_types.HasFlag(INDI_SUITABLE_DS_TYPE_AP)) { _requested_vs_type = GetAppliedPriceValueStorageType(); diff --git a/Indicator/IndicatorTick.h b/Indicator/IndicatorTick.h index c13a9ca09..c5be17898 100644 --- a/Indicator/IndicatorTick.h +++ b/Indicator/IndicatorTick.h @@ -131,19 +131,19 @@ class IndicatorTick : public Indicator { /** * Returns value storage of given kind. */ - IValueStorage* GetSpecificValueStorage(ENUM_INDI_VS_TYPE _type) override { + IValueStorage* GetSpecificValueStorage(ENUM_INDI_DATA_VS_TYPE _type) override { Print("IndicatorTick::GetSpecificValueStorage() is no longer available!"); /* switch (_type) { - case INDI_VS_TYPE_PRICE_ASK: + case INDI_DATA_VS_TYPE_PRICE_ASK: return (IValueStorage*)itdata.GetAskValueStorage(); - case INDI_VS_TYPE_PRICE_BID: + case INDI_DATA_VS_TYPE_PRICE_BID: return (IValueStorage*)itdata.GetBidValueStorage(); - case INDI_VS_TYPE_SPREAD: + case INDI_DATA_VS_TYPE_SPREAD: return (IValueStorage*)itdata.GetSpreadValueStorage(); - case INDI_VS_TYPE_VOLUME: + case INDI_DATA_VS_TYPE_VOLUME: return (IValueStorage*)itdata.GetVolumeValueStorage(); - case INDI_VS_TYPE_TICK_VOLUME: + case INDI_DATA_VS_TYPE_TICK_VOLUME: return (IValueStorage*)itdata.GetTickVolumeValueStorage(); default: // Trying in parent class. @@ -156,13 +156,13 @@ class IndicatorTick : public Indicator { /** * Checks whether indicator support given value storage type. */ - bool HasSpecificValueStorage(ENUM_INDI_VS_TYPE _type) override { + bool HasSpecificValueStorage(ENUM_INDI_DATA_VS_TYPE _type) override { switch (_type) { - case INDI_VS_TYPE_PRICE_ASK: - case INDI_VS_TYPE_PRICE_BID: - case INDI_VS_TYPE_SPREAD: - case INDI_VS_TYPE_VOLUME: - case INDI_VS_TYPE_TICK_VOLUME: + case INDI_DATA_VS_TYPE_PRICE_ASK: + case INDI_DATA_VS_TYPE_PRICE_BID: + case INDI_DATA_VS_TYPE_SPREAD: + case INDI_DATA_VS_TYPE_VOLUME: + case INDI_DATA_VS_TYPE_TICK_VOLUME: return true; default: break; diff --git a/Indicator/IndicatorTickSource.h b/Indicator/IndicatorTickSource.h index 0c0e3b5a1..b2c911c9c 100644 --- a/Indicator/IndicatorTickSource.h +++ b/Indicator/IndicatorTickSource.h @@ -67,32 +67,32 @@ class IndicatorTickSource : public Indicator { if (_input_mode == -1) { // Source mode which acts as an applied price wasn't selected, so we have to ensure that source is a Tick // indicator. Valid only if implements bid or ask price. - _result &= _indi.HasSpecificValueStorage(INDI_VS_TYPE_PRICE_BID) || - _indi.HasSpecificValueStorage(INDI_VS_TYPE_PRICE_ASK); + _result &= _indi.HasSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_BID) || + _indi.HasSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_ASK); } else { // Applied price selected. We will select source indicator only if it provides price buffer for given applied // price. switch (_input_mode) { case PRICE_OPEN: - _result &= _indi.HasSpecificValueStorage(INDI_VS_TYPE_PRICE_OPEN); + _result &= _indi.HasSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_OPEN); break; case PRICE_HIGH: - _result &= _indi.HasSpecificValueStorage(INDI_VS_TYPE_PRICE_HIGH); + _result &= _indi.HasSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_HIGH); break; case PRICE_LOW: - _result &= _indi.HasSpecificValueStorage(INDI_VS_TYPE_PRICE_LOW); + _result &= _indi.HasSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_LOW); break; case PRICE_CLOSE: - _result &= _indi.HasSpecificValueStorage(INDI_VS_TYPE_PRICE_CLOSE); + _result &= _indi.HasSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_CLOSE); break; case PRICE_MEDIAN: - _result &= _indi.HasSpecificValueStorage(INDI_VS_TYPE_PRICE_MEDIAN); + _result &= _indi.HasSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_MEDIAN); break; case PRICE_TYPICAL: - _result &= _indi.HasSpecificValueStorage(INDI_VS_TYPE_PRICE_TYPICAL); + _result &= _indi.HasSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_TYPICAL); break; case PRICE_WEIGHTED: - _result &= _indi.HasSpecificValueStorage(INDI_VS_TYPE_PRICE_WEIGHTED); + _result &= _indi.HasSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_WEIGHTED); break; default: Alert("Invalid input mode ", _input_mode, " for indicator ", _indi.GetFullName(), diff --git a/Indicators/Indi_ColorLine.mqh b/Indicators/Indi_ColorLine.mqh index 991dda0af..bd65644e5 100644 --- a/Indicators/Indi_ColorLine.mqh +++ b/Indicators/Indi_ColorLine.mqh @@ -76,7 +76,7 @@ class Indi_ColorLine : public Indicator { } // Volume uses volume only. - return _ds PTR_DEREF HasSpecificValueStorage(INDI_VS_TYPE_VOLUME); + return _ds PTR_DEREF HasSpecificValueStorage(INDI_DATA_VS_TYPE_VOLUME); } /** diff --git a/Indicators/Indi_DetrendedPrice.mqh b/Indicators/Indi_DetrendedPrice.mqh index 528e356a9..ffdbd9ed2 100644 --- a/Indicators/Indi_DetrendedPrice.mqh +++ b/Indicators/Indi_DetrendedPrice.mqh @@ -76,7 +76,7 @@ class Indi_DetrendedPrice : public Indicator { } // Volume uses volume only. - return _ds PTR_DEREF HasSpecificValueStorage(INDI_VS_TYPE_VOLUME); + return _ds PTR_DEREF HasSpecificValueStorage(INDI_DATA_VS_TYPE_VOLUME); } /** diff --git a/Indicators/Indi_OBV.mqh b/Indicators/Indi_OBV.mqh index 42c9378dc..7c100911c 100644 --- a/Indicators/Indi_OBV.mqh +++ b/Indicators/Indi_OBV.mqh @@ -87,7 +87,7 @@ class Indi_OBV : public Indicator { } // Volume uses volume only. - return _ds PTR_DEREF HasSpecificValueStorage(INDI_VS_TYPE_VOLUME); + return _ds PTR_DEREF HasSpecificValueStorage(INDI_DATA_VS_TYPE_VOLUME); } /** diff --git a/Indicators/Indi_VROC.mqh b/Indicators/Indi_VROC.mqh index db0b27575..0f71dab06 100644 --- a/Indicators/Indi_VROC.mqh +++ b/Indicators/Indi_VROC.mqh @@ -71,7 +71,7 @@ class Indi_VROC : public Indicator { } // VROC uses volume only. - return _ds PTR_DEREF HasSpecificValueStorage(INDI_VS_TYPE_VOLUME); + return _ds PTR_DEREF HasSpecificValueStorage(INDI_DATA_VS_TYPE_VOLUME); } /** diff --git a/Indicators/Indi_Volumes.mqh b/Indicators/Indi_Volumes.mqh index 3ff5212f0..63f06f923 100644 --- a/Indicators/Indi_Volumes.mqh +++ b/Indicators/Indi_Volumes.mqh @@ -74,7 +74,7 @@ class Indi_Volumes : public Indicator { } // Volume uses volume only. - return _ds PTR_DEREF HasSpecificValueStorage(INDI_VS_TYPE_VOLUME); + return _ds PTR_DEREF HasSpecificValueStorage(INDI_DATA_VS_TYPE_VOLUME); } /** diff --git a/Indicators/Price/Indi_MA.h b/Indicators/Price/Indi_MA.h index c3222a25b..bda4a7a5f 100644 --- a/Indicators/Price/Indi_MA.h +++ b/Indicators/Price/Indi_MA.h @@ -120,7 +120,7 @@ class Indi_MA : public Indicator { } // Volume uses volume only. - return _ds PTR_DEREF HasSpecificValueStorage(INDI_VS_TYPE_VOLUME); + return _ds PTR_DEREF HasSpecificValueStorage(INDI_DATA_VS_TYPE_VOLUME); } /** @@ -703,10 +703,10 @@ class Indi_MA : public Indicator { /** * Returns value storage of given kind. */ - IValueStorage *GetSpecificValueStorage(ENUM_INDI_VS_TYPE _type) override { + IValueStorage *GetSpecificValueStorage(ENUM_INDI_DATA_VS_TYPE _type) override { switch (_type) { - case INDI_VS_TYPE_PRICE_ASK: - case INDI_VS_TYPE_PRICE_BID: + case INDI_DATA_VS_TYPE_PRICE_ASK: + case INDI_DATA_VS_TYPE_PRICE_BID: // We're returning the same buffer for ask and bid price, as target indicator probably won't bother. return GetValueStorage(0); default: @@ -718,10 +718,10 @@ class Indi_MA : public Indicator { /** * Checks whether indicator support given value storage type. */ - bool HasSpecificValueStorage(ENUM_INDI_VS_TYPE _type) override { + bool HasSpecificValueStorage(ENUM_INDI_DATA_VS_TYPE _type) override { switch (_type) { - case INDI_VS_TYPE_PRICE_ASK: - case INDI_VS_TYPE_PRICE_BID: + case INDI_DATA_VS_TYPE_PRICE_ASK: + case INDI_DATA_VS_TYPE_PRICE_BID: return true; default: // Trying in parent class. diff --git a/Indicators/Price/Indi_Price.h b/Indicators/Price/Indi_Price.h index 6000d5e3b..5ca8db8df 100644 --- a/Indicators/Price/Indi_Price.h +++ b/Indicators/Price/Indi_Price.h @@ -105,26 +105,26 @@ class Indi_Price : public Indicator { /** * Returns value storage of given kind. */ - IValueStorage *GetSpecificValueStorage(ENUM_INDI_VS_TYPE _type) override { + IValueStorage *GetSpecificValueStorage(ENUM_INDI_DATA_VS_TYPE _type) override { // Returning Price indicator which provides applied price in the only buffer #0. switch (_type) { - case INDI_VS_TYPE_PRICE_ASK: // Tick. - case INDI_VS_TYPE_PRICE_BID: // Tick. + case INDI_DATA_VS_TYPE_PRICE_ASK: // Tick. + case INDI_DATA_VS_TYPE_PRICE_BID: // Tick. return GetPlatformPrices(GetSymbol(), iparams.GetAppliedPrice(), GetTf(), iparams.GetShift()) PTR_DEREF GetValueStorage(0); - case INDI_VS_TYPE_PRICE_OPEN: // Candle. + case INDI_DATA_VS_TYPE_PRICE_OPEN: // Candle. return GetPlatformPrices(GetSymbol(), PRICE_OPEN, GetTf(), iparams.GetShift()) PTR_DEREF GetValueStorage(0); - case INDI_VS_TYPE_PRICE_HIGH: // Candle. + case INDI_DATA_VS_TYPE_PRICE_HIGH: // Candle. return GetPlatformPrices(GetSymbol(), PRICE_HIGH, GetTf(), iparams.GetShift()) PTR_DEREF GetValueStorage(0); - case INDI_VS_TYPE_PRICE_LOW: // Candle. + case INDI_DATA_VS_TYPE_PRICE_LOW: // Candle. return GetPlatformPrices(GetSymbol(), PRICE_LOW, GetTf(), iparams.GetShift()) PTR_DEREF GetValueStorage(0); - case INDI_VS_TYPE_PRICE_CLOSE: // Candle. + case INDI_DATA_VS_TYPE_PRICE_CLOSE: // Candle. return GetPlatformPrices(GetSymbol(), PRICE_CLOSE, GetTf(), iparams.GetShift()) PTR_DEREF GetValueStorage(0); - case INDI_VS_TYPE_PRICE_MEDIAN: // Candle. + case INDI_DATA_VS_TYPE_PRICE_MEDIAN: // Candle. return GetPlatformPrices(GetSymbol(), PRICE_MEDIAN, GetTf(), iparams.GetShift()) PTR_DEREF GetValueStorage(0); - case INDI_VS_TYPE_PRICE_TYPICAL: // Candle. + case INDI_DATA_VS_TYPE_PRICE_TYPICAL: // Candle. return GetPlatformPrices(GetSymbol(), PRICE_TYPICAL, GetTf(), iparams.GetShift()) PTR_DEREF GetValueStorage(0); - case INDI_VS_TYPE_PRICE_WEIGHTED: // Candle. + case INDI_DATA_VS_TYPE_PRICE_WEIGHTED: // Candle. return GetPlatformPrices(GetSymbol(), PRICE_WEIGHTED, GetTf(), iparams.GetShift()) PTR_DEREF GetValueStorage(0); default: // Trying in parent class. @@ -135,17 +135,17 @@ class Indi_Price : public Indicator { /** * Checks whether indicator support given value storage type. */ - bool HasSpecificValueStorage(ENUM_INDI_VS_TYPE _type) override { + bool HasSpecificValueStorage(ENUM_INDI_DATA_VS_TYPE _type) override { switch (_type) { - case INDI_VS_TYPE_PRICE_ASK: // Tick. - case INDI_VS_TYPE_PRICE_BID: // Tick. - case INDI_VS_TYPE_PRICE_OPEN: // Candle. - case INDI_VS_TYPE_PRICE_HIGH: // Candle. - case INDI_VS_TYPE_PRICE_LOW: // Candle. - case INDI_VS_TYPE_PRICE_CLOSE: // Candle. - case INDI_VS_TYPE_PRICE_MEDIAN: // Candle. - case INDI_VS_TYPE_PRICE_TYPICAL: // Candle. - case INDI_VS_TYPE_PRICE_WEIGHTED: // Candle. + case INDI_DATA_VS_TYPE_PRICE_ASK: // Tick. + case INDI_DATA_VS_TYPE_PRICE_BID: // Tick. + case INDI_DATA_VS_TYPE_PRICE_OPEN: // Candle. + case INDI_DATA_VS_TYPE_PRICE_HIGH: // Candle. + case INDI_DATA_VS_TYPE_PRICE_LOW: // Candle. + case INDI_DATA_VS_TYPE_PRICE_CLOSE: // Candle. + case INDI_DATA_VS_TYPE_PRICE_MEDIAN: // Candle. + case INDI_DATA_VS_TYPE_PRICE_TYPICAL: // Candle. + case INDI_DATA_VS_TYPE_PRICE_WEIGHTED: // Candle. return true; default: // Trying in parent class. diff --git a/Storage/Dict/Buffer/BufferTick.h b/Storage/Dict/Buffer/BufferTick.h index 9573cb44b..27e14efa4 100644 --- a/Storage/Dict/Buffer/BufferTick.h +++ b/Storage/Dict/Buffer/BufferTick.h @@ -40,15 +40,15 @@ class BufferTickValueStorage : ValueStorage { // Poiner to buffer to take tick from. BufferTick *buffer_tick; - // INDI_VS_TYPE_PRICE_ASK, INDI_VS_TYPE_PRICE_BID, INDI_VS_TYPE_SPREAD, INDI_VS_TYPE_TICK_VOLUME or - // INDI_VS_TYPE_VOLUME. - ENUM_INDI_VS_TYPE vs_type; + // INDI_DATA_VS_TYPE_PRICE_ASK, INDI_DATA_VS_TYPE_PRICE_BID, INDI_DATA_VS_TYPE_SPREAD, INDI_DATA_VS_TYPE_TICK_VOLUME or + // INDI_DATA_VS_TYPE_VOLUME. + ENUM_INDI_DATA_VS_TYPE vs_type; public: /** * Constructor. */ - BufferTickValueStorage(BufferTick *_buffer_tick, ENUM_INDI_VS_TYPE _vs_type) + BufferTickValueStorage(BufferTick *_buffer_tick, ENUM_INDI_DATA_VS_TYPE _vs_type) : buffer_tick(_buffer_tick), vs_type(_vs_type) {} /** @@ -56,15 +56,15 @@ class BufferTickValueStorage : ValueStorage { */ TV Fetch(datetime _dt) override { switch (vs_type) { - case INDI_VS_TYPE_PRICE_ASK: + case INDI_DATA_VS_TYPE_PRICE_ASK: return (TV)buffer_tick PTR_DEREF GetByKey(_dt).ask; - case INDI_VS_TYPE_PRICE_BID: + case INDI_DATA_VS_TYPE_PRICE_BID: return (TV)buffer_tick PTR_DEREF GetByKey(_dt).bid; - case INDI_VS_TYPE_SPREAD: + case INDI_DATA_VS_TYPE_SPREAD: // return (TV)buffer_tick PTR_DEREF GetByKey(_dt).spread; - case INDI_VS_TYPE_TICK_VOLUME: + case INDI_DATA_VS_TYPE_TICK_VOLUME: // return (TV)buffer_tick PTR_DEREF GetByKey(_dt).tick_volume; - case INDI_VS_TYPE_VOLUME: + case INDI_DATA_VS_TYPE_VOLUME: // return (TV)buffer_tick PTR_DEREF GetByKey(_dt).volume; break; } @@ -154,7 +154,7 @@ class BufferTick : public BufferStruct> { */ BufferTickValueStorage *GetAskValueStorage() { if (_vs_ask == NULL) { - _vs_ask = new BufferTickValueStorage(THIS_PTR, INDI_VS_TYPE_PRICE_ASK); + _vs_ask = new BufferTickValueStorage(THIS_PTR, INDI_DATA_VS_TYPE_PRICE_ASK); } return _vs_ask; } @@ -164,7 +164,7 @@ class BufferTick : public BufferStruct> { */ BufferTickValueStorage *GetBidValueStorage() { if (_vs_bid == NULL) { - _vs_bid = new BufferTickValueStorage(THIS_PTR, INDI_VS_TYPE_PRICE_BID); + _vs_bid = new BufferTickValueStorage(THIS_PTR, INDI_DATA_VS_TYPE_PRICE_BID); } return _vs_bid; } @@ -174,7 +174,7 @@ class BufferTick : public BufferStruct> { */ BufferTickValueStorage *GetSpreadValueStorage() { if (_vs_spread == NULL) { - _vs_spread = new BufferTickValueStorage(THIS_PTR, INDI_VS_TYPE_SPREAD); + _vs_spread = new BufferTickValueStorage(THIS_PTR, INDI_DATA_VS_TYPE_SPREAD); } return _vs_spread; } @@ -184,7 +184,7 @@ class BufferTick : public BufferStruct> { */ BufferTickValueStorage *GetVolumeValueStorage() { if (_vs_volume == NULL) { - _vs_volume = new BufferTickValueStorage(THIS_PTR, INDI_VS_TYPE_VOLUME); + _vs_volume = new BufferTickValueStorage(THIS_PTR, INDI_DATA_VS_TYPE_VOLUME); } return _vs_volume; } @@ -194,7 +194,7 @@ class BufferTick : public BufferStruct> { */ BufferTickValueStorage *GetTickVolumeValueStorage() { if (_vs_tick_volume == NULL) { - _vs_tick_volume = new BufferTickValueStorage(THIS_PTR, INDI_VS_TYPE_TICK_VOLUME); + _vs_tick_volume = new BufferTickValueStorage(THIS_PTR, INDI_DATA_VS_TYPE_TICK_VOLUME); } return _vs_tick_volume; } diff --git a/Storage/ValueStorage.h b/Storage/ValueStorage.h index 7cabfce1f..3b51799f5 100644 --- a/Storage/ValueStorage.h +++ b/Storage/ValueStorage.h @@ -98,21 +98,21 @@ enum ENUM_IPEAK { IPEAK_LOWEST, IPEAK_HIGHEST }; #define INDICATOR_CALCULATE_POPULATE_PARAMS_AND_CACHE_LONG(INDI, KEY) \ IndicatorData *_suitable_ds = INDI PTR_DEREF GetSuitableDataSource(); \ ValueStorage *_time = \ - (ValueStorage *)_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_VS_TYPE_TIME); \ + (ValueStorage *)_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_TIME); \ ValueStorage *_tick_volume = \ - (ValueStorage *)_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_VS_TYPE_TICK_VOLUME); \ + (ValueStorage *)_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_TICK_VOLUME); \ ValueStorage *_volume = \ - (ValueStorage *)_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_VS_TYPE_VOLUME); \ + (ValueStorage *)_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_VOLUME); \ ValueStorage *_spread = \ - (ValueStorage *)_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_VS_TYPE_SPREAD); \ + (ValueStorage *)_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_SPREAD); \ ValueStorage *_price_open = \ - (ValueStorage *)_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_VS_TYPE_PRICE_OPEN); \ + (ValueStorage *)_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_OPEN); \ ValueStorage *_price_high = \ - (ValueStorage *)_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_VS_TYPE_PRICE_HIGH); \ + (ValueStorage *)_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_HIGH); \ ValueStorage *_price_low = \ - (ValueStorage *)_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_VS_TYPE_PRICE_LOW); \ + (ValueStorage *)_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_LOW); \ ValueStorage *_price_close = \ - (ValueStorage *)_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_VS_TYPE_PRICE_CLOSE); \ + (ValueStorage *)_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_CLOSE); \ INDICATOR_CALCULATE_POPULATE_CACHE(INDI, KEY) #define INDICATOR_CALCULATE_POPULATED_PARAMS_LONG \ diff --git a/tests/IndicatorsTest.mq5 b/tests/IndicatorsTest.mq5 index 194f18321..bdcb5d8b5 100644 --- a/tests/IndicatorsTest.mq5 +++ b/tests/IndicatorsTest.mq5 @@ -289,7 +289,7 @@ bool InitIndicators() { IndiBandsParams indi_bands_over_rsi_params(20, 2, 0, PRICE_OPEN); Ref indi_bands_over_rsi = new Indi_Bands(indi_bands_over_rsi_params); // Using RSI's mode 0 as applied price. - indi_bands_over_rsi REF_DEREF SetDataSourceAppliedPrice(INDI_VS_TYPE_INDEX_0); + indi_bands_over_rsi REF_DEREF SetDataSourceAppliedPrice(INDI_DATA_VS_TYPE_INDEX_0); indi_bands_over_rsi REF_DEREF SetDataSource(indi_rsi.Ptr()); indis.Add(indi_bands_over_rsi); From 36c88ee0968dc4fb88c24b475171ee274b0d0ded Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 21:33:57 +0100 Subject: [PATCH 031/109] Renames INDICATOR_ENTRY to INDICATOR_DATA_ENTRY (GH-556) --- Indicator/IndicatorData.enum.h | 2 +- Indicator/IndicatorData.h | 2 +- Indicator/IndicatorData.struct.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Indicator/IndicatorData.enum.h b/Indicator/IndicatorData.enum.h index b29b52e49..57b8aebc5 100644 --- a/Indicator/IndicatorData.enum.h +++ b/Indicator/IndicatorData.enum.h @@ -31,7 +31,7 @@ #endif /* Indicator entry flags. */ -enum INDICATOR_ENTRY_FLAGS { +enum INDICATOR_DATA_ENTRY_FLAGS { INDI_ENTRY_FLAG_NONE = 0 << 0, INDI_ENTRY_FLAG_IS_BITWISE = 1 << 0, INDI_ENTRY_FLAG_IS_DOUBLED = 1 << 1, // Type is doubled in size (e.g. double or long). diff --git a/Indicator/IndicatorData.h b/Indicator/IndicatorData.h index 55de3f3bb..0d07f39c2 100644 --- a/Indicator/IndicatorData.h +++ b/Indicator/IndicatorData.h @@ -202,7 +202,7 @@ class IndicatorData : public IndicatorBase { /** * Gets an indicator property flag. */ - bool GetFlag(INDICATOR_ENTRY_FLAGS _prop, int _rel_shift = 0) { + bool GetFlag(INDICATOR_DATA_ENTRY_FLAGS _prop, int _rel_shift = 0) { IndicatorDataEntry _entry = GetEntry(_rel_shift); return _entry.CheckFlag(_prop); } diff --git a/Indicator/IndicatorData.struct.h b/Indicator/IndicatorData.struct.h index 66f137cf1..25b3eb1a4 100644 --- a/Indicator/IndicatorData.struct.h +++ b/Indicator/IndicatorData.struct.h @@ -360,12 +360,12 @@ struct IndicatorDataEntry { // Setters. bool Resize(int _size = 0) { return _size > 0 ? ArrayResize(values, _size) > 0 : true; } // Value flag methods for bitwise operations. - bool CheckFlag(INDICATOR_ENTRY_FLAGS _prop) { return CheckFlags(_prop); } + bool CheckFlag(INDICATOR_DATA_ENTRY_FLAGS _prop) { return CheckFlags(_prop); } bool CheckFlags(unsigned short _flags) { return (flags & _flags) != 0; } bool CheckFlagsAll(unsigned short _flags) { return (flags & _flags) == _flags; } void AddFlags(unsigned short _flags) { flags |= _flags; } void RemoveFlags(unsigned short _flags) { flags &= ~_flags; } - void SetFlag(INDICATOR_ENTRY_FLAGS _flag, bool _value) { + void SetFlag(INDICATOR_DATA_ENTRY_FLAGS _flag, bool _value) { if (_value) { AddFlags(_flag); } else { From 596971276c8b8fd4efd4e7485978cd3e373d9bc7 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 21:34:52 +0100 Subject: [PATCH 032/109] Renames PriceIndiParams struct to IndiPriceParams (GH-556) --- Indicators/Price/Indi_Price.h | 18 +++++++++--------- Indicators/tests/DrawIndicator.test.mq5 | 8 ++++---- tests/IndicatorsTest.mq5 | 18 +++++++++--------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Indicators/Price/Indi_Price.h b/Indicators/Price/Indi_Price.h index 5ca8db8df..eb1215133 100644 --- a/Indicators/Price/Indi_Price.h +++ b/Indicators/Price/Indi_Price.h @@ -27,13 +27,13 @@ #include "../../Storage/Objects.h" // Structs. -struct PriceIndiParams : IndicatorParams { +struct IndiPriceParams : IndicatorParams { ENUM_APPLIED_PRICE ap; // Struct constructor. - PriceIndiParams(ENUM_APPLIED_PRICE _ap = PRICE_TYPICAL, int _shift = 0) : IndicatorParams(INDI_PRICE), ap(_ap) { + IndiPriceParams(ENUM_APPLIED_PRICE _ap = PRICE_TYPICAL, int _shift = 0) : IndicatorParams(INDI_PRICE), ap(_ap) { SetShift(_shift); }; - PriceIndiParams(PriceIndiParams &_params) : IndicatorParams() { THIS_REF = _params; }; + IndiPriceParams(IndiPriceParams &_params) : IndicatorParams() { THIS_REF = _params; }; // Getters. ENUM_APPLIED_PRICE GetAppliedPrice() { return ap; } // Setters. @@ -43,18 +43,18 @@ struct PriceIndiParams : IndicatorParams { /** * Price Indicator. */ -class Indi_Price : public Indicator { +class Indi_Price : public Indicator { public: /** * Class constructor. */ - Indi_Price(PriceIndiParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, + Indi_Price(IndiPriceParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, int _indi_src_mode = 0) : Indicator(_p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_PRICE, _indi_src_mode), _indi_src){}; Indi_Price(int _shift = 0, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, int _indi_src_mode = 0) - : Indicator(PriceIndiParams(), + : Indicator(IndiPriceParams(), IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_PRICE, _indi_src_mode), _indi_src){}; /** @@ -90,7 +90,7 @@ class Indi_Price : public Indicator { string _key = _cache_key.ToString(); Indi_Price *_indi_price; if (!Objects::TryGet(_key, _indi_price)) { - PriceIndiParams _indi_price_params(_ap, _shift); + IndiPriceParams _indi_price_params(_ap, _shift); _indi_price = Objects::Set(_key, new Indi_Price(_indi_price_params)); if (_base_indi == nullptr) { @@ -128,7 +128,7 @@ class Indi_Price : public Indicator { return GetPlatformPrices(GetSymbol(), PRICE_WEIGHTED, GetTf(), iparams.GetShift()) PTR_DEREF GetValueStorage(0); default: // Trying in parent class. - return Indicator::GetSpecificValueStorage(_type); + return Indicator::GetSpecificValueStorage(_type); } } @@ -149,7 +149,7 @@ class Indi_Price : public Indicator { return true; default: // Trying in parent class. - return Indicator::HasSpecificValueStorage(_type); + return Indicator::HasSpecificValueStorage(_type); } } }; diff --git a/Indicators/tests/DrawIndicator.test.mq5 b/Indicators/tests/DrawIndicator.test.mq5 index e83e18aba..437487f30 100644 --- a/Indicators/tests/DrawIndicator.test.mq5 +++ b/Indicators/tests/DrawIndicator.test.mq5 @@ -113,7 +113,7 @@ bool InitIndicators() { #ifndef __MQL4__ // @fixme: Make it work for MT4. // Current Price (used by custom indicators) . - PriceIndiParams price_params(); + IndiPriceParams price_params(); // price_params.SetDraw(clrGreenYellow); Platform::AddWithDefaultBindings(new Indi_Price(price_params), "EURUSD", PERIOD_M1); #endif @@ -121,7 +121,7 @@ bool InitIndicators() { /* @fixme: Array out of range. // Bollinger Bands over Price indicator. /* - PriceIndiParams price_params_4_bands(); + IndiPriceParams price_params_4_bands(); IndicatorBase *indi_price_4_bands = new Indi_Price(price_params_4_bands); IndiBandsParams bands_on_price_params(); bands_on_price_params.SetDraw(clrCadetBlue); @@ -131,7 +131,7 @@ bool InitIndicators() { // Moving Average (MA) over Price indicator. /* - PriceIndiParams price_params_4_ma(); + IndiPriceParams price_params_4_ma(); IndicatorBase *indi_price_4_ma = new Indi_Price(price_params_4_ma); IndiMAParams ma_on_price_params(); ma_on_price_params.SetDraw(clrYellowGreen); @@ -140,7 +140,7 @@ bool InitIndicators() { Platform::AddWithDefaultBindings(new Indi_MA(ma_on_price_params, indi_price_4_ma)); // Relative Strength Index (RSI) over Price indicator. - PriceIndiParams price_params_4_rsi(); + IndiPriceParams price_params_4_rsi(); IndicatorData *indi_price_4_rsi = new Indi_Price(price_params_4_rsi); IndiRSIParams rsi_on_price_params(); rsi_on_price_params.SetDraw(clrBisque, 1); diff --git a/tests/IndicatorsTest.mq5 b/tests/IndicatorsTest.mq5 index bdcb5d8b5..4117543d3 100644 --- a/tests/IndicatorsTest.mq5 +++ b/tests/IndicatorsTest.mq5 @@ -162,7 +162,7 @@ bool InitIndicators() { /* Price/OHLC indicators */ // Price indicator. - Ref indi_price = new Indi_Price(PriceIndiParams()); + Ref indi_price = new Indi_Price(IndiPriceParams()); // indis.Add(indi_price); // @fixme: Make it work with the test? /* Standard indicators */ @@ -313,7 +313,7 @@ bool InitIndicators() { indis.Add(new Indi_SAR(sar_params)); // Standard Deviation (StdDev). - Ref indi_price_for_stdev = new Indi_Price(PriceIndiParams()); + Ref indi_price_for_stdev = new Indi_Price(IndiPriceParams()); IndiStdDevParams stddev_on_price_params(); // stddev_on_price_params.SetDraw(clrBlue, 1); // @fixme Ref indi_stddev_on_price = @@ -338,7 +338,7 @@ bool InitIndicators() { indis.Add(new Indi_Demo()); // Bollinger Bands over Price indicator. - PriceIndiParams price_params_4_bands(); + IndiPriceParams price_params_4_bands(); Ref indi_price_4_bands = new Indi_Price(price_params_4_bands); IndiBandsParams bands_on_price_params(); // bands_on_price_params.SetDraw(clrCadetBlue); // @fixme @@ -359,7 +359,7 @@ bool InitIndicators() { indis.Add(indi_stddev_on_ma_sma.Ptr()); // Standard Deviation (StdDev) in SMA mode over Price. - PriceIndiParams price_params_for_stddev_sma(); + IndiPriceParams price_params_for_stddev_sma(); Ref indi_price_for_stddev_sma = new Indi_Price(price_params_for_stddev_sma); IndiStdDevParams stddev_sma_on_price_params(); // stddev_sma_on_price_params.SetDraw(true, 1); // @fixme @@ -368,7 +368,7 @@ bool InitIndicators() { indis.Add(indi_stddev_on_sma.Ptr()); // Moving Average (MA) over Price indicator. - PriceIndiParams price_params_4_ma(); + IndiPriceParams price_params_4_ma(); Ref indi_price_4_ma = new Indi_Price(price_params_4_ma); IndiMAParams ma_on_price_params(13, 0, MODE_SMA, PRICE_OPEN, 0); // ma_on_price_params.SetDraw(clrYellowGreen); // @fixme @@ -377,7 +377,7 @@ bool InitIndicators() { indis.Add(indi_ma_on_price.Ptr()); // Commodity Channel Index (CCI) over Price indicator. - PriceIndiParams price_params_4_cci(); + IndiPriceParams price_params_4_cci(); Ref indi_price_4_cci = new Indi_Price(price_params_4_cci); IndiCCIParams cci_on_price_params(); // cci_on_price_params.SetDraw(clrYellowGreen, 1); // @fixme @@ -385,7 +385,7 @@ bool InitIndicators() { indis.Add(indi_cci_on_price.Ptr()); // Envelopes over Price indicator. - PriceIndiParams price_params_4_envelopes(); + IndiPriceParams price_params_4_envelopes(); Ref indi_price_4_envelopes = new Indi_Price(price_params_4_envelopes); IndiEnvelopesParams env_on_price_params(); // env_on_price_params.SetDraw(clrBrown); // @fixme @@ -394,7 +394,7 @@ bool InitIndicators() { indis.Add(indi_envelopes_on_price.Ptr()); // DEMA over Price indicator. - PriceIndiParams price_params_4_dema(); + IndiPriceParams price_params_4_dema(); Ref indi_price_4_dema = new Indi_Price(price_params_4_dema); IndiDEMAParams dema_on_price_params(13, 2, PRICE_OPEN); // dema_on_price_params.SetDraw(clrRed); // @fixme @@ -411,7 +411,7 @@ bool InitIndicators() { indis.Add(indi_momentum_on_price.Ptr()); // Relative Strength Index (RSI) over Price indicator. - PriceIndiParams price_params_4_rsi(); + IndiPriceParams price_params_4_rsi(); Ref indi_price_4_rsi = new Indi_Price(price_params_4_rsi); IndiRSIParams rsi_on_price_params(); // rsi_on_price_params.SetDraw(clrBisque, 1); // @fixme From c97c93be960a3709004c82e51998abe8a2997665 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 21:36:06 +0100 Subject: [PATCH 033/109] Renames ENUM_INDICATOR_INDEX enum to ENUM_INDICATOR_DATA_INDEX (GH-556) --- Indicator/IndicatorData.enum.h | 4 ++-- Indicator/IndicatorData.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Indicator/IndicatorData.enum.h b/Indicator/IndicatorData.enum.h index 57b8aebc5..f3128fffd 100644 --- a/Indicator/IndicatorData.enum.h +++ b/Indicator/IndicatorData.enum.h @@ -44,11 +44,11 @@ enum INDICATOR_DATA_ENTRY_FLAGS { }; /* Define indicator index. */ -enum ENUM_INDICATOR_INDEX { +enum ENUM_INDICATOR_DATA_INDEX { CURR = 0, PREV = 1, PPREV = 2, - FINAL_ENUM_INDICATOR_INDEX = 3 // Should be the last one. Used to calculate the number of enum items. + FINAL_ENUM_INDICATOR_DATA_INDEX = 3 // Should be the last one. Used to calculate the number of enum items. }; // Storage type for IndicatorBase::GetSpecificValueStorage(). diff --git a/Indicator/IndicatorData.h b/Indicator/IndicatorData.h index 0d07f39c2..0d0f5de34 100644 --- a/Indicator/IndicatorData.h +++ b/Indicator/IndicatorData.h @@ -179,7 +179,7 @@ class IndicatorData : public IndicatorBase { return GetEntry(_rel_shift); } - IndicatorDataEntry operator[](ENUM_INDICATOR_INDEX _rel_shift) { return GetEntry((int)_rel_shift); } + IndicatorDataEntry operator[](ENUM_INDICATOR_DATA_INDEX _rel_shift) { return GetEntry((int)_rel_shift); } /* Getters */ From 7314d8d50d6796645336530df7df765569b40326 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 21:37:32 +0100 Subject: [PATCH 034/109] Renames IndicatorState struct to IndicatorDataState (GH-556) --- Indicator/Indicator.define.h | 2 +- Indicator/Indicator.h | 8 ++++---- Indicator/IndicatorData.h | 2 +- Indicator/IndicatorData.struct.h | 10 +++++----- Indicators/Indi_ZigZag.mqh | 2 +- Indicators/Oscillator/Indi_WPR.h | 2 +- Indicators/tests/DrawIndicator.test.mq5 | 4 ++-- Platform.h | 2 +- tests/IndicatorsTest.mq5 | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Indicator/Indicator.define.h b/Indicator/Indicator.define.h index 9eb31cca6..6518047c9 100644 --- a/Indicator/Indicator.define.h +++ b/Indicator/Indicator.define.h @@ -101,7 +101,7 @@ #endif #define INDICATOR_BUILTIN_CALL_AND_RETURN(NATIVE_METHOD_CALL, MODE, SHIFT) \ - int _handle = Object::IsValid(_obj) ? _obj PTR_DEREF Get(IndicatorState::INDICATOR_STATE_PROP_HANDLE) : 0; \ + int _handle = Object::IsValid(_obj) ? _obj PTR_DEREF Get(IndicatorDataState::INDICATOR_STATE_PROP_HANDLE) : 0; \ ARRAY(double, _res); \ ResetLastError(); \ if (_handle == 0 || _handle == INVALID_HANDLE) { \ diff --git a/Indicator/Indicator.h b/Indicator/Indicator.h index 095320158..05024afcb 100644 --- a/Indicator/Indicator.h +++ b/Indicator/Indicator.h @@ -136,7 +136,7 @@ class Indicator : public IndicatorData { } /** - * Gets a value from IndicatorState struct. + * Gets a value from IndicatorDataState struct. */ template T Get(STRUCT_ENUM_INDICATOR_STATE_PROP _param) { @@ -605,10 +605,10 @@ class Indicator : public IndicatorData { _entry.Resize(_max_modes); _entry.timestamp = GetBarTime(_rel_shift); #ifndef __MQL4__ - if (IndicatorData::Get(STRUCT_ENUM(IndicatorState, INDICATOR_STATE_PROP_IS_CHANGED))) { + if (IndicatorData::Get(STRUCT_ENUM(IndicatorDataState, INDICATOR_STATE_PROP_IS_CHANGED))) { // Resets the handle on any parameter changes. - IndicatorData::Set(STRUCT_ENUM(IndicatorState, INDICATOR_STATE_PROP_HANDLE), INVALID_HANDLE); - IndicatorData::Set(STRUCT_ENUM(IndicatorState, INDICATOR_STATE_PROP_IS_CHANGED), false); + IndicatorData::Set(STRUCT_ENUM(IndicatorDataState, INDICATOR_STATE_PROP_HANDLE), INVALID_HANDLE); + IndicatorData::Set(STRUCT_ENUM(IndicatorDataState, INDICATOR_STATE_PROP_IS_CHANGED), false); } #endif for (int _mode = 0; _mode < _max_modes; _mode++) { diff --git a/Indicator/IndicatorData.h b/Indicator/IndicatorData.h index 0d0f5de34..60028c53b 100644 --- a/Indicator/IndicatorData.h +++ b/Indicator/IndicatorData.h @@ -76,7 +76,7 @@ class IndicatorData : public IndicatorBase { // DrawIndicator* draw; IndicatorCalculateCache cache; IndicatorDataParams idparams; // Indicator data params. - IndicatorState istate; + IndicatorDataState istate; Ref indi_src; // Indicator used as data source. protected: diff --git a/Indicator/IndicatorData.struct.h b/Indicator/IndicatorData.struct.h index 25b3eb1a4..137743230 100644 --- a/Indicator/IndicatorData.struct.h +++ b/Indicator/IndicatorData.struct.h @@ -27,7 +27,7 @@ // Defines. #define STRUCT_ENUM_IDATA_PARAM STRUCT_ENUM(IndicatorDataParams, ENUM_IDATA_PARAM) -#define STRUCT_ENUM_INDICATOR_STATE_PROP STRUCT_ENUM(IndicatorState, ENUM_INDICATOR_STATE_PROP) +#define STRUCT_ENUM_INDICATOR_STATE_PROP STRUCT_ENUM(IndicatorDataState, ENUM_INDICATOR_STATE_PROP) // Includes. #include "../Serializer/SerializerConversions.h" @@ -538,7 +538,7 @@ struct IndicatorDataParams { }; /* Structure for indicator state. */ -struct IndicatorState { +struct IndicatorDataState { public: // @todo: Change it to protected. int handle; // Indicator handle (MQL5 only). bool is_changed; // Set when params has been recently changed. @@ -550,10 +550,10 @@ struct IndicatorState { INDICATOR_STATE_PROP_IS_READY, }; // Constructor. - IndicatorState() : handle(INVALID_HANDLE), is_changed(true), is_ready(false) {} + IndicatorDataState() : handle(INVALID_HANDLE), is_changed(true), is_ready(false) {} // Getters. template - T Get(STRUCT_ENUM(IndicatorState, ENUM_INDICATOR_STATE_PROP) _prop) { + T Get(STRUCT_ENUM(IndicatorDataState, ENUM_INDICATOR_STATE_PROP) _prop) { switch (_prop) { case INDICATOR_STATE_PROP_HANDLE: return (T)handle; @@ -567,7 +567,7 @@ struct IndicatorState { } // Setters. template - void Set(STRUCT_ENUM(IndicatorState, ENUM_INDICATOR_STATE_PROP) _prop, T _value) { + void Set(STRUCT_ENUM(IndicatorDataState, ENUM_INDICATOR_STATE_PROP) _prop, T _value) { switch (_prop) { case INDICATOR_STATE_PROP_HANDLE: handle = (T)_value; diff --git a/Indicators/Indi_ZigZag.mqh b/Indicators/Indi_ZigZag.mqh index 3242fd352..9d49b1fff 100644 --- a/Indicators/Indi_ZigZag.mqh +++ b/Indicators/Indi_ZigZag.mqh @@ -116,7 +116,7 @@ class Indi_ZigZag : public Indicator { static double iCustomZigZag(string _symbol, ENUM_TIMEFRAMES _tf, string _name, int _depth, int _deviation, int _backstep, ENUM_ZIGZAG_LINE _mode = 0, int _shift = 0, IndicatorData *_obj = NULL) { #ifdef __MQL5__ - int _handle = Object::IsValid(_obj) ? _obj.Get(IndicatorState::INDICATOR_STATE_PROP_HANDLE) : NULL; + int _handle = Object::IsValid(_obj) ? _obj.Get(IndicatorDataState::INDICATOR_STATE_PROP_HANDLE) : NULL; double _res[]; if (_handle == NULL || _handle == INVALID_HANDLE) { if ((_handle = ::iCustom(_symbol, _tf, _name, _depth, _deviation, _backstep)) == INVALID_HANDLE) { diff --git a/Indicators/Oscillator/Indi_WPR.h b/Indicators/Oscillator/Indi_WPR.h index fdcb55e72..7074da75f 100644 --- a/Indicators/Oscillator/Indi_WPR.h +++ b/Indicators/Oscillator/Indi_WPR.h @@ -87,7 +87,7 @@ class Indi_WPR : public Indicator { #ifdef __MQL4__ return ::iWPR(_symbol, _tf, _period, _shift); #else // __MQL5__ - int _handle = Object::IsValid(_obj) ? _obj.Get(IndicatorState::INDICATOR_STATE_PROP_HANDLE) : NULL; + int _handle = Object::IsValid(_obj) ? _obj.Get(IndicatorDataState::INDICATOR_STATE_PROP_HANDLE) : NULL; double _res[]; if (_handle == NULL || _handle == INVALID_HANDLE) { if ((_handle = ::iWPR(_symbol, _tf, _period)) == INVALID_HANDLE) { diff --git a/Indicators/tests/DrawIndicator.test.mq5 b/Indicators/tests/DrawIndicator.test.mq5 index 437487f30..e3cdbf41f 100644 --- a/Indicators/tests/DrawIndicator.test.mq5 +++ b/Indicators/tests/DrawIndicator.test.mq5 @@ -72,7 +72,7 @@ void OnTick() { IndicatorData *_indi = iter.Value().Ptr(); _indi.OnTick(Platform::GetGlobalTickIndex()); IndicatorDataEntry _entry = _indi.GetEntry(); - if (_indi.Get(STRUCT_ENUM(IndicatorState, INDICATOR_STATE_PROP_IS_READY)) && _entry.IsValid()) { + if (_indi.Get(STRUCT_ENUM(IndicatorDataState, INDICATOR_STATE_PROP_IS_READY)) && _entry.IsValid()) { #ifdef __debug__ PrintFormat("%s: bar %d: %s", _indi.GetName(), bar_processed, _indi.ToString()); #endif @@ -165,7 +165,7 @@ bool PrintIndicators(string _prefix = "") { for (DictIterator> iter = Platform::GetIndicators() PTR_DEREF Begin(); iter.IsValid(); ++iter) { IndicatorData *_indi = iter.Value().Ptr(); - if (_indi.Get(STRUCT_ENUM(IndicatorState, INDICATOR_STATE_PROP_IS_READY))) { + if (_indi.Get(STRUCT_ENUM(IndicatorDataState, INDICATOR_STATE_PROP_IS_READY))) { PrintFormat("%s: %s: %s", _prefix, _indi.GetName(), _indi.ToString()); } } diff --git a/Platform.h b/Platform.h index 8f5d43521..8efa9d334 100644 --- a/Platform.h +++ b/Platform.h @@ -842,7 +842,7 @@ datetime StructToTime(MqlDateTime &dt_struct) { Platform::Tick(); \ if (Platform::IsNewHour()) { \ IndicatorDataEntry _entry = indi REF_DEREF GetEntry(); \ - bool _is_ready = indi REF_DEREF Get(STRUCT_ENUM(IndicatorState, INDICATOR_STATE_PROP_IS_READY)); \ + bool _is_ready = indi REF_DEREF Get(STRUCT_ENUM(IndicatorDataState, INDICATOR_STATE_PROP_IS_READY)); \ bool _is_valid = _entry.IsValid(); \ Print(indi REF_DEREF ToString(), _is_ready ? " (Ready)" : " (Not yet ready)"); \ if (_is_ready && !_is_valid) { \ diff --git a/tests/IndicatorsTest.mq5 b/tests/IndicatorsTest.mq5 index 4117543d3..f41ce1c1d 100644 --- a/tests/IndicatorsTest.mq5 +++ b/tests/IndicatorsTest.mq5 @@ -126,7 +126,7 @@ void OnTick() { // if (_indi.GetType() != INDI_AMA) // continue; - if (_indi PTR_DEREF Get(STRUCT_ENUM(IndicatorState, INDICATOR_STATE_PROP_IS_READY))) { + if (_indi PTR_DEREF Get(STRUCT_ENUM(IndicatorDataState, INDICATOR_STATE_PROP_IS_READY))) { if (_entry.IsValid()) { PrintFormat("%s: bar %d: %s", _indi PTR_DEREF GetFullName(), _candles PTR_DEREF GetBars(), _indi PTR_DEREF ToString()); @@ -595,7 +595,7 @@ bool PrintIndicators(string _prefix = "") { ResetLastError(); continue; } - if (_indi.Get(STRUCT_ENUM(IndicatorState, INDICATOR_STATE_PROP_IS_READY))) { + if (_indi.Get(STRUCT_ENUM(IndicatorDataState, INDICATOR_STATE_PROP_IS_READY))) { PrintFormat("%s: %s: %s", _prefix, _indi.GetName(), _indi.ToString()); } } From db8eaa8bf47de4d9662b50583c15d8110de0728b Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 21:39:01 +0100 Subject: [PATCH 035/109] Renames INDICATOR_STATE enums to INDICATOR_DATA_STATE (GH-556) --- Indicator/Indicator.define.h | 2 +- Indicator/Indicator.h | 8 ++++---- Indicator/IndicatorData.h | 4 ++-- Indicator/IndicatorData.struct.h | 26 ++++++++++++------------- Indicators/Indi_ZigZag.mqh | 2 +- Indicators/Oscillator/Indi_WPR.h | 2 +- Indicators/tests/DrawIndicator.test.mq5 | 4 ++-- Platform.h | 2 +- tests/IndicatorsTest.mq5 | 4 ++-- 9 files changed, 27 insertions(+), 27 deletions(-) diff --git a/Indicator/Indicator.define.h b/Indicator/Indicator.define.h index 6518047c9..b6f51a62d 100644 --- a/Indicator/Indicator.define.h +++ b/Indicator/Indicator.define.h @@ -101,7 +101,7 @@ #endif #define INDICATOR_BUILTIN_CALL_AND_RETURN(NATIVE_METHOD_CALL, MODE, SHIFT) \ - int _handle = Object::IsValid(_obj) ? _obj PTR_DEREF Get(IndicatorDataState::INDICATOR_STATE_PROP_HANDLE) : 0; \ + int _handle = Object::IsValid(_obj) ? _obj PTR_DEREF Get(IndicatorDataState::INDICATOR_DATA_STATE_PROP_HANDLE) : 0; \ ARRAY(double, _res); \ ResetLastError(); \ if (_handle == 0 || _handle == INVALID_HANDLE) { \ diff --git a/Indicator/Indicator.h b/Indicator/Indicator.h index 05024afcb..8b4f98378 100644 --- a/Indicator/Indicator.h +++ b/Indicator/Indicator.h @@ -139,7 +139,7 @@ class Indicator : public IndicatorData { * Gets a value from IndicatorDataState struct. */ template - T Get(STRUCT_ENUM_INDICATOR_STATE_PROP _param) { + T Get(STRUCT_ENUM_INDICATOR_DATA_STATE_PROP _param) { return istate.Get(_param); } @@ -605,10 +605,10 @@ class Indicator : public IndicatorData { _entry.Resize(_max_modes); _entry.timestamp = GetBarTime(_rel_shift); #ifndef __MQL4__ - if (IndicatorData::Get(STRUCT_ENUM(IndicatorDataState, INDICATOR_STATE_PROP_IS_CHANGED))) { + if (IndicatorData::Get(STRUCT_ENUM(IndicatorDataState, INDICATOR_DATA_STATE_PROP_IS_CHANGED))) { // Resets the handle on any parameter changes. - IndicatorData::Set(STRUCT_ENUM(IndicatorDataState, INDICATOR_STATE_PROP_HANDLE), INVALID_HANDLE); - IndicatorData::Set(STRUCT_ENUM(IndicatorDataState, INDICATOR_STATE_PROP_IS_CHANGED), false); + IndicatorData::Set(STRUCT_ENUM(IndicatorDataState, INDICATOR_DATA_STATE_PROP_HANDLE), INVALID_HANDLE); + IndicatorData::Set(STRUCT_ENUM(IndicatorDataState, INDICATOR_DATA_STATE_PROP_IS_CHANGED), false); } #endif for (int _mode = 0; _mode < _max_modes; _mode++) { diff --git a/Indicator/IndicatorData.h b/Indicator/IndicatorData.h index 60028c53b..9825c22ab 100644 --- a/Indicator/IndicatorData.h +++ b/Indicator/IndicatorData.h @@ -195,7 +195,7 @@ class IndicatorData : public IndicatorBase { * Gets an indicator's state property value. */ template - T Get(STRUCT_ENUM_INDICATOR_STATE_PROP _prop) { + T Get(STRUCT_ENUM_INDICATOR_DATA_STATE_PROP _prop) { return istate.Get(_prop); } @@ -777,7 +777,7 @@ class IndicatorData : public IndicatorBase { * Sets an indicator's state property value. */ template - void Set(STRUCT_ENUM_INDICATOR_STATE_PROP _prop, T _value) { + void Set(STRUCT_ENUM_INDICATOR_DATA_STATE_PROP _prop, T _value) { istate.Set(_prop, _value); } diff --git a/Indicator/IndicatorData.struct.h b/Indicator/IndicatorData.struct.h index 137743230..e62085aa6 100644 --- a/Indicator/IndicatorData.struct.h +++ b/Indicator/IndicatorData.struct.h @@ -27,7 +27,7 @@ // Defines. #define STRUCT_ENUM_IDATA_PARAM STRUCT_ENUM(IndicatorDataParams, ENUM_IDATA_PARAM) -#define STRUCT_ENUM_INDICATOR_STATE_PROP STRUCT_ENUM(IndicatorDataState, ENUM_INDICATOR_STATE_PROP) +#define STRUCT_ENUM_INDICATOR_DATA_STATE_PROP STRUCT_ENUM(IndicatorDataState, ENUM_INDICATOR_DATA_STATE_PROP) // Includes. #include "../Serializer/SerializerConversions.h" @@ -544,22 +544,22 @@ struct IndicatorDataState { bool is_changed; // Set when params has been recently changed. bool is_ready; // Set when indicator is ready (has valid values). public: - enum ENUM_INDICATOR_STATE_PROP { - INDICATOR_STATE_PROP_HANDLE, - INDICATOR_STATE_PROP_IS_CHANGED, - INDICATOR_STATE_PROP_IS_READY, + enum ENUM_INDICATOR_DATA_STATE_PROP { + INDICATOR_DATA_STATE_PROP_HANDLE, + INDICATOR_DATA_STATE_PROP_IS_CHANGED, + INDICATOR_DATA_STATE_PROP_IS_READY, }; // Constructor. IndicatorDataState() : handle(INVALID_HANDLE), is_changed(true), is_ready(false) {} // Getters. template - T Get(STRUCT_ENUM(IndicatorDataState, ENUM_INDICATOR_STATE_PROP) _prop) { + T Get(STRUCT_ENUM(IndicatorDataState, ENUM_INDICATOR_DATA_STATE_PROP) _prop) { switch (_prop) { - case INDICATOR_STATE_PROP_HANDLE: + case INDICATOR_DATA_STATE_PROP_HANDLE: return (T)handle; - case INDICATOR_STATE_PROP_IS_CHANGED: + case INDICATOR_DATA_STATE_PROP_IS_CHANGED: return (T)is_changed; - case INDICATOR_STATE_PROP_IS_READY: + case INDICATOR_DATA_STATE_PROP_IS_READY: return (T)is_ready; }; SetUserError(ERR_INVALID_PARAMETER); @@ -567,15 +567,15 @@ struct IndicatorDataState { } // Setters. template - void Set(STRUCT_ENUM(IndicatorDataState, ENUM_INDICATOR_STATE_PROP) _prop, T _value) { + void Set(STRUCT_ENUM(IndicatorDataState, ENUM_INDICATOR_DATA_STATE_PROP) _prop, T _value) { switch (_prop) { - case INDICATOR_STATE_PROP_HANDLE: + case INDICATOR_DATA_STATE_PROP_HANDLE: handle = (T)_value; break; - case INDICATOR_STATE_PROP_IS_CHANGED: + case INDICATOR_DATA_STATE_PROP_IS_CHANGED: is_changed = (T)_value; break; - case INDICATOR_STATE_PROP_IS_READY: + case INDICATOR_DATA_STATE_PROP_IS_READY: is_ready = (T)_value; break; default: diff --git a/Indicators/Indi_ZigZag.mqh b/Indicators/Indi_ZigZag.mqh index 9d49b1fff..eab0b6bd0 100644 --- a/Indicators/Indi_ZigZag.mqh +++ b/Indicators/Indi_ZigZag.mqh @@ -116,7 +116,7 @@ class Indi_ZigZag : public Indicator { static double iCustomZigZag(string _symbol, ENUM_TIMEFRAMES _tf, string _name, int _depth, int _deviation, int _backstep, ENUM_ZIGZAG_LINE _mode = 0, int _shift = 0, IndicatorData *_obj = NULL) { #ifdef __MQL5__ - int _handle = Object::IsValid(_obj) ? _obj.Get(IndicatorDataState::INDICATOR_STATE_PROP_HANDLE) : NULL; + int _handle = Object::IsValid(_obj) ? _obj.Get(IndicatorDataState::INDICATOR_DATA_STATE_PROP_HANDLE) : NULL; double _res[]; if (_handle == NULL || _handle == INVALID_HANDLE) { if ((_handle = ::iCustom(_symbol, _tf, _name, _depth, _deviation, _backstep)) == INVALID_HANDLE) { diff --git a/Indicators/Oscillator/Indi_WPR.h b/Indicators/Oscillator/Indi_WPR.h index 7074da75f..19460907e 100644 --- a/Indicators/Oscillator/Indi_WPR.h +++ b/Indicators/Oscillator/Indi_WPR.h @@ -87,7 +87,7 @@ class Indi_WPR : public Indicator { #ifdef __MQL4__ return ::iWPR(_symbol, _tf, _period, _shift); #else // __MQL5__ - int _handle = Object::IsValid(_obj) ? _obj.Get(IndicatorDataState::INDICATOR_STATE_PROP_HANDLE) : NULL; + int _handle = Object::IsValid(_obj) ? _obj.Get(IndicatorDataState::INDICATOR_DATA_STATE_PROP_HANDLE) : NULL; double _res[]; if (_handle == NULL || _handle == INVALID_HANDLE) { if ((_handle = ::iWPR(_symbol, _tf, _period)) == INVALID_HANDLE) { diff --git a/Indicators/tests/DrawIndicator.test.mq5 b/Indicators/tests/DrawIndicator.test.mq5 index e3cdbf41f..d0f5dfc36 100644 --- a/Indicators/tests/DrawIndicator.test.mq5 +++ b/Indicators/tests/DrawIndicator.test.mq5 @@ -72,7 +72,7 @@ void OnTick() { IndicatorData *_indi = iter.Value().Ptr(); _indi.OnTick(Platform::GetGlobalTickIndex()); IndicatorDataEntry _entry = _indi.GetEntry(); - if (_indi.Get(STRUCT_ENUM(IndicatorDataState, INDICATOR_STATE_PROP_IS_READY)) && _entry.IsValid()) { + if (_indi.Get(STRUCT_ENUM(IndicatorDataState, INDICATOR_DATA_STATE_PROP_IS_READY)) && _entry.IsValid()) { #ifdef __debug__ PrintFormat("%s: bar %d: %s", _indi.GetName(), bar_processed, _indi.ToString()); #endif @@ -165,7 +165,7 @@ bool PrintIndicators(string _prefix = "") { for (DictIterator> iter = Platform::GetIndicators() PTR_DEREF Begin(); iter.IsValid(); ++iter) { IndicatorData *_indi = iter.Value().Ptr(); - if (_indi.Get(STRUCT_ENUM(IndicatorDataState, INDICATOR_STATE_PROP_IS_READY))) { + if (_indi.Get(STRUCT_ENUM(IndicatorDataState, INDICATOR_DATA_STATE_PROP_IS_READY))) { PrintFormat("%s: %s: %s", _prefix, _indi.GetName(), _indi.ToString()); } } diff --git a/Platform.h b/Platform.h index 8efa9d334..4bbec7a8f 100644 --- a/Platform.h +++ b/Platform.h @@ -842,7 +842,7 @@ datetime StructToTime(MqlDateTime &dt_struct) { Platform::Tick(); \ if (Platform::IsNewHour()) { \ IndicatorDataEntry _entry = indi REF_DEREF GetEntry(); \ - bool _is_ready = indi REF_DEREF Get(STRUCT_ENUM(IndicatorDataState, INDICATOR_STATE_PROP_IS_READY)); \ + bool _is_ready = indi REF_DEREF Get(STRUCT_ENUM(IndicatorDataState, INDICATOR_DATA_STATE_PROP_IS_READY)); \ bool _is_valid = _entry.IsValid(); \ Print(indi REF_DEREF ToString(), _is_ready ? " (Ready)" : " (Not yet ready)"); \ if (_is_ready && !_is_valid) { \ diff --git a/tests/IndicatorsTest.mq5 b/tests/IndicatorsTest.mq5 index f41ce1c1d..0e1581cb3 100644 --- a/tests/IndicatorsTest.mq5 +++ b/tests/IndicatorsTest.mq5 @@ -126,7 +126,7 @@ void OnTick() { // if (_indi.GetType() != INDI_AMA) // continue; - if (_indi PTR_DEREF Get(STRUCT_ENUM(IndicatorDataState, INDICATOR_STATE_PROP_IS_READY))) { + if (_indi PTR_DEREF Get(STRUCT_ENUM(IndicatorDataState, INDICATOR_DATA_STATE_PROP_IS_READY))) { if (_entry.IsValid()) { PrintFormat("%s: bar %d: %s", _indi PTR_DEREF GetFullName(), _candles PTR_DEREF GetBars(), _indi PTR_DEREF ToString()); @@ -595,7 +595,7 @@ bool PrintIndicators(string _prefix = "") { ResetLastError(); continue; } - if (_indi.Get(STRUCT_ENUM(IndicatorDataState, INDICATOR_STATE_PROP_IS_READY))) { + if (_indi.Get(STRUCT_ENUM(IndicatorDataState, INDICATOR_DATA_STATE_PROP_IS_READY))) { PrintFormat("%s: %s: %s", _prefix, _indi.GetName(), _indi.ToString()); } } From f2b53219d62f7923a2c159541c8861391134da40 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 21:43:38 +0100 Subject: [PATCH 036/109] GHA: Removes Indi_WPR.test from the main test --- .github/workflows/test-indicators.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test-indicators.yml b/.github/workflows/test-indicators.yml index e69133e32..b9ca470db 100644 --- a/.github/workflows/test-indicators.yml +++ b/.github/workflows/test-indicators.yml @@ -100,7 +100,6 @@ jobs: - Indi_VIDYA.test - Indi_VROC.test - Indi_Volumes.test - - Indi_WPR.test - Indi_WilliamsAD.test - Indi_ZigZag.test - Indi_ZigZagColor.test From d3413341570cbef8f9a253359bebc2dfdb687b0d Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 21:51:43 +0100 Subject: [PATCH 037/109] Moves ObjectsCache to Storage/Cache/ Adds new tests --- .github/workflows/test-storage-cache.yml | 61 +++++++++++++++++++++++ Indicators/Indi_StdDev.mqh | 2 +- Storage/{ => Cache}/ObjectsCache.h | 2 +- Storage/Cache/tests/Makefile | 12 +++++ Storage/Cache/tests/ObjectsCache.test.cpp | 36 +++++++++++++ Storage/Cache/tests/ObjectsCache.test.mq4 | 28 +++++++++++ Storage/Cache/tests/ObjectsCache.test.mq5 | 40 +++++++++++++++ Storage/ValueStorage.applied_price.h | 2 +- Storage/ValueStorage.price_median.h | 2 +- Storage/ValueStorage.price_typical.h | 2 +- Storage/ValueStorage.price_weighted.h | 2 +- Storage/ValueStorage.spread.h | 2 +- Storage/ValueStorage.tick_volume.h | 2 +- Storage/ValueStorage.time.h | 2 +- Storage/ValueStorage.volume.h | 2 +- tests/CompileTest.mq5 | 2 +- 16 files changed, 188 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/test-storage-cache.yml rename Storage/{ => Cache}/ObjectsCache.h (98%) create mode 100644 Storage/Cache/tests/Makefile create mode 100644 Storage/Cache/tests/ObjectsCache.test.cpp create mode 100644 Storage/Cache/tests/ObjectsCache.test.mq4 create mode 100644 Storage/Cache/tests/ObjectsCache.test.mq5 diff --git a/.github/workflows/test-storage-cache.yml b/.github/workflows/test-storage-cache.yml new file mode 100644 index 000000000..899e0dac1 --- /dev/null +++ b/.github/workflows/test-storage-cache.yml @@ -0,0 +1,61 @@ +--- +name: Test Storage/Cache + +# yamllint disable-line rule:truthy +on: + pull_request: + paths: + - 'Storage/Cache/**' + - '.github/workflows/test-storage-cache.yml' + push: + paths: + - 'Storage/Cache/**' + - '.github/workflows/test-storage-cache.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: 'Storage/Cache/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' + + Tests-MQL4: + defaults: + run: + shell: bash + working-directory: Storage/Cache/tests + needs: Compile + runs-on: ubuntu-latest + strategy: + matrix: + test: + - ObjectsCache.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 }} + RunOnError: show_logs 200 + timeout-minutes: 10 diff --git a/Indicators/Indi_StdDev.mqh b/Indicators/Indi_StdDev.mqh index 253eb4c95..992478f9e 100644 --- a/Indicators/Indi_StdDev.mqh +++ b/Indicators/Indi_StdDev.mqh @@ -29,7 +29,7 @@ // Includes. #include "../Indicator/Indicator.h" -#include "../Storage/ObjectsCache.h" +#include "../Storage/Cache/ObjectsCache.h" #include "Price/Indi_MA.h" #include "Indi_PriceFeeder.mqh" diff --git a/Storage/ObjectsCache.h b/Storage/Cache/ObjectsCache.h similarity index 98% rename from Storage/ObjectsCache.h rename to Storage/Cache/ObjectsCache.h index 1b47c51cc..132fbef1c 100644 --- a/Storage/ObjectsCache.h +++ b/Storage/Cache/ObjectsCache.h @@ -30,7 +30,7 @@ #endif // Includes. -#include "../Storage/Dict/DictStruct.h" +#include "../../Storage/Dict/DictStruct.h" /** * Makes DictStruct object pointers to be deleted at the end. diff --git a/Storage/Cache/tests/Makefile b/Storage/Cache/tests/Makefile new file mode 100644 index 000000000..e792364f0 --- /dev/null +++ b/Storage/Cache/tests/Makefile @@ -0,0 +1,12 @@ +CC := g++ # C++ compiler +CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags +SRCS := $(wildcard *.cpp) # Get all .cpp files in the current directory +OBJS := $(SRCS:.cpp=.o) # Object files corresponding to the source files + +all: $(OBJS) + +%.o: %.cpp + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -v $(OBJS) diff --git a/Storage/Cache/tests/ObjectsCache.test.cpp b/Storage/Cache/tests/ObjectsCache.test.cpp new file mode 100644 index 000000000..3f5d792fc --- /dev/null +++ b/Storage/Cache/tests/ObjectsCache.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test C++ compilation of ObjectsCache class. + */ + +// Includes. +#include "../ObjectsCache.h" + +int main(int argc, char **argv) { + + // @todo: Add more tests. + // ... + + return 0; +} diff --git a/Storage/Cache/tests/ObjectsCache.test.mq4 b/Storage/Cache/tests/ObjectsCache.test.mq4 new file mode 100644 index 000000000..47374a5de --- /dev/null +++ b/Storage/Cache/tests/ObjectsCache.test.mq4 @@ -0,0 +1,28 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test functionality of ObjectsCache class. + */ + +// Includes. +#include "ObjectsCache.test.mq5" diff --git a/Storage/Cache/tests/ObjectsCache.test.mq5 b/Storage/Cache/tests/ObjectsCache.test.mq5 new file mode 100644 index 000000000..b0ec18056 --- /dev/null +++ b/Storage/Cache/tests/ObjectsCache.test.mq5 @@ -0,0 +1,40 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test functionality of ObjectsCache class. + */ + +// Includes. +#include "../../../Test.mqh" +#include "../ObjectsCache.h" + +/** + * Implements OnInit(). + */ +int OnInit() { + + // @todo: Add more tests. + // ... + + return (GetLastError() > 0 ? INIT_FAILED : INIT_SUCCEEDED); +} diff --git a/Storage/ValueStorage.applied_price.h b/Storage/ValueStorage.applied_price.h index bb752a5b5..bb539190d 100644 --- a/Storage/ValueStorage.applied_price.h +++ b/Storage/ValueStorage.applied_price.h @@ -26,7 +26,7 @@ // Includes. #include "../Chart.struct.h" -#include "ObjectsCache.h" +#include "Cache/ObjectsCache.h" #include "ValueStorage.history.h" // Forward declarations. diff --git a/Storage/ValueStorage.price_median.h b/Storage/ValueStorage.price_median.h index 890ffee3e..3e0e62d5c 100644 --- a/Storage/ValueStorage.price_median.h +++ b/Storage/ValueStorage.price_median.h @@ -28,7 +28,7 @@ class IndicatorBase; // Includes. -#include "ObjectsCache.h" +#include "Cache/ObjectsCache.h" #include "ValueStorage.history.h" /** diff --git a/Storage/ValueStorage.price_typical.h b/Storage/ValueStorage.price_typical.h index fe99eb869..8f6609ba0 100644 --- a/Storage/ValueStorage.price_typical.h +++ b/Storage/ValueStorage.price_typical.h @@ -25,7 +25,7 @@ */ // Includes. -#include "ObjectsCache.h" +#include "Cache/ObjectsCache.h" #include "ValueStorage.history.h" /** diff --git a/Storage/ValueStorage.price_weighted.h b/Storage/ValueStorage.price_weighted.h index 91029acc4..38b6aa411 100644 --- a/Storage/ValueStorage.price_weighted.h +++ b/Storage/ValueStorage.price_weighted.h @@ -25,7 +25,7 @@ */ // Includes. -#include "ObjectsCache.h" +#include "Cache/ObjectsCache.h" #include "ValueStorage.history.h" /** diff --git a/Storage/ValueStorage.spread.h b/Storage/ValueStorage.spread.h index 17510321e..ee2e1cf3c 100644 --- a/Storage/ValueStorage.spread.h +++ b/Storage/ValueStorage.spread.h @@ -25,7 +25,7 @@ */ // Includes. -#include "ObjectsCache.h" +#include "Cache/ObjectsCache.h" #include "ValueStorage.history.h" /** diff --git a/Storage/ValueStorage.tick_volume.h b/Storage/ValueStorage.tick_volume.h index f2f6d699b..cad534e28 100644 --- a/Storage/ValueStorage.tick_volume.h +++ b/Storage/ValueStorage.tick_volume.h @@ -25,7 +25,7 @@ */ // Includes. -#include "ObjectsCache.h" +#include "Cache/ObjectsCache.h" #include "ValueStorage.history.h" /** diff --git a/Storage/ValueStorage.time.h b/Storage/ValueStorage.time.h index c2bdf2bf1..0f73a3b04 100644 --- a/Storage/ValueStorage.time.h +++ b/Storage/ValueStorage.time.h @@ -26,7 +26,7 @@ // Includes. #include "../Util.h" -#include "ObjectsCache.h" +#include "Cache/ObjectsCache.h" #include "ValueStorage.history.h" /** diff --git a/Storage/ValueStorage.volume.h b/Storage/ValueStorage.volume.h index 17072e40e..e68f96e82 100644 --- a/Storage/ValueStorage.volume.h +++ b/Storage/ValueStorage.volume.h @@ -25,7 +25,7 @@ */ // Includes. -#include "ObjectsCache.h" +#include "Cache/ObjectsCache.h" #include "ValueStorage.history.h" /** diff --git a/tests/CompileTest.mq5 b/tests/CompileTest.mq5 index b3e1d303c..8c35e391a 100644 --- a/tests/CompileTest.mq5 +++ b/tests/CompileTest.mq5 @@ -86,7 +86,7 @@ struct IndicatorParams; #include "../RegistryBinary.mqh" #include "../Report.mqh" #include "../Storage/Objects.h" -#include "../Storage/ObjectsCache.h" +#include "../Storage/Cache/ObjectsCache.h" // #include "../SVG.mqh" // @removeme #include "../Session.mqh" #include "../SetFile.mqh" From 1bc9b841ed4c8be5cbfe150e6e2c7c4708ae8af1 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 22:13:48 +0100 Subject: [PATCH 038/109] Renames IndicatorData.struct.cache.h to Storage/Cache/IndicatorCalculateCache.h (GH-556) --- .github/workflows/test-storage-cache.yml | 1 + Indicator/Indicator.struct.h | 2 +- Indicator/IndicatorData.h | 2 +- .../Cache/IndicatorCalculateCache.h | 4 +- .../tests/IndicatorCalculateCache.test.cpp | 36 +++++++++++++++++ .../tests/IndicatorCalculateCache.test.mq4 | 28 +++++++++++++ .../tests/IndicatorCalculateCache.test.mq5 | 40 +++++++++++++++++++ 7 files changed, 109 insertions(+), 4 deletions(-) rename Indicator/IndicatorData.struct.cache.h => Storage/Cache/IndicatorCalculateCache.h (99%) create mode 100644 Storage/Cache/tests/IndicatorCalculateCache.test.cpp create mode 100644 Storage/Cache/tests/IndicatorCalculateCache.test.mq4 create mode 100644 Storage/Cache/tests/IndicatorCalculateCache.test.mq5 diff --git a/.github/workflows/test-storage-cache.yml b/.github/workflows/test-storage-cache.yml index 899e0dac1..63557652b 100644 --- a/.github/workflows/test-storage-cache.yml +++ b/.github/workflows/test-storage-cache.yml @@ -48,6 +48,7 @@ jobs: strategy: matrix: test: + - IndicatorCalculateCache.test - ObjectsCache.test steps: - uses: actions/download-artifact@v2 diff --git a/Indicator/Indicator.struct.h b/Indicator/Indicator.struct.h index 59e498e1e..f2db3d4d4 100644 --- a/Indicator/Indicator.struct.h +++ b/Indicator/Indicator.struct.h @@ -42,7 +42,7 @@ struct ChartParams; #include "../Storage/DateTime.struct.h" #include "../Serializer/SerializerNode.enum.h" #include "Indicator.enum.h" -#include "IndicatorData.struct.cache.h" +#include "../Storage/Cache/IndicatorCalculateCache.h" //#include "Indicator.struct.serialize.h" /* Structure for indicator parameters. */ diff --git a/Indicator/IndicatorData.h b/Indicator/IndicatorData.h index 9825c22ab..138f08fd7 100644 --- a/Indicator/IndicatorData.h +++ b/Indicator/IndicatorData.h @@ -48,7 +48,7 @@ struct ExternInstantiateIndicatorBufferValueStorageDouble { #include "Indicator.enum.h" #include "IndicatorBase.h" #include "IndicatorData.enum.h" -#include "IndicatorData.struct.cache.h" +#include "../Storage/Cache/IndicatorCalculateCache.h" #include "IndicatorData.struct.h" #include "IndicatorData.struct.serialize.h" #include "IndicatorData.struct.signal.h" diff --git a/Indicator/IndicatorData.struct.cache.h b/Storage/Cache/IndicatorCalculateCache.h similarity index 99% rename from Indicator/IndicatorData.struct.cache.h rename to Storage/Cache/IndicatorCalculateCache.h index 610646d0b..a7a125a69 100644 --- a/Indicator/IndicatorData.struct.cache.h +++ b/Storage/Cache/IndicatorCalculateCache.h @@ -31,8 +31,8 @@ #endif // Includes. -#include "../Refs.mqh" -#include "../Storage/ValueStorage.h" +#include "../../Refs.mqh" +#include "../ValueStorage.h" /** * Holds buffers used to cache values calculated via OnCalculate methods. diff --git a/Storage/Cache/tests/IndicatorCalculateCache.test.cpp b/Storage/Cache/tests/IndicatorCalculateCache.test.cpp new file mode 100644 index 000000000..3c2196816 --- /dev/null +++ b/Storage/Cache/tests/IndicatorCalculateCache.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test C++ compilation of IndicatorCalculateCache class. + */ + +// Includes. +#include "../IndicatorCalculateCache.h" + +int main(int argc, char **argv) { + + // @todo: Add more tests. + // ... + + return 0; +} diff --git a/Storage/Cache/tests/IndicatorCalculateCache.test.mq4 b/Storage/Cache/tests/IndicatorCalculateCache.test.mq4 new file mode 100644 index 000000000..a6d801da3 --- /dev/null +++ b/Storage/Cache/tests/IndicatorCalculateCache.test.mq4 @@ -0,0 +1,28 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test functionality of IndicatorCalculateCache class. + */ + +// Includes. +#include "IndicatorCalculateCache.test.mq5" diff --git a/Storage/Cache/tests/IndicatorCalculateCache.test.mq5 b/Storage/Cache/tests/IndicatorCalculateCache.test.mq5 new file mode 100644 index 000000000..0c1f91fe3 --- /dev/null +++ b/Storage/Cache/tests/IndicatorCalculateCache.test.mq5 @@ -0,0 +1,40 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test functionality of ObjectsCache class. + */ + +// Includes. +#include "../../../Test.mqh" +#include "../IndicatorCalculateCache.h" + +/** + * Implements OnInit(). + */ +int OnInit() { + + // @todo: Add more tests. + // ... + + return (GetLastError() > 0 ? INIT_FAILED : INIT_SUCCEEDED); +} From f479d88ca78442a34ac51c2b8aef68db68da8ed5 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 22:35:15 +0100 Subject: [PATCH 039/109] Renames IndicatorCalculateCache class to IndiBufferCache (GH-556) --- .github/workflows/test-storage-cache.yml | 2 +- Indicator/Indicator.h | 10 +++++----- Indicator/Indicator.struct.h | 2 +- Indicator/IndicatorBase.h | 10 +++++----- Indicator/IndicatorData.h | 6 +++--- Indicator/README.md | 4 ++-- Indicators/Indi_ADXW.mqh | 2 +- Indicators/Indi_AMA.mqh | 2 +- Indicators/Indi_ASI.mqh | 2 +- Indicators/Indi_BWZT.mqh | 2 +- Indicators/Indi_CHO.mqh | 2 +- Indicators/Indi_CHV.mqh | 2 +- Indicators/Indi_ColorBars.mqh | 2 +- Indicators/Indi_ColorCandlesDaily.mqh | 2 +- Indicators/Indi_ColorLine.mqh | 2 +- Indicators/Indi_DEMA.mqh | 2 +- Indicators/Indi_DetrendedPrice.mqh | 2 +- Indicators/Indi_FractalAdaptiveMA.mqh | 2 +- Indicators/Indi_HeikenAshi.mqh | 2 +- Indicators/Indi_MassIndex.mqh | 2 +- Indicators/Indi_PriceChannel.mqh | 2 +- Indicators/Indi_PriceVolumeTrend.mqh | 2 +- Indicators/Indi_RateOfChange.mqh | 2 +- Indicators/Indi_TEMA.mqh | 2 +- Indicators/Indi_TRIX.mqh | 2 +- Indicators/Indi_UltimateOscillator.mqh | 2 +- Indicators/Indi_VIDYA.mqh | 2 +- Indicators/Indi_VROC.mqh | 2 +- Indicators/Indi_Volumes.mqh | 2 +- Indicators/Indi_WilliamsAD.mqh | 2 +- Indicators/Indi_ZigZag.mqh | 2 +- Indicators/Indi_ZigZagColor.mqh | 2 +- Indicators/Price/Indi_MA.h | 6 +++--- Indicators/PriceRange/Indi_Bands.h | 2 +- Indicators/PriceRange/Indi_Envelopes.h | 4 ++-- .../{IndicatorCalculateCache.h => IndiBufferCache.h} | 12 ++++++------ ...culateCache.test.cpp => IndiBufferCache.test.cpp} | 4 ++-- ...culateCache.test.mq4 => IndiBufferCache.test.mq4} | 4 ++-- ...culateCache.test.mq5 => IndiBufferCache.test.mq5} | 2 +- Storage/ValueStorage.h | 6 +++--- 40 files changed, 63 insertions(+), 63 deletions(-) rename Storage/Cache/{IndicatorCalculateCache.h => IndiBufferCache.h} (95%) rename Storage/Cache/tests/{IndicatorCalculateCache.test.cpp => IndiBufferCache.test.cpp} (92%) rename Storage/Cache/tests/{IndicatorCalculateCache.test.mq4 => IndiBufferCache.test.mq4} (91%) rename Storage/Cache/tests/{IndicatorCalculateCache.test.mq5 => IndiBufferCache.test.mq5} (96%) diff --git a/.github/workflows/test-storage-cache.yml b/.github/workflows/test-storage-cache.yml index 63557652b..bf46a81ab 100644 --- a/.github/workflows/test-storage-cache.yml +++ b/.github/workflows/test-storage-cache.yml @@ -48,7 +48,7 @@ jobs: strategy: matrix: test: - - IndicatorCalculateCache.test + - IndiBufferCache.test - ObjectsCache.test steps: - uses: actions/download-artifact@v2 diff --git a/Indicator/Indicator.h b/Indicator/Indicator.h index 8b4f98378..69117c594 100644 --- a/Indicator/Indicator.h +++ b/Indicator/Indicator.h @@ -242,7 +242,7 @@ class Indicator : public IndicatorData { * cache_key.Add(period); * cache_key.Add(foo_method); * - * Ref cache = Indicator::OnCalculateProxy(cache_key.ToString(), price, total); + * Ref cache = Indicator::OnCalculateProxy(cache_key.ToString(), price, total); * * int prev_calculated = * Indi_Foo::Calculate(total, cache.Ptr().prev_calculated, 0, price, cache.Ptr().buffer1, ma_method, period); @@ -258,21 +258,21 @@ class Indicator : public IndicatorData { * WARNING: Do not use shifts when creating cache_key, as this will create many invalid buffers. */ /* - static IndicatorCalculateCache OnCalculateProxy(string key, double& price[], int& total) { + static IndiBufferCache OnCalculateProxy(string key, double& price[], int& total) { if (total == 0) { total = ArraySize(price); } // Stores previously calculated value. - static DictStruct cache; + static DictStruct cache; unsigned int position; - IndicatorCalculateCache cache_item; + IndiBufferCache cache_item; if (cache.KeyExists(key, position)) { cache_item = cache.GetByKey(key); } else { - IndicatorCalculateCache cache_item_new(1, ArraySize(price)); + IndiBufferCache cache_item_new(1, ArraySize(price)); cache_item = cache_item_new; cache.Set(key, cache_item); } diff --git a/Indicator/Indicator.struct.h b/Indicator/Indicator.struct.h index f2db3d4d4..0982decd9 100644 --- a/Indicator/Indicator.struct.h +++ b/Indicator/Indicator.struct.h @@ -42,7 +42,7 @@ struct ChartParams; #include "../Storage/DateTime.struct.h" #include "../Serializer/SerializerNode.enum.h" #include "Indicator.enum.h" -#include "../Storage/Cache/IndicatorCalculateCache.h" +#include "../Storage/Cache/IndiBufferCache.h" //#include "Indicator.struct.serialize.h" /* Structure for indicator parameters. */ diff --git a/Indicator/IndicatorBase.h b/Indicator/IndicatorBase.h index f206e727c..72a6c0b4d 100644 --- a/Indicator/IndicatorBase.h +++ b/Indicator/IndicatorBase.h @@ -104,7 +104,7 @@ class IndicatorBase : public Object { * cache_key.Add(period); * cache_key.Add(foo_method); * - * Ref cache = Indicator::OnCalculateProxy(cache_key.ToString(), price, total); + * Ref cache = Indicator::OnCalculateProxy(cache_key.ToString(), price, total); * * int prev_calculated = * Indi_Foo::Calculate(total, cache.Ptr().prev_calculated, 0, price, cache.Ptr().buffer1, ma_method, period); @@ -120,21 +120,21 @@ class IndicatorBase : public Object { * WARNING: Do not use shifts when creating cache_key, as this will create many invalid buffers. */ /* - static IndicatorCalculateCache OnCalculateProxy(string key, double& price[], int& total) { + static IndiBufferCache OnCalculateProxy(string key, double& price[], int& total) { if (total == 0) { total = ArraySize(price); } // Stores previously calculated value. - static DictStruct cache; + static DictStruct cache; unsigned int position; - IndicatorCalculateCache cache_item; + IndiBufferCache cache_item; if (cache.KeyExists(key, position)) { cache_item = cache.GetByKey(key); } else { - IndicatorCalculateCache cache_item_new(1, ArraySize(price)); + IndiBufferCache cache_item_new(1, ArraySize(price)); cache_item = cache_item_new; cache.Set(key, cache_item); } diff --git a/Indicator/IndicatorData.h b/Indicator/IndicatorData.h index 138f08fd7..c062b2fbc 100644 --- a/Indicator/IndicatorData.h +++ b/Indicator/IndicatorData.h @@ -48,7 +48,7 @@ struct ExternInstantiateIndicatorBufferValueStorageDouble { #include "Indicator.enum.h" #include "IndicatorBase.h" #include "IndicatorData.enum.h" -#include "../Storage/Cache/IndicatorCalculateCache.h" +#include "../Storage/Cache/IndiBufferCache.h" #include "IndicatorData.struct.h" #include "IndicatorData.struct.serialize.h" #include "IndicatorData.struct.signal.h" @@ -74,7 +74,7 @@ class IndicatorData : public IndicatorBase { BufferStruct idata; DictStruct> indicators; // Indicators list keyed by id. // DrawIndicator* draw; - IndicatorCalculateCache cache; + IndiBufferCache cache; IndicatorDataParams idparams; // Indicator data params. IndicatorDataState istate; Ref indi_src; // Indicator used as data source. @@ -573,7 +573,7 @@ class IndicatorData : public IndicatorBase { /** * Returns buffers' cache. */ - IndicatorCalculateCache* GetCache() { return &cache; } + IndiBufferCache* GetCache() { return &cache; } /** * Get pointer to data of indicator. diff --git a/Indicator/README.md b/Indicator/README.md index 17420b37c..3394a87b5 100644 --- a/Indicator/README.md +++ b/Indicator/README.md @@ -134,7 +134,7 @@ Shift passed is relative to the shift from `IndicatorParams::shift` All shifts passed are relative to the shift from `IndicatorParams::shift` (read via `Indicator::iparams.shift`). -### IndicatorCalculateCache::GetValue()/GetTailValue(int _buffer_index, int _shift) +### IndiBufferCache::GetValue()/GetTailValue(int _buffer_index, int _shift) Shift passed may be relative or absolute. It depends on the ValueStorage specialization. @@ -142,7 +142,7 @@ E.g., `HistoryValueStorage` operates on relative shifts, but `NativeValueStorage` operates on absolute shift, because it is unaware for which indicator values are stored. -Thus way, `IndicatorCalculateCache::GetValue()` and `IndicatorCalculateCache::GetTailValue()` +Thus way, `IndiBufferCache::GetValue()` and `IndiBufferCache::GetTailValue()` also don't know which type of shift was passed. However, all current indicators uses `NativeValueStorage` for storing indicator values, so shift passed must is treated as absolute. diff --git a/Indicators/Indi_ADXW.mqh b/Indicators/Indi_ADXW.mqh index c5a82f0b2..b9dcca041 100644 --- a/Indicators/Indi_ADXW.mqh +++ b/Indicators/Indi_ADXW.mqh @@ -131,7 +131,7 @@ class Indi_ADXW : public Indicator { * Calculates ADX Wilder on the array of values. */ static double iADXWilderOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _period, int _mode, int _abs_shift, - IndicatorCalculateCache *_cache, bool _recalculate = false) { + IndiBufferCache *_cache, bool _recalculate = false) { _cache.SetPriceBuffer(_open, _high, _low, _close); if (!_cache.HasBuffers()) { diff --git a/Indicators/Indi_AMA.mqh b/Indicators/Indi_AMA.mqh index 6acbf831d..f32f31c25 100644 --- a/Indicators/Indi_AMA.mqh +++ b/Indicators/Indi_AMA.mqh @@ -121,7 +121,7 @@ class Indi_AMA : public Indicator { */ static double iAMAOnArray(INDICATOR_CALCULATE_PARAMS_SHORT, int _ama_period, int _fast_ema_period, int _slow_ema_period, int _ama_shift, int _mode, int _abs_shift, - IndicatorCalculateCache *_cache, bool _recalculate = false) { + IndiBufferCache *_cache, bool _recalculate = false) { _cache.SetPriceBuffer(_price); if (!_cache.HasBuffers()) { diff --git a/Indicators/Indi_ASI.mqh b/Indicators/Indi_ASI.mqh index e0ec2cc6a..75fa5cfe0 100644 --- a/Indicators/Indi_ASI.mqh +++ b/Indicators/Indi_ASI.mqh @@ -115,7 +115,7 @@ class Indi_ASI : public Indicator { * Calculates ASI on the array of values. */ static double iASIOnArray(INDICATOR_CALCULATE_PARAMS_LONG, double _mpc, int _mode, int _abs_shift, - IndicatorCalculateCache *_cache, bool _recalculate = false) { + IndiBufferCache *_cache, bool _recalculate = false) { _cache.SetPriceBuffer(_open, _high, _low, _close); if (!_cache.HasBuffers()) { diff --git a/Indicators/Indi_BWZT.mqh b/Indicators/Indi_BWZT.mqh index e30dceeeb..66e3a0d87 100644 --- a/Indicators/Indi_BWZT.mqh +++ b/Indicators/Indi_BWZT.mqh @@ -139,7 +139,7 @@ class Indi_BWZT : public Indicator { * Calculates BWZT on the array of values. */ static double iBWZTOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _mode, int _abs_shift, int _data_limit, - IndicatorCalculateCache *_cache, Indi_AC *_indi_ac, Indi_AO *_indi_ao, + IndiBufferCache *_cache, Indi_AC *_indi_ac, Indi_AO *_indi_ao, bool _recalculate = false) { _cache.SetPriceBuffer(_open, _high, _low, _close); diff --git a/Indicators/Indi_CHO.mqh b/Indicators/Indi_CHO.mqh index 3d4102a4d..97622a207 100644 --- a/Indicators/Indi_CHO.mqh +++ b/Indicators/Indi_CHO.mqh @@ -118,7 +118,7 @@ class Indi_CHO : public Indicator { */ static double iChaikinOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _fast_ma_period, int _slow_ma_period, ENUM_MA_METHOD _ma_method, ENUM_APPLIED_VOLUME _av, int _mode, int _abs_shift, - IndicatorCalculateCache *_cache, bool _recalculate = false) { + IndiBufferCache *_cache, bool _recalculate = false) { _cache.SetPriceBuffer(_open, _high, _low, _close); if (!_cache.HasBuffers()) { diff --git a/Indicators/Indi_CHV.mqh b/Indicators/Indi_CHV.mqh index ddd5dcb83..18b249494 100644 --- a/Indicators/Indi_CHV.mqh +++ b/Indicators/Indi_CHV.mqh @@ -107,7 +107,7 @@ class Indi_CHV : public Indicator { */ static double iCHVOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _smooth_period, int _chv_period, ENUM_CHV_SMOOTH_METHOD _smooth_method, int _mode, int _abs_shift, - IndicatorCalculateCache *_cache, bool _recalculate = false) { + IndiBufferCache *_cache, bool _recalculate = false) { _cache.SetPriceBuffer(_open, _high, _low, _close); if (!_cache.HasBuffers()) { diff --git a/Indicators/Indi_ColorBars.mqh b/Indicators/Indi_ColorBars.mqh index 8fd78494c..9563ada32 100644 --- a/Indicators/Indi_ColorBars.mqh +++ b/Indicators/Indi_ColorBars.mqh @@ -77,7 +77,7 @@ class Indi_ColorBars : public Indicator { * Calculates Color Bars on the array of values. */ static double iColorBarsOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _mode, int _abs_shift, - IndicatorCalculateCache *_cache, bool _recalculate = false) { + IndiBufferCache *_cache, bool _recalculate = false) { _cache.SetPriceBuffer(_open, _high, _low, _close); if (!_cache.HasBuffers()) { diff --git a/Indicators/Indi_ColorCandlesDaily.mqh b/Indicators/Indi_ColorCandlesDaily.mqh index fc0592d1e..943243b5f 100644 --- a/Indicators/Indi_ColorCandlesDaily.mqh +++ b/Indicators/Indi_ColorCandlesDaily.mqh @@ -90,7 +90,7 @@ class Indi_ColorCandlesDaily : public Indicator { * Calculates Color Candles Daily on the array of values. */ static double iCCDOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _mode, int _abs_shift, - IndicatorCalculateCache *_cache, bool _recalculate = false) { + IndiBufferCache *_cache, bool _recalculate = false) { _cache.SetPriceBuffer(_open, _high, _low, _close); if (!_cache.HasBuffers()) { diff --git a/Indicators/Indi_ColorLine.mqh b/Indicators/Indi_ColorLine.mqh index bd65644e5..ac494c31b 100644 --- a/Indicators/Indi_ColorLine.mqh +++ b/Indicators/Indi_ColorLine.mqh @@ -95,7 +95,7 @@ class Indi_ColorLine : public Indicator { * Calculates Color Line on the array of values. */ static double iColorLineOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _mode, int _abs_shift, - IndicatorCalculateCache *_cache, IndicatorData *_indi_ma, + IndiBufferCache *_cache, IndicatorData *_indi_ma, bool _recalculate = false) { _cache.SetPriceBuffer(_open, _high, _low, _close); diff --git a/Indicators/Indi_DEMA.mqh b/Indicators/Indi_DEMA.mqh index 10b00d9d3..299bd009a 100644 --- a/Indicators/Indi_DEMA.mqh +++ b/Indicators/Indi_DEMA.mqh @@ -127,7 +127,7 @@ class Indi_DEMA : public Indicator { } static double iDEMAOnArray(INDICATOR_CALCULATE_PARAMS_SHORT, unsigned int _ma_period, unsigned int _ma_shift, - int _mode, int _shift, IndicatorCalculateCache *_cache = NULL, + int _mode, int _shift, IndiBufferCache *_cache = NULL, bool _recalculate = false) { if (_cache == nullptr) { Print("iDEMAOnArray() cannot yet work without cache object!"); diff --git a/Indicators/Indi_DetrendedPrice.mqh b/Indicators/Indi_DetrendedPrice.mqh index ffdbd9ed2..b492b2a2b 100644 --- a/Indicators/Indi_DetrendedPrice.mqh +++ b/Indicators/Indi_DetrendedPrice.mqh @@ -93,7 +93,7 @@ class Indi_DetrendedPrice : public Indicator { * Calculates DPO on the array of values. */ static double iDPOOnArray(INDICATOR_CALCULATE_PARAMS_SHORT, int _period, ENUM_APPLIED_PRICE _ap, int _mode, - int _abs_shift, IndicatorCalculateCache *_cache, bool _recalculate = false) { + int _abs_shift, IndiBufferCache *_cache, bool _recalculate = false) { _cache.SetPriceBuffer(_price); if (!_cache.HasBuffers()) { diff --git a/Indicators/Indi_FractalAdaptiveMA.mqh b/Indicators/Indi_FractalAdaptiveMA.mqh index 3ca51ca89..0e518ce63 100644 --- a/Indicators/Indi_FractalAdaptiveMA.mqh +++ b/Indicators/Indi_FractalAdaptiveMA.mqh @@ -122,7 +122,7 @@ class Indi_FrAMA : public Indicator { * Calculates FrAMA on the array of values. */ static double iFrAMAOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _ma_period, int _ma_shift, ENUM_APPLIED_PRICE _ap, - int _mode, int _abs_shift, IndicatorCalculateCache *_cache, + int _mode, int _abs_shift, IndiBufferCache *_cache, bool _recalculate = false) { _cache.SetPriceBuffer(_open, _high, _low, _close); diff --git a/Indicators/Indi_HeikenAshi.mqh b/Indicators/Indi_HeikenAshi.mqh index 5f451d479..f12b639d9 100644 --- a/Indicators/Indi_HeikenAshi.mqh +++ b/Indicators/Indi_HeikenAshi.mqh @@ -168,7 +168,7 @@ class Indi_HeikenAshi : public Indicator { * Calculates Heiken Ashi on the array of values. */ static double iHeikenAshiOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _mode, int _abs_shift, - IndicatorCalculateCache *_cache, bool _recalculate = false) { + IndiBufferCache *_cache, bool _recalculate = false) { _cache.SetPriceBuffer(_open, _high, _low, _close); if (!_cache.HasBuffers()) { diff --git a/Indicators/Indi_MassIndex.mqh b/Indicators/Indi_MassIndex.mqh index 60adeb55e..88cbd3dfd 100644 --- a/Indicators/Indi_MassIndex.mqh +++ b/Indicators/Indi_MassIndex.mqh @@ -98,7 +98,7 @@ class Indi_MassIndex : public Indicator { * Calculates Mass Index on the array of values. */ static double iMIOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _period, int _second_period, int _sum_period, int _mode, - int _abs_shift, IndicatorCalculateCache *_cache, bool _recalculate = false) { + int _abs_shift, IndiBufferCache *_cache, bool _recalculate = false) { _cache.SetPriceBuffer(_open, _high, _low, _close); if (!_cache.HasBuffers()) { diff --git a/Indicators/Indi_PriceChannel.mqh b/Indicators/Indi_PriceChannel.mqh index 690aad74b..2b5c6ec68 100644 --- a/Indicators/Indi_PriceChannel.mqh +++ b/Indicators/Indi_PriceChannel.mqh @@ -90,7 +90,7 @@ class Indi_PriceChannel : public Indicator { * Calculates Price Channel on the array of values. */ static double iPriceChannelOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _period, int _mode, int _abs_shift, - IndicatorCalculateCache *_cache, bool _recalculate = false) { + IndiBufferCache *_cache, bool _recalculate = false) { _cache.SetPriceBuffer(_open, _high, _low, _close); if (!_cache.HasBuffers()) { diff --git a/Indicators/Indi_PriceVolumeTrend.mqh b/Indicators/Indi_PriceVolumeTrend.mqh index 681e14243..28719fc81 100644 --- a/Indicators/Indi_PriceVolumeTrend.mqh +++ b/Indicators/Indi_PriceVolumeTrend.mqh @@ -85,7 +85,7 @@ class Indi_PriceVolumeTrend : public Indicator { * Calculates Price Volume Trend on the array of values. */ static double iPVTOnArray(INDICATOR_CALCULATE_PARAMS_LONG, ENUM_APPLIED_VOLUME _av, int _mode, int _abs_shift, - IndicatorCalculateCache *_cache, bool _recalculate = false) { + IndiBufferCache *_cache, bool _recalculate = false) { _cache.SetPriceBuffer(_open, _high, _low, _close); if (!_cache.HasBuffers()) { diff --git a/Indicators/Indi_RateOfChange.mqh b/Indicators/Indi_RateOfChange.mqh index 3d9695360..0c49c953d 100644 --- a/Indicators/Indi_RateOfChange.mqh +++ b/Indicators/Indi_RateOfChange.mqh @@ -79,7 +79,7 @@ class Indi_RateOfChange : public Indicator { * Calculates Rate of Change on the array of values. */ static double iROCOnArray(INDICATOR_CALCULATE_PARAMS_SHORT, int _period, int _mode, int _abs_shift, - IndicatorCalculateCache *_cache, bool _recalculate = false) { + IndiBufferCache *_cache, bool _recalculate = false) { _cache.SetPriceBuffer(_price); if (!_cache.HasBuffers()) { diff --git a/Indicators/Indi_TEMA.mqh b/Indicators/Indi_TEMA.mqh index 519ba7b57..8476623b8 100644 --- a/Indicators/Indi_TEMA.mqh +++ b/Indicators/Indi_TEMA.mqh @@ -103,7 +103,7 @@ class Indi_TEMA : public Indicator { * Calculates iTEMA on the array of values. */ static double iTEMAOnArray(INDICATOR_CALCULATE_PARAMS_SHORT, int _ma_period, int _ma_shift, int _mode, int _abs_shift, - IndicatorCalculateCache *_cache, bool _recalculate = false) { + IndiBufferCache *_cache, bool _recalculate = false) { _cache.SetPriceBuffer(_price); if (!_cache.HasBuffers()) { diff --git a/Indicators/Indi_TRIX.mqh b/Indicators/Indi_TRIX.mqh index 357da9088..db602af97 100644 --- a/Indicators/Indi_TRIX.mqh +++ b/Indicators/Indi_TRIX.mqh @@ -101,7 +101,7 @@ class Indi_TRIX : public Indicator { * Calculates TriX on the array of values. */ static double iTriXOnArray(INDICATOR_CALCULATE_PARAMS_SHORT, int _ma_period, int _mode, int _abs_shift, - IndicatorCalculateCache *_cache, bool _recalculate = false) { + IndiBufferCache *_cache, bool _recalculate = false) { _cache.SetPriceBuffer(_price); if (!_cache.HasBuffers()) { diff --git a/Indicators/Indi_UltimateOscillator.mqh b/Indicators/Indi_UltimateOscillator.mqh index 65f408fd7..1897c9d1d 100644 --- a/Indicators/Indi_UltimateOscillator.mqh +++ b/Indicators/Indi_UltimateOscillator.mqh @@ -120,7 +120,7 @@ class Indi_UltimateOscillator : public Indicator { */ static double iUOOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _fast_period, int _middle_period, int _slow_period, int _fast_k, int _middle_k, int _slow_k, int _mode, int _abs_shift, - IndicatorCalculateCache *_cache, IndicatorData *_indi_atr_fast, + IndiBufferCache *_cache, IndicatorData *_indi_atr_fast, IndicatorData *_indi_atr_middle, IndicatorData *_indi_atr_slow, bool _recalculate = false) { _cache.SetPriceBuffer(_open, _high, _low, _close); diff --git a/Indicators/Indi_VIDYA.mqh b/Indicators/Indi_VIDYA.mqh index 0d3b4d033..6d3217f84 100644 --- a/Indicators/Indi_VIDYA.mqh +++ b/Indicators/Indi_VIDYA.mqh @@ -106,7 +106,7 @@ class Indi_VIDYA : public Indicator { * Calculates iVIDyA on the array of values. */ static double iVIDyAOnArray(INDICATOR_CALCULATE_PARAMS_SHORT, int _cmo_period, int _ema_period, int _ma_shift, - int _mode, int _abs_shift, IndicatorCalculateCache *_cache, + int _mode, int _abs_shift, IndiBufferCache *_cache, bool _recalculate = false) { _cache.SetPriceBuffer(_price); diff --git a/Indicators/Indi_VROC.mqh b/Indicators/Indi_VROC.mqh index 0f71dab06..34d124de9 100644 --- a/Indicators/Indi_VROC.mqh +++ b/Indicators/Indi_VROC.mqh @@ -93,7 +93,7 @@ class Indi_VROC : public Indicator { * Calculates VROC on the array of values. */ static double iVROCOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _period, ENUM_APPLIED_VOLUME _av, int _mode, - int _abs_shift, IndicatorCalculateCache *_cache, bool _recalculate = false) { + int _abs_shift, IndiBufferCache *_cache, bool _recalculate = false) { _cache.SetPriceBuffer(_open, _high, _low, _close); if (!_cache.HasBuffers()) { diff --git a/Indicators/Indi_Volumes.mqh b/Indicators/Indi_Volumes.mqh index 63f06f923..c720b8d3c 100644 --- a/Indicators/Indi_Volumes.mqh +++ b/Indicators/Indi_Volumes.mqh @@ -96,7 +96,7 @@ class Indi_Volumes : public Indicator { * Calculates AMVolumes on the array of values. */ static double iVolumesOnArray(INDICATOR_CALCULATE_PARAMS_LONG, ENUM_APPLIED_VOLUME _av, int _mode, int _abs_shift, - IndicatorCalculateCache *_cache, bool _recalculate = false) { + IndiBufferCache *_cache, bool _recalculate = false) { _cache.SetPriceBuffer(_open, _high, _low, _close); if (!_cache.HasBuffers()) { diff --git a/Indicators/Indi_WilliamsAD.mqh b/Indicators/Indi_WilliamsAD.mqh index 27c8c9469..ef47ec6a3 100644 --- a/Indicators/Indi_WilliamsAD.mqh +++ b/Indicators/Indi_WilliamsAD.mqh @@ -94,7 +94,7 @@ class Indi_WilliamsAD : public Indicator { * Calculates William's AD on the array of values. */ static double iWADOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _mode, int _abs_shift, - IndicatorCalculateCache *_cache, bool _recalculate = false) { + IndiBufferCache *_cache, bool _recalculate = false) { _cache.SetPriceBuffer(_open, _high, _low, _close); if (!_cache.HasBuffers()) { diff --git a/Indicators/Indi_ZigZag.mqh b/Indicators/Indi_ZigZag.mqh index eab0b6bd0..f1ce33ad2 100644 --- a/Indicators/Indi_ZigZag.mqh +++ b/Indicators/Indi_ZigZag.mqh @@ -161,7 +161,7 @@ class Indi_ZigZag : public Indicator { * Calculates ZigZag on the array of values. */ static double iZigZagOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _depth, int _deviation, int _backstep, int _mode, - int _abs_shift, IndicatorCalculateCache *_cache, bool _recalculate = false) { + int _abs_shift, IndiBufferCache *_cache, bool _recalculate = false) { _cache.SetPriceBuffer(_open, _high, _low, _close); if (!_cache.HasBuffers()) { diff --git a/Indicators/Indi_ZigZagColor.mqh b/Indicators/Indi_ZigZagColor.mqh index 6593e8f81..a1ee4237a 100644 --- a/Indicators/Indi_ZigZagColor.mqh +++ b/Indicators/Indi_ZigZagColor.mqh @@ -108,7 +108,7 @@ class Indi_ZigZagColor : public Indicator { * Calculates ZigZag Color on the array of values. */ static double iZigZagColorOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _depth, int _deviation, int _backstep, - int _mode, int _abs_shift, IndicatorCalculateCache *_cache, + int _mode, int _abs_shift, IndiBufferCache *_cache, bool _recalculate = false) { _cache.SetPriceBuffer(_open, _high, _low, _close); diff --git a/Indicators/Price/Indi_MA.h b/Indicators/Price/Indi_MA.h index bda4a7a5f..7d85e06e0 100644 --- a/Indicators/Price/Indi_MA.h +++ b/Indicators/Price/Indi_MA.h @@ -55,7 +55,7 @@ double iMA(string _symbol, int _tf, int _ma_period, int _ma_shift, int _ma_metho (ENUM_APPLIED_PRICE)_ap, _shift); } double iMAOnArray(ARRAY_REF(double, _arr), int _total, int _period, int _ma_shift, int _ma_method, int _abs_shift, - IndicatorCalculateCache *_cache = NULL) { + IndiBufferCache *_cache = NULL) { ResetLastError(); return Indi_MA::iMAOnArray(_arr, _total, _period, _ma_shift, _ma_method, _abs_shift, _cache); } @@ -166,7 +166,7 @@ class Indi_MA : public Indicator { * Calculates MA on the array of values. Cache is optional. */ static double iMAOnArray(ARRAY_REF(double, price), int total, int ma_period, int ma_shift, int ma_method, int shift, - IndicatorCalculateCache *cache = NULL) { + IndiBufferCache *cache = NULL) { #ifdef __MQL4__ return ::iMAOnArray(price, total, ma_period, ma_shift, ma_method, shift); #else @@ -182,7 +182,7 @@ class Indi_MA : public Indicator { * Calculates MA on the array of values. */ static double iMAOnArray(ValueStorage &price, int total, int ma_period, int ma_shift, int ma_method, - int shift, IndicatorCalculateCache *_cache = NULL, bool recalculate = false) { + int shift, IndiBufferCache *_cache = NULL, bool recalculate = false) { if (_cache != NULL) { _cache.SetPriceBuffer(price); diff --git a/Indicators/PriceRange/Indi_Bands.h b/Indicators/PriceRange/Indi_Bands.h index a06a0ffeb..c19e04987 100644 --- a/Indicators/PriceRange/Indi_Bands.h +++ b/Indicators/PriceRange/Indi_Bands.h @@ -162,7 +162,7 @@ class Indi_Bands : public Indicator { } static double iBandsOnArray(INDICATOR_CALCULATE_PARAMS_SHORT, int _period, double _deviation, int _bands_shift, - int _mode, int _abs_shift, IndicatorCalculateCache *_cache, + int _mode, int _abs_shift, IndiBufferCache *_cache, bool _recalculate = false) { _cache.SetPriceBuffer(_price); diff --git a/Indicators/PriceRange/Indi_Envelopes.h b/Indicators/PriceRange/Indi_Envelopes.h index e58acf46e..9e93bb311 100644 --- a/Indicators/PriceRange/Indi_Envelopes.h +++ b/Indicators/PriceRange/Indi_Envelopes.h @@ -164,7 +164,7 @@ class Indi_Envelopes : public Indicator { static double iEnvelopesOnArray(double &price[], int total, int ma_period, ENUM_MA_METHOD ma_method, int ma_shift, double deviation, int mode, int shift, - IndicatorCalculateCache *_cache = NULL) { + IndiBufferCache *_cache = NULL) { #ifdef __MQL4__ return iEnvelopesOnArray(price, total, ma_period, ma_method, ma_shift, deviation, mode, shift); #else @@ -178,7 +178,7 @@ class Indi_Envelopes : public Indicator { static double iEnvelopesOnArray(ValueStorage *_price, int _total, int _ma_period, ENUM_MA_METHOD _ma_method, int _ma_shift, double _deviation, int _mode, int _shift, - IndicatorCalculateCache *_cache = NULL) { + IndiBufferCache *_cache = NULL) { // We need 1 bar more because MA methods assumes we have historic bars. if (_price PTR_DEREF Size() < _shift + _ma_shift + _ma_period + 1) { return DBL_MIN; diff --git a/Storage/Cache/IndicatorCalculateCache.h b/Storage/Cache/IndiBufferCache.h similarity index 95% rename from Storage/Cache/IndicatorCalculateCache.h rename to Storage/Cache/IndiBufferCache.h index a7a125a69..2fd474f03 100644 --- a/Storage/Cache/IndicatorCalculateCache.h +++ b/Storage/Cache/IndiBufferCache.h @@ -38,7 +38,7 @@ * Holds buffers used to cache values calculated via OnCalculate methods. */ template -class IndicatorCalculateCache : public Dynamic { +class IndiBufferCache : public Dynamic { public: // Total number of calculated values. int prev_calculated; @@ -68,12 +68,12 @@ class IndicatorCalculateCache : public Dynamic { ARRAY(IValueStorage *, buffers); // Auxiliary caches related to this one. - ARRAY(IndicatorCalculateCache *, subcaches); + ARRAY(IndiBufferCache *, subcaches); /** * Constructor. */ - IndicatorCalculateCache(int _buffers_size = 0) { + IndiBufferCache(int _buffers_size = 0) { prev_calculated = 0; total = 0; initialized = false; @@ -83,7 +83,7 @@ class IndicatorCalculateCache : public Dynamic { /** * Destructor. */ - ~IndicatorCalculateCache() { + ~IndiBufferCache() { int i; for (i = 0; i < ArraySize(buffers); ++i) { @@ -123,13 +123,13 @@ class IndicatorCalculateCache : public Dynamic { * Returns existing or new cache as a child of current one. Useful when indicator uses other indicators and requires * unique caches for them. */ - IndicatorCalculateCache *GetSubCache(int index) { + IndiBufferCache *GetSubCache(int index) { if (index >= ArraySize(subcaches)) { ArrayResize(subcaches, index + 1, 10); } if (subcaches[index] == NULL) { - subcaches[index] = new IndicatorCalculateCache(); + subcaches[index] = new IndiBufferCache(); } return subcaches[index]; diff --git a/Storage/Cache/tests/IndicatorCalculateCache.test.cpp b/Storage/Cache/tests/IndiBufferCache.test.cpp similarity index 92% rename from Storage/Cache/tests/IndicatorCalculateCache.test.cpp rename to Storage/Cache/tests/IndiBufferCache.test.cpp index 3c2196816..5e7a40004 100644 --- a/Storage/Cache/tests/IndicatorCalculateCache.test.cpp +++ b/Storage/Cache/tests/IndiBufferCache.test.cpp @@ -21,11 +21,11 @@ /** * @file - * Test C++ compilation of IndicatorCalculateCache class. + * Test C++ compilation of IndiBufferCache class. */ // Includes. -#include "../IndicatorCalculateCache.h" +#include "../IndiBufferCache.h" int main(int argc, char **argv) { diff --git a/Storage/Cache/tests/IndicatorCalculateCache.test.mq4 b/Storage/Cache/tests/IndiBufferCache.test.mq4 similarity index 91% rename from Storage/Cache/tests/IndicatorCalculateCache.test.mq4 rename to Storage/Cache/tests/IndiBufferCache.test.mq4 index a6d801da3..dda5bacf9 100644 --- a/Storage/Cache/tests/IndicatorCalculateCache.test.mq4 +++ b/Storage/Cache/tests/IndiBufferCache.test.mq4 @@ -21,8 +21,8 @@ /** * @file - * Test functionality of IndicatorCalculateCache class. + * Test functionality of IndiBufferCache class. */ // Includes. -#include "IndicatorCalculateCache.test.mq5" +#include "IndiBufferCache.test.mq5" diff --git a/Storage/Cache/tests/IndicatorCalculateCache.test.mq5 b/Storage/Cache/tests/IndiBufferCache.test.mq5 similarity index 96% rename from Storage/Cache/tests/IndicatorCalculateCache.test.mq5 rename to Storage/Cache/tests/IndiBufferCache.test.mq5 index 0c1f91fe3..7ff72d85c 100644 --- a/Storage/Cache/tests/IndicatorCalculateCache.test.mq5 +++ b/Storage/Cache/tests/IndiBufferCache.test.mq5 @@ -26,7 +26,7 @@ // Includes. #include "../../../Test.mqh" -#include "../IndicatorCalculateCache.h" +#include "../IndiBufferCache.h" /** * Implements OnInit(). diff --git a/Storage/ValueStorage.h b/Storage/ValueStorage.h index 3b51799f5..09714f138 100644 --- a/Storage/ValueStorage.h +++ b/Storage/ValueStorage.h @@ -68,10 +68,10 @@ enum ENUM_IPEAK { IPEAK_LOWEST, IPEAK_HIGHEST }; #define INDICATOR_CALCULATE_GET_PARAMS_SHORT _cache.GetTotal(), _cache.GetPrevCalculated(), 0, _cache.GetPriceBuffer() #define INDICATOR_CALCULATE_POPULATE_CACHE(INDI, KEY) \ - IndicatorCalculateCache *_cache; \ + IndiBufferCache *_cache; \ string _key = Util::MakeKey(INDI PTR_DEREF GetId(), KEY); \ - if (!Objects>::TryGet(_key, _cache)) { \ - _cache = Objects>::Set(_key, new IndicatorCalculateCache()); \ + if (!Objects>::TryGet(_key, _cache)) { \ + _cache = Objects>::Set(_key, new IndiBufferCache()); \ } /** From 7172b62cb892ffe1127d9afc7c1c59f28db27003 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 22:43:13 +0100 Subject: [PATCH 040/109] Renames CompileIndicatorsTest to Indicators/tests/Indicators --- .github/workflows/test-indicators.yml | 1 + .github/workflows/test.yml | 1 - .../tests/Indicators.test.mq4 | 4 ++-- .../tests/Indicators.test.mq5 | 10 ++-------- 4 files changed, 5 insertions(+), 11 deletions(-) rename tests/CompileIndicatorsTest.mq4 => Indicators/tests/Indicators.test.mq4 (92%) rename tests/CompileIndicatorsTest.mq5 => Indicators/tests/Indicators.test.mq5 (76%) diff --git a/.github/workflows/test-indicators.yml b/.github/workflows/test-indicators.yml index b9ca470db..8a7e8e811 100644 --- a/.github/workflows/test-indicators.yml +++ b/.github/workflows/test-indicators.yml @@ -103,6 +103,7 @@ jobs: - Indi_WilliamsAD.test - Indi_ZigZag.test - Indi_ZigZagColor.test + - Indicators.test # Requires refactoring: # - Indi_DEMA.test steps: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d680f548f..8a1e1adfd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -54,7 +54,6 @@ jobs: matrix: test: - ChartTest - - CompileIndicatorsTest - EATest - IndicatorsTest - MailTest diff --git a/tests/CompileIndicatorsTest.mq4 b/Indicators/tests/Indicators.test.mq4 similarity index 92% rename from tests/CompileIndicatorsTest.mq4 rename to Indicators/tests/Indicators.test.mq4 index 5eac8e1a5..ee10e238c 100644 --- a/tests/CompileIndicatorsTest.mq4 +++ b/Indicators/tests/Indicators.test.mq4 @@ -21,8 +21,8 @@ /** * @file - * Test compilation of Indicators/ files. + * Test compilation of all indicators. */ // Includes. -#include "CompileIndicatorsTest.mq5" +#include "Indicators.test.mq5" diff --git a/tests/CompileIndicatorsTest.mq5 b/Indicators/tests/Indicators.test.mq5 similarity index 76% rename from tests/CompileIndicatorsTest.mq5 rename to Indicators/tests/Indicators.test.mq5 index e528fe7c0..a17d5b994 100644 --- a/tests/CompileIndicatorsTest.mq5 +++ b/Indicators/tests/Indicators.test.mq5 @@ -21,17 +21,11 @@ /** * @file - * Test compilation of Indicators/ files. + * Test compilation of all indicators. */ // Includes. -#include "../Indicators/includes.h" -#include "../Indicators/Bitwise/includes.h" -#include "../Indicators/OHLC/includes.h" -#include "../Indicators/Oscillator/includes.h" -#include "../Indicators/Price/includes.h" -#include "../Indicators/PriceRange/includes.h" -#include "../Indicators/Special/includes.h" +#include "../includes.h" /** * Implements Init event handler. From 08923ef11b0764fa10d95380aee7648f84c641e1 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 22:46:38 +0100 Subject: [PATCH 041/109] Removes SVG.mqh as redundant --- SVG.mqh | 66 ------------------------------------------- tests/CompileTest.mq5 | 1 - 2 files changed, 67 deletions(-) delete mode 100644 SVG.mqh diff --git a/SVG.mqh b/SVG.mqh deleted file mode 100644 index 3239e1420..000000000 --- a/SVG.mqh +++ /dev/null @@ -1,66 +0,0 @@ -//+------------------------------------------------------------------+ -//| 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 . - * - */ - -#property copyright "" -#property link "" - -class SVG { - datetime x,y,t; - datetime tdiff; - int filehandle; - -public: - - SVG(string filename) - { - string svg="0) { - x=TimeHour(Time[i])*TimeMinute(Time[i]); - tdiff=(Time[0]-Time[i]); - y=(Time[Bars-1]-Time[i])/-100; - FileWrite(filehandle,t++,High[i]); - - } - - } - else Print("File open failed, error ",GetLastError()); - - } - - -}; diff --git a/tests/CompileTest.mq5 b/tests/CompileTest.mq5 index 8c35e391a..d70df6853 100644 --- a/tests/CompileTest.mq5 +++ b/tests/CompileTest.mq5 @@ -87,7 +87,6 @@ struct IndicatorParams; #include "../Report.mqh" #include "../Storage/Objects.h" #include "../Storage/Cache/ObjectsCache.h" -// #include "../SVG.mqh" // @removeme #include "../Session.mqh" #include "../SetFile.mqh" #include "../Socket.mqh" From f7e6218945831b7c8e968be5256c8c765acc8305 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 22:48:13 +0100 Subject: [PATCH 042/109] Removes RegistryBinary.mqh as redundant --- RegistryBinary.mqh | 274 ------------------------------------------ tests/CompileTest.mq5 | 1 - 2 files changed, 275 deletions(-) delete mode 100644 RegistryBinary.mqh diff --git a/RegistryBinary.mqh b/RegistryBinary.mqh deleted file mode 100644 index 3597d375a..000000000 --- a/RegistryBinary.mqh +++ /dev/null @@ -1,274 +0,0 @@ -//+------------------------------------------------------------------+ -//| 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 . - * - */ - -class RegistryBinary { - struct RegistryBinaryData - { - int key; - int val; - }; - - int handle, size; - string filename; - RegistryBinaryData array[], copyArray[]; - - public: - - void RegistryBinary (string path = "", bool binary = 0) { - if (binary == 0) - { - if (path != "") { - - handle = FileOpen(path, FILE_READ|FILE_CSV|FILE_ANSI, "="); - - if (handle != INVALID_HANDLE) - { - int count = 0; - while(FileIsEnding(handle)==false) - { - ArrayResize(array,(count+1),100000); - - array[count].key = FileReadInteger(handle); - array[count].val = FileReadInteger(handle); - count++; - } - } - - FileClose(handle); - - filename = path; - } - } - else - { - // @todo Add support for binary files, numeric instead of string key and val - handle = FileOpen(path, FILE_BIN|FILE_READ); - - if (handle != INVALID_HANDLE) - { - FileReadArray(handle, array, 0, WHOLE_ARRAY); - } - - FileClose(handle); - - filename = path; - } - - } - - bool Save (string path = "", bool binary = 0) { - - if (path == "") - { - path = filename; - } - - if (binary == 0) - { - handle = FileOpen(path, FILE_WRITE|FILE_CSV, "="); - - if(handle != INVALID_HANDLE) - { - size = ArraySize(array); - - if(size > 0) - { - for (int i = 0; i < size; i++) - { - FileWrite(handle, array[i].key, array[i].val); - } - } - - FileClose(handle); - return true; - } else { - FileClose(handle); - return false; - } - } - else - { - // @todo Add support for binary files, numeric instead of string key and val - - handle = FileOpen(path, FILE_BIN|FILE_WRITE); - - if(handle != INVALID_HANDLE) - { - size = ArraySize(array); - - if(size > 0) - { - FileWriteArray(handle,array, 0, WHOLE_ARRAY); - } - - FileClose(handle); - return true; - } else { - FileClose(handle); - return false; - } - } - } - - string GetKeys (bool withValues = 0) { - - size = ArraySize(array); - string keys = "Empty"; - - if(size > 0) - { - keys = ""; - for (int i = 0; i < size; i++) - { - keys += IntegerToString(array[i].key); - - if (withValues == 1) { - keys += "=" + IntegerToString(array[i].val); - } - - keys += ";"; - } - } - - return keys; - } - - bool Delete (int key) { - - size = ArraySize(array); - - if(size > 0) - { - int offset = 0; - for (int i = 0; i < size; i++) - { - if (array[i].key == key) - { - Erase(array, i); - return true; - break; - } - } - } - - return false; - } - - template - void Erase(T& A[], int iPos){ - int iLast = ArraySize(A) - 1; - A[iPos].key = A[iLast].key; - A[iPos].val = A[iLast].val; - ArrayResize(A, iLast); - } - - int GetValueInteger (int key) { - - size = ArraySize(array); - - if(size > 0) - { - for (int i = 0; i < size; i++) - { - if (array[i].key == key) - { - return(array[i].val); - break; - } - } - } - - return(NULL); - } - - /* - double GetValueDouble (int key) { - - string value = GetValueString(key); - - if(value != NULL) { - #ifdef MQL4 - return(StrToDouble(value)); - #else - return(StringToDouble(value)); - #endif - } else { - return(NULL); - } - } - */ - - bool SetValue (int key, int value) { - - size = ArraySize(array); - int i = 0; - - if(size > 0) - { - for (;i < size; i++) - { - if (array[i].key == key) - { - array[i].val = value; - return true; - break; - } - } - } - - ArrayResize(array, (size+1), 100000); - - array[i].key = key; - array[i].val = value; - - return true; - } - - /* - bool SetValue (int key, double value) { - - size = ArraySize(array); - int i = 0; - - if(size > 0) - { - for (;i < size; i++) - { - if (array[i].key == key) - { - array[i].val = DoubleToString(value); - return(1); - break; - } - } - } - - ArrayResize(array, (size+1), 100000); - - array[i].key = key; - array[i].val = DoubleToString(value); - - return(1); - } - */ - -}; diff --git a/tests/CompileTest.mq5 b/tests/CompileTest.mq5 index d70df6853..57fe2b3ec 100644 --- a/tests/CompileTest.mq5 +++ b/tests/CompileTest.mq5 @@ -83,7 +83,6 @@ struct IndicatorParams; #include "../Storage/Redis.h" #include "../Refs.mqh" #include "../Registry.mqh" -#include "../RegistryBinary.mqh" #include "../Report.mqh" #include "../Storage/Objects.h" #include "../Storage/Cache/ObjectsCache.h" From cc966c25f80713a993a990ce10963cd274c44d89 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 22:49:00 +0100 Subject: [PATCH 043/109] Removes Registry.mqh as redundant --- Registry.mqh | 272 ------------------------------------------ tests/CompileTest.mq5 | 1 - 2 files changed, 273 deletions(-) delete mode 100644 Registry.mqh diff --git a/Registry.mqh b/Registry.mqh deleted file mode 100644 index 377636124..000000000 --- a/Registry.mqh +++ /dev/null @@ -1,272 +0,0 @@ -//+------------------------------------------------------------------+ -//| 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 . - * - */ - -/** - * Class to provide storing mechanism. - */ -class Registry { - struct RegistryData - { - string key; - string val; - }; - - int handle; - string filename; - RegistryData array[], copyArray[]; - - public: - - Registry(string path = "") { - - if (path != "") { - - handle = FileOpen(path, FILE_READ|FILE_CSV|FILE_ANSI, "="); - - if (handle != INVALID_HANDLE) - { - int count = 0; - while(FileIsEnding(handle)==false) - { - ArrayResize(array,(count+1),100000); - - array[count].key = FileReadString(handle); - array[count].val = FileReadString(handle); - count++; - } - } - - FileClose(handle); - - filename = path; - } - - } - - bool Save(string path = "") { - - if (path == "") - { - path = filename; - } - - handle = FileOpen(path, FILE_WRITE|FILE_CSV, "="); - - if(handle != INVALID_HANDLE) - { - int size = ArraySize(array); - - if(size > 0) - { - for (int i = 0; i < size; i++) - { - FileWrite(handle, array[i].key, array[i].val); - } - } - - FileClose(handle); - return true; - } else { - FileClose(handle); - return false; - } - } - - string GetKeys (bool withValues = 0) { - - int size = ArraySize(array); - string keys = "Empty"; - - if(size > 0) - { - keys = ""; - for (int i = 0; i < size; i++) - { - keys += array[i].key; - - if (withValues == 1) { - keys += "=" + array[i].val; - } - - keys += ";"; - } - } - - return keys; - } - - bool Delete (string key) { - int size = ArraySize(array); - - if(size > 0) - { - int offset = 0; - for (int i = 0; i < size; i++) - { - if (array[i].key == key) - { - Erase(array, i); - return true; - break; - } - } - } - - return false; - } - - template - void Erase(T& A[], int iPos){ - int iLast = ArraySize(A) - 1; - A[iPos].key = A[iLast].key; - A[iPos].val = A[iLast].val; - ArrayResize(A, iLast); - } - - string GetValueString (string key) { - - int size = ArraySize(array); - - if(size > 0) - { - for (int i = 0; i < size; i++) - { - if (array[i].key == key) - { - return(array[i].val); - break; - } - } - } - - return(NULL); - } - - int GetValueInteger (string key) { - - string value = GetValueString(key); - - if(value != NULL) { -#ifdef MQL4 - return(StrToInteger(value)); -#else - return((int) StringToInteger(value)); -#endif - } else { - return(NULL); - } - } - - double GetValueDouble (string key) { - - string value = GetValueString(key); - - if(value != NULL) { -#ifdef MQL4 - return(StrToDouble(value)); -#else - return(StringToDouble(value)); -#endif - } else { - return(NULL); - } - } - - bool SetValue (string key, string value) { - - int size = ArraySize(array); - int i = 0; - - if(size > 0) - { - for (;i < size; i++) - { - if (array[i].key == key) - { - array[i].val = value; - return true; - break; - } - } - } - - ArrayResize(array, (size+1), 100000); - - array[i].key = key; - array[i].val = value; - - return true; - } - - bool SetValue (string key, double value) { - - int size = ArraySize(array); - int i = 0; - - if(size > 0) - { - for (;i < size; i++) - { - if (array[i].key == key) - { - array[i].val = DoubleToString(value); - return true; - break; - } - } - } - - ArrayResize(array, (size+1), 100000); - - array[i].key = key; - array[i].val = DoubleToString(value); - - return true; - } - - bool SetValue (string key, int value) { - - int size = ArraySize(array); - int i = 0; - - if(size > 0) - { - for (;i < size; i++) - { - if (array[i].key == key) - { - array[i].val = IntegerToString(value); - return true; - break; - } - } - } - - ArrayResize(array, (size+1), 100000); - - array[i].key = key; - array[i].val = IntegerToString(value); - - return true; - } - -}; diff --git a/tests/CompileTest.mq5 b/tests/CompileTest.mq5 index 57fe2b3ec..ebad7c85f 100644 --- a/tests/CompileTest.mq5 +++ b/tests/CompileTest.mq5 @@ -82,7 +82,6 @@ struct IndicatorParams; // #include "../Profiler.mqh" #include "../Storage/Redis.h" #include "../Refs.mqh" -#include "../Registry.mqh" #include "../Report.mqh" #include "../Storage/Objects.h" #include "../Storage/Cache/ObjectsCache.h" From e40f05c122517d9b348ca1ad013b37ae146a452d Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 22:49:48 +0100 Subject: [PATCH 044/109] Removes Session.mqh as redundant --- Session.mqh | 274 ------------------------------------------ tests/CompileTest.mq5 | 1 - 2 files changed, 275 deletions(-) delete mode 100644 Session.mqh diff --git a/Session.mqh b/Session.mqh deleted file mode 100644 index c52d9c718..000000000 --- a/Session.mqh +++ /dev/null @@ -1,274 +0,0 @@ -//+------------------------------------------------------------------+ -//| 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 . - * - */ - -/** - * Class to provide storing mechanism for session variables. - */ -class Session { -public: - - struct SessionData - { - string key; - string val; - }; - - int handle; - string filename; - SessionData array[], copyArray[]; - - public: - - void Registry (string path = "") { - - if (path != "") { - - handle = FileOpen(path, FILE_READ|FILE_CSV|FILE_ANSI, "="); - - if (handle != INVALID_HANDLE) - { - int count = 0; - while(FileIsEnding(handle)==false) - { - ArrayResize(array,(count+1),100000); - - array[count].key = FileReadString(handle); - array[count].val = FileReadString(handle); - count++; - } - } - - FileClose(handle); - - filename = path; - } - - } - - bool Save (string path = "") { - - if (path == "") - { - path = filename; - } - - handle = FileOpen(path, FILE_WRITE|FILE_CSV, "="); - - if(handle != INVALID_HANDLE) - { - int size = ArraySize(array); - - if(size > 0) - { - for (int i = 0; i < size; i++) - { - FileWrite(handle, array[i].key, array[i].val); - } - } - - FileClose(handle); - return true; - } else { - FileClose(handle); - return false; - } - } - - string GetKeys (bool withValues = 0) { - - int size = ArraySize(array); - string keys = "Empty"; - - if(size > 0) - { - keys = ""; - for (int i = 0; i < size; i++) - { - keys += array[i].key; - - if (withValues == 1) { - keys += "=" + array[i].val; - } - - keys += ";"; - } - } - - return keys; - } - - bool Delete (string key) { - int size = ArraySize(array); - - if(size > 0) - { - int offset = 0; - for (int i = 0; i < size; i++) - { - if (array[i].key == key) - { - Erase(array, i); - return true; - break; - } - } - } - - return false; - } - - template - void Erase(T& A[], int iPos){ - int iLast = ArraySize(A) - 1; - A[iPos].key = A[iLast].key; - A[iPos].val = A[iLast].val; - ArrayResize(A, iLast); - } - - string GetValueString (string key) { - - int size = ArraySize(array); - - if(size > 0) - { - for (int i = 0; i < size; i++) - { - if (array[i].key == key) - { - return(array[i].val); - break; - } - } - } - - return(NULL); - } - - int GetValueInteger (string key) { - - string value = GetValueString(key); - - if(value != NULL) { -#ifdef MQL4 - return(StrToInteger(value)); -#else - return((int) StringToInteger(value)); -#endif - } else { - return(NULL); - } - } - - double GetValueDouble (string key) { - - string value = GetValueString(key); - - if(value != NULL) { -#ifdef MQL4 - return(StrToDouble(value)); -#else - return(StringToDouble(value)); -#endif - } else { - return(NULL); - } - } - - bool SetValue (string key, string value) { - - int size = ArraySize(array); - int i = 0; - - if(size > 0) - { - for (;i < size; i++) - { - if (array[i].key == key) - { - array[i].val = value; - return true; - break; - } - } - } - - ArrayResize(array, (size+1), 100000); - - array[i].key = key; - array[i].val = value; - - return true; - } - - bool SetValue (string key, double value) { - - int size = ArraySize(array); - int i = 0; - - if(size > 0) - { - for (;i < size; i++) - { - if (array[i].key == key) - { - array[i].val = DoubleToString(value); - return true; - break; - } - } - } - - ArrayResize(array, (size+1), 100000); - - array[i].key = key; - array[i].val = DoubleToString(value); - - return true; - } - - bool SetValue (string key, int value) { - - int size = ArraySize(array); - int i = 0; - - if(size > 0) - { - for (;i < size; i++) - { - if (array[i].key == key) - { - array[i].val = IntegerToString(value); - return true; - break; - } - } - } - - ArrayResize(array, (size+1), 100000); - - array[i].key = key; - array[i].val = IntegerToString(value); - - return true; - } - -}; diff --git a/tests/CompileTest.mq5 b/tests/CompileTest.mq5 index ebad7c85f..46e5b463f 100644 --- a/tests/CompileTest.mq5 +++ b/tests/CompileTest.mq5 @@ -85,7 +85,6 @@ struct IndicatorParams; #include "../Report.mqh" #include "../Storage/Objects.h" #include "../Storage/Cache/ObjectsCache.h" -#include "../Session.mqh" #include "../SetFile.mqh" #include "../Socket.mqh" #include "../Stats.mqh" From 0158bda8735ad0e2d4f912e76d8d67776c0e5b40 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 22:51:11 +0100 Subject: [PATCH 045/109] Removes Msg.mqh as redundant --- Msg.mqh | 97 ------------------------------------------- tests/CompileTest.mq5 | 1 - 2 files changed, 98 deletions(-) delete mode 100644 Msg.mqh diff --git a/Msg.mqh b/Msg.mqh deleted file mode 100644 index 34e7f985f..000000000 --- a/Msg.mqh +++ /dev/null @@ -1,97 +0,0 @@ -//+------------------------------------------------------------------+ -//| 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 . - * - */ - -/* - * Class to provide methods to deal with the messages. - */ -class Msg { -public: - - string last_msg; - - /* - * Display a text message. - * - * @param string text Text of the message. - * @param string type Type of the message. - * @param string subtype Subtype of the message. - * @param int no Number of the message. - * @param bool print Condition whether to print as a standard message. - * @param bool comment Condition whether to print as a comment. - * @param bool alert Condition whether to print as an alert. - * @param bool dups When true, ignore the duplicates. - * - * @return - * Return text if the message is shown, otherwise NULL. - * - */ - static string ShowText( - string text, - string type = "", - string subtype = "", - int no = 0, - bool print = true, - bool comment = false, - bool alert = false, - bool dups = true, - string sep = ": " - ) { - - static string _last_msg; - bool shown = false; - - string msg = ""; - - if (type != "") { - msg += type; - if (no > 0) { - msg += " (" + IntegerToString(no) + ")"; - } - msg += sep; - } - if (subtype != "") { - msg += subtype + sep; - } - msg += text; - - if (msg != _last_msg || !dups) { - if (print) { - Print(msg); - shown = true; - } - if (comment) { - Comment(msg); - shown = true; - } - if (alert) { - Alert(msg); - shown = true; - } - if (shown) { - _last_msg = msg; - return msg; - } - } - return NULL; - } - -}; diff --git a/tests/CompileTest.mq5 b/tests/CompileTest.mq5 index 46e5b463f..a073aa038 100644 --- a/tests/CompileTest.mq5 +++ b/tests/CompileTest.mq5 @@ -74,7 +74,6 @@ struct IndicatorParams; #include "../Math.h" #include "../Matrix.mqh" #include "../MiniMatrix.h" -#include "../Msg.mqh" #include "../Storage/Object.h" #include "../Order.mqh" #include "../Orders.mqh" From 937a53ac3423a7d13563b84dbe9a63245312d968 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 22:53:12 +0100 Subject: [PATCH 046/109] Removes MQL4.mqh as redundant --- MQL4.mqh | 1058 ----------------------------------------- Terminal.mqh | 5 +- tests/CompileTest.mq5 | 1 - 3 files changed, 1 insertion(+), 1063 deletions(-) delete mode 100644 MQL4.mqh diff --git a/MQL4.mqh b/MQL4.mqh deleted file mode 100644 index b4a0c5398..000000000 --- a/MQL4.mqh +++ /dev/null @@ -1,1058 +0,0 @@ -//+------------------------------------------------------------------+ -//| 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 . - * - */ - -/** - * @file - * Provide backward compatibility for MQL4 in MT5/MQL5. - */ - -// Prevents processing this includes file for the second time. -#ifndef MQL4_MQH -#define MQL4_MQH - -//+------------------------------------------------------------------+ -//| Declaration of constants -//+------------------------------------------------------------------+ - -// Index in the order pool. -#ifndef SELECT_BY_POS -#define SELECT_BY_POS 0 -#endif - -// Some of standard MQL4 constants are absent in MQL5, therefore they should be declared as below. -#ifdef __MQL5__ -#define show_inputs script_show_inputs -// -- -#define extern input -// -- -#define init OnInit -// -- - -// Defines macros for MQL5. -/* @fixme: Conflicts with SymbolInfo::Ask() method. -#define Ask SymbolInfo::GetAsk(_Symbol) -#define Bid SymbolInfo::GetAsk(_Symbol) -//#define Bid (::SymbolInfoDouble(_Symbol, ::SYMBOL_BID)) -//#define Ask (::SymbolInfoDouble(_Symbol, ::SYMBOL_ASK)) -*/ - -// Defines macros for MQL5. -/* @fixme: error: macro too complex -#define Day(void) DateTime::Day() -#define DayOfWeek(void) SymbolInfo::DayOfWeek() -#define DayOfYear(void) SymbolInfo::DayOfYear() -*/ - -// Define boolean values. -#define True true -#define False false -#define TRUE true -#define FALSE false -// -- -/* @fixme: If this is defined, cannot call: DateTime::TimeToStr(). -#ifndef TimeToStr -#define TimeToStr(time_value, flags) TimeToString(time_value, flags) -#endif -*/ -// -- -#define CurTime TimeCurrent -// -- -#define LocalTime TimeLocal - -#ifndef TRADE_ACTION_CLOSE_BY -#define TRADE_ACTION_CLOSE_BY 1 -#endif - -//+------------------------------------------------------------------+ -//| Includes. -//+------------------------------------------------------------------+ - -/** - * Returns market data about securities. - */ -/* -#include "Market.mqh" -double MarketInfo(string _symbol, int _type) { - return Market::MarketInfo(_symbol, _type); -} -*/ - -//+------------------------------------------------------------------+ -//| | -//+------------------------------------------------------------------+ -string StringSetChar(const string &String_Var, const int iPos, const unsigned short Value) { - string Str = String_Var; - - ::StringSetCharacter(Str, iPos, Value); - - return (Str); -} - -#endif // __MQL5__ - -#ifdef __MQL5__ -#ifndef __MT4ORDERS__ - -#define __MT4ORDERS__ - -#define RESERVE_SIZE 1000 -#define DAY (24 * 3600) -#define HISTORY_PAUSE (MT4HISTORY::IsTester ? 0 : 5) - -class MT4HISTORY { - private: - static const bool IsTester; - - long Tickets[]; - unsigned int Amount; - - datetime LastTime; - - int LastTotalDeals; - int LastTotalOrders; - - datetime LastInitTime; - -#define GETNEXTPOS_FUNCTION(NAME) \ - static int GetNextPosMT4##NAME(int iPos) { \ - const int Total = ::History##NAME##sTotal(); \ - \ - while (iPos < Total) { \ - if (MT4HISTORY::IsMT4##NAME(::History##NAME##GetTicket(iPos))) break; \ - \ - iPos++; \ - } \ - \ - return (iPos); \ - } - - GETNEXTPOS_FUNCTION(Order) - GETNEXTPOS_FUNCTION(Deal) - -#undef GETNEXTPOS_FUNCTION - - bool RefreshHistory(void) { - bool Res = false; - - const datetime LastTimeCurrent = ::TimeCurrent(); - - if ((!MT4HISTORY::IsTester) && (LastTimeCurrent >= this PTR_DEREF LastInitTime + DAY)) { - this PTR_DEREF LastTime = 0; - - this PTR_DEREF LastTotalOrders = 0; - this PTR_DEREF LastTotalDeals = 0; - - this PTR_DEREF Amount = 0; - - ::ArrayResize(this PTR_DEREF Tickets, this PTR_DEREF Amount, RESERVE_SIZE); - - this PTR_DEREF LastInitTime = LastTimeCurrent; - } - - if (::HistorySelect(this PTR_DEREF LastTime, - ::MathMax(LastTimeCurrent, this PTR_DEREF LastTime) + DAY)) // Daily stock. - { - const int TotalOrders = ::HistoryOrdersTotal(); - const int TotalDeals = ::HistoryDealsTotal(); - - Res = ((TotalOrders != this PTR_DEREF LastTotalOrders) || (TotalDeals != this PTR_DEREF LastTotalDeals)); - - if (Res) { - int iOrder = MT4HISTORY::GetNextPosMT4Order(this PTR_DEREF LastTotalOrders); - int iDeal = MT4HISTORY::GetNextPosMT4Deal(this PTR_DEREF LastTotalDeals); - - long TimeOrder = (iOrder < TotalOrders) - ? ::HistoryOrderGetInteger(::HistoryOrderGetTicket(iOrder), ORDER_TIME_DONE /*_MSC*/) - : LONG_MAX; // ORDER_TIME_DONE_MSC returns zero in the tester (build 1470). - long TimeDeal = (iDeal < TotalDeals) - ? ::HistoryDealGetInteger(::HistoryDealGetTicket(iDeal), DEAL_TIME /*_MSC*/) - : LONG_MAX; - - while ((iDeal < TotalDeals) || (iOrder < TotalOrders)) - if (TimeOrder < TimeDeal) { - this PTR_DEREF Amount = ::ArrayResize(this PTR_DEREF Tickets, this PTR_DEREF Amount + 1, RESERVE_SIZE); - - this PTR_DEREF Tickets[this PTR_DEREF Amount - 1] = -(long)::HistoryOrderGetTicket(iOrder); - - iOrder = MT4HISTORY::GetNextPosMT4Order(iOrder + 1); - - TimeOrder = (iOrder < TotalOrders) - ? ::HistoryOrderGetInteger(::HistoryOrderGetTicket(iOrder), ORDER_TIME_DONE /*_MSC*/) - : LONG_MAX; // ORDER_TIME_DONE_MSC returns zero in the tester (build 1470). - } else { - this PTR_DEREF Amount = ::ArrayResize(this PTR_DEREF Tickets, this PTR_DEREF Amount + 1, RESERVE_SIZE); - - this PTR_DEREF Tickets[this PTR_DEREF Amount - 1] = (long)::HistoryDealGetTicket(iDeal); - - iDeal = MT4HISTORY::GetNextPosMT4Deal(iDeal + 1); - - TimeDeal = (iDeal < TotalDeals) ? ::HistoryDealGetInteger(::HistoryDealGetTicket(iDeal), DEAL_TIME /*_MSC*/) - : LONG_MAX; - } - - TimeOrder = (TotalOrders > 0) - ? ::HistoryOrderGetInteger(::HistoryOrderGetTicket(TotalOrders - 1), ORDER_TIME_DONE /*_MSC*/) - : 0; - TimeDeal = - (TotalDeals > 0) ? ::HistoryDealGetInteger(::HistoryDealGetTicket(TotalDeals - 1), DEAL_TIME /*_MSC*/) : 0; - - const long MaxTime = ::MathMax(TimeOrder, TimeDeal); - - this PTR_DEREF LastTotalOrders = 0; - this PTR_DEREF LastTotalDeals = 0; - - if (LastTimeCurrent - HISTORY_PAUSE > MaxTime) - this PTR_DEREF LastTime = LastTimeCurrent - HISTORY_PAUSE; - else { - this PTR_DEREF LastTime = (datetime)MaxTime; - - if (TimeOrder == MaxTime) - for (int i = TotalOrders - 1; i >= 0; i--) { - if (TimeOrder > ::HistoryOrderGetInteger(::HistoryOrderGetTicket(i), ORDER_TIME_DONE /*_MSC*/)) break; - - this PTR_DEREF LastTotalOrders++; - } - - if (TimeDeal == MaxTime) - for (int i = TotalDeals - 1; i >= 0; i--) { - if (TimeDeal != ::HistoryDealGetInteger(::HistoryDealGetTicket(TotalDeals - 1), DEAL_TIME /*_MSC*/)) - break; - - this PTR_DEREF LastTotalDeals++; - } - } - } else if (LastTimeCurrent - HISTORY_PAUSE > this PTR_DEREF LastTime) { - this PTR_DEREF LastTime = LastTimeCurrent - HISTORY_PAUSE; - - this PTR_DEREF LastTotalOrders = 0; - this PTR_DEREF LastTotalDeals = 0; - } - } - - return (Res); - } - - public: - static bool IsMT4Deal(const unsigned long Ticket) { - const ENUM_DEAL_TYPE Type = (ENUM_DEAL_TYPE)::HistoryDealGetInteger(Ticket, DEAL_TYPE); - - return (((Type != DEAL_TYPE_BUY) && (Type != DEAL_TYPE_SELL)) || - ((ENUM_DEAL_ENTRY)::HistoryDealGetInteger(Ticket, DEAL_ENTRY) == DEAL_ENTRY_OUT)); - } - - static bool IsMT4Order(const unsigned long Ticket) { - return ((::HistoryOrderGetDouble(Ticket, ORDER_VOLUME_CURRENT) > 0) || - (::HistoryOrderGetInteger(Ticket, ORDER_POSITION_ID) == 0)); - } - - MT4HISTORY(void) : Amount(0), LastTime(0), LastTotalDeals(0), LastTotalOrders(0), LastInitTime(0) { - ::ArrayResize(this PTR_DEREF Tickets, this PTR_DEREF Amount, RESERVE_SIZE); - - this PTR_DEREF RefreshHistory(); - } - - int GetAmount(void) { - this PTR_DEREF RefreshHistory(); - - return ((int)this PTR_DEREF Amount); - } - - long operator[](const unsigned int Pos) { - long Res = 0; - - if (Pos >= this PTR_DEREF Amount) { - this PTR_DEREF RefreshHistory(); - - if (Pos < this PTR_DEREF Amount) Res = this PTR_DEREF Tickets[Pos]; - } else - Res = this PTR_DEREF Tickets[Pos]; - - return (Res); - } -}; - -static const bool MT4HISTORY::IsTester = (::MQLInfoInteger(MQL_TESTER) || ::MQLInfoInteger(MQL_OPTIMIZATION) || - ::MQLInfoInteger(MQL_VISUAL_MODE) || ::MQLInfoInteger(MQL_FRAME_MODE)); - -#undef HISTORY_PAUSE -#undef DAY -#undef RESERVE_SIZE - -struct MT4_ORDER { - int Ticket; - int Type; - - double Lots; - - string Symbol; - string Comment; - - double OpenPrice; - datetime OpenTime; - - double StopLoss; - double TakeProfit; - - double ClosePrice; - datetime CloseTime; - - datetime Expiration; - - int MagicNumber; - - double Profit; - - double Commission; - double Swap; - - string ToString(void) const { - static const string Types[] = {"buy", "sell", "buy limit", "sell limit", "buy stop", "sell stop", "balance"}; - const int digits = (int)::SymbolInfoInteger(this PTR_DEREF Symbol, SYMBOL_DIGITS); - - return ( - "#" + (string)this PTR_DEREF Ticket + " " + (string)this PTR_DEREF OpenTime + " " + - ((this PTR_DEREF Type < ::ArraySize(Types)) ? Types[this PTR_DEREF Type] : "unknown") + " " + - ::DoubleToString(this PTR_DEREF Lots, 2) + " " + this PTR_DEREF Symbol + " " + - ::DoubleToString(this PTR_DEREF OpenPrice, digits) + " " + ::DoubleToString(this PTR_DEREF StopLoss, digits) + - " " + ::DoubleToString(this PTR_DEREF TakeProfit, digits) + " " + - ((this PTR_DEREF CloseTime > 0) ? ((string)this PTR_DEREF CloseTime + " ") : "") + - ::DoubleToString(this PTR_DEREF ClosePrice, digits) + " " + ::DoubleToString(this PTR_DEREF Commission, 2) + - " " + ::DoubleToString(this PTR_DEREF Swap, 2) + " " + ::DoubleToString(this PTR_DEREF Profit, 2) + " " + - ((this PTR_DEREF Comment == "") ? "" : (this PTR_DEREF Comment + " ")) + (string)this PTR_DEREF MagicNumber + - (((this PTR_DEREF Expiration > 0) ? (" expiration " + (string)this PTR_DEREF Expiration) : ""))); - } -}; - -class MT4ORDERS { - private: - static MT4_ORDER Order; - static MT4HISTORY History; - - static const bool IsTester; - - static unsigned long GetPositionDealIn(const unsigned long PositionIdentifier = 0) { - unsigned long Ticket = 0; - - if ((PositionIdentifier == 0) ? ::HistorySelectByPosition(::PositionGetInteger(POSITION_IDENTIFIER)) - : ::HistorySelectByPosition(PositionIdentifier)) { - const int Total = ::HistoryDealsTotal(); - - for (int i = 0; i < Total; i++) { - const unsigned long TicketDeal = ::HistoryDealGetTicket(i); - - if (TicketDeal > 0) - if ((ENUM_DEAL_ENTRY)::HistoryDealGetInteger(TicketDeal, DEAL_ENTRY) == DEAL_ENTRY_IN) { - Ticket = TicketDeal; - - break; - } - } - } - - return (Ticket); - } - - static double GetPositionCommission(void) { - double Commission = ::PositionGetDouble(POSITION_COMMISSION); - - if (Commission == 0) { - const unsigned long Ticket = MT4ORDERS::GetPositionDealIn(); - - if (Ticket > 0) { - const double LotsIn = ::HistoryDealGetDouble(Ticket, DEAL_VOLUME); - - if (LotsIn > 0) - Commission = ::HistoryDealGetDouble(Ticket, DEAL_COMMISSION) * ::PositionGetDouble(POSITION_VOLUME) / LotsIn; - } - } - - return (Commission); - } - - static string GetPositionComment(void) { - string comment = ::PositionGetString(POSITION_COMMENT); - - if (comment == "") { - const unsigned long Ticket = MT4ORDERS::GetPositionDealIn(); - - if (Ticket > 0) comment = ::HistoryDealGetString(Ticket, DEAL_COMMENT); - } - - return (comment); - } - - static void GetPositionData(void) { - MT4ORDERS::Order.Ticket = (int)::PositionGetInteger(POSITION_TICKET); - MT4ORDERS::Order.Type = (int)::PositionGetInteger(POSITION_TYPE); - - MT4ORDERS::Order.Lots = ::PositionGetDouble(POSITION_VOLUME); - - MT4ORDERS::Order.Symbol = ::PositionGetString(POSITION_SYMBOL); - MT4ORDERS::Order.Comment = MT4ORDERS::GetPositionComment(); - - MT4ORDERS::Order.OpenPrice = ::PositionGetDouble(POSITION_PRICE_OPEN); - MT4ORDERS::Order.OpenTime = (datetime)::PositionGetInteger(POSITION_TIME); - - MT4ORDERS::Order.StopLoss = ::PositionGetDouble(POSITION_SL); - MT4ORDERS::Order.TakeProfit = ::PositionGetDouble(POSITION_TP); - - MT4ORDERS::Order.ClosePrice = ::PositionGetDouble(POSITION_PRICE_CURRENT); - MT4ORDERS::Order.CloseTime = 0; - - MT4ORDERS::Order.Expiration = 0; - - MT4ORDERS::Order.MagicNumber = (int)::PositionGetInteger(POSITION_MAGIC); - - MT4ORDERS::Order.Profit = ::PositionGetDouble(POSITION_PROFIT); - - MT4ORDERS::Order.Commission = MT4ORDERS::GetPositionCommission(); - MT4ORDERS::Order.Swap = ::PositionGetDouble(POSITION_SWAP); - - return; - } - - static void GetOrderData(void) { - MT4ORDERS::Order.Ticket = (int)::OrderGetInteger(ORDER_TICKET); - MT4ORDERS::Order.Type = (int)::OrderGetInteger(ORDER_TYPE); - - MT4ORDERS::Order.Lots = ::OrderGetDouble(ORDER_VOLUME_CURRENT); - - MT4ORDERS::Order.Symbol = ::OrderGetString(ORDER_SYMBOL); - MT4ORDERS::Order.Comment = ::OrderGetString(ORDER_COMMENT); - - MT4ORDERS::Order.OpenPrice = ::OrderGetDouble(ORDER_PRICE_OPEN); - MT4ORDERS::Order.OpenTime = (datetime)::OrderGetInteger(ORDER_TIME_SETUP); - - MT4ORDERS::Order.StopLoss = ::OrderGetDouble(ORDER_SL); - MT4ORDERS::Order.TakeProfit = ::OrderGetDouble(ORDER_TP); - - MT4ORDERS::Order.ClosePrice = ::OrderGetDouble(ORDER_PRICE_CURRENT); - MT4ORDERS::Order.CloseTime = (datetime)::OrderGetInteger(ORDER_TIME_DONE); - - MT4ORDERS::Order.Expiration = (datetime)::OrderGetInteger(ORDER_TIME_EXPIRATION); - - MT4ORDERS::Order.MagicNumber = (int)::OrderGetInteger(ORDER_MAGIC); - - MT4ORDERS::Order.Profit = 0; - - MT4ORDERS::Order.Commission = 0; - MT4ORDERS::Order.Swap = 0; - - return; - } - - static void GetHistoryOrderData(const unsigned long Ticket) { - MT4ORDERS::Order.Ticket = (int)::HistoryOrderGetInteger(Ticket, ORDER_TICKET); - MT4ORDERS::Order.Type = (int)::HistoryOrderGetInteger(Ticket, ORDER_TYPE); - - MT4ORDERS::Order.Lots = ::HistoryOrderGetDouble(Ticket, ORDER_VOLUME_CURRENT); - - if (MT4ORDERS::Order.Lots == 0) MT4ORDERS::Order.Lots = ::HistoryOrderGetDouble(Ticket, ORDER_VOLUME_INITIAL); - - MT4ORDERS::Order.Symbol = ::HistoryOrderGetString(Ticket, ORDER_SYMBOL); - MT4ORDERS::Order.Comment = ::HistoryOrderGetString(Ticket, ORDER_COMMENT); - - MT4ORDERS::Order.OpenPrice = ::HistoryOrderGetDouble(Ticket, ORDER_PRICE_OPEN); - MT4ORDERS::Order.OpenTime = (datetime)::HistoryOrderGetInteger(Ticket, ORDER_TIME_SETUP); - - MT4ORDERS::Order.StopLoss = ::HistoryOrderGetDouble(Ticket, ORDER_SL); - MT4ORDERS::Order.TakeProfit = ::HistoryOrderGetDouble(Ticket, ORDER_TP); - - MT4ORDERS::Order.ClosePrice = 0; - MT4ORDERS::Order.CloseTime = (datetime)::HistoryOrderGetInteger(Ticket, ORDER_TIME_DONE); - - MT4ORDERS::Order.Expiration = (datetime)::HistoryOrderGetInteger(Ticket, ORDER_TIME_EXPIRATION); - - MT4ORDERS::Order.MagicNumber = (int)::HistoryOrderGetInteger(Ticket, ORDER_MAGIC); - - MT4ORDERS::Order.Profit = 0; - - MT4ORDERS::Order.Commission = 0; - MT4ORDERS::Order.Swap = 0; - - return; - } - - static void GetHistoryPositionData(const unsigned long Ticket) { - MT4ORDERS::Order.Ticket = (int)::HistoryDealGetInteger(Ticket, DEAL_TICKET); - MT4ORDERS::Order.Type = (int)::HistoryDealGetInteger(Ticket, DEAL_TYPE); - - if ((MT4ORDERS::Order.Type > OP_SELL)) - MT4ORDERS::Order.Type += (OP_BALANCE - OP_SELL - 1); - else - MT4ORDERS::Order.Type = 1 - MT4ORDERS::Order.Type; - - MT4ORDERS::Order.Lots = ::HistoryDealGetDouble(Ticket, DEAL_VOLUME); - - MT4ORDERS::Order.Symbol = ::HistoryDealGetString(Ticket, DEAL_SYMBOL); - MT4ORDERS::Order.Comment = ::HistoryDealGetString(Ticket, DEAL_COMMENT); - - MT4ORDERS::Order.OpenPrice = ::HistoryDealGetDouble(Ticket, DEAL_PRICE); - MT4ORDERS::Order.OpenTime = (datetime)::HistoryDealGetInteger(Ticket, DEAL_TIME); - - MT4ORDERS::Order.StopLoss = 0; - MT4ORDERS::Order.TakeProfit = 0; - - MT4ORDERS::Order.ClosePrice = ::HistoryDealGetDouble(Ticket, DEAL_PRICE); - MT4ORDERS::Order.CloseTime = (datetime)::HistoryDealGetInteger(Ticket, DEAL_TIME); - ; - - MT4ORDERS::Order.Expiration = 0; - - MT4ORDERS::Order.MagicNumber = (int)::HistoryDealGetInteger(Ticket, DEAL_MAGIC); - - MT4ORDERS::Order.Profit = ::HistoryDealGetDouble(Ticket, DEAL_PROFIT); - - MT4ORDERS::Order.Commission = ::HistoryDealGetDouble(Ticket, DEAL_COMMISSION); - MT4ORDERS::Order.Swap = ::HistoryDealGetDouble(Ticket, DEAL_SWAP); - - const unsigned long OpenTicket = MT4ORDERS::GetPositionDealIn(::HistoryDealGetInteger(Ticket, DEAL_POSITION_ID)); - - if (OpenTicket > 0) { - MT4ORDERS::Order.OpenPrice = ::HistoryDealGetDouble(OpenTicket, DEAL_PRICE); - MT4ORDERS::Order.OpenTime = (datetime)::HistoryDealGetInteger(OpenTicket, DEAL_TIME); - - const double OpenLots = ::HistoryDealGetDouble(OpenTicket, DEAL_VOLUME); - - if (OpenLots > 0) - MT4ORDERS::Order.Commission += - ::HistoryDealGetDouble(OpenTicket, DEAL_COMMISSION) * MT4ORDERS::Order.Lots / OpenLots; - - if (MT4ORDERS::Order.MagicNumber == 0) - MT4ORDERS::Order.MagicNumber = (int)::HistoryDealGetInteger(OpenTicket, DEAL_MAGIC); - - if (MT4ORDERS::Order.Comment == "") MT4ORDERS::Order.Comment = ::HistoryDealGetString(OpenTicket, DEAL_COMMENT); - } - - return; - } - - static bool Waiting(const bool FlagInit = false) { - static unsigned long StartTime = 0; - - if (FlagInit) StartTime = ::GetMicrosecondCount(); - - const bool Res = (::GetMicrosecondCount() - StartTime < MT4ORDERS::OrderSend_MaxPause); - - if (Res) ::Sleep(0); - - return (Res); - } - - static bool EqualPrices(const double Price1, const double Price2, const int digits) { - return (::NormalizeDouble(Price1 - Price2, digits) == 0); - } - -#define WHILE(A) while (!(Res = (A)) && MT4ORDERS::Waiting()) - - static bool OrderSend(const MqlTradeRequest &Request, MqlTradeResult &Result) { - bool Res = ::OrderSend(Request, Result); - - if (Res && !MT4ORDERS::IsTester && (Result.retcode < TRADE_RETCODE_ERROR) && (MT4ORDERS::OrderSend_MaxPause > 0)) { - Res = (Result.retcode == TRADE_RETCODE_DONE); - MT4ORDERS::Waiting(true); - - if (Request.action == TRADE_ACTION_DEAL) { - WHILE(::HistoryOrderSelect(Result.order)); - - Res = Res && (((ENUM_ORDER_STATE)::HistoryOrderGetInteger(Result.order, ORDER_STATE) == ORDER_STATE_FILLED) || - ((ENUM_ORDER_STATE)::HistoryOrderGetInteger(Result.order, ORDER_STATE) == ORDER_STATE_PARTIAL)); - - if (Res) WHILE(::HistoryDealSelect(Result.deal)); - } else if (Request.action == TRADE_ACTION_PENDING) { - if (Res) - WHILE(::OrderSelect(Result.order)); - else { - WHILE(::HistoryOrderSelect(Result.order)); - - Res = false; - } - } else if (Request.action == TRADE_ACTION_SLTP) { - if (Res) { - bool EqualSL = false; - bool EqualTP = false; - - const int digits = (int)::SymbolInfoInteger(Request.symbol, SYMBOL_DIGITS); - - if ((Request.position == 0) ? ::PositionSelect(Request.symbol) : ::PositionSelectByTicket(Request.position)) { - EqualSL = MT4ORDERS::EqualPrices(::PositionGetDouble(POSITION_SL), Request.sl, digits); - EqualTP = MT4ORDERS::EqualPrices(::PositionGetDouble(POSITION_TP), Request.tp, digits); - } - - WHILE((EqualSL && EqualTP)) - if ((Request.position == 0) ? ::PositionSelect(Request.symbol) : ::PositionSelectByTicket(Request.position)) { - EqualSL = MT4ORDERS::EqualPrices(::PositionGetDouble(POSITION_SL), Request.sl, digits); - EqualTP = MT4ORDERS::EqualPrices(::PositionGetDouble(POSITION_TP), Request.tp, digits); - } - } - } else if (Request.action == TRADE_ACTION_MODIFY) { - if (Res) { - bool EqualSL = false; - bool EqualTP = false; - - const int digits = (int)::SymbolInfoInteger(Request.symbol, SYMBOL_DIGITS); - - if (::OrderSelect(Result.order)) { - EqualSL = MT4ORDERS::EqualPrices(::OrderGetDouble(ORDER_SL), Request.sl, digits); - EqualTP = MT4ORDERS::EqualPrices(::OrderGetDouble(ORDER_TP), Request.tp, digits); - } - - WHILE((EqualSL && EqualTP)) - if (::OrderSelect(Result.order)) { - EqualSL = MT4ORDERS::EqualPrices(::OrderGetDouble(ORDER_SL), Request.sl, digits); - EqualTP = MT4ORDERS::EqualPrices(::OrderGetDouble(ORDER_TP), Request.tp, digits); - } - } - } else if (Request.action == TRADE_ACTION_REMOVE) - if (Res) WHILE(::HistoryOrderSelect(Result.order)); - } - - return (Res); - } - -#undef WHILE - - static bool NewOrderSend(const MqlTradeRequest &Request) { - MqlTradeResult Result; - - return (MT4ORDERS::OrderSend(Request, Result) ? Result.retcode < TRADE_RETCODE_ERROR : false); - } - - static bool ModifyPosition(const unsigned long Ticket, MqlTradeRequest &Request) { - const bool Res = ::PositionSelectByTicket(Ticket); - - if (Res) { - Request.action = TRADE_ACTION_SLTP; - - Request.position = Ticket; - Request.symbol = ::PositionGetString(POSITION_SYMBOL); - } - - return (Res); - } - - static ENUM_ORDER_TYPE_FILLING GetFilling(const string Symb, const unsigned int Type = ORDER_FILLING_FOK) { - const ENUM_SYMBOL_TRADE_EXECUTION ExeMode = - (ENUM_SYMBOL_TRADE_EXECUTION)::SymbolInfoInteger(Symb, SYMBOL_TRADE_EXEMODE); - const int FillingMode = (int)::SymbolInfoInteger(Symb, SYMBOL_FILLING_MODE); - - return ((FillingMode == 0 || (Type >= ORDER_FILLING_RETURN) || ((FillingMode & (Type + 1)) != Type + 1)) - ? (((ExeMode == SYMBOL_TRADE_EXECUTION_EXCHANGE) || (ExeMode == SYMBOL_TRADE_EXECUTION_INSTANT)) - ? ORDER_FILLING_RETURN - : ((FillingMode == SYMBOL_FILLING_IOC) ? ORDER_FILLING_IOC : ORDER_FILLING_FOK)) - : (ENUM_ORDER_TYPE_FILLING)Type); - } - - static bool ModifyOrder(const unsigned long _ticket, const double _price, const datetime _expiration, - MqlTradeRequest &Request) { - const bool _res = ::OrderSelect(_ticket); - - if (_res) { - Request.action = TRADE_ACTION_MODIFY; - Request.order = _ticket; - - Request.price = _price; - - Request.symbol = ::OrderGetString(ORDER_SYMBOL); - - Request.type_filling = MT4ORDERS::GetFilling(Request.symbol); - - if (_expiration > 0) { - Request.type_time = ORDER_TIME_SPECIFIED; - Request.expiration = _expiration; - } - } - - return (_res); - } - - public: - static bool SelectByPosHistory(const int Index) { - const int Ticket = (int)MT4ORDERS::History[Index]; - const bool Res = - (Ticket > 0) ? ::HistoryDealSelect(Ticket) : ((Ticket < 0) ? ::HistoryOrderSelect(-Ticket) : false); - - if (Res) { - if (Ticket > 0) - MT4ORDERS::GetHistoryPositionData(Ticket); - else - MT4ORDERS::GetHistoryOrderData(-Ticket); - } - - return (Res); - } - - // position has higher priority - static bool SelectByPos(const int Index) { - const int Total = ::PositionsTotal(); - const bool Flag = (Index < Total); - - const bool Res = - (Flag) ? ::PositionSelectByTicket(::PositionGetTicket(Index)) : ::OrderSelect(::OrderGetTicket(Index - Total)); - - if (Res) { - if (Flag) - MT4ORDERS::GetPositionData(); - else - MT4ORDERS::GetOrderData(); - } - - return (Res); - } - - static bool SelectByHistoryTicket(const int Ticket) { - bool Res = ::HistoryDealSelect(Ticket) ? MT4HISTORY::IsMT4Deal(Ticket) : false; - - if (Res) - MT4ORDERS::GetHistoryPositionData(Ticket); - else { - Res = ::HistoryOrderSelect(Ticket) ? MT4HISTORY::IsMT4Order(Ticket) : false; - - if (Res) MT4ORDERS::GetHistoryOrderData(Ticket); - } - - return (Res); - } - - static bool SelectByExistingTicket(const int Ticket) { - bool Res = true; - - if (::PositionSelectByTicket(Ticket)) - MT4ORDERS::GetPositionData(); - else if (::OrderSelect(Ticket)) - MT4ORDERS::GetOrderData(); - else - Res = false; - - return (Res); - } - - // One Ticket priority: - // MODE_TRADES: exist position > exist order > deal > canceled order - // MODE_HISTORY: deal > canceled order > exist position > exist order - static bool SelectByTicket(const int Ticket, const int Pool = MODE_TRADES) { - return ((Pool == MODE_TRADES) - ? (MT4ORDERS::SelectByExistingTicket(Ticket) ? true : MT4ORDERS::SelectByHistoryTicket(Ticket)) - : (MT4ORDERS::SelectByHistoryTicket(Ticket) ? true : MT4ORDERS::SelectByExistingTicket(Ticket))); - } - - public: - static unsigned int OrderSend_MaxPause; - - static bool MT4OrderSelect(const int Index, const int Select, const int Pool = MODE_TRADES) { - return ((Select == SELECT_BY_POS) - ? ((Pool == MODE_TRADES) ? MT4ORDERS::SelectByPos(Index) : MT4ORDERS::SelectByPosHistory(Index)) - : MT4ORDERS::SelectByTicket(Index, Pool)); - } - - // MT5 OrderSelect - static bool MT4OrderSelect(const unsigned long Ticket) { return (::OrderSelect(Ticket)); } - - static int MT4OrdersTotal(void) { return (::OrdersTotal() + ::PositionsTotal()); } - - // MT5 OrdersTotal - static int MT4OrdersTotal(const bool MT5) { return (::OrdersTotal()); } - - static int MT4OrdersHistoryTotal(void) { return (MT4ORDERS::History.GetAmount()); } - - static int MT4OrderSend(const string Symb, const int Type, const double dVolume, const double _price, - const int SlipPage, const double SL, const double TP, const string comment = NULL, - const int magic = 0, const datetime dExpiration = 0, color arrow_color = clrNONE) { - MqlTradeRequest Request = {0}; - - Request.action = (((Type == OP_BUY) || (Type == OP_SELL)) ? TRADE_ACTION_DEAL : TRADE_ACTION_PENDING); - Request.magic = magic; - - Request.symbol = ((Symb == NULL) ? ::Symbol() : Symb); - Request.volume = dVolume; - Request.price = _price; - - Request.tp = TP; - Request.sl = SL; - Request.deviation = SlipPage; - Request.type = (ENUM_ORDER_TYPE)Type; - - Request.type_filling = MT4ORDERS::GetFilling(Request.symbol, (unsigned int)Request.deviation); - - if (dExpiration > 0) { - Request.type_time = ORDER_TIME_SPECIFIED; - Request.expiration = dExpiration; - } - - Request.comment = comment; - - MqlTradeResult Result; - - return (MT4ORDERS::OrderSend(Request, Result) - ? ((Request.action == TRADE_ACTION_DEAL) - ? (::HistoryDealSelect(Result.deal) ? (int)::HistoryDealGetInteger(Result.deal, DEAL_POSITION_ID) - : -1) - : (int)Result.order) - : -1); - } - - static bool MT4OrderModify(const unsigned long Ticket, const double _price, const double SL, const double TP, - const datetime Expiration, const color Arrow_Color = clrNONE) { - MqlTradeRequest Request = {0}; - - // considered case if order and position has the same ticket - bool Res = - ((Ticket != MT4ORDERS::Order.Ticket) || (MT4ORDERS::Order.Ticket <= OP_SELL)) - ? (MT4ORDERS::ModifyPosition(Ticket, Request) ? true - : MT4ORDERS::ModifyOrder(Ticket, _price, Expiration, Request)) - : (MT4ORDERS::ModifyOrder(Ticket, _price, Expiration, Request) - ? true - : MT4ORDERS::ModifyPosition(Ticket, Request)); - - if (Res) { - Request.tp = TP; - Request.sl = SL; - - Res = MT4ORDERS::NewOrderSend(Request); - } - - return (Res); - } - - static bool MT4OrderClose(const unsigned long Ticket, const double dLots, const double _price, const int SlipPage, - const color Arrow_Color = clrNONE) { - bool Res = ::PositionSelectByTicket(Ticket); - - if (Res) { - MqlTradeRequest Request = {0}; - - Request.action = TRADE_ACTION_DEAL; - Request.position = Ticket; - - Request.symbol = ::PositionGetString(POSITION_SYMBOL); - - Request.volume = dLots; - Request.price = _price; - - Request.deviation = SlipPage; - - Request.type = (ENUM_ORDER_TYPE)(1 - ::PositionGetInteger(POSITION_TYPE)); - - Request.type_filling = MT4ORDERS::GetFilling(Request.symbol, (unsigned int)Request.deviation); - - Res = MT4ORDERS::NewOrderSend(Request); - } - - return (Res); - } - - static bool MT4OrderCloseBy(const unsigned long Ticket, const int Opposite, const color Arrow_color) { - bool Res = ::PositionSelectByTicket(Ticket); - - if (Res) { - string _symbol = ::PositionGetString(POSITION_SYMBOL); - ENUM_POSITION_TYPE type = (ENUM_POSITION_TYPE)::PositionGetInteger(POSITION_TYPE); - - if (!PositionSelectByTicket(Opposite)) return (false); - - string symbol_by = ::PositionGetString(POSITION_SYMBOL); - ENUM_POSITION_TYPE type_by = (ENUM_POSITION_TYPE)::PositionGetInteger(POSITION_TYPE); - - if (type == type_by) return (false); - if (_symbol != symbol_by) return (false); - - MqlTradeRequest Request = {0}; - - Request.action = TRADE_ACTION_CLOSE_BY; - Request.position = Ticket; - Request.position_by = Opposite; - - Res = MT4ORDERS::NewOrderSend(Request); - } - return (Res); - } - - static bool MT4OrderDelete(const unsigned long Ticket, const color Arrow_Color = clrNONE) { - bool Res = ::OrderSelect(Ticket); - - if (Res) { - MqlTradeRequest Request = {0}; - - Request.action = TRADE_ACTION_REMOVE; - Request.order = Ticket; - - Res = MT4ORDERS::NewOrderSend(Request); - } - - return (Res); - } -}; - -static MT4_ORDER MT4ORDERS::Order = {0}; - -static MT4HISTORY MT4ORDERS::History; - -static const bool MT4ORDERS::IsTester = (::MQLInfoInteger(MQL_TESTER) || ::MQLInfoInteger(MQL_OPTIMIZATION) || - ::MQLInfoInteger(MQL_VISUAL_MODE) || ::MQLInfoInteger(MQL_FRAME_MODE)); - -static unsigned int MT4ORDERS::OrderSend_MaxPause = 1000000; // Maximum time synchronization in microseconds. - -bool OrderClose(const unsigned long Ticket, const double dLots, const double _price, const int SlipPage, - const color Arrow_Color = clrNONE) { - return (MT4ORDERS::MT4OrderClose(Ticket, dLots, _price, SlipPage, Arrow_Color)); -} - -bool OrderModify(const unsigned long Ticket, const double _price, const double SL, const double TP, - const datetime Expiration, const color Arrow_Color = clrNONE) { - return (MT4ORDERS::MT4OrderModify(Ticket, _price, SL, TP, Expiration, Arrow_Color)); -} - -bool OrderDelete(const unsigned long Ticket, const color Arrow_Color = clrNONE) { - return (MT4ORDERS::MT4OrderDelete(Ticket, Arrow_Color)); -} - -bool OrderCloseBy(const unsigned long Ticket, const int Opposite, const color Arrow_color) { - return (MT4ORDERS::MT4OrderCloseBy(Ticket, Opposite, Arrow_color)); -} - -#endif // __MT4ORDERS__ -#endif // __MQL5__ - -/** - * MQL4 wrapper to work in MQL5. - */ -class MQL4 { - public: - /** - * Converts MQL4 time periods. - * - * As in MQL5 chart period constants changed, and some new time periods (M2, M3, M4, M6, M10, M12, H2, H3, H6, H8, - * H12) were added. - * - * Note: In MQL5 the numerical values of chart timeframe constants (from H1) - * are not equal to the number of minutes of a bar. - * E.g. In MQL5, the value of constant PERIOD_H1 is 16385, but in MQL4 PERIOD_H1=60. - * - * @see: https://www.mql5.com/en/articles/81 - */ - static ENUM_TIMEFRAMES TFMigrate(int _tf) { - switch (_tf) { - case 0: - return (PERIOD_CURRENT); - case 1: - return (PERIOD_M1); - case 2: - return (PERIOD_M2); - case 3: - return (PERIOD_M3); - case 4: - return (PERIOD_M4); - case 5: - return (PERIOD_M5); - case 6: - return (PERIOD_M6); - case 10: - return (PERIOD_M10); - case 12: - return (PERIOD_M12); - case 15: - return (PERIOD_M15); - case 30: - return (PERIOD_M30); - case 60: - return (PERIOD_H1); - case 240: - return (PERIOD_H4); - case 1440: - return (PERIOD_D1); - case 10080: - return (PERIOD_W1); - case 43200: - return (PERIOD_MN1); - case 16385: - return (PERIOD_H1); - case 16386: - return (PERIOD_H2); - case 16387: - return (PERIOD_H3); - case 16388: - return (PERIOD_H4); - case 16390: - return (PERIOD_H6); - case 16392: - return (PERIOD_H8); - case 16396: - return (PERIOD_H12); - case 16408: - return (PERIOD_D1); - case 32769: - return (PERIOD_W1); - case 49153: - return (PERIOD_MN1); - default: - return (PERIOD_CURRENT); - } - } - - ENUM_MA_METHOD MethodMigrate(int method) { - switch (method) { - case 0: - return (MODE_SMA); - case 1: - return (MODE_EMA); - case 2: - return (MODE_SMMA); - case 3: - return (MODE_LWMA); - default: - return (MODE_SMA); - } - } - - ENUM_APPLIED_PRICE PriceMigrate(int price) { - switch (price) { - case 1: - return (PRICE_CLOSE); - case 2: - return (PRICE_OPEN); - case 3: - return (PRICE_HIGH); - case 4: - return (PRICE_LOW); - case 5: - return (PRICE_MEDIAN); - case 6: - return (PRICE_TYPICAL); - case 7: - return (PRICE_WEIGHTED); - default: - return (PRICE_CLOSE); - } - } - - ENUM_STO_PRICE StoFieldMigrate(int field) { - switch (field) { - case 0: - return (STO_LOWHIGH); - case 1: - return (STO_CLOSECLOSE); - default: - return (STO_LOWHIGH); - } - } -}; -#endif // MQL4_MQH diff --git a/Terminal.mqh b/Terminal.mqh index b11406cf6..e5656afab 100644 --- a/Terminal.mqh +++ b/Terminal.mqh @@ -47,10 +47,7 @@ class Terminal; #include "Terminal.extern.h" #include "Terminal.struct.h" -#ifdef __MQL5__ -// Provide backward compatibility for MQL4 in MQL5. -//#include "MQL4.mqh" -#else +#ifdef __MQL4__ // Provides forward compatibility for MQL5 in MQL4. #include "MQL5.mqh" #endif diff --git a/tests/CompileTest.mq5 b/tests/CompileTest.mq5 index a073aa038..52e80dc3f 100644 --- a/tests/CompileTest.mq5 +++ b/tests/CompileTest.mq5 @@ -67,7 +67,6 @@ struct IndicatorParams; #include "../MD5.mqh" #include "../Storage/IValueStorage.h" #include "../Task/TaskCondition.h" -//#include "../MQL4.mqh" // @removeme //#include "../MQL5.mqh" // @removeme #include "../Mail.mqh" #include "../Market.mqh" From 2cbae30560698754b11800059e1e4feda0bd78d3 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 22:55:01 +0100 Subject: [PATCH 047/109] Removes Inet.mqh as redundant --- Inet.mqh | 66 ------------------------------------------- tests/CompileTest.mq5 | 1 - 2 files changed, 67 deletions(-) delete mode 100644 Inet.mqh diff --git a/Inet.mqh b/Inet.mqh deleted file mode 100644 index 18b40307a..000000000 --- a/Inet.mqh +++ /dev/null @@ -1,66 +0,0 @@ -//+------------------------------------------------------------------+ -//| 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 . - * - */ - -#ifndef __no_dll__ -#import "wininet.dll" -// Forces the request to be resolved by the origin server, even if a cached copy exists on the proxy. -#define INTERNET_FLAG_PRAGMA_NOCACHE 0x00000100 -// Does not add the returned entity to the cache. -#define INTERNET_FLAG_NO_CACHE_WRITE 0x04000000 -// Forces a download of the requested file, object, or directory listing from the origin server, not from the cache. -#define INTERNET_FLAG_RELOAD 0x80000000 -int InternetOpenA(string agent, int access_type, string proxy_name, string proxy_bypass, int flags); -int InternetOpenUrlA(int internet, string url, string headers, int headers_length, int flags, int context); -int InternetReadFile(int handler, string buffer, int buffer_size, int& bytes_read[]); -int InternetCloseHandle(int handler); -#import "urlmon.dll" -int URLDownloadToFileW(int caller, string url, string filename, int reserved, int callback); -#import -#endif - -/** - * Class to provide methods that using the Internet Protocol (IP). - */ -class Inet { - -public: - - /** - * Read content from given URL. - */ - bool ReadFromURL(string url, string &output) { - #ifdef __no_dll__ - return (false); - #endif - int handler = InternetOpenUrlA(-1, url, "0", 0, -2080374528, 0); - if (handler == 0) { - return (false); - } - int out[] = {1}; - string buffer = "xxxxxxxxxx"; - int result = InternetReadFile(handler, buffer, 10, out); - if (handler != 0) InternetCloseHandle(handler); - output = buffer; - return (true); - } - -}; diff --git a/tests/CompileTest.mq5 b/tests/CompileTest.mq5 index 52e80dc3f..3fce599dd 100644 --- a/tests/CompileTest.mq5 +++ b/tests/CompileTest.mq5 @@ -62,7 +62,6 @@ struct IndicatorParams; #include "../Indicators/DrawIndicator.mqh" #include "../EA.mqh" #include "../File.mqh" -// #include "../Inet.mqh" #include "../Log.mqh" #include "../MD5.mqh" #include "../Storage/IValueStorage.h" From 5e28f8db4113a58c8597f4c564b23ee96045542f Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 22:56:23 +0100 Subject: [PATCH 048/109] Removes BasicTrade.mqh as redundant --- BasicTrade.mqh | 432 ------------------------------------------ tests/CompileTest.mq5 | 1 - 2 files changed, 433 deletions(-) delete mode 100644 BasicTrade.mqh diff --git a/BasicTrade.mqh b/BasicTrade.mqh deleted file mode 100644 index 5020ef2dc..000000000 --- a/BasicTrade.mqh +++ /dev/null @@ -1,432 +0,0 @@ -//+------------------------------------------------------------------+ -//| 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 . - * - */ - -/** - * @file - * Provides basic trade functionality. - */ - -// Class dependencies. -#ifdef __MQL5__ -class CTrade; -#endif - -//--- -#define CUR 0 -#define PREV 1 -#define FAR 2 -//--- -#define ERR_ORDER_SELECT ERR_USER_ERROR_FIRST + 102 -#define ERR_INVALID_ORDER_TYPE ERR_USER_ERROR_FIRST + 103 -#define ERR_INVALID_SYMBOL_NAME ERR_USER_ERROR_FIRST + 104 -#define ERR_INVALID_EXPIRATION_TIME ERR_USER_ERROR_FIRST + 105 -//--- -#define TRADE_PAUSE_SHORT 500 -#define TRADE_PAUSE_LONG 5000 -#define OPEN_METHODS 8 - -#ifdef __MQL4__ -//+------------------------------------------------------------------+ -//| ENUM_APPLIED_VOLUME | -//+------------------------------------------------------------------+ -enum ENUM_APPLIED_VOLUME { VOLUME_TICK, VOLUME_REAL }; -#endif - -//+------------------------------------------------------------------+ -#ifdef __MQL4__ -#define TFS 9 -const ENUM_TIMEFRAMES tf[TFS] = {PERIOD_M1, PERIOD_M5, PERIOD_M15, PERIOD_M30, PERIOD_H1, - PERIOD_H4, PERIOD_D1, PERIOD_W1, PERIOD_MN1}; -#endif - -//+------------------------------------------------------------------+ -#ifdef __MQL5__ - -#define TFS 21 -const ENUM_TIMEFRAMES tf[TFS] = {PERIOD_M1, PERIOD_M2, PERIOD_M3, PERIOD_M4, PERIOD_M5, PERIOD_M6, PERIOD_M10, - PERIOD_M12, PERIOD_M15, PERIOD_M20, PERIOD_M30, PERIOD_H1, PERIOD_H2, PERIOD_H3, - PERIOD_H4, PERIOD_H6, PERIOD_H8, PERIOD_H12, PERIOD_D1, PERIOD_W1, PERIOD_MN1}; -#endif -//+------------------------------------------------------------------+ -//| TPositionCount | -//+------------------------------------------------------------------+ -struct TPositionCount { - int buy_count; - int sell_count; -}; -//+------------------------------------------------------------------+ -//| TDealTime | -//+------------------------------------------------------------------+ -struct TDealTime { - datetime buy_time; - datetime sell_time; -}; -//+------------------------------------------------------------------+ -//| ENUN_OPEN_METHOD | -//+------------------------------------------------------------------+ -enum ENUM_OPEN_METHOD { - OPEN_METHOD_ONE = -1, // One Of Methods - OPEN_METHOD_SUM = 0, // Sum Of Methods - OPEN_METHOD1 = 1, // Method #1 (1) - OPEN_METHOD2 = 2, // Method #2 (2) - OPEN_METHOD3 = 4, // Method #3 (4) - OPEN_METHOD4 = 8, // Method #4 (8) - OPEN_METHOD5 = 16, // Method #5 (16) - OPEN_METHOD6 = 32, // Method #6 (32) - OPEN_METHOD7 = 64, // Method #7 (64) - OPEN_METHOD8 = 128 // Method #8 (128) -}; -//+------------------------------------------------------------------+ -//| GetOpenMethod | -//+------------------------------------------------------------------+ -int GetOpenMethod(const int open_method, const int one_of_methods, const int sum_of_methods) { - int result = open_method; - - if (open_method == OPEN_METHOD_ONE) result = -one_of_methods; - - if (open_method == OPEN_METHOD_SUM) result = sum_of_methods; - - return (result); -} -//+------------------------------------------------------------------+ -//| ENUM_TRADE_DIRECTION | -//+------------------------------------------------------------------+ -enum ENUM_TRADE_DIRECTION { - TRADE_NONE = -1, // None - TRADE_BUY = 0, // Buy - TRADE_SELL = 1, // Sell - TRADE_BOTH = 2 // Both -}; -//+------------------------------------------------------------------+ -//| | -//+------------------------------------------------------------------+ -enum ENUM_RUN_MODE { RUN_OPTIMIZATION, RUN_VISUAL, RUN_TESTER, RUN_LIVE }; -//+------------------------------------------------------------------+ -//| | -//+------------------------------------------------------------------+ -ENUM_RUN_MODE GetRunMode(void) { - if (MQLInfoInteger(MQL_OPTIMIZATION)) return (RUN_OPTIMIZATION); - if (MQLInfoInteger(MQL_VISUAL_MODE)) return (RUN_VISUAL); - if (MQLInfoInteger(MQL_TESTER)) return (RUN_TESTER); - return (RUN_LIVE); -} -//+------------------------------------------------------------------+ -//| | -//+------------------------------------------------------------------+ -string BoolToString(const bool _value) { - if (_value) return ("yes"); - return ("no"); -} -//+------------------------------------------------------------------+ -//| | -//+------------------------------------------------------------------+ -string TimeframeToString(const ENUM_TIMEFRAMES _tf) { return (StringSubstr(EnumToString(_tf), 7)); } -//+------------------------------------------------------------------+ -//| | -//+------------------------------------------------------------------+ -string OpenMethodToString(const ENUM_OPEN_METHOD _open_method, const int one_of_methods, const int sum_of_methods) { - string result = ""; - switch (_open_method) { - case OPEN_METHOD_ONE: - result = "One Of Methods (" + IntegerToString(one_of_methods) + ")"; - break; - case OPEN_METHOD_SUM: - result = "Sum Of Methods (" + IntegerToString(sum_of_methods) + ")"; - break; - default: - result = StringSubstr(EnumToString(_open_method), 5); - break; - } - return (result); -} - -//+------------------------------------------------------------------+ -//| CBasicTrade | -//+------------------------------------------------------------------+ -class CBasicTrade { - private: - int m_last_error; - - protected: - //+------------------------------------------------------------------+ - double NormalizeVolume(const double _volume) { - double lot_min = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_MIN); - double lot_max = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_MAX); - double lot_step = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_STEP); - //--- - double lot_value = _volume; - if (lot_value <= lot_min) - lot_value = lot_min; - else if (lot_value >= lot_max) - lot_value = lot_max; - else - lot_value = round(lot_value / lot_step) * lot_step; - //--- - return (NormalizeDouble(lot_value, 2)); - } - - //+------------------------------------------------------------------+ - int TimeframeToIndex(ENUM_TIMEFRAMES _tf) { - if (_tf == 0 || _tf == PERIOD_CURRENT) _tf = (ENUM_TIMEFRAMES)Period(); - int total = ArraySize(tf); - for (int i = 0; i < total; i++) { - if (tf[i] == _tf) return (i); - } - return (0); - } - - public: - //+------------------------------------------------------------------+ - void CBasicTrade(void) { m_last_error = 0; } - - //+------------------------------------------------------------------+ - bool Trade(string _symbol, // symbol - ENUM_TRADE_DIRECTION _type, // operation - double _volume, // volume - int _stop_loss, // stop loss, pips - int _take_profit, // take profit, pips - string _comment = NULL, // comment - int _magic = 0 // magic number - ) { - ResetLastError(); - m_last_error = 0; - - //--- check symbol name - double _point = SymbolInfoDouble(_symbol, SYMBOL_POINT); - if (_point == 0.0) { - m_last_error = ERR_INVALID_SYMBOL_NAME; - return (false); - } - - //--- order type - if (!(_type == TRADE_BUY || _type == TRADE_SELL)) { - m_last_error = ERR_INVALID_ORDER_TYPE; - return (false); - } - - //--- get digits - int _digits = (int)SymbolInfoInteger(_symbol, SYMBOL_DIGITS); - - //--- get coef point - int _coef_point = 1; - if (_digits == 3 || _digits == 5) _coef_point = 10; - -#ifdef __MQL4__ - - int attempts = 5; - while (attempts > 0) { - ResetLastError(); - - if (IsTradeContextBusy()) { - Sleep(TRADE_PAUSE_SHORT); - attempts--; - continue; - } - - RefreshRates(); - - //--- check the free margin - if (AccountFreeMarginCheck(_symbol, _type, _volume) <= 0 || _LastError == ERR_NOT_ENOUGH_MONEY) { - m_last_error = ERR_NOT_ENOUGH_MONEY; - return (false); - } - - //--- - double price = 0.0; - if (_type == OP_BUY) price = NormalizeDouble(SymbolInfoDouble(_symbol, SYMBOL_ASK), _digits); - if (_type == OP_SELL) price = NormalizeDouble(SymbolInfoDouble(_symbol, SYMBOL_BID), _digits); - - //--- - int slippage = (int)SymbolInfoInteger(_symbol, SYMBOL_SPREAD); - - //--- - double volume = NormalizeVolume(_volume); - - //--- - int ticket = OrderSend(_symbol, _type, volume, price, slippage, 0, 0, _comment, _magic, 0, clrNONE); - if (ticket > 0) { - if (_stop_loss > 0 || _take_profit > 0) { - if (OrderSelect(ticket, SELECT_BY_TICKET)) { - //--- - double order_open_price = NormalizeDouble(OrderOpenPrice(), _digits); - double order_stop_loss = NormalizeDouble(OrderStopLoss(), _digits); - double order_take_profit = NormalizeDouble(OrderTakeProfit(), _digits); - - double sl = 0.0; - double tp = 0.0; - - //--- - attempts = 5; - while (attempts > 0) { - ResetLastError(); - RefreshRates(); - //--- - double _bid = SymbolInfoDouble(_symbol, SYMBOL_BID); - double _ask = SymbolInfoDouble(_symbol, SYMBOL_ASK); - - if (IsTradeContextBusy()) { - attempts--; - Sleep(TRADE_PAUSE_SHORT); - continue; - } - - //--- - int stop_level = (int)SymbolInfoInteger(_symbol, SYMBOL_TRADE_STOPS_LEVEL); - int spread = (int)SymbolInfoInteger(_symbol, SYMBOL_SPREAD); - stop_level = fmax(stop_level, spread); - - //--- - if (OrderType() == OP_BUY) { - if (_stop_loss == -1.0) - sl = order_stop_loss; - else if (_stop_loss == 0.0) - sl = 0.0; - else - sl = NormalizeDouble( - fmin(order_open_price - _stop_loss * _coef_point * _point, _bid - stop_level * _point), _digits); - - if (_take_profit == -1.0) - tp = order_take_profit; - else if (_take_profit == 0.0) - tp = 0.0; - else - tp = NormalizeDouble( - fmax(order_open_price + _take_profit * _coef_point * _point, _bid + stop_level * _point), - _digits); - } - - if (OrderType() == OP_SELL) { - if (_stop_loss == -1.0) - sl = order_stop_loss; - else if (_stop_loss == 0.0) - sl = 0.0; - else - sl = NormalizeDouble( - fmax(order_open_price + _stop_loss * _coef_point * _point, _ask + stop_level * _point), _digits); - - if (_take_profit == -1.0) - tp = order_take_profit; - else if (_take_profit == 0.0) - tp = 0.0; - else - tp = NormalizeDouble( - fmin(order_open_price - _take_profit * _coef_point * _point, _ask - stop_level * _point), - _digits); - } - - if (sl == order_stop_loss && tp == order_take_profit) return (true); - - //--- - ResetLastError(); - if (OrderModify(ticket, order_open_price, sl, tp, 0, clrNONE)) { - return (true); - } else { - // ENUM_ERROR_LEVEL level=PrintError(_LastError); - // if(level==LEVEL_ERROR) - { - Sleep(TRADE_PAUSE_LONG); - return (false); - } - } - - //--- - Sleep(TRADE_PAUSE_SHORT); - attempts--; - } // end while - } - - Sleep(TRADE_PAUSE_SHORT); - return (true); // position opened - } else { - // ENUM_ERROR_LEVEL level=PrintError(_LastError); - // if(level==LEVEL_ERROR) - { - Sleep(TRADE_PAUSE_LONG); - break; - } - } // end else - - Sleep(TRADE_PAUSE_SHORT); - attempts--; - } - } -#endif - - //--- -#ifdef __MQL5__ - - ENUM_ORDER_TYPE order_type = -1; - double price = 0.0; - double sl = 0.0; - double tp = 0.0; - double _ask = SymbolInfoDouble(_symbol, SYMBOL_ASK); - double _bid = SymbolInfoDouble(_symbol, SYMBOL_BID); - int stop_level = (int)SymbolInfoInteger(_symbol, SYMBOL_TRADE_STOPS_LEVEL); - if (_type == TRADE_BUY) { - order_type = ORDER_TYPE_BUY; - price = _ask; - - if (_stop_loss > 0) - sl = NormalizeDouble(fmin(price - _stop_loss * _coef_point * _point, _bid - stop_level * _point), _digits); - - if (_take_profit > 0) - tp = NormalizeDouble(fmax(price + _take_profit * _coef_point * _point, _bid + stop_level * _point), _digits); - } - if (_type == TRADE_SELL) { - order_type = ORDER_TYPE_SELL; - price = _bid; - - if (_stop_loss > 0) - sl = NormalizeDouble(fmax(price + _stop_loss * _coef_point * _point, _ask + stop_level * _point), _digits); - - if (_take_profit > 0) - tp = NormalizeDouble(fmin(price - _take_profit * _coef_point * _point, _ask - stop_level * _point), _digits); - } - - double volume = NormalizeVolume(_volume); - -#ifdef CTrade - // @todo: To test. - CTrade trade; - if (!trade) { - return (false); - } - trade.SetDeviationInPoints(SymbolInfoInteger(_symbol, SYMBOL_SPREAD)); - trade.SetExpertMagicNumber(_magic); - - //--- - trade.SetTypeFilling(GetTypeFilling(_symbol)); - bool result = trade.PositionOpen(_symbol, order_type, volume, price, sl, tp, _comment); - if (!result) { - m_last_error = (int)trade.ResultRetcode(); - } -#else - return (false); -#endif -#endif - - return (true); - } - - //+------------------------------------------------------------------+ - int GetLastError() { return (m_last_error); } -}; diff --git a/tests/CompileTest.mq5 b/tests/CompileTest.mq5 index 3fce599dd..3ee9b3cd4 100644 --- a/tests/CompileTest.mq5 +++ b/tests/CompileTest.mq5 @@ -42,7 +42,6 @@ struct IndicatorParams; #include "../Account/AccountMt.h" #include "../Storage/Array.h" #include "../Task/TaskAction.h" -//#include "../BasicTrade.mqh" // @removeme #include "../Storage/Dict/Buffer/Buffer.h" #include "../Storage/Dict/Buffer/BufferFXT.h" #include "../Storage/Dict/Buffer/BufferStruct.h" From 7ccd5e93f819dae2b143c0c367d5cc7c51cbbe86 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 23:04:02 +0100 Subject: [PATCH 049/109] Renames Web.mqh to Web/Web.h --- .github/workflows/test-web.yml | 63 +++++++++++++++++++++ .github/workflows/test.yml | 24 -------- Web.mqh => Web/Web.h | 0 tests/WebTest.mq4 => Web/tests/Web.test.mq4 | 2 +- tests/WebTest.mq5 => Web/tests/Web.test.mq5 | 8 +-- tests/CompileTest.mq5 | 1 - 6 files changed, 68 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/test-web.yml rename Web.mqh => Web/Web.h (100%) rename tests/WebTest.mq4 => Web/tests/Web.test.mq4 (97%) rename tests/WebTest.mq5 => Web/tests/Web.test.mq5 (95%) diff --git a/.github/workflows/test-web.yml b/.github/workflows/test-web.yml new file mode 100644 index 000000000..2bd796883 --- /dev/null +++ b/.github/workflows/test-web.yml @@ -0,0 +1,63 @@ +--- +name: Test Web + +# yamllint disable-line rule:truthy +on: + pull_request: + paths: + - 'Web/**' + - '.github/workflows/test-web.yml' + push: + paths: + - 'Web/**' + - '.github/workflows/test-web.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: 'Web/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' + + Tests-MQL4: + defaults: + run: + shell: bash + working-directory: Web/tests + needs: Compile + runs-on: ubuntu-latest + strategy: + matrix: + test: + # @fixme: GH-266 + - Web.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 }} + RunOnFail: "exit 0" + if: always() + timeout-minutes: 10 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8a1e1adfd..825ef17a4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -85,30 +85,6 @@ jobs: if: always() timeout-minutes: 10 - Scripts-MQL4-Ignore: - defaults: - run: - shell: bash - working-directory: tests - needs: Compile - runs-on: ubuntu-latest - strategy: - matrix: - test: - # @fixme: GH-266 - - WebTest - steps: - - uses: actions/download-artifact@v2 - with: - name: files-ex4 - - name: Run ${{ matrix.test }} - uses: fx31337/mql-tester-action@master - with: - Script: ${{ matrix.test }} - RunOnFail: "exit 0" - if: always() - timeout-minutes: 10 - Tests-MQL4: defaults: run: diff --git a/Web.mqh b/Web/Web.h similarity index 100% rename from Web.mqh rename to Web/Web.h diff --git a/tests/WebTest.mq4 b/Web/tests/Web.test.mq4 similarity index 97% rename from tests/WebTest.mq4 rename to Web/tests/Web.test.mq4 index 288d0be6d..9c02f114d 100644 --- a/tests/WebTest.mq4 +++ b/Web/tests/Web.test.mq4 @@ -25,4 +25,4 @@ */ // Includes. -#include "WebTest.mq5" +#include "Web.test.mq5" diff --git a/tests/WebTest.mq5 b/Web/tests/Web.test.mq5 similarity index 95% rename from tests/WebTest.mq5 rename to Web/tests/Web.test.mq5 index 61b822e39..cfbd7ff67 100644 --- a/tests/WebTest.mq5 +++ b/Web/tests/Web.test.mq5 @@ -25,10 +25,10 @@ */ // Includes. -#include "../Convert.mqh" -#include "../Terminal.mqh" -#include "../Test.mqh" -#include "../Web.mqh" +#include "../../Convert.mqh" +#include "../../Terminal.mqh" +#include "../../Test.mqh" +#include "../Web.h" // Properties. #property strict diff --git a/tests/CompileTest.mq5 b/tests/CompileTest.mq5 index 3ee9b3cd4..2b79b1fa1 100644 --- a/tests/CompileTest.mq5 +++ b/tests/CompileTest.mq5 @@ -105,7 +105,6 @@ struct IndicatorParams; #include "../Timer.mqh" #include "../Trade.mqh" #include "../Util.h" -#include "../Web.mqh" // Includes Indicator files. #include "../Indicator/Indicator.define.h" From e8ce5553eae3787954091442ef556ea545a8c176 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 17 Jun 2023 23:59:06 +0100 Subject: [PATCH 050/109] Moves platform related classes to Platform/ --- .github/workflows/test-platform.yml | 64 +++++++++++++++++++ .github/workflows/test.yml | 6 +- 3D/tests/3D.test.mq5 | 2 +- Account/Account.struct.h | 2 +- Account/AccountBase.struct.h | 2 +- Account/AccountForex.struct.h | 2 +- Account/AccountMt.h | 4 +- Account/tests/Account.test.cpp | 2 +- Account/tests/AccountForex.test.cpp | 2 +- Account/tests/AccountMt.test.cpp | 2 +- Chart.struct.h | 2 +- Chart.struct.static.h | 4 +- Chart.struct.tf.h | 4 +- ChartMt.h | 2 +- Common.extern.h | 2 +- Convert.mqh | 2 +- Draw.mqh | 8 +-- EA.mqh | 4 +- Exchange/tests/Exchange.test.cpp | 2 +- Exchange/tests/Exchange.test.mq5 | 2 +- File.extern.h | 2 +- File.mqh | 6 +- Indicator/IndicatorBase.h | 2 +- Indicator/tests/IndicatorBase.test.cpp | 2 +- Indicator/tests/IndicatorCandle.test.mq5 | 2 +- Indicator/tests/IndicatorRenko.test.mq5 | 2 +- Indicator/tests/IndicatorTf.test.mq5 | 2 +- Indicator/tests/IndicatorTick.test.mq5 | 2 +- Indicator/tests/classes/IndicatorTfDummy.h | 2 +- Indicators/Bitwise/tests/Indi_Candle.test.mq5 | 2 +- .../Bitwise/tests/Indi_Pattern.test.mq5 | 2 +- Indicators/Indi_ZigZag.mqh | 1 + Indicators/OHLC/tests/Indi_OHLC.test.cpp | 2 +- Indicators/OHLC/tests/Indi_OHLC.test.mq5 | 2 +- Indicators/Oscillator/Indi_WPR.h | 1 + .../Oscillator/tests/Indi_MACD.test.cpp | 2 +- .../Oscillator/tests/Indi_MACD.test.mq5 | 2 +- Indicators/Oscillator/tests/Indi_RSI.test.cpp | 2 +- Indicators/Oscillator/tests/Indi_RSI.test.mq5 | 2 +- .../Oscillator/tests/Indi_Stochastic.test.mq5 | 2 +- Indicators/Oscillator/tests/Indi_WPR.test.mq5 | 2 +- Indicators/Price/Indi_Price.h | 2 +- .../Price/tests/Indi_AppliedPrice.test.mq5 | 2 +- Indicators/Price/tests/Indi_MA.test.mq5 | 2 +- Indicators/Price/tests/Indi_Price.test.cpp | 2 +- Indicators/Price/tests/Indi_Price.test.mq5 | 2 +- .../PriceMulti/tests/Indi_Alligator.test.mq5 | 2 +- .../PriceRange/tests/Indi_Bands.test.mq5 | 2 +- .../PriceRange/tests/Indi_Envelopes.test.mq5 | 2 +- Indicators/PriceRange/tests/Indi_SAR.test.mq5 | 2 +- Indicators/Special/tests/Indi_Custom.test.mq5 | 2 +- Indicators/Tick/tests/Indi_TickMt.test.mq5 | 2 +- Indicators/tests/DrawIndicator.test.cpp | 2 +- Indicators/tests/Indi_AC.test.mq5 | 2 +- Indicators/tests/Indi_AD.test.mq5 | 2 +- Indicators/tests/Indi_ADX.test.mq5 | 2 +- Indicators/tests/Indi_ADXW.test.mq5 | 2 +- Indicators/tests/Indi_AMA.test.mq5 | 2 +- Indicators/tests/Indi_AO.test.mq5 | 2 +- Indicators/tests/Indi_ASI.test.mq5 | 2 +- Indicators/tests/Indi_ATR.test.mq5 | 2 +- Indicators/tests/Indi_BWMFI.test.mq5 | 2 +- Indicators/tests/Indi_BWZT.test.mq5 | 2 +- Indicators/tests/Indi_BearsPower.test.mq5 | 2 +- Indicators/tests/Indi_BullsPower.test.mq5 | 2 +- Indicators/tests/Indi_CCI.test.mq5 | 2 +- Indicators/tests/Indi_CHO.test.mq5 | 2 +- Indicators/tests/Indi_CHV.test.mq5 | 2 +- Indicators/tests/Indi_ColorBars.test.mq5 | 2 +- .../tests/Indi_ColorCandlesDaily.test.mq5 | 2 +- Indicators/tests/Indi_ColorLine.test.mq5 | 2 +- .../tests/Indi_CustomMovingAverage.test.mq5 | 2 +- Indicators/tests/Indi_DEMA.test.mq5 | 2 +- Indicators/tests/Indi_DeMarker.test.mq5 | 2 +- Indicators/tests/Indi_Demo.test.mq5 | 2 +- Indicators/tests/Indi_DetrendedPrice.test.mq5 | 2 +- Indicators/tests/Indi_Drawer.test.mq5 | 2 +- Indicators/tests/Indi_Force.test.mq5 | 2 +- .../tests/Indi_FractalAdaptiveMA.test.mq5 | 2 +- Indicators/tests/Indi_Fractals.test.mq5 | 2 +- Indicators/tests/Indi_Gator.test.mq5 | 2 +- Indicators/tests/Indi_HeikenAshi.test.mq5 | 2 +- Indicators/tests/Indi_Ichimoku.test.mq5 | 2 +- Indicators/tests/Indi_Killzones.test.mq5 | 2 +- Indicators/tests/Indi_MFI.test.mq5 | 2 +- Indicators/tests/Indi_MassIndex.test.mq5 | 2 +- Indicators/tests/Indi_Momentum.test.mq5 | 2 +- Indicators/tests/Indi_OBV.test.mq5 | 2 +- Indicators/tests/Indi_OsMA.test.mq5 | 2 +- Indicators/tests/Indi_Pivot.test.mq5 | 2 +- Indicators/tests/Indi_PriceChannel.test.mq5 | 2 +- Indicators/tests/Indi_PriceFeeder.test.mq5 | 2 +- .../tests/Indi_PriceVolumeTrend.test.mq5 | 2 +- Indicators/tests/Indi_RS.test.mq5 | 2 +- Indicators/tests/Indi_RVI.test.mq5 | 2 +- Indicators/tests/Indi_RateOfChange.test.mq5 | 2 +- Indicators/tests/Indi_StdDev.test.mq5 | 2 +- Indicators/tests/Indi_TEMA.test.mq5 | 2 +- Indicators/tests/Indi_TRIX.test.mq5 | 2 +- .../tests/Indi_UltimateOscillator.test.mq5 | 2 +- Indicators/tests/Indi_VIDYA.test.mq5 | 2 +- Indicators/tests/Indi_VROC.test.mq5 | 2 +- Indicators/tests/Indi_Volumes.test.mq5 | 2 +- Indicators/tests/Indi_WilliamsAD.test.mq5 | 2 +- Indicators/tests/Indi_ZigZag.test.mq5 | 2 +- Indicators/tests/Indi_ZigZagColor.test.mq5 | 2 +- Log.mqh | 2 +- Mail.mqh | 2 +- Deal.enum.h => Platform/Deal.enum.h | 0 MQL5.mqh => Platform/MQL5.mqh | 0 Order.define.h => Platform/Order.define.h | 0 Order.enum.h => Platform/Order.enum.h | 0 Order.mqh => Platform/Order.h | 24 +++---- Order.struct.h => Platform/Order.struct.h | 8 +-- OrderQuery.h => Platform/OrderQuery.h | 8 +-- Orders.mqh => Platform/Orders.h | 14 ++-- .../Platform.define.h | 0 .../Platform.extern.h | 6 +- Platform.h => Platform/Platform.h | 16 ++--- PlatformTime.h => Platform/PlatformTime.h | 6 +- .../Terminal.define.h | 0 Terminal.enum.h => Platform/Terminal.enum.h | 2 +- .../Terminal.extern.h | 2 +- Terminal.mqh => Platform/Terminal.h | 10 +-- .../Terminal.struct.h | 0 Platform/tests/Makefile | 12 ++++ Platform/tests/Order.test.cpp | 35 ++++++++++ .../tests/Order.test.mq4 | 2 +- .../tests/Order.test.mq5 | 10 +-- Platform/tests/OrderQuery.test.cpp | 36 +++++++++++ .../tests/OrderQuery.test.mq4 | 2 +- .../tests/OrderQuery.test.mq5 | 2 +- Platform/tests/Orders.test.cpp | 35 ++++++++++ .../tests/Orders.test.mq4 | 2 +- .../tests/Orders.test.mq5 | 2 +- Platform/tests/Platform.test.cpp | 35 ++++++++++ Platform/tests/Platform.test.mq4 | 28 ++++++++ Platform/tests/Platform.test.mq5 | 43 +++++++++++++ Platform/tests/Terminal.test.cpp | 35 ++++++++++ .../tests/Terminal.test.mq4 | 2 +- .../tests/Terminal.test.mq5 | 8 +-- README.md | 28 ++++---- Serializer/Serializer.h | 2 +- Serializer/SerializerNode.h | 2 +- Serializer/tests/Serializable.test.cpp | 2 +- Stats.mqh | 2 +- Storage/DateTime.entry.h | 2 +- Storage/DateTime.h | 2 +- Storage/DateTime.static.h | 2 +- Storage/Dict/Buffer/tests/BufferFXT.test.mq5 | 2 +- Storage/String.extern.h | 2 +- Storage/tests/ItemsHistory.test.mq5 | 2 +- SummaryReport.mqh | 4 +- SymbolInfo.extern.h | 2 +- SymbolInfo.struct.static.h | 6 +- Task/Task.h | 2 +- Task/Task.struct.h | 2 +- Task/TaskAction.h | 2 +- Task/TaskAction.struct.h | 2 +- Task/TaskCondition.h | 2 +- Task/TaskCondition.struct.h | 2 +- Task/TaskGetter.h | 2 +- Task/TaskGetter.struct.h | 2 +- Tester.mqh | 2 +- Tick/tests/TickManager.test.cpp | 2 +- Trade.mqh | 4 +- Trade/tests/TradeSignal.test.cpp | 2 +- Trade/tests/TradeSignalManager.test.cpp | 2 +- Web/tests/Web.test.mq5 | 2 +- tests/Chart.test.cpp | 2 +- tests/CompileTest.mq5 | 7 +- tests/IndicatorsTest.mq5 | 2 +- tests/TradeTest.mq5 | 2 +- 173 files changed, 553 insertions(+), 233 deletions(-) create mode 100644 .github/workflows/test-platform.yml rename Deal.enum.h => Platform/Deal.enum.h (100%) rename MQL5.mqh => Platform/MQL5.mqh (100%) rename Order.define.h => Platform/Order.define.h (100%) rename Order.enum.h => Platform/Order.enum.h (100%) rename Order.mqh => Platform/Order.h (99%) rename Order.struct.h => Platform/Order.struct.h (99%) rename OrderQuery.h => Platform/OrderQuery.h (98%) rename Orders.mqh => Platform/Orders.h (98%) rename Platform.define.h => Platform/Platform.define.h (100%) rename Platform.extern.h => Platform/Platform.extern.h (98%) rename Platform.h => Platform/Platform.h (98%) rename PlatformTime.h => Platform/PlatformTime.h (96%) rename Terminal.define.h => Platform/Terminal.define.h (100%) rename Terminal.enum.h => Platform/Terminal.enum.h (99%) rename Terminal.extern.h => Platform/Terminal.extern.h (98%) rename Terminal.mqh => Platform/Terminal.h (99%) rename Terminal.struct.h => Platform/Terminal.struct.h (100%) create mode 100644 Platform/tests/Makefile create mode 100644 Platform/tests/Order.test.cpp rename tests/OrderTest.mq4 => Platform/tests/Order.test.mq4 (97%) rename tests/OrderTest.mq5 => Platform/tests/Order.test.mq5 (97%) create mode 100644 Platform/tests/OrderQuery.test.cpp rename tests/OrderQueryTest.mq4 => Platform/tests/OrderQuery.test.mq4 (97%) rename tests/OrderQueryTest.mq5 => Platform/tests/OrderQuery.test.mq5 (99%) create mode 100644 Platform/tests/Orders.test.cpp rename tests/OrdersTest.mq4 => Platform/tests/Orders.test.mq4 (97%) rename tests/OrdersTest.mq5 => Platform/tests/Orders.test.mq5 (97%) create mode 100644 Platform/tests/Platform.test.cpp create mode 100644 Platform/tests/Platform.test.mq4 create mode 100644 Platform/tests/Platform.test.mq5 create mode 100644 Platform/tests/Terminal.test.cpp rename tests/TerminalTest.mq4 => Platform/tests/Terminal.test.mq4 (97%) rename tests/TerminalTest.mq5 => Platform/tests/Terminal.test.mq5 (95%) diff --git a/.github/workflows/test-platform.yml b/.github/workflows/test-platform.yml new file mode 100644 index 000000000..0bb8b5638 --- /dev/null +++ b/.github/workflows/test-platform.yml @@ -0,0 +1,64 @@ +--- +name: Test Platform + +# yamllint disable-line rule:truthy +on: + pull_request: + paths: + - 'Platform/**' + - '.github/workflows/test-platform.yml' + push: + paths: + - 'Platform/**' + - '.github/workflows/test-platform.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: 'Platform/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' + + Tests-MQL4: + defaults: + run: + shell: bash + working-directory: Platform/tests + needs: Compile + runs-on: ubuntu-latest + strategy: + matrix: + test: + - Order.test + - OrderQuery.test + - Orders.test + - Platform.test + - Terminal.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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 825ef17a4..1e1f512cf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -59,13 +59,11 @@ jobs: - MailTest - MarketTest - MatrixTest - - OrderTest - - OrdersTest - StatsTest - StrategyTest - StrategyTest-RSI - - SymbolInfoTest - SummaryReportTest + - SymbolInfoTest - TickerTest - TradeTest max-parallel: 4 @@ -101,10 +99,8 @@ jobs: - LogTest - MD5Test - MathTest - - OrderQuery - ProfilerTest - RefsTest - - TerminalTest - TimerTest steps: - uses: actions/download-artifact@v2 diff --git a/3D/tests/3D.test.mq5 b/3D/tests/3D.test.mq5 index 89b7f588a..6e572ea96 100644 --- a/3D/tests/3D.test.mq5 +++ b/3D/tests/3D.test.mq5 @@ -42,7 +42,7 @@ #include "../Frontends/MT5Frontend.h" #include "../../Storage/Dict/Buffer/BufferStruct.h" #include "../../Chart.mqh" -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Serializer/Serializer.h" #include "../../Test.mqh" diff --git a/Account/Account.struct.h b/Account/Account.struct.h index 4d90c2a94..df094d1b5 100644 --- a/Account/Account.struct.h +++ b/Account/Account.struct.h @@ -36,7 +36,7 @@ class Serializer; // Includes. #include "../Serializer/Serializer.h" -#include "../Terminal.define.h" +#include "../Platform/Terminal.define.h" // Struct for account entries. struct AccountEntry { diff --git a/Account/AccountBase.struct.h b/Account/AccountBase.struct.h index 85a0cbde2..6d525a78a 100644 --- a/Account/AccountBase.struct.h +++ b/Account/AccountBase.struct.h @@ -37,7 +37,7 @@ class Serializer; // Includes. #include "../Serializer/Serializer.h" #include "../Std.h" -#include "../Terminal.define.h" +#include "../Platform/Terminal.define.h" // Struct for account entries. struct AccountBaseEntry { diff --git a/Account/AccountForex.struct.h b/Account/AccountForex.struct.h index 13d32c786..3e67d0920 100644 --- a/Account/AccountForex.struct.h +++ b/Account/AccountForex.struct.h @@ -36,7 +36,7 @@ class Serializer; // Includes. #include "../Serializer/Serializer.h" -#include "../Terminal.define.h" +#include "../Platform/Terminal.define.h" // Struct for account entries. struct AccountForexEntry : public AccountBaseEntry { diff --git a/Account/AccountMt.h b/Account/AccountMt.h index 5df1305ba..6f463f0c5 100644 --- a/Account/AccountMt.h +++ b/Account/AccountMt.h @@ -33,8 +33,8 @@ class AccountMt; #include "../Convert.mqh" #include "../Storage/Data.struct.h" #include "../Indicator/Indicator.struct.h" -#include "../Order.struct.h" -#include "../Orders.mqh" +#include "../Platform/Order.struct.h" +#include "../Platform/Orders.h" #include "../Serializer/Serializer.h" #include "../SymbolInfo.mqh" #include "../Task/TaskCondition.enum.h" diff --git a/Account/tests/Account.test.cpp b/Account/tests/Account.test.cpp index 2a21e9711..bcc67bf48 100644 --- a/Account/tests/Account.test.cpp +++ b/Account/tests/Account.test.cpp @@ -26,7 +26,7 @@ // Includes. #include "../Account.h" -#include "../../Platform.h" +#include "../../Platform/Platform.h" int main(int argc, char **argv) { diff --git a/Account/tests/AccountForex.test.cpp b/Account/tests/AccountForex.test.cpp index 2e1cdf4ad..d22162b80 100644 --- a/Account/tests/AccountForex.test.cpp +++ b/Account/tests/AccountForex.test.cpp @@ -26,7 +26,7 @@ // Includes. #include "../AccountForex.h" -#include "../../Platform.h" +#include "../../Platform/Platform.h" int main(int argc, char **argv) { diff --git a/Account/tests/AccountMt.test.cpp b/Account/tests/AccountMt.test.cpp index 79707d3c6..d0ed5ea42 100644 --- a/Account/tests/AccountMt.test.cpp +++ b/Account/tests/AccountMt.test.cpp @@ -26,7 +26,7 @@ // Includes. #include "../AccountMt.h" -#include "../../Platform.h" +#include "../../Platform/Platform.h" int main(int argc, char **argv) { diff --git a/Chart.struct.h b/Chart.struct.h index 66bb1ab39..1b1bfbc1d 100644 --- a/Chart.struct.h +++ b/Chart.struct.h @@ -43,7 +43,7 @@ struct ChartTf; #include "Chart.struct.tf.h" #include "Serializer/Serializer.h" #include "Serializer/SerializerNode.enum.h" -#include "Terminal.define.h" +#include "Platform/Terminal.define.h" /* Defines struct to store bar entries. */ struct ChartEntry { diff --git a/Chart.struct.static.h b/Chart.struct.static.h index 2758c2d02..2ed5aa9fe 100644 --- a/Chart.struct.static.h +++ b/Chart.struct.static.h @@ -33,8 +33,8 @@ // Includes. #include "Chart.define.h" #include "Chart.symboltf.h" -#include "Platform.extern.h" -#include "Terminal.define.h" +#include "Platform/Platform.extern.h" +#include "Platform/Terminal.define.h" /* Defines struct for chart static methods. */ struct ChartStatic { diff --git a/Chart.struct.tf.h b/Chart.struct.tf.h index ddcfc17fc..a34f5abac 100644 --- a/Chart.struct.tf.h +++ b/Chart.struct.tf.h @@ -28,7 +28,7 @@ #ifndef __MQL__ // Allows the preprocessor to include a header file when it is needed. #pragma once -#include "Platform.extern.h" +#include "Platform/Platform.extern.h" #endif // Forward declarations. @@ -38,7 +38,7 @@ class Serializer; #include "Chart.enum.h" #include "Serializer/Serializer.h" #include "Serializer/SerializerNode.enum.h" -#include "Terminal.define.h" +#include "Platform/Terminal.define.h" /* Defines struct for chart timeframe. */ struct ChartTf { diff --git a/ChartMt.h b/ChartMt.h index 5f32f0230..e3e236c1a 100644 --- a/ChartMt.h +++ b/ChartMt.h @@ -33,7 +33,7 @@ // Includes. #include "Chart.struct.static.h" #include "Chart.symboltf.h" -#include "Terminal.define.h" +#include "Platform/Terminal.define.h" #ifdef __DISABLED diff --git a/Common.extern.h b/Common.extern.h index f35cc0421..3fb06072e 100644 --- a/Common.extern.h +++ b/Common.extern.h @@ -28,7 +28,7 @@ #include "Chart.enum.h" #include "Storage/DateTime.enum.h" -#include "Terminal.define.h" +#include "Platform/Terminal.define.h" void DebugBreak() { #ifdef _MSC_VER diff --git a/Convert.mqh b/Convert.mqh index 139cbb45f..67870af64 100644 --- a/Convert.mqh +++ b/Convert.mqh @@ -33,7 +33,7 @@ #include "Storage/DateTime.extern.h" #include "Storage/DateTime.h" #include "Math.extern.h" -#include "Order.enum.h" +#include "Platform/Order.enum.h" #include "SymbolInfo.enum.h" #include "SymbolInfo.extern.h" #include "SymbolInfo.struct.static.h" diff --git a/Draw.mqh b/Draw.mqh index d925a51ac..b71c0709c 100644 --- a/Draw.mqh +++ b/Draw.mqh @@ -33,10 +33,10 @@ class Draw; #include "Storage/Data.define.h" #include "Storage/Object.extern.h" #include "Storage/Object.h" -#include "Platform.extern.h" -#include "Terminal.define.h" -#include "Terminal.enum.h" -#include "Terminal.extern.h" +#include "Platform/Platform.extern.h" +#include "Platform/Terminal.define.h" +#include "Platform/Terminal.enum.h" +#include "Platform/Terminal.extern.h" #ifndef __MQL4__ // Defines macros (for MQL4 backward compatibility). diff --git a/EA.mqh b/EA.mqh index 6a05fd6b5..143622037 100644 --- a/EA.mqh +++ b/EA.mqh @@ -37,7 +37,7 @@ #include "EA.enum.h" #include "EA.struct.h" #include "Market.mqh" -#include "Platform.h" +#include "Platform/Platform.h" #include "Refs.struct.h" #include "Serializer/SerializerConverter.h" #include "Serializer/SerializerCsv.h" @@ -47,7 +47,7 @@ #include "SummaryReport.mqh" #include "Task/TaskManager.h" #include "Task/Taskable.h" -#include "Terminal.mqh" +#include "Platform/Terminal.h" #include "Trade.mqh" #include "Trade/TradeSignal.h" #include "Trade/TradeSignalManager.h" diff --git a/Exchange/tests/Exchange.test.cpp b/Exchange/tests/Exchange.test.cpp index 91dd1310f..dda339de0 100644 --- a/Exchange/tests/Exchange.test.cpp +++ b/Exchange/tests/Exchange.test.cpp @@ -26,7 +26,7 @@ // Includes. #include "../Exchange.h" -#include "../../Platform.h" +#include "../../Platform/Platform.h" int main(int argc, char **argv) { diff --git a/Exchange/tests/Exchange.test.mq5 b/Exchange/tests/Exchange.test.mq5 index b01ca7ced..52a12a7af 100644 --- a/Exchange/tests/Exchange.test.mq5 +++ b/Exchange/tests/Exchange.test.mq5 @@ -25,7 +25,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Exchange.h" diff --git a/File.extern.h b/File.extern.h index 2510fd9ec..946501846 100644 --- a/File.extern.h +++ b/File.extern.h @@ -24,7 +24,7 @@ #include "File.define.h" #include "Storage/MemoryFileSystem.h" #include "Storage/String.extern.h" -#include "Terminal.define.h" +#include "Platform/Terminal.define.h" // Define external global functions. #ifndef __MQL__ diff --git a/File.mqh b/File.mqh index fc840d1a7..afa9a2ef8 100644 --- a/File.mqh +++ b/File.mqh @@ -38,9 +38,9 @@ #include "File.define.h" #include "File.extern.h" #include "Std.h" -#include "Terminal.define.h" -#include "Terminal.enum.h" -#include "Terminal.extern.h" +#include "Platform/Terminal.define.h" +#include "Platform/Terminal.enum.h" +#include "Platform/Terminal.extern.h" /** * Class to provide a group of functions for working with files. diff --git a/Indicator/IndicatorBase.h b/Indicator/IndicatorBase.h index 72a6c0b4d..220f8ec9a 100644 --- a/Indicator/IndicatorBase.h +++ b/Indicator/IndicatorBase.h @@ -37,7 +37,7 @@ #include "../Storage/DateTime.h" #include "../Log.mqh" #include "../Storage/Object.h" -#include "../Platform.extern.h" +#include "../Platform/Platform.extern.h" #include "../Refs.mqh" #include "../Serializer/Serializer.h" #include "../Serializer/SerializerCsv.h" diff --git a/Indicator/tests/IndicatorBase.test.cpp b/Indicator/tests/IndicatorBase.test.cpp index 94d03caa3..46f7d0410 100644 --- a/Indicator/tests/IndicatorBase.test.cpp +++ b/Indicator/tests/IndicatorBase.test.cpp @@ -26,7 +26,7 @@ // Includes. #include "../IndicatorBase.h" -#include "../../Platform.h" +#include "../../Platform/Platform.h" int main(int argc, char **argv) { diff --git a/Indicator/tests/IndicatorCandle.test.mq5 b/Indicator/tests/IndicatorCandle.test.mq5 index c2bbf072f..fd0c1b68f 100644 --- a/Indicator/tests/IndicatorCandle.test.mq5 +++ b/Indicator/tests/IndicatorCandle.test.mq5 @@ -25,7 +25,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../IndicatorCandle.h" diff --git a/Indicator/tests/IndicatorRenko.test.mq5 b/Indicator/tests/IndicatorRenko.test.mq5 index c54d2cfcc..1beebb52c 100644 --- a/Indicator/tests/IndicatorRenko.test.mq5 +++ b/Indicator/tests/IndicatorRenko.test.mq5 @@ -29,7 +29,7 @@ // Includes. #include "../../Indicators/Indi_AMA.mqh" #include "../../Indicators/Tick/Indi_TickMt.h" -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../../Util.h" #include "../IndicatorRenko.h" diff --git a/Indicator/tests/IndicatorTf.test.mq5 b/Indicator/tests/IndicatorTf.test.mq5 index a5982ce46..0dc176d6e 100644 --- a/Indicator/tests/IndicatorTf.test.mq5 +++ b/Indicator/tests/IndicatorTf.test.mq5 @@ -31,7 +31,7 @@ #include "../../Indicators/Indi_AMA.mqh" #include "../../Indicators/Tick/Indi_TickMt.h" #include "../../Log.mqh" -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../SymbolInfo.mqh" #include "../../Test.mqh" #include "../../Util.h" diff --git a/Indicator/tests/IndicatorTick.test.mq5 b/Indicator/tests/IndicatorTick.test.mq5 index 0d39b3030..b5e133e5a 100644 --- a/Indicator/tests/IndicatorTick.test.mq5 +++ b/Indicator/tests/IndicatorTick.test.mq5 @@ -25,7 +25,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../IndicatorTick.h" #include "classes/IndicatorTickDummy.h" diff --git a/Indicator/tests/classes/IndicatorTfDummy.h b/Indicator/tests/classes/IndicatorTfDummy.h index 591c3f089..844c20931 100644 --- a/Indicator/tests/classes/IndicatorTfDummy.h +++ b/Indicator/tests/classes/IndicatorTfDummy.h @@ -30,7 +30,7 @@ #endif // Includes. -#include "../../../Platform.define.h" +#include "../../../Platform/Platform.define.h" #include "../../IndicatorTf.h" #include "../../IndicatorTf.struct.h" diff --git a/Indicators/Bitwise/tests/Indi_Candle.test.mq5 b/Indicators/Bitwise/tests/Indi_Candle.test.mq5 index 703cd2851..cc1588f1d 100644 --- a/Indicators/Bitwise/tests/Indi_Candle.test.mq5 +++ b/Indicators/Bitwise/tests/Indi_Candle.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../../Platform.h" +#include "../../../Platform/Platform.h" #include "../../../Test.mqh" #include "../Indi_Candle.mqh" diff --git a/Indicators/Bitwise/tests/Indi_Pattern.test.mq5 b/Indicators/Bitwise/tests/Indi_Pattern.test.mq5 index fd266e7d2..351c9a0c7 100644 --- a/Indicators/Bitwise/tests/Indi_Pattern.test.mq5 +++ b/Indicators/Bitwise/tests/Indi_Pattern.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../../Platform.h" +#include "../../../Platform/Platform.h" #include "../../../Test.mqh" #include "../Indi_Pattern.mqh" diff --git a/Indicators/Indi_ZigZag.mqh b/Indicators/Indi_ZigZag.mqh index f1ce33ad2..46d46713b 100644 --- a/Indicators/Indi_ZigZag.mqh +++ b/Indicators/Indi_ZigZag.mqh @@ -27,6 +27,7 @@ // Includes. #include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.all.h" +#include "../Platform/Terminal.h" // Defines. #ifdef __MQL4__ diff --git a/Indicators/OHLC/tests/Indi_OHLC.test.cpp b/Indicators/OHLC/tests/Indi_OHLC.test.cpp index c24d48bdb..bc4c95d4b 100644 --- a/Indicators/OHLC/tests/Indi_OHLC.test.cpp +++ b/Indicators/OHLC/tests/Indi_OHLC.test.cpp @@ -26,7 +26,7 @@ // Includes. #include "../Indi_OHLC.mqh" -#include "../../../Platform.h" +#include "../../../Platform/Platform.h" int main(int argc, char **argv) { // @todo diff --git a/Indicators/OHLC/tests/Indi_OHLC.test.mq5 b/Indicators/OHLC/tests/Indi_OHLC.test.mq5 index 043969e8c..cb5e0d2a3 100644 --- a/Indicators/OHLC/tests/Indi_OHLC.test.mq5 +++ b/Indicators/OHLC/tests/Indi_OHLC.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../../Platform.h" +#include "../../../Platform/Platform.h" #include "../../../Test.mqh" #include "../Indi_OHLC.mqh" diff --git a/Indicators/Oscillator/Indi_WPR.h b/Indicators/Oscillator/Indi_WPR.h index 19460907e..962068758 100644 --- a/Indicators/Oscillator/Indi_WPR.h +++ b/Indicators/Oscillator/Indi_WPR.h @@ -22,6 +22,7 @@ // Includes. #include "../../Indicator/Indicator.h" +#include "../../Platform/Terminal.h" #ifndef __MQL4__ // Defines global functions (for MQL4 backward compability). diff --git a/Indicators/Oscillator/tests/Indi_MACD.test.cpp b/Indicators/Oscillator/tests/Indi_MACD.test.cpp index cd5a2a498..a0c0a0f45 100644 --- a/Indicators/Oscillator/tests/Indi_MACD.test.cpp +++ b/Indicators/Oscillator/tests/Indi_MACD.test.cpp @@ -55,7 +55,7 @@ extern int iMACD( */ // Includes. -#include "../../../Platform.h" +#include "../../../Platform/Platform.h" #include "../Indi_MACD.h" int main(int argc, char **argv) { diff --git a/Indicators/Oscillator/tests/Indi_MACD.test.mq5 b/Indicators/Oscillator/tests/Indi_MACD.test.mq5 index af458e5c9..69f069190 100644 --- a/Indicators/Oscillator/tests/Indi_MACD.test.mq5 +++ b/Indicators/Oscillator/tests/Indi_MACD.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../../Platform.h" +#include "../../../Platform/Platform.h" #include "../../../Test.mqh" #include "../Indi_MACD.h" diff --git a/Indicators/Oscillator/tests/Indi_RSI.test.cpp b/Indicators/Oscillator/tests/Indi_RSI.test.cpp index c0632c853..860b2181a 100644 --- a/Indicators/Oscillator/tests/Indi_RSI.test.cpp +++ b/Indicators/Oscillator/tests/Indi_RSI.test.cpp @@ -27,7 +27,7 @@ // Includes. #include "../Indi_RSI.h" -#include "../../../Platform.h" +#include "../../../Platform/Platform.h" int main(int argc, char **argv) { // @todo diff --git a/Indicators/Oscillator/tests/Indi_RSI.test.mq5 b/Indicators/Oscillator/tests/Indi_RSI.test.mq5 index 51d55d51d..5d8016307 100644 --- a/Indicators/Oscillator/tests/Indi_RSI.test.mq5 +++ b/Indicators/Oscillator/tests/Indi_RSI.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../../Platform.h" +#include "../../../Platform/Platform.h" #include "../../../Test.mqh" #include "../Indi_RSI.h" diff --git a/Indicators/Oscillator/tests/Indi_Stochastic.test.mq5 b/Indicators/Oscillator/tests/Indi_Stochastic.test.mq5 index 846e09034..d61c7a741 100644 --- a/Indicators/Oscillator/tests/Indi_Stochastic.test.mq5 +++ b/Indicators/Oscillator/tests/Indi_Stochastic.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../../Platform.h" +#include "../../../Platform/Platform.h" #include "../../../Test.mqh" #include "../Indi_Stochastic.h" diff --git a/Indicators/Oscillator/tests/Indi_WPR.test.mq5 b/Indicators/Oscillator/tests/Indi_WPR.test.mq5 index ec0f19b19..58a8b97be 100644 --- a/Indicators/Oscillator/tests/Indi_WPR.test.mq5 +++ b/Indicators/Oscillator/tests/Indi_WPR.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../../Platform.h" +#include "../../../Platform/Platform.h" #include "../../../Test.mqh" #include "../Indi_WPR.h" diff --git a/Indicators/Price/Indi_Price.h b/Indicators/Price/Indi_Price.h index eb1215133..4994ce97d 100644 --- a/Indicators/Price/Indi_Price.h +++ b/Indicators/Price/Indi_Price.h @@ -23,7 +23,7 @@ // Includes. #include "../../Storage/Dict/Buffer/BufferStruct.h" #include "../../Indicator/Indicator.h" -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Storage/Objects.h" // Structs. diff --git a/Indicators/Price/tests/Indi_AppliedPrice.test.mq5 b/Indicators/Price/tests/Indi_AppliedPrice.test.mq5 index edfa281f4..d5a5914a8 100644 --- a/Indicators/Price/tests/Indi_AppliedPrice.test.mq5 +++ b/Indicators/Price/tests/Indi_AppliedPrice.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../../Platform.h" +#include "../../../Platform/Platform.h" #include "../../../Test.mqh" #include "../Indi_AppliedPrice.h" #include "../Indi_Price.h" diff --git a/Indicators/Price/tests/Indi_MA.test.mq5 b/Indicators/Price/tests/Indi_MA.test.mq5 index 530b9b4e2..8d45119bb 100644 --- a/Indicators/Price/tests/Indi_MA.test.mq5 +++ b/Indicators/Price/tests/Indi_MA.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../../Platform.h" +#include "../../../Platform/Platform.h" #include "../../../Test.mqh" #include "../Indi_MA.h" diff --git a/Indicators/Price/tests/Indi_Price.test.cpp b/Indicators/Price/tests/Indi_Price.test.cpp index 7883c7202..fd2e8e0cf 100644 --- a/Indicators/Price/tests/Indi_Price.test.cpp +++ b/Indicators/Price/tests/Indi_Price.test.cpp @@ -26,7 +26,7 @@ // Includes. #include "../Indi_Price.h" -#include "../../../Platform.h" +#include "../../../Platform/Platform.h" int main(int argc, char **argv) { diff --git a/Indicators/Price/tests/Indi_Price.test.mq5 b/Indicators/Price/tests/Indi_Price.test.mq5 index 602355ec6..8289aecd8 100644 --- a/Indicators/Price/tests/Indi_Price.test.mq5 +++ b/Indicators/Price/tests/Indi_Price.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../../Platform.h" +#include "../../../Platform/Platform.h" #include "../../../Test.mqh" #include "../Indi_Price.h" diff --git a/Indicators/PriceMulti/tests/Indi_Alligator.test.mq5 b/Indicators/PriceMulti/tests/Indi_Alligator.test.mq5 index e885a0e16..17501d957 100644 --- a/Indicators/PriceMulti/tests/Indi_Alligator.test.mq5 +++ b/Indicators/PriceMulti/tests/Indi_Alligator.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../../Platform.h" +#include "../../../Platform/Platform.h" #include "../../../Test.mqh" #include "../Indi_Alligator.h" diff --git a/Indicators/PriceRange/tests/Indi_Bands.test.mq5 b/Indicators/PriceRange/tests/Indi_Bands.test.mq5 index ffa0a91dd..4afa3348b 100644 --- a/Indicators/PriceRange/tests/Indi_Bands.test.mq5 +++ b/Indicators/PriceRange/tests/Indi_Bands.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../../Platform.h" +#include "../../../Platform/Platform.h" #include "../../../Test.mqh" #include "../Indi_Bands.h" diff --git a/Indicators/PriceRange/tests/Indi_Envelopes.test.mq5 b/Indicators/PriceRange/tests/Indi_Envelopes.test.mq5 index ed787e9dd..bd6a6a721 100644 --- a/Indicators/PriceRange/tests/Indi_Envelopes.test.mq5 +++ b/Indicators/PriceRange/tests/Indi_Envelopes.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../../Platform.h" +#include "../../../Platform/Platform.h" #include "../../../Test.mqh" #include "../Indi_Envelopes.h" diff --git a/Indicators/PriceRange/tests/Indi_SAR.test.mq5 b/Indicators/PriceRange/tests/Indi_SAR.test.mq5 index 7dcdf3ed0..6decbbdbc 100644 --- a/Indicators/PriceRange/tests/Indi_SAR.test.mq5 +++ b/Indicators/PriceRange/tests/Indi_SAR.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../../Platform.h" +#include "../../../Platform/Platform.h" #include "../../../Test.mqh" #include "../Indi_SAR.h" diff --git a/Indicators/Special/tests/Indi_Custom.test.mq5 b/Indicators/Special/tests/Indi_Custom.test.mq5 index 281fe217d..501650511 100644 --- a/Indicators/Special/tests/Indi_Custom.test.mq5 +++ b/Indicators/Special/tests/Indi_Custom.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../../Platform.h" +#include "../../../Platform/Platform.h" #include "../../../Test.mqh" #include "../Indi_Custom.mqh" diff --git a/Indicators/Tick/tests/Indi_TickMt.test.mq5 b/Indicators/Tick/tests/Indi_TickMt.test.mq5 index d5213aa4f..1366a2905 100644 --- a/Indicators/Tick/tests/Indi_TickMt.test.mq5 +++ b/Indicators/Tick/tests/Indi_TickMt.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../../Platform.h" +#include "../../../Platform/Platform.h" #include "../../../Test.mqh" #include "../Indi_TickMt.h" diff --git a/Indicators/tests/DrawIndicator.test.cpp b/Indicators/tests/DrawIndicator.test.cpp index 7c79b9f35..c89cee28c 100644 --- a/Indicators/tests/DrawIndicator.test.cpp +++ b/Indicators/tests/DrawIndicator.test.cpp @@ -26,7 +26,7 @@ // Includes. #include "../DrawIndicator.mqh" -#include "../../Platform.h" +#include "../../Platform/Platform.h" int main(int argc, char **argv) { diff --git a/Indicators/tests/Indi_AC.test.mq5 b/Indicators/tests/Indi_AC.test.mq5 index d08589756..c73b2beac 100644 --- a/Indicators/tests/Indi_AC.test.mq5 +++ b/Indicators/tests/Indi_AC.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_AC.mqh" diff --git a/Indicators/tests/Indi_AD.test.mq5 b/Indicators/tests/Indi_AD.test.mq5 index 4e4d4e906..744811a8c 100644 --- a/Indicators/tests/Indi_AD.test.mq5 +++ b/Indicators/tests/Indi_AD.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_AD.mqh" diff --git a/Indicators/tests/Indi_ADX.test.mq5 b/Indicators/tests/Indi_ADX.test.mq5 index 3d14b98b7..ae42e788b 100644 --- a/Indicators/tests/Indi_ADX.test.mq5 +++ b/Indicators/tests/Indi_ADX.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_ADX.mqh" diff --git a/Indicators/tests/Indi_ADXW.test.mq5 b/Indicators/tests/Indi_ADXW.test.mq5 index 5b7c9d6f7..6fbae36cf 100644 --- a/Indicators/tests/Indi_ADXW.test.mq5 +++ b/Indicators/tests/Indi_ADXW.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_ADXW.mqh" diff --git a/Indicators/tests/Indi_AMA.test.mq5 b/Indicators/tests/Indi_AMA.test.mq5 index 7422d7608..47a8697a0 100644 --- a/Indicators/tests/Indi_AMA.test.mq5 +++ b/Indicators/tests/Indi_AMA.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_AMA.mqh" diff --git a/Indicators/tests/Indi_AO.test.mq5 b/Indicators/tests/Indi_AO.test.mq5 index 63578c0f7..aaacb3aa6 100644 --- a/Indicators/tests/Indi_AO.test.mq5 +++ b/Indicators/tests/Indi_AO.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_AO.mqh" diff --git a/Indicators/tests/Indi_ASI.test.mq5 b/Indicators/tests/Indi_ASI.test.mq5 index ce3d82555..bd7ef040b 100644 --- a/Indicators/tests/Indi_ASI.test.mq5 +++ b/Indicators/tests/Indi_ASI.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_ASI.mqh" diff --git a/Indicators/tests/Indi_ATR.test.mq5 b/Indicators/tests/Indi_ATR.test.mq5 index da54c2735..8b2a48816 100644 --- a/Indicators/tests/Indi_ATR.test.mq5 +++ b/Indicators/tests/Indi_ATR.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_ATR.mqh" diff --git a/Indicators/tests/Indi_BWMFI.test.mq5 b/Indicators/tests/Indi_BWMFI.test.mq5 index 34e8c60b3..3ab4423a0 100644 --- a/Indicators/tests/Indi_BWMFI.test.mq5 +++ b/Indicators/tests/Indi_BWMFI.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_BWMFI.mqh" diff --git a/Indicators/tests/Indi_BWZT.test.mq5 b/Indicators/tests/Indi_BWZT.test.mq5 index db1c6fcfe..079cebb8e 100644 --- a/Indicators/tests/Indi_BWZT.test.mq5 +++ b/Indicators/tests/Indi_BWZT.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_BWZT.mqh" diff --git a/Indicators/tests/Indi_BearsPower.test.mq5 b/Indicators/tests/Indi_BearsPower.test.mq5 index e8e2df5d3..e19fa7504 100644 --- a/Indicators/tests/Indi_BearsPower.test.mq5 +++ b/Indicators/tests/Indi_BearsPower.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_BearsPower.mqh" diff --git a/Indicators/tests/Indi_BullsPower.test.mq5 b/Indicators/tests/Indi_BullsPower.test.mq5 index 9baac42ee..ad10c0a9c 100644 --- a/Indicators/tests/Indi_BullsPower.test.mq5 +++ b/Indicators/tests/Indi_BullsPower.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_BullsPower.mqh" diff --git a/Indicators/tests/Indi_CCI.test.mq5 b/Indicators/tests/Indi_CCI.test.mq5 index 95a38f9e0..89b38f368 100644 --- a/Indicators/tests/Indi_CCI.test.mq5 +++ b/Indicators/tests/Indi_CCI.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_CCI.mqh" diff --git a/Indicators/tests/Indi_CHO.test.mq5 b/Indicators/tests/Indi_CHO.test.mq5 index 0699d5dc4..5f9c8c7b8 100644 --- a/Indicators/tests/Indi_CHO.test.mq5 +++ b/Indicators/tests/Indi_CHO.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_CHO.mqh" diff --git a/Indicators/tests/Indi_CHV.test.mq5 b/Indicators/tests/Indi_CHV.test.mq5 index 8d0cf54d7..a16794958 100644 --- a/Indicators/tests/Indi_CHV.test.mq5 +++ b/Indicators/tests/Indi_CHV.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_CHV.mqh" diff --git a/Indicators/tests/Indi_ColorBars.test.mq5 b/Indicators/tests/Indi_ColorBars.test.mq5 index 5a5720b1c..dea42594b 100644 --- a/Indicators/tests/Indi_ColorBars.test.mq5 +++ b/Indicators/tests/Indi_ColorBars.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_ColorBars.mqh" diff --git a/Indicators/tests/Indi_ColorCandlesDaily.test.mq5 b/Indicators/tests/Indi_ColorCandlesDaily.test.mq5 index 6684279ba..7aadea996 100644 --- a/Indicators/tests/Indi_ColorCandlesDaily.test.mq5 +++ b/Indicators/tests/Indi_ColorCandlesDaily.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_ColorCandlesDaily.mqh" diff --git a/Indicators/tests/Indi_ColorLine.test.mq5 b/Indicators/tests/Indi_ColorLine.test.mq5 index 46b1b43ae..04f87c582 100644 --- a/Indicators/tests/Indi_ColorLine.test.mq5 +++ b/Indicators/tests/Indi_ColorLine.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_ColorLine.mqh" diff --git a/Indicators/tests/Indi_CustomMovingAverage.test.mq5 b/Indicators/tests/Indi_CustomMovingAverage.test.mq5 index 4f00b28b9..5815eb263 100644 --- a/Indicators/tests/Indi_CustomMovingAverage.test.mq5 +++ b/Indicators/tests/Indi_CustomMovingAverage.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_CustomMovingAverage.mqh" diff --git a/Indicators/tests/Indi_DEMA.test.mq5 b/Indicators/tests/Indi_DEMA.test.mq5 index 9400c1122..1428b2dd3 100644 --- a/Indicators/tests/Indi_DEMA.test.mq5 +++ b/Indicators/tests/Indi_DEMA.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_DEMA.mqh" diff --git a/Indicators/tests/Indi_DeMarker.test.mq5 b/Indicators/tests/Indi_DeMarker.test.mq5 index dea33ef3a..853a724b8 100644 --- a/Indicators/tests/Indi_DeMarker.test.mq5 +++ b/Indicators/tests/Indi_DeMarker.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_DeMarker.mqh" diff --git a/Indicators/tests/Indi_Demo.test.mq5 b/Indicators/tests/Indi_Demo.test.mq5 index 9d2804070..c23e7a243 100644 --- a/Indicators/tests/Indi_Demo.test.mq5 +++ b/Indicators/tests/Indi_Demo.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_Demo.mqh" diff --git a/Indicators/tests/Indi_DetrendedPrice.test.mq5 b/Indicators/tests/Indi_DetrendedPrice.test.mq5 index f017069c2..e4bf4a88b 100644 --- a/Indicators/tests/Indi_DetrendedPrice.test.mq5 +++ b/Indicators/tests/Indi_DetrendedPrice.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_DetrendedPrice.mqh" diff --git a/Indicators/tests/Indi_Drawer.test.mq5 b/Indicators/tests/Indi_Drawer.test.mq5 index b89a934e2..390ebc223 100644 --- a/Indicators/tests/Indi_Drawer.test.mq5 +++ b/Indicators/tests/Indi_Drawer.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_Drawer.mqh" diff --git a/Indicators/tests/Indi_Force.test.mq5 b/Indicators/tests/Indi_Force.test.mq5 index 3a1016a25..e2808fb8d 100644 --- a/Indicators/tests/Indi_Force.test.mq5 +++ b/Indicators/tests/Indi_Force.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_Force.mqh" diff --git a/Indicators/tests/Indi_FractalAdaptiveMA.test.mq5 b/Indicators/tests/Indi_FractalAdaptiveMA.test.mq5 index 0e8ad66b5..788fcb5cf 100644 --- a/Indicators/tests/Indi_FractalAdaptiveMA.test.mq5 +++ b/Indicators/tests/Indi_FractalAdaptiveMA.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_FractalAdaptiveMA.mqh" diff --git a/Indicators/tests/Indi_Fractals.test.mq5 b/Indicators/tests/Indi_Fractals.test.mq5 index d1240aa06..6c9b84ec7 100644 --- a/Indicators/tests/Indi_Fractals.test.mq5 +++ b/Indicators/tests/Indi_Fractals.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_Fractals.mqh" diff --git a/Indicators/tests/Indi_Gator.test.mq5 b/Indicators/tests/Indi_Gator.test.mq5 index ccb2d54e5..30877bdfe 100644 --- a/Indicators/tests/Indi_Gator.test.mq5 +++ b/Indicators/tests/Indi_Gator.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_Gator.mqh" diff --git a/Indicators/tests/Indi_HeikenAshi.test.mq5 b/Indicators/tests/Indi_HeikenAshi.test.mq5 index 29de9b699..15b21c3a3 100644 --- a/Indicators/tests/Indi_HeikenAshi.test.mq5 +++ b/Indicators/tests/Indi_HeikenAshi.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_HeikenAshi.mqh" diff --git a/Indicators/tests/Indi_Ichimoku.test.mq5 b/Indicators/tests/Indi_Ichimoku.test.mq5 index 3c865f10a..39f18cf6f 100644 --- a/Indicators/tests/Indi_Ichimoku.test.mq5 +++ b/Indicators/tests/Indi_Ichimoku.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_Ichimoku.mqh" diff --git a/Indicators/tests/Indi_Killzones.test.mq5 b/Indicators/tests/Indi_Killzones.test.mq5 index e4b864bb1..82dd006e4 100644 --- a/Indicators/tests/Indi_Killzones.test.mq5 +++ b/Indicators/tests/Indi_Killzones.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_Killzones.mqh" diff --git a/Indicators/tests/Indi_MFI.test.mq5 b/Indicators/tests/Indi_MFI.test.mq5 index 0fe7fcb8a..f347cadf8 100644 --- a/Indicators/tests/Indi_MFI.test.mq5 +++ b/Indicators/tests/Indi_MFI.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_MFI.mqh" diff --git a/Indicators/tests/Indi_MassIndex.test.mq5 b/Indicators/tests/Indi_MassIndex.test.mq5 index 7b8c60f63..9f895d691 100644 --- a/Indicators/tests/Indi_MassIndex.test.mq5 +++ b/Indicators/tests/Indi_MassIndex.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_MassIndex.mqh" diff --git a/Indicators/tests/Indi_Momentum.test.mq5 b/Indicators/tests/Indi_Momentum.test.mq5 index 74051a637..b1f3ce6e7 100644 --- a/Indicators/tests/Indi_Momentum.test.mq5 +++ b/Indicators/tests/Indi_Momentum.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_Momentum.mqh" diff --git a/Indicators/tests/Indi_OBV.test.mq5 b/Indicators/tests/Indi_OBV.test.mq5 index ef9a85e9f..ab84dedb7 100644 --- a/Indicators/tests/Indi_OBV.test.mq5 +++ b/Indicators/tests/Indi_OBV.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_OBV.mqh" diff --git a/Indicators/tests/Indi_OsMA.test.mq5 b/Indicators/tests/Indi_OsMA.test.mq5 index 96c42673e..f9f30b23d 100644 --- a/Indicators/tests/Indi_OsMA.test.mq5 +++ b/Indicators/tests/Indi_OsMA.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_OsMA.mqh" diff --git a/Indicators/tests/Indi_Pivot.test.mq5 b/Indicators/tests/Indi_Pivot.test.mq5 index 3d6ccaa9c..a5d2b6c8e 100644 --- a/Indicators/tests/Indi_Pivot.test.mq5 +++ b/Indicators/tests/Indi_Pivot.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_Pivot.mqh" diff --git a/Indicators/tests/Indi_PriceChannel.test.mq5 b/Indicators/tests/Indi_PriceChannel.test.mq5 index 4398eb042..db5d4a7f1 100644 --- a/Indicators/tests/Indi_PriceChannel.test.mq5 +++ b/Indicators/tests/Indi_PriceChannel.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_PriceChannel.mqh" diff --git a/Indicators/tests/Indi_PriceFeeder.test.mq5 b/Indicators/tests/Indi_PriceFeeder.test.mq5 index a246724dd..a857158e9 100644 --- a/Indicators/tests/Indi_PriceFeeder.test.mq5 +++ b/Indicators/tests/Indi_PriceFeeder.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_PriceFeeder.mqh" diff --git a/Indicators/tests/Indi_PriceVolumeTrend.test.mq5 b/Indicators/tests/Indi_PriceVolumeTrend.test.mq5 index 4dba56d8c..0b2d5e39c 100644 --- a/Indicators/tests/Indi_PriceVolumeTrend.test.mq5 +++ b/Indicators/tests/Indi_PriceVolumeTrend.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_PriceVolumeTrend.mqh" diff --git a/Indicators/tests/Indi_RS.test.mq5 b/Indicators/tests/Indi_RS.test.mq5 index 70913a8aa..2f2f7f1ee 100644 --- a/Indicators/tests/Indi_RS.test.mq5 +++ b/Indicators/tests/Indi_RS.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_RS.mqh" diff --git a/Indicators/tests/Indi_RVI.test.mq5 b/Indicators/tests/Indi_RVI.test.mq5 index 0103a52df..c7269887f 100644 --- a/Indicators/tests/Indi_RVI.test.mq5 +++ b/Indicators/tests/Indi_RVI.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_RVI.mqh" diff --git a/Indicators/tests/Indi_RateOfChange.test.mq5 b/Indicators/tests/Indi_RateOfChange.test.mq5 index 461dbc8a7..b59242ac5 100644 --- a/Indicators/tests/Indi_RateOfChange.test.mq5 +++ b/Indicators/tests/Indi_RateOfChange.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_RateOfChange.mqh" diff --git a/Indicators/tests/Indi_StdDev.test.mq5 b/Indicators/tests/Indi_StdDev.test.mq5 index 4a89925bc..eb15c0961 100644 --- a/Indicators/tests/Indi_StdDev.test.mq5 +++ b/Indicators/tests/Indi_StdDev.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_StdDev.mqh" diff --git a/Indicators/tests/Indi_TEMA.test.mq5 b/Indicators/tests/Indi_TEMA.test.mq5 index 27435e085..e8580038a 100644 --- a/Indicators/tests/Indi_TEMA.test.mq5 +++ b/Indicators/tests/Indi_TEMA.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_TEMA.mqh" diff --git a/Indicators/tests/Indi_TRIX.test.mq5 b/Indicators/tests/Indi_TRIX.test.mq5 index af59ba4c9..01436a50c 100644 --- a/Indicators/tests/Indi_TRIX.test.mq5 +++ b/Indicators/tests/Indi_TRIX.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_TRIX.mqh" diff --git a/Indicators/tests/Indi_UltimateOscillator.test.mq5 b/Indicators/tests/Indi_UltimateOscillator.test.mq5 index 2098a16bd..588399532 100644 --- a/Indicators/tests/Indi_UltimateOscillator.test.mq5 +++ b/Indicators/tests/Indi_UltimateOscillator.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_UltimateOscillator.mqh" diff --git a/Indicators/tests/Indi_VIDYA.test.mq5 b/Indicators/tests/Indi_VIDYA.test.mq5 index 6c58d088f..4b944e477 100644 --- a/Indicators/tests/Indi_VIDYA.test.mq5 +++ b/Indicators/tests/Indi_VIDYA.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_VIDYA.mqh" diff --git a/Indicators/tests/Indi_VROC.test.mq5 b/Indicators/tests/Indi_VROC.test.mq5 index 6758b7356..74307eda6 100644 --- a/Indicators/tests/Indi_VROC.test.mq5 +++ b/Indicators/tests/Indi_VROC.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_VROC.mqh" diff --git a/Indicators/tests/Indi_Volumes.test.mq5 b/Indicators/tests/Indi_Volumes.test.mq5 index afbc77518..255bf0993 100644 --- a/Indicators/tests/Indi_Volumes.test.mq5 +++ b/Indicators/tests/Indi_Volumes.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_Volumes.mqh" diff --git a/Indicators/tests/Indi_WilliamsAD.test.mq5 b/Indicators/tests/Indi_WilliamsAD.test.mq5 index 591037698..486a39cd1 100644 --- a/Indicators/tests/Indi_WilliamsAD.test.mq5 +++ b/Indicators/tests/Indi_WilliamsAD.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_WilliamsAD.mqh" diff --git a/Indicators/tests/Indi_ZigZag.test.mq5 b/Indicators/tests/Indi_ZigZag.test.mq5 index 15fe3df21..9e87d579f 100644 --- a/Indicators/tests/Indi_ZigZag.test.mq5 +++ b/Indicators/tests/Indi_ZigZag.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_ZigZag.mqh" diff --git a/Indicators/tests/Indi_ZigZagColor.test.mq5 b/Indicators/tests/Indi_ZigZagColor.test.mq5 index 5f0cdba67..84b697e01 100644 --- a/Indicators/tests/Indi_ZigZagColor.test.mq5 +++ b/Indicators/tests/Indi_ZigZagColor.test.mq5 @@ -20,7 +20,7 @@ */ // Includes. -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../Indi_ZigZagColor.mqh" diff --git a/Log.mqh b/Log.mqh index f4abc30f6..852104bb1 100644 --- a/Log.mqh +++ b/Log.mqh @@ -328,7 +328,7 @@ class Log : public Object { } }; -#include "Terminal.mqh" +#include "Platform/Terminal.h" /** * Reports last error. diff --git a/Mail.mqh b/Mail.mqh index dc22ffac2..1b30d4b1c 100644 --- a/Mail.mqh +++ b/Mail.mqh @@ -23,7 +23,7 @@ // Includes. #include "Account/AccountMt.h" #include "Convert.mqh" -#include "Order.mqh" +#include "Platform/Order.h" // Prevents processing this includes file for the second time. #ifndef MAIL_MQH diff --git a/Deal.enum.h b/Platform/Deal.enum.h similarity index 100% rename from Deal.enum.h rename to Platform/Deal.enum.h diff --git a/MQL5.mqh b/Platform/MQL5.mqh similarity index 100% rename from MQL5.mqh rename to Platform/MQL5.mqh diff --git a/Order.define.h b/Platform/Order.define.h similarity index 100% rename from Order.define.h rename to Platform/Order.define.h diff --git a/Order.enum.h b/Platform/Order.enum.h similarity index 100% rename from Order.enum.h rename to Platform/Order.enum.h diff --git a/Order.mqh b/Platform/Order.h similarity index 99% rename from Order.mqh rename to Platform/Order.h index 6180d6b6c..697630a62 100644 --- a/Order.mqh +++ b/Platform/Order.h @@ -33,22 +33,22 @@ class SymbolInfo; // Includes. -#include "Convert.mqh" -#include "Storage/Data.define.h" -#include "Storage/Data.struct.h" +#include "../Convert.mqh" +#include "../Storage/Data.define.h" +#include "../Storage/Data.struct.h" #include "Deal.enum.h" -#include "Log.mqh" +#include "../Log.mqh" #include "Order.define.h" #include "Order.enum.h" #include "Order.struct.h" -#include "Serializer/Serializer.define.h" -#include "Serializer/Serializer.h" -#include "Serializer/SerializerConverter.h" -#include "Serializer/SerializerJson.h" -#include "Std.h" -#include "Storage/String.h" -#include "SymbolInfo.mqh" -#include "Task/TaskAction.enum.h" +#include "../Serializer/Serializer.define.h" +#include "../Serializer/Serializer.h" +#include "../Serializer/SerializerConverter.h" +#include "../Serializer/SerializerJson.h" +#include "../Std.h" +#include "../Storage/String.h" +#include "../SymbolInfo.mqh" +#include "../Task/TaskAction.enum.h" /* Defines for backward compatibility. */ diff --git a/Order.struct.h b/Platform/Order.struct.h similarity index 99% rename from Order.struct.h rename to Platform/Order.struct.h index 331a626a2..86a26bb77 100644 --- a/Order.struct.h +++ b/Platform/Order.struct.h @@ -31,12 +31,12 @@ #endif // Includes. -#include "Storage/Data.struct.h" +#include "../Storage/Data.struct.h" #include "Order.enum.h" #include "Platform.extern.h" -#include "Serializer/Serializer.h" -#include "SymbolInfo.struct.static.h" -#include "Terminal.mqh" +#include "../Serializer/Serializer.h" +#include "../SymbolInfo.struct.static.h" +#include "Terminal.h" #ifndef __MQL5__ /** diff --git a/OrderQuery.h b/Platform/OrderQuery.h similarity index 98% rename from OrderQuery.h rename to Platform/OrderQuery.h index 0ea17dc84..27d2f251e 100644 --- a/OrderQuery.h +++ b/Platform/OrderQuery.h @@ -26,10 +26,10 @@ */ // Includes. -#include "Storage/Dict/DictStruct.h" -#include "Order.mqh" -#include "Refs.mqh" -#include "Std.h" +#include "../Storage/Dict/DictStruct.h" +#include "Order.h" +#include "../Refs.mqh" +#include "../Std.h" class OrderQuery : public Dynamic { protected: diff --git a/Orders.mqh b/Platform/Orders.h similarity index 98% rename from Orders.mqh rename to Platform/Orders.h index 89b821555..6e9a7f3bf 100644 --- a/Orders.mqh +++ b/Platform/Orders.h @@ -24,13 +24,13 @@ class Orders; // Includes. -#include "Account/Account.h" -#include "Chart.struct.static.h" -#include "Log.mqh" -#include "Math.h" -#include "Order.mqh" -#include "Terminal.mqh" -#include "Trade.struct.h" +#include "../Account/Account.h" +#include "../Chart.struct.static.h" +#include "../Log.mqh" +#include "../Math.h" +#include "Order.h" +#include "Terminal.h" +#include "../Trade.struct.h" /* Defines */ diff --git a/Platform.define.h b/Platform/Platform.define.h similarity index 100% rename from Platform.define.h rename to Platform/Platform.define.h diff --git a/Platform.extern.h b/Platform/Platform.extern.h similarity index 98% rename from Platform.extern.h rename to Platform/Platform.extern.h index 0b163d817..4a9b69305 100644 --- a/Platform.extern.h +++ b/Platform/Platform.extern.h @@ -25,10 +25,10 @@ #pragma once // Includes. -#include "Account/Account.enum.h" -#include "Storage/Data.define.h" +#include "../Account/Account.enum.h" +#include "../Storage/Data.define.h" #include "Deal.enum.h" -#include "Storage/Object.extern.h" +#include "../Storage/Object.extern.h" #include "Order.define.h" #include "Order.enum.h" #include "Terminal.enum.h" diff --git a/Platform.h b/Platform/Platform.h similarity index 98% rename from Platform.h rename to Platform/Platform.h index 4bbec7a8f..e0189134d 100644 --- a/Platform.h +++ b/Platform/Platform.h @@ -46,20 +46,20 @@ extern int Bars(CONST_REF_TO(string) _symbol, ENUM_TIMEFRAMES _tf); * Current platform's static methods. */ -#include "Indicators/DrawIndicator.mqh" -#include "Storage/Flags.struct.h" -#include "Indicator/IndicatorData.h" -#include "Indicator/tests/classes/IndicatorTfDummy.h" -#include "Std.h" +#include "../Indicators/DrawIndicator.mqh" +#include "../Storage/Flags.struct.h" +#include "../Indicator/IndicatorData.h" +#include "../Indicator/tests/classes/IndicatorTfDummy.h" +#include "../Std.h" #ifdef __MQLBUILD__ -#include "Indicators/Tick/Indi_TickMt.h" +#include "../Indicators/Tick/Indi_TickMt.h" #define PLATFORM_DEFAULT_INDICATOR_TICK Indi_TickMt #else -#include "Indicators/Tick/Indi_TickProvider.h" +#include "../Indicators/Tick/Indi_TickProvider.h" #define PLATFORM_DEFAULT_INDICATOR_TICK Indi_TickProvider #endif -#include "SymbolInfo.struct.static.h" +#include "../SymbolInfo.struct.static.h" class Platform { // Whether Init() was already called. diff --git a/PlatformTime.h b/Platform/PlatformTime.h similarity index 96% rename from PlatformTime.h rename to Platform/PlatformTime.h index 75c1d70e6..6f53b4e2f 100644 --- a/PlatformTime.h +++ b/Platform/PlatformTime.h @@ -21,8 +21,8 @@ */ // Includes. -#include "Storage/DateTime.enum.h" -#include "Storage/DateTime.struct.h" +#include "../Storage/DateTime.enum.h" +#include "../Storage/DateTime.struct.h" /** * @file @@ -37,7 +37,7 @@ #endif -#include "Std.h" +#include "../Std.h" class PlatformTime { static MqlDateTime current_time; diff --git a/Terminal.define.h b/Platform/Terminal.define.h similarity index 100% rename from Terminal.define.h rename to Platform/Terminal.define.h diff --git a/Terminal.enum.h b/Platform/Terminal.enum.h similarity index 99% rename from Terminal.enum.h rename to Platform/Terminal.enum.h index 5e56a0fe6..38bb88052 100644 --- a/Terminal.enum.h +++ b/Platform/Terminal.enum.h @@ -31,7 +31,7 @@ #endif // Includes. -#include "Indicator/Indicator.define.h" +#include "../Indicator/Indicator.define.h" // Defines user error enumeration. enum ENUM_USER_ERR { USER_ERR_INVALID_ARGUMENT }; diff --git a/Terminal.extern.h b/Platform/Terminal.extern.h similarity index 98% rename from Terminal.extern.h rename to Platform/Terminal.extern.h index d39f9ff96..77ca8c894 100644 --- a/Terminal.extern.h +++ b/Platform/Terminal.extern.h @@ -25,7 +25,7 @@ #pragma once // Includes. -#include "Storage/String.h" +#include "../Storage/String.h" #include "Terminal.define.h" #include "Terminal.enum.h" diff --git a/Terminal.mqh b/Platform/Terminal.h similarity index 99% rename from Terminal.mqh rename to Platform/Terminal.h index e5656afab..65fd270aa 100644 --- a/Terminal.mqh +++ b/Platform/Terminal.h @@ -37,11 +37,11 @@ class Terminal; #define TERMINAL_MQH // Includes. -#include "Convert.mqh" -#include "Storage/Data.struct.h" -#include "Storage/Object.h" -#include "Refs.mqh" -#include "Storage/String.h" +#include "../Convert.mqh" +#include "../Storage/Data.struct.h" +#include "../Storage/Object.h" +#include "../Refs.mqh" +#include "../Storage/String.h" #include "Terminal.define.h" #include "Terminal.enum.h" #include "Terminal.extern.h" diff --git a/Terminal.struct.h b/Platform/Terminal.struct.h similarity index 100% rename from Terminal.struct.h rename to Platform/Terminal.struct.h diff --git a/Platform/tests/Makefile b/Platform/tests/Makefile new file mode 100644 index 000000000..e792364f0 --- /dev/null +++ b/Platform/tests/Makefile @@ -0,0 +1,12 @@ +CC := g++ # C++ compiler +CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags +SRCS := $(wildcard *.cpp) # Get all .cpp files in the current directory +OBJS := $(SRCS:.cpp=.o) # Object files corresponding to the source files + +all: $(OBJS) + +%.o: %.cpp + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -v $(OBJS) diff --git a/Platform/tests/Order.test.cpp b/Platform/tests/Order.test.cpp new file mode 100644 index 000000000..392294030 --- /dev/null +++ b/Platform/tests/Order.test.cpp @@ -0,0 +1,35 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test C++ compilation of Order class. + */ + +// Includes. +#include "../Order.h" + +int main(int argc, char **argv) { + + // @todo + + return 0; +} diff --git a/tests/OrderTest.mq4 b/Platform/tests/Order.test.mq4 similarity index 97% rename from tests/OrderTest.mq4 rename to Platform/tests/Order.test.mq4 index 093ac02d1..45c7a788c 100644 --- a/tests/OrderTest.mq4 +++ b/Platform/tests/Order.test.mq4 @@ -25,4 +25,4 @@ */ // Includes. -#include "OrderTest.mq5" +#include "Order.test.mq5" diff --git a/tests/OrderTest.mq5 b/Platform/tests/Order.test.mq5 similarity index 97% rename from tests/OrderTest.mq5 rename to Platform/tests/Order.test.mq5 index 65b5beddf..3d8f94f40 100644 --- a/tests/OrderTest.mq5 +++ b/Platform/tests/Order.test.mq5 @@ -25,12 +25,12 @@ */ // Includes. -#include "../Chart.mqh" -#include "../Order.mqh" +#include "../../Chart.mqh" +#include "../Order.h" #include "../Platform.h" -#include "../Serializer/SerializerConverter.h" -#include "../Serializer/SerializerJson.h" -#include "../Test.mqh" +#include "../../Serializer/SerializerConverter.h" +#include "../../Serializer/SerializerJson.h" +#include "../../Test.mqh" // Global defines. #define MAX_ORDERS 10 diff --git a/Platform/tests/OrderQuery.test.cpp b/Platform/tests/OrderQuery.test.cpp new file mode 100644 index 000000000..4a05d2324 --- /dev/null +++ b/Platform/tests/OrderQuery.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test C++ compilation of OrderQuery class. + */ + +// Includes. +#include "../OrderQuery.h" +#include "../Platform.h" + +int main(int argc, char **argv) { + + // @todo + + return 0; +} diff --git a/tests/OrderQueryTest.mq4 b/Platform/tests/OrderQuery.test.mq4 similarity index 97% rename from tests/OrderQueryTest.mq4 rename to Platform/tests/OrderQuery.test.mq4 index c18fa9667..5832eb4ce 100644 --- a/tests/OrderQueryTest.mq4 +++ b/Platform/tests/OrderQuery.test.mq4 @@ -25,4 +25,4 @@ */ // Includes. -#include "OrderQueryTest.mq5" +#include "OrderQuery.test.mq5" diff --git a/tests/OrderQueryTest.mq5 b/Platform/tests/OrderQuery.test.mq5 similarity index 99% rename from tests/OrderQueryTest.mq5 rename to Platform/tests/OrderQuery.test.mq5 index 8a4ada61b..863066e0c 100644 --- a/tests/OrderQueryTest.mq5 +++ b/Platform/tests/OrderQuery.test.mq5 @@ -26,7 +26,7 @@ // Includes. #include "../OrderQuery.h" -#include "../Test.mqh" +#include "../../Test.mqh" bool Test01() { bool _result = true; diff --git a/Platform/tests/Orders.test.cpp b/Platform/tests/Orders.test.cpp new file mode 100644 index 000000000..2c79be8e4 --- /dev/null +++ b/Platform/tests/Orders.test.cpp @@ -0,0 +1,35 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test C++ compilation of Orders class. + */ + +// Includes. +#include "../Orders.h" + +int main(int argc, char **argv) { + + // @todo + + return 0; +} diff --git a/tests/OrdersTest.mq4 b/Platform/tests/Orders.test.mq4 similarity index 97% rename from tests/OrdersTest.mq4 rename to Platform/tests/Orders.test.mq4 index b668077a2..4ba6bb5ae 100644 --- a/tests/OrdersTest.mq4 +++ b/Platform/tests/Orders.test.mq4 @@ -26,4 +26,4 @@ */ // Includes. -#include "OrdersTest.mq5" +#include "Orders.test.mq5" diff --git a/tests/OrdersTest.mq5 b/Platform/tests/Orders.test.mq5 similarity index 97% rename from tests/OrdersTest.mq5 rename to Platform/tests/Orders.test.mq5 index 7f4d7d13c..ef687ddd1 100644 --- a/tests/OrdersTest.mq5 +++ b/Platform/tests/Orders.test.mq5 @@ -27,7 +27,7 @@ */ // Includes. -#include "../Orders.mqh" +#include "../Orders.h" /** * Implements OnInit(). diff --git a/Platform/tests/Platform.test.cpp b/Platform/tests/Platform.test.cpp new file mode 100644 index 000000000..157cab9f8 --- /dev/null +++ b/Platform/tests/Platform.test.cpp @@ -0,0 +1,35 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test C++ compilation of Platform class. + */ + +// Includes. +#include "../Platform.h" + +int main(int argc, char **argv) { + + // @todo + + return 0; +} diff --git a/Platform/tests/Platform.test.mq4 b/Platform/tests/Platform.test.mq4 new file mode 100644 index 000000000..afaa714dc --- /dev/null +++ b/Platform/tests/Platform.test.mq4 @@ -0,0 +1,28 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test functionality of Platform class. + */ + +// Includes. +#include "Platform.test.mq5" diff --git a/Platform/tests/Platform.test.mq5 b/Platform/tests/Platform.test.mq5 new file mode 100644 index 000000000..726b826b8 --- /dev/null +++ b/Platform/tests/Platform.test.mq5 @@ -0,0 +1,43 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test functionality of Platform class. + */ + +// Includes. +#include "../../Test.mqh" +#include "../Platform.h" + +/** + * Implements OnInit(). + */ +int OnInit() { + bool _result = true; + // @todo: Write some tests. + return _result && GetLastError() == 0 ? INIT_SUCCEEDED : INIT_FAILED; +} + +/** + * Implements Tick event handler. + */ +void OnTick() {} diff --git a/Platform/tests/Terminal.test.cpp b/Platform/tests/Terminal.test.cpp new file mode 100644 index 000000000..6adab5122 --- /dev/null +++ b/Platform/tests/Terminal.test.cpp @@ -0,0 +1,35 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test C++ compilation of Terminal class. + */ + +// Includes. +#include "../Terminal.h" + +int main(int argc, char **argv) { + + // @todo + + return 0; +} diff --git a/tests/TerminalTest.mq4 b/Platform/tests/Terminal.test.mq4 similarity index 97% rename from tests/TerminalTest.mq4 rename to Platform/tests/Terminal.test.mq4 index 4736c2b6a..19aaf80f5 100644 --- a/tests/TerminalTest.mq4 +++ b/Platform/tests/Terminal.test.mq4 @@ -25,4 +25,4 @@ */ // Includes. -#include "TerminalTest.mq5" +#include "Terminal.test.mq5" diff --git a/tests/TerminalTest.mq5 b/Platform/tests/Terminal.test.mq5 similarity index 95% rename from tests/TerminalTest.mq5 rename to Platform/tests/Terminal.test.mq5 index 6373e7413..07664ba39 100644 --- a/tests/TerminalTest.mq5 +++ b/Platform/tests/Terminal.test.mq5 @@ -25,9 +25,9 @@ */ // Includes. -#include "../Convert.mqh" -#include "../Terminal.mqh" -#include "../Test.mqh" +#include "../../Convert.mqh" +#include "../Terminal.h" +#include "../../Test.mqh" // Variables. Terminal *terminal; @@ -55,7 +55,7 @@ int OnInit() { assertTrueOrFail(StringLen(terminal.GetDataPath()) > 10, "Invalid data path?!"); assertTrueOrFail(StringLen(terminal.GetExpertPath()) > 10, "Invalid Expert path?!"); assertTrueOrFail(StringLen(terminal.GetTerminalPath()) > 10, "Invalid Terminal path?!"); - assertTrueOrFail(Terminal::WindowExpertName() == "TerminalTest", "Invalid EA name!"); + assertTrueOrFail(Terminal::WindowExpertName() == "Terminal.test", "Invalid EA name!"); assertTrueOrFail(terminal.GetScreenDpi() >= 0, "Invalid screen DPI?!"); assertTrueOrFail(terminal.GetBuild() >= 1000, "Invalid Terminal build?!"); assertTrueOrFail(terminal.GetCodePage() >= 0, "Invalid code page?!"); diff --git a/README.md b/README.md index a0b0cc423..1af38f7f9 100644 --- a/README.md +++ b/README.md @@ -116,20 +116,20 @@ Find below the table of conversion (replace code on left with the right one): | `iWPR()` | `Indi_WPR::iWPR()` | `Indicators/Oscillator/Indi_WPR.h` | | `RefreshRates()` | `Market::RefreshRates()` | `Market.mqh` | | `delete object` | `Object::Delete(object)` | `Storage/Object.h` | -| `GetOrderProfit()` | `Order::GetOrderProfit()` | `Order.mqh` | -| `OrderClose()` | `OrderStatic::Close()` | `Order.struct.h` | -| `OrderCloseTime()` | `OrderStatic::CloseTime()` | `Order.struct.h` | -| `OrderCommission()` | `OrderStatic::Commission()` | `Order.struct.h` | -| `OrderLots()` | `OrderStatic::Lots()` | `Order.struct.h` | -| `OrderMagicNumber()` | `OrderStatic::MagicNumber()` | `Order.struct.h` | -| `OrderOpenPrice()` | `OrderStatic::OpenPrice()` | `Order.struct.h` | -| `OrderOpenTime()` | `OrderStatic::OpenTime()` | `Order.struct.h` | -| `OrderPrint()` | `OrderStatic::Print()` | `Order.struct.h` | -| `OrderSelect()` | `OrderStatic::Select()` | `Order.struct.h` | -| `OrderStopLoss()` | `OrderStatic::StopLoss()` | `Order.struct.h` | -| `OrderSymbol()` | `OrderStatic::Symbol()` | `Order.struct.h` | -| `OrderTicket()` | `OrderStatic::Ticket()` | `Order.struct.h` | -| `OrderType()` | `OrderStatic::Type()` | `Order.struct.h` | +| `GetOrderProfit()` | `Order::GetOrderProfit()` | `Platform/Order.h` | +| `OrderClose()` | `OrderStatic::Close()` | `Platform/Order.struct.h` | +| `OrderCloseTime()` | `OrderStatic::CloseTime()` | `Platform/Order.struct.h` | +| `OrderCommission()` | `OrderStatic::Commission()` | `Platform/Order.struct.h` | +| `OrderLots()` | `OrderStatic::Lots()` | `Platform/Order.struct.h` | +| `OrderMagicNumber()` | `OrderStatic::MagicNumber()` | `Platform/Order.struct.h` | +| `OrderOpenPrice()` | `OrderStatic::OpenPrice()` | `Platform/Order.struct.h` | +| `OrderOpenTime()` | `OrderStatic::OpenTime()` | `Platform/Order.struct.h` | +| `OrderPrint()` | `OrderStatic::Print()` | `Platform/Order.struct.h` | +| `OrderSelect()` | `OrderStatic::Select()` | `Platform/Order.struct.h` | +| `OrderStopLoss()` | `OrderStatic::StopLoss()` | `Platform/Order.struct.h` | +| `OrderSymbol()` | `OrderStatic::Symbol()` | `Platform/Order.struct.h` | +| `OrderTicket()` | `OrderStatic::Ticket()` | `Platform/Order.struct.h` | +| `OrderType()` | `OrderStatic::Type()` | `Platform/Order.struct.h` | | `OrdersTotal()` | `TradeStatic::TotalActive()` | `Trade.mqh` | diff --git a/Serializer/Serializer.h b/Serializer/Serializer.h index 01b4e2c61..d0446e6d3 100644 --- a/Serializer/Serializer.h +++ b/Serializer/Serializer.h @@ -26,7 +26,7 @@ // Includes. #include "../Convert.basic.h" -#include "../Terminal.define.h" +#include "../Platform/Terminal.define.h" #include "Serializer.define.h" #include "Serializer.enum.h" #include "SerializerNode.h" diff --git a/Serializer/SerializerNode.h b/Serializer/SerializerNode.h index 5f071e87b..f56ecf207 100644 --- a/Serializer/SerializerNode.h +++ b/Serializer/SerializerNode.h @@ -26,7 +26,7 @@ // Includes. #include "../Math.extern.h" -#include "../Terminal.define.h" +#include "../Platform/Terminal.define.h" #include "SerializerNode.enum.h" #include "SerializerNodeParam.h" diff --git a/Serializer/tests/Serializable.test.cpp b/Serializer/tests/Serializable.test.cpp index 5d4c20047..072fca720 100644 --- a/Serializer/tests/Serializable.test.cpp +++ b/Serializer/tests/Serializable.test.cpp @@ -26,7 +26,7 @@ // Includes. #include "../Serializable.h" -#include "../../Platform.h" +#include "../../Platform/Platform.h" int main(int argc, char **argv) { diff --git a/Stats.mqh b/Stats.mqh index 4cf0af9f5..838209e76 100644 --- a/Stats.mqh +++ b/Stats.mqh @@ -22,7 +22,7 @@ // Includes. #include "Chart.mqh" -#include "Platform.h" +#include "Platform/Platform.h" /** * Class to collect ticks, bars and other data for statistical purposes. diff --git a/Storage/DateTime.entry.h b/Storage/DateTime.entry.h index 541958100..10c3ab060 100644 --- a/Storage/DateTime.entry.h +++ b/Storage/DateTime.entry.h @@ -32,7 +32,7 @@ // Includes. #include "DateTime.static.h" -#include "../PlatformTime.h" +#include "../Platform/PlatformTime.h" #include "../Std.h" struct DateTimeEntry : MqlDateTime { diff --git a/Storage/DateTime.h b/Storage/DateTime.h index c284d15ec..159ada1b2 100644 --- a/Storage/DateTime.h +++ b/Storage/DateTime.h @@ -44,7 +44,7 @@ struct DataParamEntry; #include "DateTime.extern.h" #include "DateTime.static.h" #include "DateTime.struct.h" -#include "../PlatformTime.h" +#include "../Platform/PlatformTime.h" #ifndef __MQL4__ // Defines global functions (for MQL4 backward compatibility). diff --git a/Storage/DateTime.static.h b/Storage/DateTime.static.h index af2170586..b7f237bb2 100644 --- a/Storage/DateTime.static.h +++ b/Storage/DateTime.static.h @@ -31,7 +31,7 @@ #endif // Includes. -#include "../PlatformTime.h" +#include "../Platform/PlatformTime.h" /* * Struct to provide static date and time methods. diff --git a/Storage/Dict/Buffer/tests/BufferFXT.test.mq5 b/Storage/Dict/Buffer/tests/BufferFXT.test.mq5 index fbf129bf0..2657efe4d 100644 --- a/Storage/Dict/Buffer/tests/BufferFXT.test.mq5 +++ b/Storage/Dict/Buffer/tests/BufferFXT.test.mq5 @@ -26,7 +26,7 @@ // Includes #include "../BufferFXT.h" -#include "../../../../Platform.h" +#include "../../../../Platform/Platform.h" #include "../../../../Test.mqh" BufferFXT *ticks; diff --git a/Storage/String.extern.h b/Storage/String.extern.h index b142b9500..2f97b16cc 100644 --- a/Storage/String.extern.h +++ b/Storage/String.extern.h @@ -35,7 +35,7 @@ #include "../Math.extern.h" #include "../Std.h" -#include "../Terminal.define.h" +#include "../Platform/Terminal.define.h" // Define external global functions. double StringToDouble(string value) { return std::stod(value); } diff --git a/Storage/tests/ItemsHistory.test.mq5 b/Storage/tests/ItemsHistory.test.mq5 index 43ac6abf3..06af30eee 100644 --- a/Storage/tests/ItemsHistory.test.mq5 +++ b/Storage/tests/ItemsHistory.test.mq5 @@ -28,7 +28,7 @@ #define INDI_CANDLE_HISTORY_SIZE 4 // Includes -#include "../../Platform.h" +#include "../../Platform/Platform.h" #include "../../Test.mqh" #include "../ItemsHistory.h" diff --git a/SummaryReport.mqh b/SummaryReport.mqh index 11ef0fb46..55fb2b0df 100644 --- a/SummaryReport.mqh +++ b/SummaryReport.mqh @@ -23,8 +23,8 @@ #include "Account/AccountMt.h" #include "Convert.mqh" #include "Indicator/IndicatorData.h" -#include "Order.struct.h" -#include "Terminal.mqh" +#include "Platform/Order.struct.h" +#include "Platform/Terminal.h" #include "Trade.mqh" /** diff --git a/SymbolInfo.extern.h b/SymbolInfo.extern.h index 0fe18dec6..24716a8fb 100644 --- a/SymbolInfo.extern.h +++ b/SymbolInfo.extern.h @@ -21,7 +21,7 @@ */ // Includes. -#include "Order.enum.h" +#include "Platform/Order.enum.h" #include "SymbolInfo.enum.h" #include "Tick/Tick.struct.h" diff --git a/SymbolInfo.struct.static.h b/SymbolInfo.struct.static.h index 5100e7f70..8018b7b1f 100644 --- a/SymbolInfo.struct.static.h +++ b/SymbolInfo.struct.static.h @@ -25,9 +25,9 @@ #pragma once #endif -#include "MQL5.mqh" -#include "Order.enum.h" -#include "Platform.extern.h" +#include "Platform/MQL5.mqh" +#include "Platform/Order.enum.h" +#include "Platform/Platform.extern.h" #include "Std.h" #include "SymbolInfo.enum.h" #include "SymbolInfo.extern.h" diff --git a/Task/Task.h b/Task/Task.h index ab36080f6..21bfa98a4 100644 --- a/Task/Task.h +++ b/Task/Task.h @@ -32,7 +32,7 @@ // Includes. #include "../Storage/Dict/DictStruct.h" -#include "../Terminal.define.h" +#include "../Platform/Terminal.define.h" #include "Task.enum.h" #include "Task.struct.h" #include "TaskAction.h" diff --git a/Task/Task.struct.h b/Task/Task.struct.h index db3a202cb..226c306e1 100644 --- a/Task/Task.struct.h +++ b/Task/Task.struct.h @@ -31,7 +31,7 @@ #endif // Includes. -#include "../Terminal.define.h" +#include "../Platform/Terminal.define.h" #include "Task.enum.h" #include "TaskAction.struct.h" #include "TaskCondition.struct.h" diff --git a/Task/TaskAction.h b/Task/TaskAction.h index b0ecba039..5c2b5c2ec 100644 --- a/Task/TaskAction.h +++ b/Task/TaskAction.h @@ -37,7 +37,7 @@ // Includes. #include "../Storage/DateTime.h" #include "../Std.h" -#include "../Terminal.define.h" +#include "../Platform/Terminal.define.h" #include "TaskAction.enum.h" #include "TaskAction.struct.h" #include "TaskActionBase.h" diff --git a/Task/TaskAction.struct.h b/Task/TaskAction.struct.h index d6d9d2b85..aac6c3935 100644 --- a/Task/TaskAction.struct.h +++ b/Task/TaskAction.struct.h @@ -33,7 +33,7 @@ #include "../Storage/Data.struct.h" #include "../Serializer/Serializer.define.h" #include "../Std.h" -#include "../Terminal.define.h" +#include "../Platform/Terminal.define.h" #include "Task.enum.h" // Forward declarations. diff --git a/Task/TaskCondition.h b/Task/TaskCondition.h index 8a798aa1e..c0a3b4fdf 100644 --- a/Task/TaskCondition.h +++ b/Task/TaskCondition.h @@ -37,7 +37,7 @@ // Includes. #include "../Storage/DateTime.h" #include "../Std.h" -#include "../Terminal.define.h" +#include "../Platform/Terminal.define.h" #include "TaskCondition.enum.h" #include "TaskCondition.struct.h" #include "TaskConditionBase.h" diff --git a/Task/TaskCondition.struct.h b/Task/TaskCondition.struct.h index 9dd0ddd0c..52547f291 100644 --- a/Task/TaskCondition.struct.h +++ b/Task/TaskCondition.struct.h @@ -34,7 +34,7 @@ #include "../Serializer/Serializer.define.h" #include "../Serializer/Serializer.enum.h" #include "../Std.h" -#include "../Terminal.define.h" +#include "../Platform/Terminal.define.h" #include "Task.enum.h" // Forward declarations. diff --git a/Task/TaskGetter.h b/Task/TaskGetter.h index 0b632899f..1824dac80 100644 --- a/Task/TaskGetter.h +++ b/Task/TaskGetter.h @@ -37,7 +37,7 @@ // Includes. //#include "TaskGetter.enum.h" #include "../Storage/DateTime.h" -#include "../Terminal.define.h" +#include "../Platform/Terminal.define.h" #include "TaskGetter.struct.h" #include "TaskGetterBase.h" diff --git a/Task/TaskGetter.struct.h b/Task/TaskGetter.struct.h index 7a3c19e61..6e23d1a9d 100644 --- a/Task/TaskGetter.struct.h +++ b/Task/TaskGetter.struct.h @@ -33,7 +33,7 @@ #include "../Storage/Data.struct.h" #include "../Serializer/Serializer.define.h" #include "../Std.h" -#include "../Terminal.define.h" +#include "../Platform/Terminal.define.h" #include "Task.enum.h" /* Entry for TaskGetter class. */ diff --git a/Tester.mqh b/Tester.mqh index e2984c2b2..b796265aa 100644 --- a/Tester.mqh +++ b/Tester.mqh @@ -22,7 +22,7 @@ // Includes. #include "SymbolInfo.mqh" -#include "Terminal.mqh" +#include "Platform/Terminal.h" /** * Class to provide functions to work with the strategy tester. diff --git a/Tick/tests/TickManager.test.cpp b/Tick/tests/TickManager.test.cpp index e0872beaa..dd57455ec 100644 --- a/Tick/tests/TickManager.test.cpp +++ b/Tick/tests/TickManager.test.cpp @@ -26,6 +26,6 @@ // Includes. #include "../TickManager.h" -#include "../../Platform.h" +#include "../../Platform/Platform.h" int main(int argc, char **argv) {} diff --git a/Trade.mqh b/Trade.mqh index d1a2d6ebf..b4c631526 100644 --- a/Trade.mqh +++ b/Trade.mqh @@ -36,8 +36,8 @@ class Trade; #include "Indicator/IndicatorData.h" #include "Math.h" #include "Storage/Object.h" -#include "Order.mqh" -#include "OrderQuery.h" +#include "Platform/Order.h" +#include "Platform/OrderQuery.h" #include "Task/TaskManager.h" #include "Task/Taskable.h" #include "Trade.enum.h" diff --git a/Trade/tests/TradeSignal.test.cpp b/Trade/tests/TradeSignal.test.cpp index 2da19c524..4d687cd8d 100644 --- a/Trade/tests/TradeSignal.test.cpp +++ b/Trade/tests/TradeSignal.test.cpp @@ -26,7 +26,7 @@ // Includes. #include "../TradeSignal.h" -#include "../../Platform.h" +#include "../../Platform/Platform.h" int main(int argc, char **argv) { diff --git a/Trade/tests/TradeSignalManager.test.cpp b/Trade/tests/TradeSignalManager.test.cpp index f37ad93cd..90576a2f7 100644 --- a/Trade/tests/TradeSignalManager.test.cpp +++ b/Trade/tests/TradeSignalManager.test.cpp @@ -26,7 +26,7 @@ // Includes. #include "../TradeSignalManager.h" -#include "../../Platform.h" +#include "../../Platform/Platform.h" int main(int argc, char **argv) { diff --git a/Web/tests/Web.test.mq5 b/Web/tests/Web.test.mq5 index cfbd7ff67..eeb53b324 100644 --- a/Web/tests/Web.test.mq5 +++ b/Web/tests/Web.test.mq5 @@ -26,7 +26,7 @@ // Includes. #include "../../Convert.mqh" -#include "../../Terminal.mqh" +#include "../../Platform/Terminal.h" #include "../../Test.mqh" #include "../Web.h" diff --git a/tests/Chart.test.cpp b/tests/Chart.test.cpp index 8af455686..3946558f2 100644 --- a/tests/Chart.test.cpp +++ b/tests/Chart.test.cpp @@ -26,7 +26,7 @@ // Includes. #include "../Chart.mqh" -#include "../Platform.h" +#include "../Platform/Platform.h" int main(int argc, char **argv) { diff --git a/tests/CompileTest.mq5 b/tests/CompileTest.mq5 index 2b79b1fa1..2f11c6f4a 100644 --- a/tests/CompileTest.mq5 +++ b/tests/CompileTest.mq5 @@ -65,15 +65,14 @@ struct IndicatorParams; #include "../MD5.mqh" #include "../Storage/IValueStorage.h" #include "../Task/TaskCondition.h" -//#include "../MQL5.mqh" // @removeme #include "../Mail.mqh" #include "../Market.mqh" #include "../Math.h" #include "../Matrix.mqh" #include "../MiniMatrix.h" #include "../Storage/Object.h" -#include "../Order.mqh" -#include "../Orders.mqh" +#include "../Platform/Order.h" +#include "../Platform/Orders.h" #include "../Pattern.mqh" // #include "../Profiler.mqh" #include "../Storage/Redis.h" @@ -98,7 +97,7 @@ struct IndicatorParams; #include "../Task/TaskObject.h" #include "../Task/TaskSetter.h" #include "../Task/Taskable.h" -#include "../Terminal.mqh" +#include "../Platform/Terminal.h" // #include "../Tester.mqh" // @removeme #include "../Storage/ValueStorage.h" // #include "../Tests.mqh" // @removeme diff --git a/tests/IndicatorsTest.mq5 b/tests/IndicatorsTest.mq5 index 0e1581cb3..4453c8194 100644 --- a/tests/IndicatorsTest.mq5 +++ b/tests/IndicatorsTest.mq5 @@ -42,7 +42,7 @@ struct DataParamEntry; #include "../Indicators/Bitwise/includes.h" #include "../Indicators/Tick/includes.h" #include "../Indicators/includes.h" -#include "../Platform.h" +#include "../Platform/Platform.h" #include "../Serializer/SerializerConverter.h" #include "../Serializer/SerializerJson.h" #include "../Std.h" diff --git a/tests/TradeTest.mq5 b/tests/TradeTest.mq5 index 6859f757f..5c34b88a3 100644 --- a/tests/TradeTest.mq5 +++ b/tests/TradeTest.mq5 @@ -33,7 +33,7 @@ struct DataParamEntry; // Includes. #include "../ChartMt.h" #include "../Indicators/Tick/Indi_TickMt.h" -#include "../Platform.h" +#include "../Platform/Platform.h" #include "../Test.mqh" #include "../Trade.mqh" From 2aa2b39e7c355c957d439cf407c55b5525bbf11e Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 18 Jun 2023 14:10:19 +0100 Subject: [PATCH 051/109] Moves Storage related info from the main README --- README.md | 93 ------------------------------------------ Storage/Dict/README.md | 20 +++++++++ Storage/README.md | 46 +++++++++++++++++++++ 3 files changed, 66 insertions(+), 93 deletions(-) create mode 100644 Storage/Dict/README.md create mode 100644 Storage/README.md diff --git a/README.md b/README.md index 1af38f7f9..a79290557 100644 --- a/README.md +++ b/README.md @@ -25,12 +25,7 @@ The code is compatible with MQL4, MQL5 and C++ programming languages. - [Conversion](#conversion) - [MQL4 to MQL5 conversion](#mql4-to-mql5-conversion) - [Classes](#classes) - - [`Account` class](#account-class) - - [Example 1 - Managing account (dynamic calls)](#example-1---managing-account-dynamic-calls) - - [Example 2 - Managing account (static calls)](#example-2---managing-account-static-calls) - [`Collection` class](#collection-class) - - [`Dict` class](#dict-class) - - [Example 1 - Storing string-int data structures](#example-1---storing-string-int-data-structures) - [`Mail` class](#mail-class) - [Example 1 - Send e-mail on trade execution](#example-1---send-e-mail-on-trade-execution) - [`Indicator` class](#indicator-class) @@ -156,94 +151,6 @@ Here are the special [predefined variables](https://docs.mql4.com/predefined) co ## Classes -### `Account` class - -The class for managing the current trading account. - -#### Example 1 - Managing account (dynamic calls) - - Account *acc = new Account(); - double _balance = acc.GetBalance(); - double _credit = acc.GetCredit(); - double _equity = acc.GetEquity(); - double _margin_free = acc.GetMarginFree(); - double _margin_used = acc.GetMarginUsed(); - if (acc.IsExpertEnabled() && acc.IsTradeAllowed()) { - // Some trade code. - } - delete acc; - -#### Example 2 - Managing account (static calls) - - double _balance = Account::AccountBalance(); - double _credit = Account::AccountCredit(); - double _equity = Account::AccountEquity(); - double _margin_free = Account::AccountFreeMargin(); - double _margin_used = Account::AccountMargin(); - if (Account::IsExpertEnabled() && Account::IsTradeAllowed()) { - // Some trade code. - } - -### `Collection` class - -This class is for storing various type of objects. Here is the example usage: - - // Define custom classes of Object type. - class Stack : Object { - public: - virtual string GetName() = NULL; - }; - class Foo : Stack { - public: - string GetName() { return "Foo"; }; - double Weight() { return 0; }; - }; - class Bar : Stack { - public: - string GetName() { return "Bar"; }; - double Weight() { return 1; }; - }; - class Baz : Stack { - public: - string GetName() { return "Baz"; }; - double Weight() { return 2; }; - }; - - int OnInit() { - // Define and add items. - Collection *stack = new Collection(); - stack.Add(new Foo); - stack.Add(new Bar); - stack.Add(new Baz); - // Print the lowest and the highest items. - Print("Lowest: ", ((Stack *)stack.GetLowest()).GetName()); - Print("Highest: ", ((Stack *)stack.GetHighest()).GetName()); - // Print all the items. - for (uint i = 0; i < stack.GetSize(); i++) { - Print(i, ": ", ((Stack *)stack.GetByIndex(i)).GetName()); - } - // Clean up. - Object::Delete(stack); - return (INIT_SUCCEEDED); - } - -### `Dict` class - -Use this class to store the values in form of a collective attribute–value pairs, -in similar way as [associative arrays](https://en.wikipedia.org/wiki/Associative_array) -with a [hash table](https://en.wikipedia.org/wiki/Hash_table) work. - -#### Example 1 - Storing string-int data structures - -Example of storing key-value data with string as a key: - - Dict data1; - data1.Set("a", 1); - data1.Set("b", 2); - data1.Set("c", 3); - data1.Unset("c"); - Print(data1.GetByKey("a")); - ### `Mail` class The purpose of `Mail` class is to provide common functionality for managing e-mails. diff --git a/Storage/Dict/README.md b/Storage/Dict/README.md new file mode 100644 index 000000000..247f7218b --- /dev/null +++ b/Storage/Dict/README.md @@ -0,0 +1,20 @@ +# Dict + +## Classes + +### `Dict` class + +Use this class to store the values in form of a collective attribute–value pairs, +in similar way as [associative arrays](https://en.wikipedia.org/wiki/Associative_array) +with a [hash table](https://en.wikipedia.org/wiki/Hash_table) work. + +#### Example 1 - Storing string-int data structures + +Example of storing key-value data with string as a key: + + Dict data1; + data1.Set("a", 1); + data1.Set("b", 2); + data1.Set("c", 3); + data1.Unset("c"); + Print(data1.GetByKey("a")); diff --git a/Storage/README.md b/Storage/README.md new file mode 100644 index 000000000..5d2cbb9e8 --- /dev/null +++ b/Storage/README.md @@ -0,0 +1,46 @@ +# Storage + +## Classes + +### `Collection` class + +This class is for storing various type of objects. Here is the example usage: + + // Define custom classes of Object type. + class Stack : Object { + public: + virtual string GetName() = NULL; + }; + class Foo : Stack { + public: + string GetName() { return "Foo"; }; + double Weight() { return 0; }; + }; + class Bar : Stack { + public: + string GetName() { return "Bar"; }; + double Weight() { return 1; }; + }; + class Baz : Stack { + public: + string GetName() { return "Baz"; }; + double Weight() { return 2; }; + }; + + int OnInit() { + // Define and add items. + Collection *stack = new Collection(); + stack.Add(new Foo); + stack.Add(new Bar); + stack.Add(new Baz); + // Print the lowest and the highest items. + Print("Lowest: ", ((Stack *)stack.GetLowest()).GetName()); + Print("Highest: ", ((Stack *)stack.GetHighest()).GetName()); + // Print all the items. + for (uint i = 0; i < stack.GetSize(); i++) { + Print(i, ": ", ((Stack *)stack.GetByIndex(i)).GetName()); + } + // Clean up. + Object::Delete(stack); + return (INIT_SUCCEEDED); + } From bc3bbcc2fe8060233bcbcacbfe856c9b373a26e8 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 18 Jun 2023 14:33:10 +0100 Subject: [PATCH 052/109] Adds README for Exchange class --- Exchange/README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Exchange/README.md diff --git a/Exchange/README.md b/Exchange/README.md new file mode 100644 index 000000000..31411ab33 --- /dev/null +++ b/Exchange/README.md @@ -0,0 +1,12 @@ +# Exchange + +## Classes + +```mermaid +classDiagram + Dynamic <|-- Exchange + Exchange: Account[] + Exchange: Symbol[] + Exchange: Trade[] + Exchange: eparams +``` From a53a3481571b90e6bbc499764f9c4d8cb86aecb4 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 18 Jun 2023 14:34:14 +0100 Subject: [PATCH 053/109] Moves Account related classes under Exchange/ --- ...-account.yml => test-exchange-account.yml} | 14 +++--- Convert.mqh | 4 +- .../Account}/Account.define.h | 0 {Account => Exchange/Account}/Account.enum.h | 0 .../Account}/Account.extern.h | 2 +- {Account => Exchange/Account}/Account.h | 4 +- .../Account}/Account.struct.h | 7 +-- {Account => Exchange/Account}/AccountBase.h | 2 +- .../Account}/AccountBase.struct.h | 9 ++-- {Account => Exchange/Account}/AccountForex.h | 2 +- .../Account}/AccountForex.struct.h | 6 +-- {Account => Exchange/Account}/AccountMt.h | 22 ++++----- Exchange/Account/README.md | 47 +++++++++++++++++++ .../Account}/tests/Account.test.cpp | 2 +- .../Account}/tests/Account.test.mq4 | 0 .../Account}/tests/Account.test.mq5 | 2 +- Exchange/Account/tests/AccountBase.test.cpp | 36 ++++++++++++++ .../Account}/tests/AccountForex.test.cpp | 2 +- .../Account}/tests/AccountForex.test.mq4 | 0 .../Account}/tests/AccountForex.test.mq5 | 2 +- .../Account}/tests/AccountMt.test.cpp | 2 +- .../Account}/tests/AccountMt.test.mq4 | 0 .../Account}/tests/AccountMt.test.mq5 | 2 +- {Account => Exchange/Account}/tests/Makefile | 0 Exchange/Exchange.h | 2 +- Mail.mqh | 2 +- Platform/Orders.h | 2 +- Platform/Platform.extern.h | 2 +- Storage/Dict/Buffer/BufferFXT.h | 2 +- SummaryReport.mqh | 2 +- Trade.mqh | 2 +- tests/CompileTest.mq5 | 2 +- tests/EATest.mq5 | 2 +- 33 files changed, 135 insertions(+), 50 deletions(-) rename .github/workflows/{test-account.yml => test-exchange-account.yml} (81%) rename {Account => Exchange/Account}/Account.define.h (100%) rename {Account => Exchange/Account}/Account.enum.h (100%) rename {Account => Exchange/Account}/Account.extern.h (96%) rename {Account => Exchange/Account}/Account.h (94%) rename {Account => Exchange/Account}/Account.struct.h (95%) rename {Account => Exchange/Account}/AccountBase.h (98%) rename {Account => Exchange/Account}/AccountBase.struct.h (92%) rename {Account => Exchange/Account}/AccountForex.h (97%) rename {Account => Exchange/Account}/AccountForex.struct.h (96%) rename {Account => Exchange/Account}/AccountMt.h (98%) create mode 100644 Exchange/Account/README.md rename {Account => Exchange/Account}/tests/Account.test.cpp (96%) rename {Account => Exchange/Account}/tests/Account.test.mq4 (100%) rename {Account => Exchange/Account}/tests/Account.test.mq5 (97%) create mode 100644 Exchange/Account/tests/AccountBase.test.cpp rename {Account => Exchange/Account}/tests/AccountForex.test.cpp (96%) rename {Account => Exchange/Account}/tests/AccountForex.test.mq4 (100%) rename {Account => Exchange/Account}/tests/AccountForex.test.mq5 (97%) rename {Account => Exchange/Account}/tests/AccountMt.test.cpp (96%) rename {Account => Exchange/Account}/tests/AccountMt.test.mq4 (100%) rename {Account => Exchange/Account}/tests/AccountMt.test.mq5 (99%) rename {Account => Exchange/Account}/tests/Makefile (100%) diff --git a/.github/workflows/test-account.yml b/.github/workflows/test-exchange-account.yml similarity index 81% rename from .github/workflows/test-account.yml rename to .github/workflows/test-exchange-account.yml index 2e3ae233d..04c6680d8 100644 --- a/.github/workflows/test-account.yml +++ b/.github/workflows/test-exchange-account.yml @@ -1,16 +1,16 @@ --- -name: Test Account +name: Test Exchange/Account # yamllint disable-line rule:truthy on: pull_request: paths: - - 'Account/**' - - '.github/workflows/test-account.yml' + - 'Exchange/Account/**' + - '.github/workflows/test-exchange/account.yml' push: paths: - - 'Account/**' - - '.github/workflows/test-account.yml' + - 'Exchange/Account/**' + - '.github/workflows/test-exchange/account.yml' jobs: @@ -22,7 +22,7 @@ jobs: uses: fx31337/mql-compile-action@master with: init-platform: true - path: 'Account/tests' + path: 'Exchange/Account/tests' verbose: true - name: Print compiled files run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' @@ -42,7 +42,7 @@ jobs: defaults: run: shell: bash - working-directory: Account/tests + working-directory: Exchange/Account/tests needs: Compile runs-on: ubuntu-latest strategy: diff --git a/Convert.mqh b/Convert.mqh index 67870af64..4ac7b675f 100644 --- a/Convert.mqh +++ b/Convert.mqh @@ -26,8 +26,8 @@ #endif // Includes. -#include "Account/Account.enum.h" -#include "Account/Account.extern.h" +#include "Exchange/Account/Account.enum.h" +#include "Exchange/Account/Account.extern.h" #include "Storage/Array.h" #include "Convert.extern.h" #include "Storage/DateTime.extern.h" diff --git a/Account/Account.define.h b/Exchange/Account/Account.define.h similarity index 100% rename from Account/Account.define.h rename to Exchange/Account/Account.define.h diff --git a/Account/Account.enum.h b/Exchange/Account/Account.enum.h similarity index 100% rename from Account/Account.enum.h rename to Exchange/Account/Account.enum.h diff --git a/Account/Account.extern.h b/Exchange/Account/Account.extern.h similarity index 96% rename from Account/Account.extern.h rename to Exchange/Account/Account.extern.h index 293db4e3d..17d5a39b8 100644 --- a/Account/Account.extern.h +++ b/Exchange/Account/Account.extern.h @@ -21,7 +21,7 @@ */ // Includes. -#include "../Storage/String.extern.h" +#include "../../Storage/String.extern.h" #include "Account.enum.h" // Define external global functions. diff --git a/Account/Account.h b/Exchange/Account/Account.h similarity index 94% rename from Account/Account.h rename to Exchange/Account/Account.h index ecba76817..95222e345 100644 --- a/Account/Account.h +++ b/Exchange/Account/Account.h @@ -25,8 +25,8 @@ #define ACCOUNT_H // Includes. -#include "../Storage/Dict/Buffer/BufferStruct.h" -#include "../Serializer/Serializer.h" +#include "../../Storage/Dict/Buffer/BufferStruct.h" +#include "../../Serializer/Serializer.h" #include "AccountBase.h" /** diff --git a/Account/Account.struct.h b/Exchange/Account/Account.struct.h similarity index 95% rename from Account/Account.struct.h rename to Exchange/Account/Account.struct.h index df094d1b5..eafb6ce62 100644 --- a/Account/Account.struct.h +++ b/Exchange/Account/Account.struct.h @@ -28,15 +28,16 @@ #ifndef __MQL__ // Allows the preprocessor to include a header file when it is needed. #pragma once -#include "../Serializer/Serializer.enum.h" #endif // Forward class declaration. class Serializer; // Includes. -#include "../Serializer/Serializer.h" -#include "../Platform/Terminal.define.h" +#include "Account.enum.h" +#include "../../Serializer/Serializer.h" +#include "../../Serializer/Serializer.enum.h" +#include "../../Platform/Terminal.define.h" // Struct for account entries. struct AccountEntry { diff --git a/Account/AccountBase.h b/Exchange/Account/AccountBase.h similarity index 98% rename from Account/AccountBase.h rename to Exchange/Account/AccountBase.h index d74fd72a3..7861461ca 100644 --- a/Account/AccountBase.h +++ b/Exchange/Account/AccountBase.h @@ -25,7 +25,7 @@ #define ACCOUNTBASE_H // Includes. -#include "../Refs.mqh" +#include "../../Refs.mqh" #include "AccountBase.struct.h" /** diff --git a/Account/AccountBase.struct.h b/Exchange/Account/AccountBase.struct.h similarity index 92% rename from Account/AccountBase.struct.h rename to Exchange/Account/AccountBase.struct.h index 6d525a78a..450d970cf 100644 --- a/Account/AccountBase.struct.h +++ b/Exchange/Account/AccountBase.struct.h @@ -28,16 +28,17 @@ #ifndef __MQL__ // Allows the preprocessor to include a header file when it is needed. #pragma once -#include "../Serializer/Serializer.enum.h" #endif // Forward class declaration. class Serializer; // Includes. -#include "../Serializer/Serializer.h" -#include "../Std.h" -#include "../Platform/Terminal.define.h" +#include "Account.enum.h" +#include "../../Serializer/Serializer.h" +#include "../../Serializer/Serializer.enum.h" +#include "../../Std.h" +#include "../../Platform/Terminal.define.h" // Struct for account entries. struct AccountBaseEntry { diff --git a/Account/AccountForex.h b/Exchange/Account/AccountForex.h similarity index 97% rename from Account/AccountForex.h rename to Exchange/Account/AccountForex.h index 03b3be121..6df312f80 100644 --- a/Account/AccountForex.h +++ b/Exchange/Account/AccountForex.h @@ -25,7 +25,7 @@ #define ACCOUNTFOREX_H // Includes. -#include "../Serializer/Serializer.h" +#include "../../Serializer/Serializer.h" #include "Account.h" #include "AccountForex.struct.h" diff --git a/Account/AccountForex.struct.h b/Exchange/Account/AccountForex.struct.h similarity index 96% rename from Account/AccountForex.struct.h rename to Exchange/Account/AccountForex.struct.h index 3e67d0920..af59483a0 100644 --- a/Account/AccountForex.struct.h +++ b/Exchange/Account/AccountForex.struct.h @@ -28,15 +28,15 @@ #ifndef __MQL__ // Allows the preprocessor to include a header file when it is needed. #pragma once -#include "../Serializer/Serializer.enum.h" #endif // Forward class declaration. class Serializer; // Includes. -#include "../Serializer/Serializer.h" -#include "../Platform/Terminal.define.h" +#include "../../Serializer/Serializer.h" +#include "../../Serializer/Serializer.enum.h" +#include "../../Platform/Terminal.define.h" // Struct for account entries. struct AccountForexEntry : public AccountBaseEntry { diff --git a/Account/AccountMt.h b/Exchange/Account/AccountMt.h similarity index 98% rename from Account/AccountMt.h rename to Exchange/Account/AccountMt.h index 6f463f0c5..a6e4b2440 100644 --- a/Account/AccountMt.h +++ b/Exchange/Account/AccountMt.h @@ -28,17 +28,17 @@ class AccountMt; // Includes. -#include "../Storage/Array.h" -#include "../Storage/Dict/Buffer/BufferStruct.h" -#include "../Convert.mqh" -#include "../Storage/Data.struct.h" -#include "../Indicator/Indicator.struct.h" -#include "../Platform/Order.struct.h" -#include "../Platform/Orders.h" -#include "../Serializer/Serializer.h" -#include "../SymbolInfo.mqh" -#include "../Task/TaskCondition.enum.h" -#include "../Trade.struct.h" +#include "../../Storage/Array.h" +#include "../../Storage/Dict/Buffer/BufferStruct.h" +#include "../../Convert.mqh" +#include "../../Storage/Data.struct.h" +#include "../../Indicator/Indicator.struct.h" +#include "../../Platform/Order.struct.h" +#include "../../Platform/Orders.h" +#include "../../Serializer/Serializer.h" +#include "../../SymbolInfo.mqh" +#include "../../Task/TaskCondition.enum.h" +#include "../../Trade.struct.h" #include "Account.define.h" #include "Account.enum.h" #include "Account.extern.h" diff --git a/Exchange/Account/README.md b/Exchange/Account/README.md new file mode 100644 index 000000000..a0d04639a --- /dev/null +++ b/Exchange/Account/README.md @@ -0,0 +1,47 @@ +# Account + +## Classes + +```mermaid +classDiagram + AccountBase <|-- Account + Dynamic <|-- AccountBase + Account <|-- AccountForex + AccountMt <|-- _ + Account : +state + Account : +entries + AccountMt: +entries + AccountMt: GetEntry() +``` + +### `Account` class + +The class for managing the current trading account. + +#### Example 1 - Managing account (dynamic calls) + +```cpp +Account *acc = new Account(); +double _balance = acc.GetBalance(); +double _credit = acc.GetCredit(); +double _equity = acc.GetEquity(); +double _margin_free = acc.GetMarginFree(); +double _margin_used = acc.GetMarginUsed(); +if (acc.IsExpertEnabled() && acc.IsTradeAllowed()) { + // Some trade code. +} +delete acc; +``` + +#### Example 2 - Managing account (static calls) + +```cpp +double _balance = Account::AccountBalance(); +double _credit = Account::AccountCredit(); +double _equity = Account::AccountEquity(); +double _margin_free = Account::AccountFreeMargin(); +double _margin_used = Account::AccountMargin(); +if (Account::IsExpertEnabled() && Account::IsTradeAllowed()) { + // Some trade code. +} +``` diff --git a/Account/tests/Account.test.cpp b/Exchange/Account/tests/Account.test.cpp similarity index 96% rename from Account/tests/Account.test.cpp rename to Exchange/Account/tests/Account.test.cpp index bcc67bf48..964cb84e1 100644 --- a/Account/tests/Account.test.cpp +++ b/Exchange/Account/tests/Account.test.cpp @@ -26,7 +26,7 @@ // Includes. #include "../Account.h" -#include "../../Platform/Platform.h" +#include "../../../Platform/Platform.h" int main(int argc, char **argv) { diff --git a/Account/tests/Account.test.mq4 b/Exchange/Account/tests/Account.test.mq4 similarity index 100% rename from Account/tests/Account.test.mq4 rename to Exchange/Account/tests/Account.test.mq4 diff --git a/Account/tests/Account.test.mq5 b/Exchange/Account/tests/Account.test.mq5 similarity index 97% rename from Account/tests/Account.test.mq5 rename to Exchange/Account/tests/Account.test.mq5 index a52e8c076..d03fd578f 100644 --- a/Account/tests/Account.test.mq5 +++ b/Exchange/Account/tests/Account.test.mq5 @@ -25,7 +25,7 @@ */ // Includes. -#include "../../Test.mqh" +#include "../../../Test.mqh" #include "../Account.h" /** diff --git a/Exchange/Account/tests/AccountBase.test.cpp b/Exchange/Account/tests/AccountBase.test.cpp new file mode 100644 index 000000000..2dbf0ea84 --- /dev/null +++ b/Exchange/Account/tests/AccountBase.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test C++ compilation of AccountBase class. + */ + +// Includes. +#include "../AccountBase.h" +#include "../../../Platform/Platform.h" + +int main(int argc, char **argv) { + + // @todo + + return 0; +} diff --git a/Account/tests/AccountForex.test.cpp b/Exchange/Account/tests/AccountForex.test.cpp similarity index 96% rename from Account/tests/AccountForex.test.cpp rename to Exchange/Account/tests/AccountForex.test.cpp index d22162b80..308734d8f 100644 --- a/Account/tests/AccountForex.test.cpp +++ b/Exchange/Account/tests/AccountForex.test.cpp @@ -26,7 +26,7 @@ // Includes. #include "../AccountForex.h" -#include "../../Platform/Platform.h" +#include "../../../Platform/Platform.h" int main(int argc, char **argv) { diff --git a/Account/tests/AccountForex.test.mq4 b/Exchange/Account/tests/AccountForex.test.mq4 similarity index 100% rename from Account/tests/AccountForex.test.mq4 rename to Exchange/Account/tests/AccountForex.test.mq4 diff --git a/Account/tests/AccountForex.test.mq5 b/Exchange/Account/tests/AccountForex.test.mq5 similarity index 97% rename from Account/tests/AccountForex.test.mq5 rename to Exchange/Account/tests/AccountForex.test.mq5 index fb10957ea..d1d5c71fa 100644 --- a/Account/tests/AccountForex.test.mq5 +++ b/Exchange/Account/tests/AccountForex.test.mq5 @@ -25,7 +25,7 @@ */ // Includes. -#include "../../Test.mqh" +#include "../../../Test.mqh" #include "../AccountForex.h" /** diff --git a/Account/tests/AccountMt.test.cpp b/Exchange/Account/tests/AccountMt.test.cpp similarity index 96% rename from Account/tests/AccountMt.test.cpp rename to Exchange/Account/tests/AccountMt.test.cpp index d0ed5ea42..ac3946948 100644 --- a/Account/tests/AccountMt.test.cpp +++ b/Exchange/Account/tests/AccountMt.test.cpp @@ -26,7 +26,7 @@ // Includes. #include "../AccountMt.h" -#include "../../Platform/Platform.h" +#include "../../../Platform/Platform.h" int main(int argc, char **argv) { diff --git a/Account/tests/AccountMt.test.mq4 b/Exchange/Account/tests/AccountMt.test.mq4 similarity index 100% rename from Account/tests/AccountMt.test.mq4 rename to Exchange/Account/tests/AccountMt.test.mq4 diff --git a/Account/tests/AccountMt.test.mq5 b/Exchange/Account/tests/AccountMt.test.mq5 similarity index 99% rename from Account/tests/AccountMt.test.mq5 rename to Exchange/Account/tests/AccountMt.test.mq5 index 2bc637fb5..156c03a93 100644 --- a/Account/tests/AccountMt.test.mq5 +++ b/Exchange/Account/tests/AccountMt.test.mq5 @@ -25,7 +25,7 @@ */ // Includes. -#include "../../Test.mqh" +#include "../../../Test.mqh" #include "../AccountMt.h" /** diff --git a/Account/tests/Makefile b/Exchange/Account/tests/Makefile similarity index 100% rename from Account/tests/Makefile rename to Exchange/Account/tests/Makefile diff --git a/Exchange/Exchange.h b/Exchange/Exchange.h index e20dc7a00..6468da7f3 100644 --- a/Exchange/Exchange.h +++ b/Exchange/Exchange.h @@ -27,7 +27,7 @@ #define EXCHANGE_H // Includes. -#include "../Account/Account.h" +#include "Account/Account.h" #include "../Storage/Dict/DictObject.h" #include "../SymbolInfo.mqh" #include "../Trade.mqh" diff --git a/Mail.mqh b/Mail.mqh index 1b30d4b1c..fdab3a93b 100644 --- a/Mail.mqh +++ b/Mail.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "Account/AccountMt.h" +#include "Exchange/Account/AccountMt.h" #include "Convert.mqh" #include "Platform/Order.h" diff --git a/Platform/Orders.h b/Platform/Orders.h index 6e9a7f3bf..a2150aaa8 100644 --- a/Platform/Orders.h +++ b/Platform/Orders.h @@ -24,7 +24,7 @@ class Orders; // Includes. -#include "../Account/Account.h" +#include "../Exchange/Account/Account.h" #include "../Chart.struct.static.h" #include "../Log.mqh" #include "../Math.h" diff --git a/Platform/Platform.extern.h b/Platform/Platform.extern.h index 4a9b69305..941f617ac 100644 --- a/Platform/Platform.extern.h +++ b/Platform/Platform.extern.h @@ -25,7 +25,7 @@ #pragma once // Includes. -#include "../Account/Account.enum.h" +#include "../Exchange/Account/Account.enum.h" #include "../Storage/Data.define.h" #include "Deal.enum.h" #include "../Storage/Object.extern.h" diff --git a/Storage/Dict/Buffer/BufferFXT.h b/Storage/Dict/Buffer/BufferFXT.h index 76b5ffc7c..40ae28ebf 100644 --- a/Storage/Dict/Buffer/BufferFXT.h +++ b/Storage/Dict/Buffer/BufferFXT.h @@ -24,7 +24,7 @@ #define BUFFER_FXT_H // Includes. -#include "../../../Account/AccountMt.h" +#include "../../../Exchange/Account/AccountMt.h" #include "../DictStruct.h" #include "../../../Indicator/IndicatorData.h" #include "../../../Storage/Object.h" diff --git a/SummaryReport.mqh b/SummaryReport.mqh index 55fb2b0df..3edfb96b4 100644 --- a/SummaryReport.mqh +++ b/SummaryReport.mqh @@ -20,7 +20,7 @@ * */ -#include "Account/AccountMt.h" +#include "Exchange/Account/AccountMt.h" #include "Convert.mqh" #include "Indicator/IndicatorData.h" #include "Platform/Order.struct.h" diff --git a/Trade.mqh b/Trade.mqh index b4c631526..6471a0810 100644 --- a/Trade.mqh +++ b/Trade.mqh @@ -30,7 +30,7 @@ class Trade; #define TRADE_MQH // Includes. -#include "Account/AccountMt.h" +#include "Exchange/Account/AccountMt.h" #include "Convert.mqh" #include "Storage/Dict/DictStruct.h" #include "Indicator/IndicatorData.h" diff --git a/tests/CompileTest.mq5 b/tests/CompileTest.mq5 index 2f11c6f4a..6070ef55f 100644 --- a/tests/CompileTest.mq5 +++ b/tests/CompileTest.mq5 @@ -39,7 +39,7 @@ struct IndicatorParams; // Includes. -#include "../Account/AccountMt.h" +#include "../Exchange/Account/AccountMt.h" #include "../Storage/Array.h" #include "../Task/TaskAction.h" #include "../Storage/Dict/Buffer/Buffer.h" diff --git a/tests/EATest.mq5 b/tests/EATest.mq5 index 5f97929b5..eec908e1b 100644 --- a/tests/EATest.mq5 +++ b/tests/EATest.mq5 @@ -28,7 +28,7 @@ struct DataParamEntry; // Includes. -#include "../Account/Account.struct.h" +#include "../Exchange/Account/Account.struct.h" #include "../EA.mqh" #include "../Test.mqh" From d0787f9d7f1f05e5526f33a91e4e6f71bfaa88f4 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 18 Jun 2023 14:52:21 +0100 Subject: [PATCH 054/109] Moves Web under Platform/ --- .../{test-web.yml => test-platform-web.yml} | 14 +++++++------- {Web => Platform/Web}/Web.h | 0 {Web => Platform/Web}/tests/Web.test.mq4 | 0 {Web => Platform/Web}/tests/Web.test.mq5 | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) rename .github/workflows/{test-web.yml => test-platform-web.yml} (82%) rename {Web => Platform/Web}/Web.h (100%) rename {Web => Platform/Web}/tests/Web.test.mq4 (100%) rename {Web => Platform/Web}/tests/Web.test.mq5 (95%) diff --git a/.github/workflows/test-web.yml b/.github/workflows/test-platform-web.yml similarity index 82% rename from .github/workflows/test-web.yml rename to .github/workflows/test-platform-web.yml index 2bd796883..110224c34 100644 --- a/.github/workflows/test-web.yml +++ b/.github/workflows/test-platform-web.yml @@ -1,16 +1,16 @@ --- -name: Test Web +name: Test Platform/Web # yamllint disable-line rule:truthy on: pull_request: paths: - - 'Web/**' - - '.github/workflows/test-web.yml' + - 'Platform/Web/**' + - '.github/workflows/test-platform-web.yml' push: paths: - - 'Web/**' - - '.github/workflows/test-web.yml' + - 'Platform/Web/**' + - '.github/workflows/test-platform-web.yml' jobs: @@ -22,7 +22,7 @@ jobs: uses: fx31337/mql-compile-action@master with: init-platform: true - path: 'Web/tests' + path: 'Platform/Web/tests' verbose: true - name: Print compiled files run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' @@ -42,7 +42,7 @@ jobs: defaults: run: shell: bash - working-directory: Web/tests + working-directory: Platform/Web/tests needs: Compile runs-on: ubuntu-latest strategy: diff --git a/Web/Web.h b/Platform/Web/Web.h similarity index 100% rename from Web/Web.h rename to Platform/Web/Web.h diff --git a/Web/tests/Web.test.mq4 b/Platform/Web/tests/Web.test.mq4 similarity index 100% rename from Web/tests/Web.test.mq4 rename to Platform/Web/tests/Web.test.mq4 diff --git a/Web/tests/Web.test.mq5 b/Platform/Web/tests/Web.test.mq5 similarity index 95% rename from Web/tests/Web.test.mq5 rename to Platform/Web/tests/Web.test.mq5 index eeb53b324..81726160e 100644 --- a/Web/tests/Web.test.mq5 +++ b/Platform/Web/tests/Web.test.mq5 @@ -25,9 +25,9 @@ */ // Includes. -#include "../../Convert.mqh" -#include "../../Platform/Terminal.h" -#include "../../Test.mqh" +#include "../../../Convert.mqh" +#include "../../Terminal.h" +#include "../../../Test.mqh" #include "../Web.h" // Properties. From b248177b67d26b2d25b2b01087cd0d2734e66275 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 18 Jun 2023 15:15:06 +0100 Subject: [PATCH 055/109] Moves Chart related classes under Platform/ --- .github/workflows/test-platform-chart.yml | 61 +++++++++++++++++++ .github/workflows/test.yml | 1 - 3D/Chart3DCandles.h | 2 +- 3D/tests/3D.test.mq5 | 2 +- Bar.struct.h | 2 +- Candle.struct.h | 2 +- Common.extern.h | 2 +- EA.mqh | 2 +- Indicator/Indicator.struct.h | 2 +- Indicator/IndicatorBase.h | 2 +- Indicator/IndicatorData.h | 2 +- Indicator/IndicatorRenko.h | 2 +- .../Oscillator/tests/Indi_MACD.test.cpp | 2 +- Indicators/Tick/Indi_TickMt.h | 2 +- .../Chart/Chart.define.h | 0 Chart.enum.h => Platform/Chart/Chart.enum.h | 0 Chart.mqh => Platform/Chart/Chart.h | 14 ++--- .../Chart/Chart.struct.h | 10 +-- .../Chart/Chart.struct.serialize.h | 4 +- .../Chart/Chart.struct.static.h | 4 +- .../Chart/Chart.struct.tf.h | 8 +-- .../Chart/Chart.symboltf.h | 2 +- ChartBase.h => Platform/Chart/ChartBase.h | 0 ChartMt.h => Platform/Chart/ChartMt.h | 2 +- .../Chart/tests}/Chart.test.cpp | 6 +- .../Chart/tests/Chart.test.mq4 | 2 +- .../Chart/tests/Chart.test.mq5 | 6 +- Platform/Chart/tests/ChartMt.test.mq4 | 28 +++++++++ Platform/Chart/tests/ChartMt.test.mq5 | 39 ++++++++++++ Platform/Chart/tests/Makefile | 12 ++++ Platform/Orders.h | 2 +- Platform/tests/Order.test.mq5 | 2 +- README.md | 16 ++--- Serializer/tests/Serializer.test.mq5 | 2 +- Stats.mqh | 2 +- Std.h | 2 +- Storage/Dict/Buffer/BufferTick.h | 2 +- Storage/ValueStorage.applied_price.h | 2 +- Strategy.struct.pricestop.h | 2 +- Ticker.mqh | 2 +- Trade/TradeSignal.struct.h | 2 +- tests/CompileTest.mq5 | 2 +- tests/MarketTest.mq5 | 2 +- tests/StrategyTest-RSI.mq5 | 2 +- tests/TradeTest.mq5 | 2 +- 45 files changed, 203 insertions(+), 64 deletions(-) create mode 100644 .github/workflows/test-platform-chart.yml rename Chart.define.h => Platform/Chart/Chart.define.h (100%) rename Chart.enum.h => Platform/Chart/Chart.enum.h (100%) rename Chart.mqh => Platform/Chart/Chart.h (96%) rename Chart.struct.h => Platform/Chart/Chart.struct.h (95%) rename Chart.struct.serialize.h => Platform/Chart/Chart.struct.serialize.h (94%) rename Chart.struct.static.h => Platform/Chart/Chart.struct.static.h (99%) rename Chart.struct.tf.h => Platform/Chart/Chart.struct.tf.h (98%) rename Chart.symboltf.h => Platform/Chart/Chart.symboltf.h (98%) rename ChartBase.h => Platform/Chart/ChartBase.h (100%) rename ChartMt.h => Platform/Chart/ChartMt.h (99%) rename {tests => Platform/Chart/tests}/Chart.test.cpp (91%) rename tests/ChartTest.mq4 => Platform/Chart/tests/Chart.test.mq4 (97%) rename tests/ChartTest.mq5 => Platform/Chart/tests/Chart.test.mq5 (97%) create mode 100644 Platform/Chart/tests/ChartMt.test.mq4 create mode 100644 Platform/Chart/tests/ChartMt.test.mq5 create mode 100644 Platform/Chart/tests/Makefile diff --git a/.github/workflows/test-platform-chart.yml b/.github/workflows/test-platform-chart.yml new file mode 100644 index 000000000..fba6f0c35 --- /dev/null +++ b/.github/workflows/test-platform-chart.yml @@ -0,0 +1,61 @@ +--- +name: Test Platform + +# yamllint disable-line rule:truthy +on: + pull_request: + paths: + - 'Platform/Chart/**' + - '.github/workflows/test-platform-chart.yml' + push: + paths: + - 'Platform/Chart/**' + - '.github/workflows/test-platform-chart.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: 'Platform/Chart/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' + + Tests-MQL4: + defaults: + run: + shell: bash + working-directory: Platform/Chart/tests + needs: Compile + runs-on: ubuntu-latest + strategy: + matrix: + test: + - Chart.test + - ChartMt.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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1e1f512cf..c18f394eb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -53,7 +53,6 @@ jobs: strategy: matrix: test: - - ChartTest - EATest - IndicatorsTest - MailTest diff --git a/3D/Chart3DCandles.h b/3D/Chart3DCandles.h index ea421b0e5..748f00b1f 100644 --- a/3D/Chart3DCandles.h +++ b/3D/Chart3DCandles.h @@ -25,7 +25,7 @@ * 3D chart candles renderer. */ -#include "../Chart.define.h" +#include "../Platform/Chart/Chart.define.h" #include "Chart3DType.h" #include "Cube.h" #include "Device.h" diff --git a/3D/tests/3D.test.mq5 b/3D/tests/3D.test.mq5 index 6e572ea96..9a4bd8cf6 100644 --- a/3D/tests/3D.test.mq5 +++ b/3D/tests/3D.test.mq5 @@ -41,7 +41,7 @@ #include "../Devices/MTDX/MTDXVertexBuffer.h" #include "../Frontends/MT5Frontend.h" #include "../../Storage/Dict/Buffer/BufferStruct.h" -#include "../../Chart.mqh" +#include "../../Platform/Chart/Chart.h" #include "../../Platform/Platform.h" #include "../../Serializer/Serializer.h" #include "../../Test.mqh" diff --git a/Bar.struct.h b/Bar.struct.h index bc0016259..7eb348fb2 100644 --- a/Bar.struct.h +++ b/Bar.struct.h @@ -35,7 +35,7 @@ class Serializer; // Includes. #include "Bar.enum.h" -#include "Chart.enum.h" +#include "Platform/Chart/Chart.enum.h" #include "Serializer/Serializable.h" #include "Serializer/Serializer.enum.h" #include "Serializer/Serializer.h" diff --git a/Candle.struct.h b/Candle.struct.h index 360e5d1da..9dc7137ef 100644 --- a/Candle.struct.h +++ b/Candle.struct.h @@ -35,7 +35,7 @@ class Serializer; // Includes. #include "Bar.enum.h" -#include "Chart.enum.h" +#include "Platform/Chart/Chart.enum.h" #include "Serializer/Serializable.h" #include "Serializer/Serializer.enum.h" #include "Serializer/Serializer.h" diff --git a/Common.extern.h b/Common.extern.h index 3fb06072e..984d4d9cc 100644 --- a/Common.extern.h +++ b/Common.extern.h @@ -26,7 +26,7 @@ #include #include -#include "Chart.enum.h" +#include "Platform/Chart/Chart.enum.h" #include "Storage/DateTime.enum.h" #include "Platform/Terminal.define.h" diff --git a/EA.mqh b/EA.mqh index 143622037..24341e79d 100644 --- a/EA.mqh +++ b/EA.mqh @@ -30,7 +30,7 @@ #define EA_MQH // Includes. -#include "Chart.mqh" +#include "Platform/Chart/Chart.h" #include "Storage/Data.struct.h" #include "Storage/Dict/Dict.h" #include "Storage/Dict/DictObject.h" diff --git a/Indicator/Indicator.struct.h b/Indicator/Indicator.struct.h index 0982decd9..f54490444 100644 --- a/Indicator/Indicator.struct.h +++ b/Indicator/Indicator.struct.h @@ -37,7 +37,7 @@ struct ChartParams; // Includes. #include "../Storage/Array.h" -#include "../Chart.struct.tf.h" +#include "../Platform/Chart/Chart.struct.tf.h" #include "../Storage/Data.struct.h" #include "../Storage/DateTime.struct.h" #include "../Serializer/SerializerNode.enum.h" diff --git a/Indicator/IndicatorBase.h b/Indicator/IndicatorBase.h index 220f8ec9a..fec1d2589 100644 --- a/Indicator/IndicatorBase.h +++ b/Indicator/IndicatorBase.h @@ -33,7 +33,7 @@ // Includes. #include "../Storage/Array.h" #include "../Storage/Dict/Buffer/BufferStruct.h" -#include "../Chart.struct.tf.h" +#include "../Platform/Chart/Chart.struct.tf.h" #include "../Storage/DateTime.h" #include "../Log.mqh" #include "../Storage/Object.h" diff --git a/Indicator/IndicatorData.h b/Indicator/IndicatorData.h index c062b2fbc..14cf5ad2d 100644 --- a/Indicator/IndicatorData.h +++ b/Indicator/IndicatorData.h @@ -40,7 +40,7 @@ struct ExternInstantiateIndicatorBufferValueStorageDouble { // Includes. #include "../Bar.struct.h" -#include "../Chart.struct.tf.h" +#include "../Platform/Chart/Chart.struct.tf.h" #include "../Storage/Flags.struct.h" #include "../Storage/IValueStorage.h" #include "../Storage/ItemsHistory.h" diff --git a/Indicator/IndicatorRenko.h b/Indicator/IndicatorRenko.h index cea1ff7a0..c6f541ff5 100644 --- a/Indicator/IndicatorRenko.h +++ b/Indicator/IndicatorRenko.h @@ -35,7 +35,7 @@ #endif // Includes. -#include "../Chart.struct.tf.h" +#include "../Platform/Chart/Chart.struct.tf.h" #include "IndicatorCandle.h" #include "IndicatorRenko.provider.h" #include "IndicatorRenko.struct.h" diff --git a/Indicators/Oscillator/tests/Indi_MACD.test.cpp b/Indicators/Oscillator/tests/Indi_MACD.test.cpp index a0c0a0f45..288bc3d99 100644 --- a/Indicators/Oscillator/tests/Indi_MACD.test.cpp +++ b/Indicators/Oscillator/tests/Indi_MACD.test.cpp @@ -25,7 +25,7 @@ */ // Include enumerations. -#include "../../../Chart.enum.h" +#include "../../../Platform/Chart/Chart.enum.h" // Define external functions. diff --git a/Indicators/Tick/Indi_TickMt.h b/Indicators/Tick/Indi_TickMt.h index b87bdf585..37bdedfdc 100644 --- a/Indicators/Tick/Indi_TickMt.h +++ b/Indicators/Tick/Indi_TickMt.h @@ -31,7 +31,7 @@ #endif // Includes. -#include "../../Chart.struct.static.h" +#include "../../Platform/Chart/Chart.struct.static.h" #include "../../Indicator/IndicatorTick.h" #include "../../Indicator/IndicatorTick.provider.h" diff --git a/Chart.define.h b/Platform/Chart/Chart.define.h similarity index 100% rename from Chart.define.h rename to Platform/Chart/Chart.define.h diff --git a/Chart.enum.h b/Platform/Chart/Chart.enum.h similarity index 100% rename from Chart.enum.h rename to Platform/Chart/Chart.enum.h diff --git a/Chart.mqh b/Platform/Chart/Chart.h similarity index 96% rename from Chart.mqh rename to Platform/Chart/Chart.h index 0555f444f..83ee53eff 100644 --- a/Chart.mqh +++ b/Platform/Chart/Chart.h @@ -30,18 +30,18 @@ */ // Prevents processing this includes file for the second time. -#ifndef CHART_MQH -#define CHART_MQH +#ifndef CHART_H +#define CHART_H // Includes. #include "Chart.define.h" #include "Chart.enum.h" #include "Chart.struct.h" #include "Chart.struct.serialize.h" -#include "Convert.mqh" -#include "Market.mqh" -#include "Serializer/Serializer.h" -#include "Task/TaskCondition.enum.h" +#include "../../Convert.mqh" +#include "../../Market.mqh" +#include "../../Serializer/Serializer.h" +#include "../../Task/TaskCondition.enum.h" // Forward class declaration. class Chart; @@ -183,4 +183,4 @@ class Chart : public Market { void SerializeStub(int _n1 = 1, int _n2 = 1, int _n3 = 1, int _n4 = 1, int _n5 = 1) {} }; -#endif +#endif // CHART_H diff --git a/Chart.struct.h b/Platform/Chart/Chart.struct.h similarity index 95% rename from Chart.struct.h rename to Platform/Chart/Chart.struct.h index 1b1bfbc1d..bcb47c018 100644 --- a/Chart.struct.h +++ b/Platform/Chart/Chart.struct.h @@ -35,15 +35,15 @@ class Class; struct ChartTf; // Includes. -#include "Storage/Array.h" -#include "Bar.struct.h" +#include "../../Storage/Array.h" +#include "../../Bar.struct.h" #include "Chart.define.h" #include "Chart.enum.h" #include "Chart.struct.static.h" #include "Chart.struct.tf.h" -#include "Serializer/Serializer.h" -#include "Serializer/SerializerNode.enum.h" -#include "Platform/Terminal.define.h" +#include "../../Serializer/Serializer.h" +#include "../../Serializer/SerializerNode.enum.h" +#include "../Terminal.define.h" /* Defines struct to store bar entries. */ struct ChartEntry { diff --git a/Chart.struct.serialize.h b/Platform/Chart/Chart.struct.serialize.h similarity index 94% rename from Chart.struct.serialize.h rename to Platform/Chart/Chart.struct.serialize.h index 99c8ecfaa..3b483bff8 100644 --- a/Chart.struct.serialize.h +++ b/Platform/Chart/Chart.struct.serialize.h @@ -29,8 +29,8 @@ class Serializer; // Includes. -#include "Serializer/Serializer.h" -#include "Serializer/SerializerNode.enum.h" +#include "../../Serializer/Serializer.h" +#include "../../Serializer/SerializerNode.enum.h" /* Method to serialize ChartEntry structure. */ SerializerNodeType ChartEntry::Serialize(Serializer& _s) { diff --git a/Chart.struct.static.h b/Platform/Chart/Chart.struct.static.h similarity index 99% rename from Chart.struct.static.h rename to Platform/Chart/Chart.struct.static.h index 2ed5aa9fe..ee766f5c1 100644 --- a/Chart.struct.static.h +++ b/Platform/Chart/Chart.struct.static.h @@ -33,8 +33,8 @@ // Includes. #include "Chart.define.h" #include "Chart.symboltf.h" -#include "Platform/Platform.extern.h" -#include "Platform/Terminal.define.h" +#include "../Platform.extern.h" +#include "../Terminal.define.h" /* Defines struct for chart static methods. */ struct ChartStatic { diff --git a/Chart.struct.tf.h b/Platform/Chart/Chart.struct.tf.h similarity index 98% rename from Chart.struct.tf.h rename to Platform/Chart/Chart.struct.tf.h index a34f5abac..6e095aafc 100644 --- a/Chart.struct.tf.h +++ b/Platform/Chart/Chart.struct.tf.h @@ -28,7 +28,7 @@ #ifndef __MQL__ // Allows the preprocessor to include a header file when it is needed. #pragma once -#include "Platform/Platform.extern.h" +#include "../Platform.extern.h" #endif // Forward declarations. @@ -36,9 +36,9 @@ class Serializer; // Includes. #include "Chart.enum.h" -#include "Serializer/Serializer.h" -#include "Serializer/SerializerNode.enum.h" -#include "Platform/Terminal.define.h" +#include "../../Serializer/Serializer.h" +#include "../../Serializer/SerializerNode.enum.h" +#include "../Terminal.define.h" /* Defines struct for chart timeframe. */ struct ChartTf { diff --git a/Chart.symboltf.h b/Platform/Chart/Chart.symboltf.h similarity index 98% rename from Chart.symboltf.h rename to Platform/Chart/Chart.symboltf.h index 52411498d..f8c8dc3d0 100644 --- a/Chart.symboltf.h +++ b/Platform/Chart/Chart.symboltf.h @@ -31,7 +31,7 @@ #endif // Includes. -#include "Std.h" +#include "../../Std.h" /** * Represents symbol and timeframe. To be used by IndicatorBase and ChartBase classes. diff --git a/ChartBase.h b/Platform/Chart/ChartBase.h similarity index 100% rename from ChartBase.h rename to Platform/Chart/ChartBase.h diff --git a/ChartMt.h b/Platform/Chart/ChartMt.h similarity index 99% rename from ChartMt.h rename to Platform/Chart/ChartMt.h index e3e236c1a..343bd7938 100644 --- a/ChartMt.h +++ b/Platform/Chart/ChartMt.h @@ -33,7 +33,7 @@ // Includes. #include "Chart.struct.static.h" #include "Chart.symboltf.h" -#include "Platform/Terminal.define.h" +#include "../Terminal.define.h" #ifdef __DISABLED diff --git a/tests/Chart.test.cpp b/Platform/Chart/tests/Chart.test.cpp similarity index 91% rename from tests/Chart.test.cpp rename to Platform/Chart/tests/Chart.test.cpp index 3946558f2..6349776c1 100644 --- a/tests/Chart.test.cpp +++ b/Platform/Chart/tests/Chart.test.cpp @@ -21,12 +21,12 @@ /** * @file - * Test C++ compilation of ChartTest class. + * Test C++ compilation of Chart class. */ // Includes. -#include "../Chart.mqh" -#include "../Platform/Platform.h" +#include "../Chart.h" +#include "../../../Platform/Platform.h" int main(int argc, char **argv) { diff --git a/tests/ChartTest.mq4 b/Platform/Chart/tests/Chart.test.mq4 similarity index 97% rename from tests/ChartTest.mq4 rename to Platform/Chart/tests/Chart.test.mq4 index f6ca3752a..81cbb7297 100644 --- a/tests/ChartTest.mq4 +++ b/Platform/Chart/tests/Chart.test.mq4 @@ -25,4 +25,4 @@ */ // Includes. -#include "ChartTest.mq5" +#include "Chart.test.mq5" diff --git a/tests/ChartTest.mq5 b/Platform/Chart/tests/Chart.test.mq5 similarity index 97% rename from tests/ChartTest.mq5 rename to Platform/Chart/tests/Chart.test.mq5 index 903c084d6..6c179fc44 100644 --- a/tests/ChartTest.mq5 +++ b/Platform/Chart/tests/Chart.test.mq5 @@ -25,9 +25,9 @@ */ // Includes. -#include "../Chart.mqh" -#include "../Convert.mqh" -#include "../Test.mqh" +#include "../Chart.h" +#include "../../../Convert.mqh" +#include "../../../Test.mqh" /** * Implements OnInit(). diff --git a/Platform/Chart/tests/ChartMt.test.mq4 b/Platform/Chart/tests/ChartMt.test.mq4 new file mode 100644 index 000000000..65e4dc65f --- /dev/null +++ b/Platform/Chart/tests/ChartMt.test.mq4 @@ -0,0 +1,28 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test functionality of ChartMt class. + */ + +// Includes. +#include "ChartMt.test.mq5" diff --git a/Platform/Chart/tests/ChartMt.test.mq5 b/Platform/Chart/tests/ChartMt.test.mq5 new file mode 100644 index 000000000..118a2342f --- /dev/null +++ b/Platform/Chart/tests/ChartMt.test.mq5 @@ -0,0 +1,39 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test functionality of ChartMt class. + */ + +// Includes. +#include "../ChartMt.h" +#include "../../../Test.mqh" + +/** + * Implements OnInit(). + */ +int OnInit() { + + // @todo: Write some tests... + + return (INIT_SUCCEEDED); +} diff --git a/Platform/Chart/tests/Makefile b/Platform/Chart/tests/Makefile new file mode 100644 index 000000000..e792364f0 --- /dev/null +++ b/Platform/Chart/tests/Makefile @@ -0,0 +1,12 @@ +CC := g++ # C++ compiler +CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags +SRCS := $(wildcard *.cpp) # Get all .cpp files in the current directory +OBJS := $(SRCS:.cpp=.o) # Object files corresponding to the source files + +all: $(OBJS) + +%.o: %.cpp + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -v $(OBJS) diff --git a/Platform/Orders.h b/Platform/Orders.h index a2150aaa8..52940e289 100644 --- a/Platform/Orders.h +++ b/Platform/Orders.h @@ -25,7 +25,7 @@ class Orders; // Includes. #include "../Exchange/Account/Account.h" -#include "../Chart.struct.static.h" +#include "Chart/Chart.struct.static.h" #include "../Log.mqh" #include "../Math.h" #include "Order.h" diff --git a/Platform/tests/Order.test.mq5 b/Platform/tests/Order.test.mq5 index 3d8f94f40..89eccb50b 100644 --- a/Platform/tests/Order.test.mq5 +++ b/Platform/tests/Order.test.mq5 @@ -25,7 +25,7 @@ */ // Includes. -#include "../../Chart.mqh" +#include "../Chart/Chart.h" #include "../Order.h" #include "../Platform.h" #include "../../Serializer/SerializerConverter.h" diff --git a/README.md b/README.md index a79290557..45838609a 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ Find below the table of conversion (replace code on left with the right one): | MQL4 (original) | MQL4 & MQL5 (replace with) | Required include file | |:---------------------|:---------------------------|:----------------------| -| `WindowRedraw()` | `Chart::WindowRedraw()` | `Chart.mqh` | +| `WindowRedraw()` | `Chart::WindowRedraw()` | `Platform/Chart/Chart.h` | | `Day()` | `DateTime::Day()` | `Storage/DateTime.h` | | `TimeDayOfWeek()` | `DateTime::DayOfWeek()` | `Storage/DateTime.h` | | `DayOfWeek()` | `DateTime::DayOfWeek()` | `Storage/DateTime.h` | @@ -136,16 +136,16 @@ Here are the special [predefined variables](https://docs.mql4.com/predefined) co | MQL4 (original) | MQL4 & MQL5 (replace with) | Required include file | |:---------------------|:-----------------------------|:--------------------| | `Ask` | `SymbolInfo::GetAsk()` | `SymbolInfo.struct.static.h` | -| `Bars` | `ChartStatic::iBars()` | `Chart.struct.static.h` | +| `Bars` | `ChartStatic::iBars()` | `Platform/Chart/Chart.struct.static.h` | | `Bid` | `SymbolInfo::GetBid()` | `SymbolInfo.struct.static.h` | -| `Close[]` | `ChartStatic::iClose()` | `Chart.struct.static.h` | +| `Close[]` | `ChartStatic::iClose()` | `Platform/Chart/Chart.struct.static.h` | | `Digits` | `SymbolInfo::GetDigits()` | `SymbolInfo.struct.static.h` | -| `High[]` | `ChartStatic::iHigh()` | `Chart.struct.static.h` | -| `Low[]` | `ChartStatic::iLow()` | `Chart.struct.static.h` | -| `Open[]` | `ChartStatic::iOpen()` | `Chart.struct.static.h` | +| `High[]` | `ChartStatic::iHigh()` | `Platform/Chart/Chart.struct.static.h` | +| `Low[]` | `ChartStatic::iLow()` | `Platform/Chart/Chart.struct.static.h` | +| `Open[]` | `ChartStatic::iOpen()` | `Platform/Chart/Chart.struct.static.h` | | `Point` | `SymbolInfo::GetPointSize()` | `SymbolInfo.struct.static.h` | -| `Time[]` | `ChartStatic::iTime()` | `Chart.struct.static.h` | -| `Volume[]` | `ChartStatic::iVolume()` | `Chart.struct.static.h` | +| `Time[]` | `ChartStatic::iTime()` | `Platform/Chart/Chart.struct.static.h` | +| `Volume[]` | `ChartStatic::iVolume()` | `Platform/Chart/Chart.struct.static.h` | diff --git a/Serializer/tests/Serializer.test.mq5 b/Serializer/tests/Serializer.test.mq5 index 0697411a5..fa703369c 100644 --- a/Serializer/tests/Serializer.test.mq5 +++ b/Serializer/tests/Serializer.test.mq5 @@ -28,7 +28,7 @@ // Includes. #include "../../Storage/Dict/Buffer/BufferStruct.h" -#include "../../Chart.mqh" +#include "../../Platform/Chart/Chart.h" #include "../../Config.mqh" #include "../../Storage/Data.define.h" #include "../../Storage/Data.struct.h" diff --git a/Stats.mqh b/Stats.mqh index 838209e76..0d45045ba 100644 --- a/Stats.mqh +++ b/Stats.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "Chart.mqh" +#include "Platform/Chart/Chart.h" #include "Platform/Platform.h" /** diff --git a/Std.h b/Std.h index 61d79cb0b..03bc65bdd 100644 --- a/Std.h +++ b/Std.h @@ -369,7 +369,7 @@ _NULL_VALUE::operator string() const { #endif #ifndef __MQL__ -#include "Chart.enum.h" +#include "Platform/Chart/Chart.enum.h" /** * Returns currently selected period for platform. */ diff --git a/Storage/Dict/Buffer/BufferTick.h b/Storage/Dict/Buffer/BufferTick.h index 27e14efa4..d196a7454 100644 --- a/Storage/Dict/Buffer/BufferTick.h +++ b/Storage/Dict/Buffer/BufferTick.h @@ -26,7 +26,7 @@ // Includes. #include "BufferStruct.h" -#include "../../../Chart.enum.h" +#include "../../../Platform/Chart/Chart.enum.h" #include "../../IValueStorage.h" #include "../../../Tick/Tick.struct.h" diff --git a/Storage/ValueStorage.applied_price.h b/Storage/ValueStorage.applied_price.h index bb539190d..34f772d16 100644 --- a/Storage/ValueStorage.applied_price.h +++ b/Storage/ValueStorage.applied_price.h @@ -25,7 +25,7 @@ */ // Includes. -#include "../Chart.struct.h" +#include "../Platform/Chart/Chart.struct.h" #include "Cache/ObjectsCache.h" #include "ValueStorage.history.h" diff --git a/Strategy.struct.pricestop.h b/Strategy.struct.pricestop.h index 6b2ea6c5a..c79902900 100644 --- a/Strategy.struct.pricestop.h +++ b/Strategy.struct.pricestop.h @@ -36,7 +36,7 @@ struct IndicatorDataEntry; struct IndicatorParams; // Includes. -#include "Chart.struct.h" +#include "Platform/Chart/Chart.struct.h" /* Structure for strategy price stops. */ struct StrategyPriceStop { diff --git a/Ticker.mqh b/Ticker.mqh index c35de884b..51476a249 100644 --- a/Ticker.mqh +++ b/Ticker.mqh @@ -28,7 +28,7 @@ class Chart; // Includes. -#include "Chart.mqh" +#include "Platform/Chart/Chart.h" #include "Log.mqh" #include "SymbolInfo.mqh" //#include "Market.mqh" diff --git a/Trade/TradeSignal.struct.h b/Trade/TradeSignal.struct.h index e3b63a535..724a4f90a 100644 --- a/Trade/TradeSignal.struct.h +++ b/Trade/TradeSignal.struct.h @@ -26,7 +26,7 @@ */ // Includes. -#include "../Chart.enum.h" +#include "../Platform/Chart/Chart.enum.h" #include "../Serializer/SerializerConverter.h" #include "../Serializer/SerializerJson.h" diff --git a/tests/CompileTest.mq5 b/tests/CompileTest.mq5 index 6070ef55f..161337022 100644 --- a/tests/CompileTest.mq5 +++ b/tests/CompileTest.mq5 @@ -45,7 +45,7 @@ struct IndicatorParams; #include "../Storage/Dict/Buffer/Buffer.h" #include "../Storage/Dict/Buffer/BufferFXT.h" #include "../Storage/Dict/Buffer/BufferStruct.h" -#include "../Chart.mqh" +#include "../Platform/Chart/Chart.h" #include "../Storage/Collection.h" #include "../Config.mqh" #include "../Convert.mqh" diff --git a/tests/MarketTest.mq5 b/tests/MarketTest.mq5 index 15ff8f639..5e0cd341c 100644 --- a/tests/MarketTest.mq5 +++ b/tests/MarketTest.mq5 @@ -25,7 +25,7 @@ */ // Includes. -#include "../Chart.define.h" +#include "../Platform/Chart/Chart.define.h" #include "../Market.mqh" #include "../Test.mqh" diff --git a/tests/StrategyTest-RSI.mq5 b/tests/StrategyTest-RSI.mq5 index e7d8c1bd4..1c21ee3b1 100644 --- a/tests/StrategyTest-RSI.mq5 +++ b/tests/StrategyTest-RSI.mq5 @@ -28,7 +28,7 @@ //#define __debug_verbose__ // Includes. -#include "../ChartMt.h" +#include "../Platform/Chart/ChartMt.h" #include "../Indicator/tests/classes/IndicatorTfDummy.h" #include "../Indicators/Oscillator/Indi_RSI.h" #include "../Indicators/Tick/Indi_TickMt.h" diff --git a/tests/TradeTest.mq5 b/tests/TradeTest.mq5 index 5c34b88a3..7f97d85c9 100644 --- a/tests/TradeTest.mq5 +++ b/tests/TradeTest.mq5 @@ -31,7 +31,7 @@ struct DataParamEntry; // Includes. -#include "../ChartMt.h" +#include "../Platform/Chart/ChartMt.h" #include "../Indicators/Tick/Indi_TickMt.h" #include "../Platform/Platform.h" #include "../Test.mqh" From a19d464e9945643c2b8453f3cae0167177947de4 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 18 Jun 2023 15:36:11 +0100 Subject: [PATCH 056/109] Improves GHA workflow for compiling with Emscripten --- .github/workflows/compile-cpp.yml | 26 ++------------------------ Makefile | 3 ++- 2 files changed, 4 insertions(+), 25 deletions(-) diff --git a/.github/workflows/compile-cpp.yml b/.github/workflows/compile-cpp.yml index b3c36af55..6243e9e5a 100644 --- a/.github/workflows/compile-cpp.yml +++ b/.github/workflows/compile-cpp.yml @@ -14,21 +14,6 @@ on: jobs: - FileList: - outputs: - filelist: ${{ steps.get-files.outputs.filelist }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - 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-Cpp: runs-on: ubuntu-latest steps: @@ -41,16 +26,9 @@ jobs: run: make Compile-Emscripten: runs-on: ubuntu-latest - needs: [Compile-Cpp, FileList] - strategy: - matrix: - file: ${{ fromJson(needs.FileList.outputs.filelist) }} steps: - uses: actions/checkout@v3 - name: Install Emscripten toolchain uses: mymindstorm/setup-emsdk@v11 - - name: Compile ${{ matrix.file }} via emcc - run: > - emcc -s WASM=1 -s ENVIRONMENT=node -s EXIT_RUNTIME=0 -s NO_EXIT_RUNTIME=1 -s ASSERTIONS=1 -Wall -s - MODULARIZE=1 -s ERROR_ON_UNDEFINED_SYMBOLS=0 --bind -s EXPORTED_FUNCTIONS="[]" -g -std=c++17 - "${{ matrix.file }}" + - name: Compile via emcc + run: make CC=emcc diff --git a/Makefile b/Makefile index 124131f7f..34cd50b8a 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags +EMCC_CFLAGS := $(CFLAGS) --bind -s ASSERTIONS=1 -s ERROR_ON_UNDEFINED_SYMBOLS=0 -s EXIT_RUNTIME=0 -s EXPORTED_FUNCTIONS="[]" -s WASM=1 -s MODULARIZE=1 -s NO_EXIT_RUNTIME=1 MAKEFILES := $(wildcard **/tests/Makefile) .PHONY: all @@ -6,7 +7,7 @@ MAKEFILES := $(wildcard **/tests/Makefile) all: $(MAKEFILES) @for makefile in $(MAKEFILES); do \ echo "Compiling $$makefile"; \ - $(MAKE) -C $$(dirname $$makefile) CFLAGS="$(CFLAGS)"; \ + $(MAKE) -C $$(dirname $$makefile) CFLAGS="$(CFLAGS)" EMCC_CFLAGS="$(EMCC_CFLAGS)"; \ done clean: $(MAKEFILES) From 3b8cc47c7ff347c778387aee8ffd03455f8e7f73 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 18 Jun 2023 15:44:39 +0100 Subject: [PATCH 057/109] Removes GHA Lint workflow --- .github/workflows/lint.yml | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 9dffc2b59..000000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,18 +0,0 @@ -# yamllint disable rule:line-length ---- -name: Lint - -# yamllint disable rule:truthy -on: - - pull_request - - push - -jobs: - YAML: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: YAML check (yamllint) - uses: ibiqlik/action-yamllint@master - with: - strict: true From 0b92f7750365a90cbdd4d970b4d34bac8d8b8f4d Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 18 Jun 2023 20:55:29 +0100 Subject: [PATCH 058/109] Moves 3D under Platform/Chart3D --- .github/workflows/test-platform-chart3d.yml | 60 +++++++++++++++++++ {3D => Platform/Chart3D}/Chart3D.h | 14 ++--- {3D => Platform/Chart3D}/Chart3DCandles.h | 2 +- {3D => Platform/Chart3D}/Chart3DType.h | 2 +- {3D => Platform/Chart3D}/Cube.h | 0 {3D => Platform/Chart3D}/Device.h | 4 +- .../Chart3D}/Devices/MTDX/MTDXDevice.h | 0 .../Chart3D}/Devices/MTDX/MTDXIndexBuffer.h | 0 .../Chart3D}/Devices/MTDX/MTDXShader.h | 0 .../Chart3D}/Devices/MTDX/MTDXVertexBuffer.h | 0 {3D => Platform/Chart3D}/Face.h | 0 {3D => Platform/Chart3D}/Frontend.h | 2 +- .../Chart3D}/Frontends/MT5Frontend.h | 0 {3D => Platform/Chart3D}/IndexBuffer.h | 2 +- {3D => Platform/Chart3D}/Interface.h | 2 +- {3D => Platform/Chart3D}/Material.h | 0 {3D => Platform/Chart3D}/Math.h | 4 +- {3D => Platform/Chart3D}/Mesh.h | 6 +- {3D => Platform/Chart3D}/Shader.h | 2 +- .../Chart3D}/Shaders/chart3d_ps.hlsl | 0 .../Chart3D}/Shaders/chart3d_vs.hlsl | 0 {3D => Platform/Chart3D}/Shaders/cube_ps.hlsl | 0 {3D => Platform/Chart3D}/Shaders/cube_vs.hlsl | 0 {3D => Platform/Chart3D}/TSR.h | 0 {3D => Platform/Chart3D}/Vertex.h | 2 +- {3D => Platform/Chart3D}/VertexBuffer.h | 2 +- Platform/Chart3D/tests/Chart3D.test.mq4 | 28 +++++++++ .../Chart3D/tests/Chart3D.test.mq5 | 10 ++-- .../Chart3D}/tests/Shaders/pixel.hlsl | 0 .../Chart3D}/tests/Shaders/vertex.hlsl | 0 tests/CompileTest.mq5 | 14 ++--- 31 files changed, 123 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/test-platform-chart3d.yml rename {3D => Platform/Chart3D}/Chart3D.h (95%) rename {3D => Platform/Chart3D}/Chart3DCandles.h (98%) rename {3D => Platform/Chart3D}/Chart3DType.h (98%) rename {3D => Platform/Chart3D}/Cube.h (100%) rename {3D => Platform/Chart3D}/Device.h (99%) rename {3D => Platform/Chart3D}/Devices/MTDX/MTDXDevice.h (100%) rename {3D => Platform/Chart3D}/Devices/MTDX/MTDXIndexBuffer.h (100%) rename {3D => Platform/Chart3D}/Devices/MTDX/MTDXShader.h (100%) rename {3D => Platform/Chart3D}/Devices/MTDX/MTDXVertexBuffer.h (100%) rename {3D => Platform/Chart3D}/Face.h (100%) rename {3D => Platform/Chart3D}/Frontend.h (99%) rename {3D => Platform/Chart3D}/Frontends/MT5Frontend.h (100%) rename {3D => Platform/Chart3D}/IndexBuffer.h (98%) rename {3D => Platform/Chart3D}/Interface.h (99%) rename {3D => Platform/Chart3D}/Material.h (100%) rename {3D => Platform/Chart3D}/Math.h (99%) rename {3D => Platform/Chart3D}/Mesh.h (98%) rename {3D => Platform/Chart3D}/Shader.h (99%) rename {3D => Platform/Chart3D}/Shaders/chart3d_ps.hlsl (100%) rename {3D => Platform/Chart3D}/Shaders/chart3d_vs.hlsl (100%) rename {3D => Platform/Chart3D}/Shaders/cube_ps.hlsl (100%) rename {3D => Platform/Chart3D}/Shaders/cube_vs.hlsl (100%) rename {3D => Platform/Chart3D}/TSR.h (100%) rename {3D => Platform/Chart3D}/Vertex.h (96%) rename {3D => Platform/Chart3D}/VertexBuffer.h (98%) create mode 100644 Platform/Chart3D/tests/Chart3D.test.mq4 rename 3D/tests/3D.test.mq5 => Platform/Chart3D/tests/Chart3D.test.mq5 (93%) rename {3D => Platform/Chart3D}/tests/Shaders/pixel.hlsl (100%) rename {3D => Platform/Chart3D}/tests/Shaders/vertex.hlsl (100%) diff --git a/.github/workflows/test-platform-chart3d.yml b/.github/workflows/test-platform-chart3d.yml new file mode 100644 index 000000000..595e333e2 --- /dev/null +++ b/.github/workflows/test-platform-chart3d.yml @@ -0,0 +1,60 @@ +--- +name: Test Platform + +# yamllint disable-line rule:truthy +on: + pull_request: + paths: + - 'Platform/Chart3D/**' + - '.github/workflows/test-platform-chart3d.yml' + push: + paths: + - 'Platform/Chart3D/**' + - '.github/workflows/test-platform-chart3d.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: 'Platform/Chart3D/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' + + Tests-MQL4: + defaults: + run: + shell: bash + working-directory: Platform/Chart3D/tests + needs: Compile + runs-on: ubuntu-latest + strategy: + matrix: + test: + - Chart3D.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 diff --git a/3D/Chart3D.h b/Platform/Chart3D/Chart3D.h similarity index 95% rename from 3D/Chart3D.h rename to Platform/Chart3D/Chart3D.h index 051a3e12d..36c2b6cfe 100644 --- a/3D/Chart3D.h +++ b/Platform/Chart3D/Chart3D.h @@ -25,13 +25,13 @@ * 3D Chart. */ -#include "../Bar.struct.h" -#include "../Indicator/IndicatorData.h" -#include "../Indicators/Price/Indi_MA.h" -#include "../Instances.h" -#include "../Refs.mqh" -#include "../Serializer/SerializerConverter.h" -#include "../Serializer/SerializerJson.h" +#include "../../Bar.struct.h" +#include "../../Indicator/IndicatorData.h" +#include "../../Indicators/Price/Indi_MA.h" +#include "../../Instances.h" +#include "../../Refs.mqh" +#include "../../Serializer/SerializerConverter.h" +#include "../../Serializer/SerializerJson.h" #include "Chart3DCandles.h" #include "Chart3DType.h" #include "Cube.h" diff --git a/3D/Chart3DCandles.h b/Platform/Chart3D/Chart3DCandles.h similarity index 98% rename from 3D/Chart3DCandles.h rename to Platform/Chart3D/Chart3DCandles.h index 748f00b1f..39489115d 100644 --- a/3D/Chart3DCandles.h +++ b/Platform/Chart3D/Chart3DCandles.h @@ -25,7 +25,7 @@ * 3D chart candles renderer. */ -#include "../Platform/Chart/Chart.define.h" +#include "../Chart/Chart.define.h" #include "Chart3DType.h" #include "Cube.h" #include "Device.h" diff --git a/3D/Chart3DType.h b/Platform/Chart3D/Chart3DType.h similarity index 98% rename from 3D/Chart3DType.h rename to Platform/Chart3D/Chart3DType.h index 9e49737f7..a320a9aa7 100644 --- a/3D/Chart3DType.h +++ b/Platform/Chart3D/Chart3DType.h @@ -25,7 +25,7 @@ * 3D chart type renderer. */ -#include "../Refs.mqh" +#include "../../Refs.mqh" #include "Device.h" class Chart3D; diff --git a/3D/Cube.h b/Platform/Chart3D/Cube.h similarity index 100% rename from 3D/Cube.h rename to Platform/Chart3D/Cube.h diff --git a/3D/Device.h b/Platform/Chart3D/Device.h similarity index 99% rename from 3D/Device.h rename to Platform/Chart3D/Device.h index 5124a22ac..4fb49ea85 100644 --- a/3D/Device.h +++ b/Platform/Chart3D/Device.h @@ -25,8 +25,8 @@ * Generic graphics device. */ -#include "../Refs.mqh" -#include "../Util.h" +#include "../../Refs.mqh" +#include "../../Util.h" #include "Frontend.h" #include "IndexBuffer.h" #include "Material.h" diff --git a/3D/Devices/MTDX/MTDXDevice.h b/Platform/Chart3D/Devices/MTDX/MTDXDevice.h similarity index 100% rename from 3D/Devices/MTDX/MTDXDevice.h rename to Platform/Chart3D/Devices/MTDX/MTDXDevice.h diff --git a/3D/Devices/MTDX/MTDXIndexBuffer.h b/Platform/Chart3D/Devices/MTDX/MTDXIndexBuffer.h similarity index 100% rename from 3D/Devices/MTDX/MTDXIndexBuffer.h rename to Platform/Chart3D/Devices/MTDX/MTDXIndexBuffer.h diff --git a/3D/Devices/MTDX/MTDXShader.h b/Platform/Chart3D/Devices/MTDX/MTDXShader.h similarity index 100% rename from 3D/Devices/MTDX/MTDXShader.h rename to Platform/Chart3D/Devices/MTDX/MTDXShader.h diff --git a/3D/Devices/MTDX/MTDXVertexBuffer.h b/Platform/Chart3D/Devices/MTDX/MTDXVertexBuffer.h similarity index 100% rename from 3D/Devices/MTDX/MTDXVertexBuffer.h rename to Platform/Chart3D/Devices/MTDX/MTDXVertexBuffer.h diff --git a/3D/Face.h b/Platform/Chart3D/Face.h similarity index 100% rename from 3D/Face.h rename to Platform/Chart3D/Face.h diff --git a/3D/Frontend.h b/Platform/Chart3D/Frontend.h similarity index 99% rename from 3D/Frontend.h rename to Platform/Chart3D/Frontend.h index 8080c65d4..50e33e082 100644 --- a/3D/Frontend.h +++ b/Platform/Chart3D/Frontend.h @@ -25,7 +25,7 @@ * Generic graphics front-end (display buffer target). */ -#include "../Refs.mqh" +#include "../../Refs.mqh" struct DrawTextQueueItem { float x; diff --git a/3D/Frontends/MT5Frontend.h b/Platform/Chart3D/Frontends/MT5Frontend.h similarity index 100% rename from 3D/Frontends/MT5Frontend.h rename to Platform/Chart3D/Frontends/MT5Frontend.h diff --git a/3D/IndexBuffer.h b/Platform/Chart3D/IndexBuffer.h similarity index 98% rename from 3D/IndexBuffer.h rename to Platform/Chart3D/IndexBuffer.h index fdd83d91e..5e9f9ceea 100644 --- a/3D/IndexBuffer.h +++ b/Platform/Chart3D/IndexBuffer.h @@ -25,7 +25,7 @@ * Generic graphics index buffer. */ -#include "../Refs.mqh" +#include "../../Refs.mqh" class Device; diff --git a/3D/Interface.h b/Platform/Chart3D/Interface.h similarity index 99% rename from 3D/Interface.h rename to Platform/Chart3D/Interface.h index 87015f3a4..72fd0e5d2 100644 --- a/3D/Interface.h +++ b/Platform/Chart3D/Interface.h @@ -25,7 +25,7 @@ * Chart events. */ -#include "../Util.h" +#include "../../Util.h" enum ENUM_INTERFACE_EVENT { INTERFACE_EVENT_NONE, diff --git a/3D/Material.h b/Platform/Chart3D/Material.h similarity index 100% rename from 3D/Material.h rename to Platform/Chart3D/Material.h diff --git a/3D/Math.h b/Platform/Chart3D/Math.h similarity index 99% rename from 3D/Math.h rename to Platform/Chart3D/Math.h index 651741a88..8db6be380 100644 --- a/3D/Math.h +++ b/Platform/Chart3D/Math.h @@ -1,10 +1,12 @@ //+------------------------------------------------------------------+ //| DXMath.mqh | -//| Copyright 2019,MetaQuotes Software Corp. | +//| Copyright 2019,MetaQuotes Software Corp. | //| https://www.mql5.com | //+------------------------------------------------------------------+ +#ifdef __MQL__ #property copyright "Copyright 2019,MetaQuotes Software Corp." #property link "https://www.mql5.com" +#endif //+------------------------------------------------------------------+ //| DirectX Math Routines | //+------------------------------------------------------------------+ diff --git a/3D/Mesh.h b/Platform/Chart3D/Mesh.h similarity index 98% rename from 3D/Mesh.h rename to Platform/Chart3D/Mesh.h index f7e6fc523..754ee5c5f 100644 --- a/3D/Mesh.h +++ b/Platform/Chart3D/Mesh.h @@ -25,9 +25,9 @@ * Generic graphics mesh. */ -#include "../Storage/Dict/Dict.h" -#include "../Refs.mqh" -#include "../Util.h" +#include "../../Storage/Dict/Dict.h" +#include "../../Refs.mqh" +#include "../../Util.h" #include "Face.h" #include "IndexBuffer.h" #include "Material.h" diff --git a/3D/Shader.h b/Platform/Chart3D/Shader.h similarity index 99% rename from 3D/Shader.h rename to Platform/Chart3D/Shader.h index 51ae50504..45576f55e 100644 --- a/3D/Shader.h +++ b/Platform/Chart3D/Shader.h @@ -25,7 +25,7 @@ * Generic graphics shader. */ -#include "../Refs.mqh" +#include "../../Refs.mqh" // Shader type. enum ENUM_SHADER_TYPE { diff --git a/3D/Shaders/chart3d_ps.hlsl b/Platform/Chart3D/Shaders/chart3d_ps.hlsl similarity index 100% rename from 3D/Shaders/chart3d_ps.hlsl rename to Platform/Chart3D/Shaders/chart3d_ps.hlsl diff --git a/3D/Shaders/chart3d_vs.hlsl b/Platform/Chart3D/Shaders/chart3d_vs.hlsl similarity index 100% rename from 3D/Shaders/chart3d_vs.hlsl rename to Platform/Chart3D/Shaders/chart3d_vs.hlsl diff --git a/3D/Shaders/cube_ps.hlsl b/Platform/Chart3D/Shaders/cube_ps.hlsl similarity index 100% rename from 3D/Shaders/cube_ps.hlsl rename to Platform/Chart3D/Shaders/cube_ps.hlsl diff --git a/3D/Shaders/cube_vs.hlsl b/Platform/Chart3D/Shaders/cube_vs.hlsl similarity index 100% rename from 3D/Shaders/cube_vs.hlsl rename to Platform/Chart3D/Shaders/cube_vs.hlsl diff --git a/3D/TSR.h b/Platform/Chart3D/TSR.h similarity index 100% rename from 3D/TSR.h rename to Platform/Chart3D/TSR.h diff --git a/3D/Vertex.h b/Platform/Chart3D/Vertex.h similarity index 96% rename from 3D/Vertex.h rename to Platform/Chart3D/Vertex.h index f9b84851e..908e2f18c 100644 --- a/3D/Vertex.h +++ b/Platform/Chart3D/Vertex.h @@ -1,4 +1,4 @@ -#include "../Refs.mqh" +#include "../../Refs.mqh" /** * Generic vertex to be used by meshes. diff --git a/3D/VertexBuffer.h b/Platform/Chart3D/VertexBuffer.h similarity index 98% rename from 3D/VertexBuffer.h rename to Platform/Chart3D/VertexBuffer.h index 822c33fb2..2abda66b5 100644 --- a/3D/VertexBuffer.h +++ b/Platform/Chart3D/VertexBuffer.h @@ -25,7 +25,7 @@ * Generic graphics vertex buffer. */ -#include "../Refs.mqh" +#include "../../Refs.mqh" class VertexBuffer : public Dynamic { // Reference to graphics device. diff --git a/Platform/Chart3D/tests/Chart3D.test.mq4 b/Platform/Chart3D/tests/Chart3D.test.mq4 new file mode 100644 index 000000000..6f02f1d0f --- /dev/null +++ b/Platform/Chart3D/tests/Chart3D.test.mq4 @@ -0,0 +1,28 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test functionality of Chart3D class. + */ + +// Includes. +#include "Chart3D.test.mq5" diff --git a/3D/tests/3D.test.mq5 b/Platform/Chart3D/tests/Chart3D.test.mq5 similarity index 93% rename from 3D/tests/3D.test.mq5 rename to Platform/Chart3D/tests/Chart3D.test.mq5 index 9a4bd8cf6..ed735ac05 100644 --- a/3D/tests/3D.test.mq5 +++ b/Platform/Chart3D/tests/Chart3D.test.mq5 @@ -40,11 +40,11 @@ #include "../Devices/MTDX/MTDXShader.h" #include "../Devices/MTDX/MTDXVertexBuffer.h" #include "../Frontends/MT5Frontend.h" -#include "../../Storage/Dict/Buffer/BufferStruct.h" -#include "../../Platform/Chart/Chart.h" -#include "../../Platform/Platform.h" -#include "../../Serializer/Serializer.h" -#include "../../Test.mqh" +#include "../../../Storage/Dict/Buffer/BufferStruct.h" +#include "../../Chart/Chart.h" +#include "../../Platform.h" +#include "../../../Serializer/Serializer.h" +#include "../../../Test.mqh" /** * Implements OnInit(). diff --git a/3D/tests/Shaders/pixel.hlsl b/Platform/Chart3D/tests/Shaders/pixel.hlsl similarity index 100% rename from 3D/tests/Shaders/pixel.hlsl rename to Platform/Chart3D/tests/Shaders/pixel.hlsl diff --git a/3D/tests/Shaders/vertex.hlsl b/Platform/Chart3D/tests/Shaders/vertex.hlsl similarity index 100% rename from 3D/tests/Shaders/vertex.hlsl rename to Platform/Chart3D/tests/Shaders/vertex.hlsl diff --git a/tests/CompileTest.mq5 b/tests/CompileTest.mq5 index 161337022..087595012 100644 --- a/tests/CompileTest.mq5 +++ b/tests/CompileTest.mq5 @@ -26,13 +26,13 @@ // 3D includes (MQL5 only). #ifdef __MQL5__ -#include "../3D/Chart3D.h" -#include "../3D/Cube.h" -#include "../3D/Devices/MTDX/MTDXDevice.h" -#include "../3D/Devices/MTDX/MTDXIndexBuffer.h" -#include "../3D/Devices/MTDX/MTDXShader.h" -#include "../3D/Devices/MTDX/MTDXVertexBuffer.h" -#include "../3D/Frontends/MT5Frontend.h" +#include "../Platform/Chart3D/Chart3D.h" +#include "../Platform/Chart3D/Cube.h" +#include "../Platform/Chart3D/Devices/MTDX/MTDXDevice.h" +#include "../Platform/Chart3D/Devices/MTDX/MTDXIndexBuffer.h" +#include "../Platform/Chart3D/Devices/MTDX/MTDXShader.h" +#include "../Platform/Chart3D/Devices/MTDX/MTDXVertexBuffer.h" +#include "../Platform/Chart3D/Frontends/MT5Frontend.h" #endif // Forward declaration. From ce2541a8e897c596b105f8153fe2fd1dd421d3bd Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 18 Jun 2023 21:04:46 +0100 Subject: [PATCH 059/109] Moves struct into ShaderVertexLayout.struct.h Adds README.md --- Platform/Chart3D/Device.h | 1 + Platform/Chart3D/README.md | 1 + Platform/Chart3D/Shader.h | 11 ------ Platform/Chart3D/ShaderVertexLayout.struct.h | 37 ++++++++++++++++++++ 4 files changed, 39 insertions(+), 11 deletions(-) create mode 100644 Platform/Chart3D/README.md create mode 100644 Platform/Chart3D/ShaderVertexLayout.struct.h diff --git a/Platform/Chart3D/Device.h b/Platform/Chart3D/Device.h index 4fb49ea85..181391eca 100644 --- a/Platform/Chart3D/Device.h +++ b/Platform/Chart3D/Device.h @@ -33,6 +33,7 @@ #include "Math.h" #include "Mesh.h" #include "Shader.h" +#include "ShaderVertexLayout.struct.h" #include "VertexBuffer.h" enum GFX_DRAW_TEXT_FLAGS { GFX_DRAW_TEXT_FLAG_NONE, GFX_DRAW_TEXT_FLAG_2D_COORD_X, GFX_DRAW_TEXT_FLAG_2D_COORD_Y }; diff --git a/Platform/Chart3D/README.md b/Platform/Chart3D/README.md new file mode 100644 index 000000000..2c8882790 --- /dev/null +++ b/Platform/Chart3D/README.md @@ -0,0 +1 @@ +# Chart3D diff --git a/Platform/Chart3D/Shader.h b/Platform/Chart3D/Shader.h index 45576f55e..7c4919c2c 100644 --- a/Platform/Chart3D/Shader.h +++ b/Platform/Chart3D/Shader.h @@ -55,17 +55,6 @@ struct MVPBuffer { // char _unused2[1]; }; -// Vertex layout used for Vertex Shaders. -struct ShaderVertexLayout { - string name; - unsigned int index; - ENUM_GFX_VAR_TYPE_FLOAT type; - unsigned int num_components; - bool clamped; - unsigned int stride; - unsigned int offset; -}; - /** * Unified vertex/pixel shader. */ diff --git a/Platform/Chart3D/ShaderVertexLayout.struct.h b/Platform/Chart3D/ShaderVertexLayout.struct.h new file mode 100644 index 000000000..240ef4462 --- /dev/null +++ b/Platform/Chart3D/ShaderVertexLayout.struct.h @@ -0,0 +1,37 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 31337 Investments 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 . + * + */ + +/** + * @file + * Defines ShaderVertexLayout structure. + */ + +// Vertex layout used for Vertex Shaders. +struct ShaderVertexLayout { + string name; + unsigned int index; + ENUM_GFX_VAR_TYPE_FLOAT type; + unsigned int num_components; + bool clamped; + unsigned int stride; + unsigned int offset; +}; From d1669be74a240601020144cbf65aaca3b146dd6d Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 18 Jun 2023 21:29:19 +0100 Subject: [PATCH 060/109] Moves Math related classes under Math/ --- .github/workflows/test-math.yml | 62 +++++++++++++++++++ .github/workflows/test.yml | 3 - Convert.mqh | 2 +- Indicator/Indicator.h | 2 +- Indicators/Special/Indi_Math.mqh | 2 +- Market.mqh | 2 +- Math.define.h => Math/Math.define.h | 0 Math.enum.h => Math/Math.enum.h | 0 Math.extern.h => Math/Math.extern.h | 0 Math.h => Math/Math.h | 4 +- Math.struct.h => Math/Math.struct.h | 2 +- Matrix.mqh => Math/Matrix.h | 1 + MiniMatrix.h => Math/MatrixMini.h | 9 ++- Math/tests/Makefile | 12 ++++ Math/tests/Math.test.cpp | 36 +++++++++++ .../MathTest.mq4 => Math/tests/Math.test.mq4 | 2 +- .../MathTest.mq5 => Math/tests/Math.test.mq5 | 2 +- Math/tests/Matrix.test.cpp | 36 +++++++++++ .../tests/Matrix.test.mq4 | 2 +- .../tests/Matrix.test.mq5 | 4 +- Math/tests/MatrixMini.test.mq4 | 28 +++++++++ Math/tests/MatrixMini.test.mq5 | 41 ++++++++++++ Pattern.struct.h | 2 +- Platform/Orders.h | 2 +- Platform/Platform.extern.h | 7 +++ Serializer/SerializerCsv.h | 4 +- Serializer/SerializerNode.h | 2 +- Std.h | 2 +- Storage/Array.h | 2 +- Storage/Database.h | 2 +- Storage/Dict/Dict.h | 2 +- Storage/String.extern.h | 2 +- Timer.mqh | 2 +- Trade.mqh | 2 +- tests/CompileTest.mq5 | 6 +- 35 files changed, 256 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/test-math.yml rename Math.define.h => Math/Math.define.h (100%) rename Math.enum.h => Math/Math.enum.h (100%) rename Math.extern.h => Math/Math.extern.h (100%) rename Math.h => Math/Math.h (98%) rename Math.struct.h => Math/Math.struct.h (97%) rename Matrix.mqh => Math/Matrix.h (99%) rename MiniMatrix.h => Math/MatrixMini.h (93%) create mode 100644 Math/tests/Makefile create mode 100644 Math/tests/Math.test.cpp rename tests/MathTest.mq4 => Math/tests/Math.test.mq4 (97%) rename tests/MathTest.mq5 => Math/tests/Math.test.mq5 (99%) create mode 100644 Math/tests/Matrix.test.cpp rename tests/MatrixTest.mq4 => Math/tests/Matrix.test.mq4 (97%) rename tests/MatrixTest.mq5 => Math/tests/Matrix.test.mq5 (99%) create mode 100644 Math/tests/MatrixMini.test.mq4 create mode 100644 Math/tests/MatrixMini.test.mq5 diff --git a/.github/workflows/test-math.yml b/.github/workflows/test-math.yml new file mode 100644 index 000000000..a3f5c2408 --- /dev/null +++ b/.github/workflows/test-math.yml @@ -0,0 +1,62 @@ +--- +name: Test Math + +# yamllint disable-line rule:truthy +on: + pull_request: + paths: + - 'Math/**' + - '.github/workflows/test-math.yml' + push: + paths: + - 'Math/**' + - '.github/workflows/test-math.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: 'Math/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' + + Tests-MQL4: + defaults: + run: + shell: bash + working-directory: Math/tests + needs: Compile + runs-on: ubuntu-latest + strategy: + matrix: + test: + - Math.test + - Matrix.test + - MatrixMini.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 }} + RunOnError: show_logs 200 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c18f394eb..6dddb6abf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -54,10 +54,8 @@ jobs: matrix: test: - EATest - - IndicatorsTest - MailTest - MarketTest - - MatrixTest - StatsTest - StrategyTest - StrategyTest-RSI @@ -97,7 +95,6 @@ jobs: - ConvertTest - LogTest - MD5Test - - MathTest - ProfilerTest - RefsTest - TimerTest diff --git a/Convert.mqh b/Convert.mqh index 4ac7b675f..b4ae88493 100644 --- a/Convert.mqh +++ b/Convert.mqh @@ -32,7 +32,7 @@ #include "Convert.extern.h" #include "Storage/DateTime.extern.h" #include "Storage/DateTime.h" -#include "Math.extern.h" +#include "Math/Math.extern.h" #include "Platform/Order.enum.h" #include "SymbolInfo.enum.h" #include "SymbolInfo.extern.h" diff --git a/Indicator/Indicator.h b/Indicator/Indicator.h index 69117c594..395d5b1dc 100644 --- a/Indicator/Indicator.h +++ b/Indicator/Indicator.h @@ -33,7 +33,7 @@ struct IndicatorParams; #include "../Storage/DateTime.h" #include "../Indicators/DrawIndicator.mqh" #include "../Storage/Flags.struct.h" -#include "../Math.h" +#include "../Math/Math.h" #include "../Storage/Object.h" #include "../Refs.mqh" #include "../Serializer/Serializer.h" diff --git a/Indicators/Special/Indi_Math.mqh b/Indicators/Special/Indi_Math.mqh index ef1af3837..f42dcd4c9 100644 --- a/Indicators/Special/Indi_Math.mqh +++ b/Indicators/Special/Indi_Math.mqh @@ -23,7 +23,7 @@ // Includes. #include "../../Storage/Dict/Buffer/BufferStruct.h" #include "../../Indicator/Indicator.h" -#include "../../Math.enum.h" +#include "../../Math/Math.enum.h" enum ENUM_MATH_OP_MODE { MATH_OP_MODE_BUILTIN, MATH_OP_MODE_CUSTOM_FUNCTION }; diff --git a/Market.mqh b/Market.mqh index 538a57319..2a2c9cedb 100644 --- a/Market.mqh +++ b/Market.mqh @@ -26,7 +26,7 @@ // Includes. #include "Market.struct.h" -#include "Math.h" +#include "Math/Math.h" #include "Serializer/Serializer.h" #include "SymbolInfo.mqh" #include "SymbolInfo.struct.static.h" diff --git a/Math.define.h b/Math/Math.define.h similarity index 100% rename from Math.define.h rename to Math/Math.define.h diff --git a/Math.enum.h b/Math/Math.enum.h similarity index 100% rename from Math.enum.h rename to Math/Math.enum.h diff --git a/Math.extern.h b/Math/Math.extern.h similarity index 100% rename from Math.extern.h rename to Math/Math.extern.h diff --git a/Math.h b/Math/Math.h similarity index 98% rename from Math.h rename to Math/Math.h index fb942ae34..b3c171c6f 100644 --- a/Math.h +++ b/Math/Math.h @@ -26,8 +26,8 @@ #endif // Includes. -#include "Storage/Data.struct.h" -#include "Indicator/Indicator.struct.h" +#include "../Storage/Data.struct.h" +#include "../Indicator/Indicator.struct.h" #include "Math.define.h" #include "Math.enum.h" #include "Math.extern.h" diff --git a/Math.struct.h b/Math/Math.struct.h similarity index 97% rename from Math.struct.h rename to Math/Math.struct.h index 4d8f957b7..50c9bfa7b 100644 --- a/Math.struct.h +++ b/Math/Math.struct.h @@ -29,7 +29,7 @@ #pragma once #endif -#include "Storage/Data.struct.h" +#include "../Storage/Data.struct.h" // Prevents processing this includes file for the second time. #ifndef MATH_STRUCT_H diff --git a/Matrix.mqh b/Math/Matrix.h similarity index 99% rename from Matrix.mqh rename to Math/Matrix.h index cb030c1fe..0893870d6 100644 --- a/Matrix.mqh +++ b/Math/Matrix.h @@ -30,6 +30,7 @@ #endif #endif +// Includes. #include "Math.h" #define MATRIX_DIMENSIONS 6 diff --git a/MiniMatrix.h b/Math/MatrixMini.h similarity index 93% rename from MiniMatrix.h rename to Math/MatrixMini.h index 14560235f..ffb08babb 100644 --- a/MiniMatrix.h +++ b/Math/MatrixMini.h @@ -21,8 +21,11 @@ */ // Prevents processing this includes file for the second time. -#ifndef MINIMATRIX_MQH -#define MINIMATRIX_MQH +#ifndef MINIMATRIX_H +#define MINIMATRIX_H + +// Includes. +#include "../Platform/Platform.extern.h" template class MiniMatrix2d { @@ -57,4 +60,4 @@ class MiniMatrix2d { int SizeY() { return size_y; } }; -#endif +#endif // MINIMATRIX_H diff --git a/Math/tests/Makefile b/Math/tests/Makefile new file mode 100644 index 000000000..e792364f0 --- /dev/null +++ b/Math/tests/Makefile @@ -0,0 +1,12 @@ +CC := g++ # C++ compiler +CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags +SRCS := $(wildcard *.cpp) # Get all .cpp files in the current directory +OBJS := $(SRCS:.cpp=.o) # Object files corresponding to the source files + +all: $(OBJS) + +%.o: %.cpp + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -v $(OBJS) diff --git a/Math/tests/Math.test.cpp b/Math/tests/Math.test.cpp new file mode 100644 index 000000000..3d50de2d9 --- /dev/null +++ b/Math/tests/Math.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test C++ compilation of Math class. + */ + +// Includes. +#include "../Math.h" +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + + // @todo + + return 0; +} diff --git a/tests/MathTest.mq4 b/Math/tests/Math.test.mq4 similarity index 97% rename from tests/MathTest.mq4 rename to Math/tests/Math.test.mq4 index 24a8cf2e0..06408cfb8 100644 --- a/tests/MathTest.mq4 +++ b/Math/tests/Math.test.mq4 @@ -25,4 +25,4 @@ */ // Includes. -#include "MathTest.mq5" +#include "Math.test.mq5" diff --git a/tests/MathTest.mq5 b/Math/tests/Math.test.mq5 similarity index 99% rename from tests/MathTest.mq5 rename to Math/tests/Math.test.mq5 index b5f20d260..dd3a25a83 100644 --- a/tests/MathTest.mq5 +++ b/Math/tests/Math.test.mq5 @@ -26,7 +26,7 @@ // Includes. #include "../Math.h" -#include "../Test.mqh" +#include "../../Test.mqh" /** * Implements initialization function. diff --git a/Math/tests/Matrix.test.cpp b/Math/tests/Matrix.test.cpp new file mode 100644 index 000000000..c0e816206 --- /dev/null +++ b/Math/tests/Matrix.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test C++ compilation of Matrix class. + */ + +// Includes. +#include "../Matrix.h" +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + + // @todo + + return 0; +} diff --git a/tests/MatrixTest.mq4 b/Math/tests/Matrix.test.mq4 similarity index 97% rename from tests/MatrixTest.mq4 rename to Math/tests/Matrix.test.mq4 index 9cdca34a7..843ce8731 100644 --- a/tests/MatrixTest.mq4 +++ b/Math/tests/Matrix.test.mq4 @@ -25,4 +25,4 @@ */ // Includes. -#include "MatrixTest.mq5" +#include "Matrix.test.mq5" diff --git a/tests/MatrixTest.mq5 b/Math/tests/Matrix.test.mq5 similarity index 99% rename from tests/MatrixTest.mq5 rename to Math/tests/Matrix.test.mq5 index f1d3d679e..44524f92d 100644 --- a/tests/MatrixTest.mq5 +++ b/Math/tests/Matrix.test.mq5 @@ -28,8 +28,8 @@ #define USE_MQL_MATH_STAT // Includes. -#include "../Matrix.mqh" -#include "../Test.mqh" +#include "../Matrix.h" +#include "../../Test.mqh" /** * Implements Init event handler. diff --git a/Math/tests/MatrixMini.test.mq4 b/Math/tests/MatrixMini.test.mq4 new file mode 100644 index 000000000..d7b57ea11 --- /dev/null +++ b/Math/tests/MatrixMini.test.mq4 @@ -0,0 +1,28 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test functionality of MatrixMini class. + */ + +// Includes. +#include "MatrixMini.test.mq5" diff --git a/Math/tests/MatrixMini.test.mq5 b/Math/tests/MatrixMini.test.mq5 new file mode 100644 index 000000000..6089aed2e --- /dev/null +++ b/Math/tests/MatrixMini.test.mq5 @@ -0,0 +1,41 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test functionality of MatrixMini class. + */ + +// Includes. +#include "../MatrixMini.h" +#include "../../Test.mqh" + +/** + * Implements Init event handler. + */ +int OnInit() { + + // @todo: Write some tests. + + // MatrixMini _matrix(2, 3, 20); + + return INIT_SUCCEEDED; +} diff --git a/Pattern.struct.h b/Pattern.struct.h index 83422f4a6..657d9ad4e 100644 --- a/Pattern.struct.h +++ b/Pattern.struct.h @@ -32,7 +32,7 @@ // Includes. #include "Bar.struct.h" -#include "Math.define.h" +#include "Math/Math.define.h" #include "Pattern.enum.h" // Defines structure for bitwise pattern values. diff --git a/Platform/Orders.h b/Platform/Orders.h index 52940e289..2f498d852 100644 --- a/Platform/Orders.h +++ b/Platform/Orders.h @@ -27,7 +27,7 @@ class Orders; #include "../Exchange/Account/Account.h" #include "Chart/Chart.struct.static.h" #include "../Log.mqh" -#include "../Math.h" +#include "../Math/Math.h" #include "Order.h" #include "Terminal.h" #include "../Trade.struct.h" diff --git a/Platform/Platform.extern.h b/Platform/Platform.extern.h index 941f617ac..3d0d67211 100644 --- a/Platform/Platform.extern.h +++ b/Platform/Platform.extern.h @@ -44,6 +44,13 @@ double iCustom(string symbol, int timeframe, string name, Args... args) { return 0; } +/** + * Displays a message in a separate window. + * @docs: https://www.mql5.com/en/docs/common/alert + */ +extern void Alert(char* argument); +extern void Alert(string argument); + /** * Returns number of candles for a given symbol and time-frame. */ diff --git a/Serializer/SerializerCsv.h b/Serializer/SerializerCsv.h index 9a8b76a93..fd90dd9b5 100644 --- a/Serializer/SerializerCsv.h +++ b/Serializer/SerializerCsv.h @@ -28,8 +28,8 @@ #include "../Storage/Dict/Dict.h" #include "../Storage/Dict/DictObject.h" #include "../Storage/Dict/DictStruct.h" -#include "../Matrix.mqh" -#include "../MiniMatrix.h" +#include "../Math/Matrix.h" +#include "../Math/MatrixMini.h" #include "../Storage/Object.h" #include "SerializerConverter.h" #include "SerializerNode.h" diff --git a/Serializer/SerializerNode.h b/Serializer/SerializerNode.h index f56ecf207..00c981d1f 100644 --- a/Serializer/SerializerNode.h +++ b/Serializer/SerializerNode.h @@ -25,7 +25,7 @@ #define SERIALIZER_NODE_H // Includes. -#include "../Math.extern.h" +#include "../Math/Math.extern.h" #include "../Platform/Terminal.define.h" #include "SerializerNode.enum.h" #include "SerializerNodeParam.h" diff --git a/Std.h b/Std.h index 03bc65bdd..84f290e47 100644 --- a/Std.h +++ b/Std.h @@ -23,7 +23,7 @@ #ifndef __MQL__ // Allows the preprocessor to include a header file when it is needed. #pragma once -#include "Math.define.h" +#include "Math/Math.define.h" #endif // Includes. diff --git a/Storage/Array.h b/Storage/Array.h index cd2feeaf8..d71102230 100644 --- a/Storage/Array.h +++ b/Storage/Array.h @@ -29,7 +29,7 @@ #include "Array.extern.h" #include "../Common.extern.h" #include "../Convert.extern.h" -#include "../Math.extern.h" +#include "../Math/Math.extern.h" #include "../Std.h" #include "String.extern.h" diff --git a/Storage/Database.h b/Storage/Database.h index 705faaeff..13fa64fa3 100644 --- a/Storage/Database.h +++ b/Storage/Database.h @@ -34,7 +34,7 @@ // Includes. #include "../Storage/Dict/DictStruct.h" -#include "../MiniMatrix.h" +#include "../Math/MatrixMini.h" #include "Database.struct.h" // Enums. diff --git a/Storage/Dict/Dict.h b/Storage/Dict/Dict.h index 015f64e7e..473627e18 100644 --- a/Storage/Dict/Dict.h +++ b/Storage/Dict/Dict.h @@ -27,7 +27,7 @@ #include "../../Convert.basic.h" #include "DictBase.h" #include "DictIteratorBase.h" -#include "../../Matrix.mqh" +#include "../../Math/Matrix.h" #include "../../Serializer/Serializer.h" #include "../../Serializer/SerializerNodeIterator.h" diff --git a/Storage/String.extern.h b/Storage/String.extern.h index 2f97b16cc..7f54cb43a 100644 --- a/Storage/String.extern.h +++ b/Storage/String.extern.h @@ -33,7 +33,7 @@ #include #include -#include "../Math.extern.h" +#include "../Math/Math.extern.h" #include "../Std.h" #include "../Platform/Terminal.define.h" diff --git a/Timer.mqh b/Timer.mqh index facaf2f9a..d0c111dc7 100644 --- a/Timer.mqh +++ b/Timer.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "Math.h" +#include "Math/Math.h" #include "Storage/Object.h" /** diff --git a/Trade.mqh b/Trade.mqh index 6471a0810..b09d876cb 100644 --- a/Trade.mqh +++ b/Trade.mqh @@ -34,7 +34,7 @@ class Trade; #include "Convert.mqh" #include "Storage/Dict/DictStruct.h" #include "Indicator/IndicatorData.h" -#include "Math.h" +#include "Math/Math.h" #include "Storage/Object.h" #include "Platform/Order.h" #include "Platform/OrderQuery.h" diff --git a/tests/CompileTest.mq5 b/tests/CompileTest.mq5 index 087595012..044a75025 100644 --- a/tests/CompileTest.mq5 +++ b/tests/CompileTest.mq5 @@ -67,9 +67,9 @@ struct IndicatorParams; #include "../Task/TaskCondition.h" #include "../Mail.mqh" #include "../Market.mqh" -#include "../Math.h" -#include "../Matrix.mqh" -#include "../MiniMatrix.h" +#include "../Math/Math.h" +#include "../Math/Matrix.h" +#include "../Math/MatrixMini.h" #include "../Storage/Object.h" #include "../Platform/Order.h" #include "../Platform/Orders.h" From 4d1e6c8efc485f930d7ebcdaafff70a7a7cf6f5f Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 18 Jun 2023 21:44:32 +0100 Subject: [PATCH 061/109] Updates GHA workflows --- .github/workflows/check.yml | 12 ++++++++---- .github/workflows/compile-cpp.yml | 12 ++++++------ .github/workflows/compile-mql.yml | 2 +- .github/workflows/sync-fork.yml | 6 +++--- .github/workflows/test-exchange-account.yml | 8 ++++---- .github/workflows/test-exchange.yml | 8 ++++---- .github/workflows/test-indicator.yml | 8 ++++---- .github/workflows/test-indicators-bitwise.yml | 8 ++++---- .github/workflows/test-indicators-ohlc.yml | 8 ++++---- .github/workflows/test-indicators-oscillator.yml | 8 ++++---- .github/workflows/test-indicators-price.yml | 8 ++++---- .github/workflows/test-indicators-pricemulti.yml | 8 ++++---- .github/workflows/test-indicators-pricerange.yml | 8 ++++---- .github/workflows/test-indicators-special.yml | 8 ++++---- .github/workflows/test-indicators-tick.yml | 8 ++++---- .github/workflows/test-indicators.yml | 8 ++++---- .github/workflows/test-math.yml | 8 ++++---- .github/workflows/test-platform-chart.yml | 8 ++++---- .github/workflows/test-platform-chart3d.yml | 8 ++++---- .github/workflows/test-platform-web.yml | 8 ++++---- .github/workflows/test-platform.yml | 8 ++++---- .github/workflows/test-serializer.yml | 8 ++++---- .github/workflows/test-storage-cache.yml | 8 ++++---- .github/workflows/test-storage-dict-buffer.yml | 8 ++++---- .github/workflows/test-storage-dict.yml | 8 ++++---- .github/workflows/test-storage.yml | 8 ++++---- .github/workflows/test-task.yml | 8 ++++---- .github/workflows/test-tick.yml | 8 ++++---- .github/workflows/test-trade.yml | 8 ++++---- .github/workflows/test.yml | 11 +++++------ 30 files changed, 123 insertions(+), 120 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index d55ecc44a..4b3a33d5c 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -1,7 +1,7 @@ --- name: Check -# yamllint disable rule:truthy +# yamllint disable-line rule:truthy on: pull_request: push: @@ -10,6 +10,10 @@ jobs: Pre-commit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v1 - - uses: pre-commit/action@v2.0.0 + - uses: actions/checkout@v3 + - uses: actions/cache@v3 + with: + path: ~/.cache/pre-commit + key: pre-commit|${{ hashFiles('.pre-commit-config.yaml') }} + - uses: actions/setup-python@v3 + - uses: pre-commit/action@v3.0.0 diff --git a/.github/workflows/compile-cpp.yml b/.github/workflows/compile-cpp.yml index 6243e9e5a..8bcbc0cb6 100644 --- a/.github/workflows/compile-cpp.yml +++ b/.github/workflows/compile-cpp.yml @@ -4,13 +4,13 @@ name: Compile C++ # yamllint disable-line rule:truthy on: pull_request: - paths-ignore: - - '**.md' - - '.github/workflows/compile-cpp.yml' + paths: + - '**.h' + - '**.mq?' push: - paths-ignore: - - '**.md' - - '.github/workflows/compile-cpp.yml' + paths: + - '**.h' + - '**.mq?' jobs: diff --git a/.github/workflows/compile-mql.yml b/.github/workflows/compile-mql.yml index 9e257e22f..2f303a298 100644 --- a/.github/workflows/compile-mql.yml +++ b/.github/workflows/compile-mql.yml @@ -17,7 +17,7 @@ jobs: Compile-MQL: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Compile uses: fx31337/mql-compile-action@master with: diff --git a/.github/workflows/sync-fork.yml b/.github/workflows/sync-fork.yml index b2fd6e168..f05a3c53c 100644 --- a/.github/workflows/sync-fork.yml +++ b/.github/workflows/sync-fork.yml @@ -1,7 +1,7 @@ --- name: Sync Fork -# yamllint disable rule:truthy +# yamllint disable-line rule:truthy on: push: branches: @@ -14,11 +14,11 @@ jobs: if: github.repository != 'EA31337/EA31337-classes' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 persist-credentials: false - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 path: upstream diff --git a/.github/workflows/test-exchange-account.yml b/.github/workflows/test-exchange-account.yml index 04c6680d8..e7d50adc5 100644 --- a/.github/workflows/test-exchange-account.yml +++ b/.github/workflows/test-exchange-account.yml @@ -17,7 +17,7 @@ jobs: Compile: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Compile uses: fx31337/mql-compile-action@master with: @@ -28,12 +28,12 @@ jobs: run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' shell: powershell - name: Upload artifacts (MQL4) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex4 path: '**/*.ex4' - name: Upload artifacts (MQL5) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex5 path: '**/*.ex5' @@ -52,7 +52,7 @@ jobs: - AccountForex.test - AccountMt.test steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: files-ex4 - name: Run ${{ matrix.test }} diff --git a/.github/workflows/test-exchange.yml b/.github/workflows/test-exchange.yml index b411d32bc..5fb580346 100644 --- a/.github/workflows/test-exchange.yml +++ b/.github/workflows/test-exchange.yml @@ -17,7 +17,7 @@ jobs: Compile: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Compile uses: fx31337/mql-compile-action@master with: @@ -28,12 +28,12 @@ jobs: run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' shell: powershell - name: Upload artifacts (MQL4) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex4 path: '**/*.ex4' - name: Upload artifacts (MQL5) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex5 path: '**/*.ex5' @@ -50,7 +50,7 @@ jobs: test: - Exchange.test steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: files-ex4 - name: Run ${{ matrix.test }} diff --git a/.github/workflows/test-indicator.yml b/.github/workflows/test-indicator.yml index 54c12dfcd..c2a0300d9 100644 --- a/.github/workflows/test-indicator.yml +++ b/.github/workflows/test-indicator.yml @@ -19,7 +19,7 @@ jobs: Compile: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Compile uses: fx31337/mql-compile-action@master with: @@ -30,12 +30,12 @@ jobs: run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' shell: powershell - name: Upload artifacts (MQL4) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex4 path: '**/*.ex4' - name: Upload artifacts (MQL5) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex5 path: '**/*.ex5' @@ -58,7 +58,7 @@ jobs: - IndicatorTick.test - IndicatorRenko.test steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: files-ex4 - name: Run ${{ matrix.test }} diff --git a/.github/workflows/test-indicators-bitwise.yml b/.github/workflows/test-indicators-bitwise.yml index 32493baaa..70ed04efb 100644 --- a/.github/workflows/test-indicators-bitwise.yml +++ b/.github/workflows/test-indicators-bitwise.yml @@ -19,7 +19,7 @@ jobs: Compile: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Compile uses: fx31337/mql-compile-action@master with: @@ -30,12 +30,12 @@ jobs: run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' shell: powershell - name: Upload artifacts (MQL4) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex4 path: '**/*.ex4' - name: Upload artifacts (MQL5) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex5 path: '**/*.ex5' @@ -53,7 +53,7 @@ jobs: - Indi_Candle.test - Indi_Pattern.test steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: files-ex4 - name: Run ${{ matrix.test }} diff --git a/.github/workflows/test-indicators-ohlc.yml b/.github/workflows/test-indicators-ohlc.yml index ce6c7c8a6..9885fa5ff 100644 --- a/.github/workflows/test-indicators-ohlc.yml +++ b/.github/workflows/test-indicators-ohlc.yml @@ -19,7 +19,7 @@ jobs: Compile: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Compile uses: fx31337/mql-compile-action@master with: @@ -30,12 +30,12 @@ jobs: run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' shell: powershell - name: Upload artifacts (MQL4) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex4 path: '**/*.ex4' - name: Upload artifacts (MQL5) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex5 path: '**/*.ex5' @@ -52,7 +52,7 @@ jobs: test: - Indi_OHLC.test steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: files-ex4 - name: Run ${{ matrix.test }} diff --git a/.github/workflows/test-indicators-oscillator.yml b/.github/workflows/test-indicators-oscillator.yml index 6b4142dd3..a66ff3177 100644 --- a/.github/workflows/test-indicators-oscillator.yml +++ b/.github/workflows/test-indicators-oscillator.yml @@ -19,7 +19,7 @@ jobs: Compile: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Compile uses: fx31337/mql-compile-action@master with: @@ -30,12 +30,12 @@ jobs: run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' shell: powershell - name: Upload artifacts (MQL4) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex4 path: '**/*.ex4' - name: Upload artifacts (MQL5) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex5 path: '**/*.ex5' @@ -55,7 +55,7 @@ jobs: - Indi_Stochastic.test - Indi_WPR.test steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: files-ex4 - name: Run ${{ matrix.test }} diff --git a/.github/workflows/test-indicators-price.yml b/.github/workflows/test-indicators-price.yml index ea5271c4e..38442d2fe 100644 --- a/.github/workflows/test-indicators-price.yml +++ b/.github/workflows/test-indicators-price.yml @@ -19,7 +19,7 @@ jobs: Compile: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Compile uses: fx31337/mql-compile-action@master with: @@ -30,12 +30,12 @@ jobs: run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' shell: powershell - name: Upload artifacts (MQL4) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex4 path: '**/*.ex4' - name: Upload artifacts (MQL5) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex5 path: '**/*.ex5' @@ -54,7 +54,7 @@ jobs: - Indi_MA.test - Indi_Price.test steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: files-ex4 - name: Run ${{ matrix.test }} diff --git a/.github/workflows/test-indicators-pricemulti.yml b/.github/workflows/test-indicators-pricemulti.yml index 287e7fc3c..ffbb50135 100644 --- a/.github/workflows/test-indicators-pricemulti.yml +++ b/.github/workflows/test-indicators-pricemulti.yml @@ -19,7 +19,7 @@ jobs: Compile: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Compile uses: fx31337/mql-compile-action@master with: @@ -30,12 +30,12 @@ jobs: run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' shell: powershell - name: Upload artifacts (MQL4) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex4 path: '**/*.ex4' - name: Upload artifacts (MQL5) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex5 path: '**/*.ex5' @@ -52,7 +52,7 @@ jobs: test: - Indi_Alligator.test steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: files-ex4 - name: Run ${{ matrix.test }} diff --git a/.github/workflows/test-indicators-pricerange.yml b/.github/workflows/test-indicators-pricerange.yml index 77baddd93..d7f14cf45 100644 --- a/.github/workflows/test-indicators-pricerange.yml +++ b/.github/workflows/test-indicators-pricerange.yml @@ -19,7 +19,7 @@ jobs: Compile: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Compile uses: fx31337/mql-compile-action@master with: @@ -30,12 +30,12 @@ jobs: run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' shell: powershell - name: Upload artifacts (MQL4) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex4 path: '**/*.ex4' - name: Upload artifacts (MQL5) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex5 path: '**/*.ex5' @@ -54,7 +54,7 @@ jobs: - Indi_Envelopes.test - Indi_SAR.test steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: files-ex4 - name: Run ${{ matrix.test }} diff --git a/.github/workflows/test-indicators-special.yml b/.github/workflows/test-indicators-special.yml index 228407782..9c64441bc 100644 --- a/.github/workflows/test-indicators-special.yml +++ b/.github/workflows/test-indicators-special.yml @@ -19,7 +19,7 @@ jobs: Compile: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Compile uses: fx31337/mql-compile-action@master with: @@ -30,12 +30,12 @@ jobs: run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' shell: powershell - name: Upload artifacts (MQL4) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex4 path: '**/*.ex4' - name: Upload artifacts (MQL5) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex5 path: '**/*.ex5' @@ -52,7 +52,7 @@ jobs: test: - Indi_Custom.test steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: files-ex4 - name: Run ${{ matrix.test }} diff --git a/.github/workflows/test-indicators-tick.yml b/.github/workflows/test-indicators-tick.yml index ee7deebfa..103ebd24e 100644 --- a/.github/workflows/test-indicators-tick.yml +++ b/.github/workflows/test-indicators-tick.yml @@ -19,7 +19,7 @@ jobs: Compile: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Compile uses: fx31337/mql-compile-action@master with: @@ -30,12 +30,12 @@ jobs: run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' shell: powershell - name: Upload artifacts (MQL4) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex4 path: '**/*.ex4' - name: Upload artifacts (MQL5) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex5 path: '**/*.ex5' @@ -52,7 +52,7 @@ jobs: test: - Indi_Tick.test steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: files-ex4 - name: Run ${{ matrix.test }} diff --git a/.github/workflows/test-indicators.yml b/.github/workflows/test-indicators.yml index 8a7e8e811..7a0ffa7dc 100644 --- a/.github/workflows/test-indicators.yml +++ b/.github/workflows/test-indicators.yml @@ -19,7 +19,7 @@ jobs: Compile: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Compile uses: fx31337/mql-compile-action@master with: @@ -30,12 +30,12 @@ jobs: run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' shell: powershell - name: Upload artifacts (MQL4) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex4 path: '**/*.ex4' - name: Upload artifacts (MQL5) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex5 path: '**/*.ex5' @@ -107,7 +107,7 @@ jobs: # Requires refactoring: # - Indi_DEMA.test steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: files-ex4 - name: Run ${{ matrix.test }} diff --git a/.github/workflows/test-math.yml b/.github/workflows/test-math.yml index a3f5c2408..ac0651ac6 100644 --- a/.github/workflows/test-math.yml +++ b/.github/workflows/test-math.yml @@ -17,7 +17,7 @@ jobs: Compile: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Compile uses: fx31337/mql-compile-action@master with: @@ -28,12 +28,12 @@ jobs: run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' shell: powershell - name: Upload artifacts (MQL4) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex4 path: '**/*.ex4' - name: Upload artifacts (MQL5) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex5 path: '**/*.ex5' @@ -52,7 +52,7 @@ jobs: - Matrix.test - MatrixMini.test steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: files-ex4 - name: Run ${{ matrix.test }} diff --git a/.github/workflows/test-platform-chart.yml b/.github/workflows/test-platform-chart.yml index fba6f0c35..181040804 100644 --- a/.github/workflows/test-platform-chart.yml +++ b/.github/workflows/test-platform-chart.yml @@ -17,7 +17,7 @@ jobs: Compile: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Compile uses: fx31337/mql-compile-action@master with: @@ -28,12 +28,12 @@ jobs: run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' shell: powershell - name: Upload artifacts (MQL4) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex4 path: '**/*.ex4' - name: Upload artifacts (MQL5) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex5 path: '**/*.ex5' @@ -51,7 +51,7 @@ jobs: - Chart.test - ChartMt.test steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: files-ex4 - name: Run ${{ matrix.test }} diff --git a/.github/workflows/test-platform-chart3d.yml b/.github/workflows/test-platform-chart3d.yml index 595e333e2..d54da30fe 100644 --- a/.github/workflows/test-platform-chart3d.yml +++ b/.github/workflows/test-platform-chart3d.yml @@ -17,7 +17,7 @@ jobs: Compile: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Compile uses: fx31337/mql-compile-action@master with: @@ -28,12 +28,12 @@ jobs: run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' shell: powershell - name: Upload artifacts (MQL4) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex4 path: '**/*.ex4' - name: Upload artifacts (MQL5) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex5 path: '**/*.ex5' @@ -50,7 +50,7 @@ jobs: test: - Chart3D.test steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: files-ex4 - name: Run ${{ matrix.test }} diff --git a/.github/workflows/test-platform-web.yml b/.github/workflows/test-platform-web.yml index 110224c34..de505e93c 100644 --- a/.github/workflows/test-platform-web.yml +++ b/.github/workflows/test-platform-web.yml @@ -17,7 +17,7 @@ jobs: Compile: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Compile uses: fx31337/mql-compile-action@master with: @@ -28,12 +28,12 @@ jobs: run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' shell: powershell - name: Upload artifacts (MQL4) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex4 path: '**/*.ex4' - name: Upload artifacts (MQL5) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex5 path: '**/*.ex5' @@ -51,7 +51,7 @@ jobs: # @fixme: GH-266 - Web.test steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: files-ex4 - name: Run ${{ matrix.test }} diff --git a/.github/workflows/test-platform.yml b/.github/workflows/test-platform.yml index 0bb8b5638..8dcc77815 100644 --- a/.github/workflows/test-platform.yml +++ b/.github/workflows/test-platform.yml @@ -17,7 +17,7 @@ jobs: Compile: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Compile uses: fx31337/mql-compile-action@master with: @@ -28,12 +28,12 @@ jobs: run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' shell: powershell - name: Upload artifacts (MQL4) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex4 path: '**/*.ex4' - name: Upload artifacts (MQL5) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex5 path: '**/*.ex5' @@ -54,7 +54,7 @@ jobs: - Platform.test - Terminal.test steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: files-ex4 - name: Run ${{ matrix.test }} diff --git a/.github/workflows/test-serializer.yml b/.github/workflows/test-serializer.yml index e532a8729..dddb5fbd2 100644 --- a/.github/workflows/test-serializer.yml +++ b/.github/workflows/test-serializer.yml @@ -17,7 +17,7 @@ jobs: Compile: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Compile uses: fx31337/mql-compile-action@master with: @@ -28,12 +28,12 @@ jobs: run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' shell: powershell - name: Upload artifacts (MQL4) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex4 path: '**/*.ex4' - name: Upload artifacts (MQL5) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex5 path: '**/*.ex5' @@ -50,7 +50,7 @@ jobs: test: - Serializer.test steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: files-ex4 - name: Run ${{ matrix.test }} diff --git a/.github/workflows/test-storage-cache.yml b/.github/workflows/test-storage-cache.yml index bf46a81ab..e15f21057 100644 --- a/.github/workflows/test-storage-cache.yml +++ b/.github/workflows/test-storage-cache.yml @@ -17,7 +17,7 @@ jobs: Compile: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Compile uses: fx31337/mql-compile-action@master with: @@ -28,12 +28,12 @@ jobs: run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' shell: powershell - name: Upload artifacts (MQL4) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex4 path: '**/*.ex4' - name: Upload artifacts (MQL5) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex5 path: '**/*.ex5' @@ -51,7 +51,7 @@ jobs: - IndiBufferCache.test - ObjectsCache.test steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: files-ex4 - name: Run ${{ matrix.test }} diff --git a/.github/workflows/test-storage-dict-buffer.yml b/.github/workflows/test-storage-dict-buffer.yml index 7658d4c3e..ef4bf3bb9 100644 --- a/.github/workflows/test-storage-dict-buffer.yml +++ b/.github/workflows/test-storage-dict-buffer.yml @@ -17,7 +17,7 @@ jobs: Compile: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Compile uses: fx31337/mql-compile-action@master with: @@ -28,12 +28,12 @@ jobs: run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' shell: powershell - name: Upload artifacts (MQL4) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex4 path: '**/*.ex4' - name: Upload artifacts (MQL5) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex5 path: '**/*.ex5' @@ -55,7 +55,7 @@ jobs: - BufferStruct.test - BufferTick.test steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: files-ex4 - name: Run ${{ matrix.test }} diff --git a/.github/workflows/test-storage-dict.yml b/.github/workflows/test-storage-dict.yml index 0a17daa03..7387c7452 100644 --- a/.github/workflows/test-storage-dict.yml +++ b/.github/workflows/test-storage-dict.yml @@ -17,7 +17,7 @@ jobs: Compile: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Compile uses: fx31337/mql-compile-action@master with: @@ -28,12 +28,12 @@ jobs: run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' shell: powershell - name: Upload artifacts (MQL4) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex4 path: '**/*.ex4' - name: Upload artifacts (MQL5) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex5 path: '**/*.ex5' @@ -50,7 +50,7 @@ jobs: test: - Dict.test steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: files-ex4 - name: Run ${{ matrix.test }} diff --git a/.github/workflows/test-storage.yml b/.github/workflows/test-storage.yml index 822cc3f13..74565404b 100644 --- a/.github/workflows/test-storage.yml +++ b/.github/workflows/test-storage.yml @@ -17,7 +17,7 @@ jobs: Compile: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Compile uses: fx31337/mql-compile-action@master with: @@ -28,12 +28,12 @@ jobs: run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' shell: powershell - name: Upload artifacts (MQL4) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex4 path: '**/*.ex4' - name: Upload artifacts (MQL5) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex5 path: '**/*.ex5' @@ -56,7 +56,7 @@ jobs: - Redis.test - ValueStorage.test steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: files-ex4 - name: Run ${{ matrix.test }} diff --git a/.github/workflows/test-task.yml b/.github/workflows/test-task.yml index 8fc77ea62..112694b35 100644 --- a/.github/workflows/test-task.yml +++ b/.github/workflows/test-task.yml @@ -17,7 +17,7 @@ jobs: Compile: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Compile uses: fx31337/mql-compile-action@master with: @@ -28,12 +28,12 @@ jobs: run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' shell: powershell - name: Upload artifacts (MQL4) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex4 path: '**/*.ex4' - name: Upload artifacts (MQL5) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex5 path: '**/*.ex5' @@ -58,7 +58,7 @@ jobs: - Taskable.car.test - Taskable.test steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: files-ex4 - name: Run ${{ matrix.test }} diff --git a/.github/workflows/test-tick.yml b/.github/workflows/test-tick.yml index 55bf74be2..af2463196 100644 --- a/.github/workflows/test-tick.yml +++ b/.github/workflows/test-tick.yml @@ -17,7 +17,7 @@ jobs: Compile: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Compile uses: fx31337/mql-compile-action@master with: @@ -27,12 +27,12 @@ jobs: run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' shell: powershell - name: Upload artifacts (MQL4) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex4 path: '**/*.ex4' - name: Upload artifacts (MQL5) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex5 path: '**/*.ex5' @@ -49,7 +49,7 @@ jobs: test: - TickManager.test steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: files-ex4 - name: Run ${{ matrix.test }} diff --git a/.github/workflows/test-trade.yml b/.github/workflows/test-trade.yml index 4810fd702..e2da5ff00 100644 --- a/.github/workflows/test-trade.yml +++ b/.github/workflows/test-trade.yml @@ -17,7 +17,7 @@ jobs: Compile: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Compile uses: fx31337/mql-compile-action@master with: @@ -28,12 +28,12 @@ jobs: run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' shell: powershell - name: Upload artifacts (MQL4) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex4 path: '**/*.ex4' - name: Upload artifacts (MQL5) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex5 path: '**/*.ex5' @@ -51,7 +51,7 @@ jobs: - TradeSignal.test - TradeSignalManager.test steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: files-ex4 - name: Run ${{ matrix.test }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6dddb6abf..d08552121 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,7 +23,7 @@ jobs: Compile: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Compile uses: fx31337/mql-compile-action@master with: @@ -33,12 +33,12 @@ jobs: run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' shell: powershell - name: Upload artifacts (MQL4) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex4 path: '**/*.ex4' - name: Upload artifacts (MQL5) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: files-ex5 path: '**/*.ex5' @@ -65,7 +65,7 @@ jobs: - TradeTest max-parallel: 4 steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: files-ex4 - name: Run ${{ matrix.test }} @@ -90,7 +90,6 @@ jobs: strategy: matrix: test: - # - 3DTest - ConfigTest - ConvertTest - LogTest @@ -99,7 +98,7 @@ jobs: - RefsTest - TimerTest steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: files-ex4 - name: Run ${{ matrix.test }} From f3219e9fb8ab91ee2511719b11d0b80c11b48bb1 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 18 Jun 2023 21:46:44 +0100 Subject: [PATCH 062/109] Renames MiniMatrix to MatrixMini --- Math/MatrixMini.h | 6 +++--- Serializer/SerializerCsv.h | 22 +++++++++++----------- Serializer/SerializerSqlite.h | 4 ++-- Storage/Database.h | 2 +- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Math/MatrixMini.h b/Math/MatrixMini.h index ffb08babb..0e4731a26 100644 --- a/Math/MatrixMini.h +++ b/Math/MatrixMini.h @@ -28,14 +28,14 @@ #include "../Platform/Platform.extern.h" template -class MiniMatrix2d { +class MatrixMini2d { public: ARRAY(T, data); int size_x; int size_y; - MiniMatrix2d() {} - MiniMatrix2d(int _size_x, int _size_y) : size_x(_size_x), size_y(_size_y) { Resize(_size_x, _size_y); } + MatrixMini2d() {} + MatrixMini2d(int _size_x, int _size_y) : size_x(_size_x), size_y(_size_y) { Resize(_size_x, _size_y); } void Resize(int _size_x, int _size_y) { ArrayResize(data, _size_x * _size_y); diff --git a/Serializer/SerializerCsv.h b/Serializer/SerializerCsv.h index fd90dd9b5..845949a65 100644 --- a/Serializer/SerializerCsv.h +++ b/Serializer/SerializerCsv.h @@ -50,8 +50,8 @@ enum ENUM_SERIALIZER_CSV_FLAGS { class SerializerCsv { public: static string Stringify(SerializerNode* _root, unsigned int serializer_flags, void* serializer_aux_arg = NULL, - MiniMatrix2d* _matrix_out = NULL, - MiniMatrix2d* _column_types_out = NULL) { + MatrixMini2d* _matrix_out = NULL, + MatrixMini2d* _column_types_out = NULL) { SerializerConverter* _stub = (SerializerConverter*)serializer_aux_arg; if (CheckPointer(_root) == POINTER_INVALID) { @@ -89,9 +89,9 @@ class SerializerCsv { ++_num_columns; } - MiniMatrix2d _cells; - MiniMatrix2d _column_titles; - MiniMatrix2d _column_types; + MatrixMini2d _cells; + MatrixMini2d _column_titles; + MatrixMini2d _column_types; if (_matrix_out == NULL) { _matrix_out = &_cells; @@ -172,8 +172,8 @@ class SerializerCsv { * Extracts column names and types from the stub, so even if there is not data, we'll still have information about * columns. */ - static void ExtractColumns(SerializerNode* _stub, MiniMatrix2d* _titles, - MiniMatrix2d* _column_types, int _flags, int& _column) { + static void ExtractColumns(SerializerNode* _stub, MatrixMini2d* _titles, + MatrixMini2d* _column_types, int _flags, int& _column) { for (unsigned int _stub_entry_idx = 0; _stub_entry_idx < _stub PTR_DEREF NumChildren(); ++_stub_entry_idx) { SerializerNode* _child = _stub PTR_DEREF GetChild(_stub_entry_idx); if (_child PTR_DEREF IsContainer()) { @@ -187,8 +187,8 @@ class SerializerCsv { /** * */ - static bool FlattenNode(SerializerNode* _data, SerializerNode* _stub, MiniMatrix2d& _cells, - MiniMatrix2d* _column_types, int _column, int _row, int _flags) { + static bool FlattenNode(SerializerNode* _data, SerializerNode* _stub, MatrixMini2d& _cells, + MatrixMini2d* _column_types, int _column, int _row, int _flags) { unsigned int _data_entry_idx; bool _include_key = bool(_flags & SERIALIZER_CSV_INCLUDE_KEY); @@ -233,8 +233,8 @@ class SerializerCsv { /** * */ - static bool FillRow(SerializerNode* _data, SerializerNode* _stub, MiniMatrix2d& _cells, - MiniMatrix2d* _column_types, int _column, int _row, int _index, + static bool FillRow(SerializerNode* _data, SerializerNode* _stub, MatrixMini2d& _cells, + MatrixMini2d* _column_types, int _column, int _row, int _index, int _level, int _flags) { unsigned int _data_entry_idx, _entry_size; diff --git a/Serializer/SerializerSqlite.h b/Serializer/SerializerSqlite.h index a94dbde6a..4544aba34 100644 --- a/Serializer/SerializerSqlite.h +++ b/Serializer/SerializerSqlite.h @@ -50,8 +50,8 @@ class SerializerSqlite { static bool ConvertToFile(SerializerConverter& source, string _path, string _table, unsigned int _stringify_flags = 0, void* _stub = NULL) { // We must have titles tree as - MiniMatrix2d _matrix_out; - MiniMatrix2d _column_types; + MatrixMini2d _matrix_out; + MatrixMini2d _column_types; string _csv = SerializerCsv::Stringify(source.root_node, _stringify_flags | SERIALIZER_CSV_INCLUDE_TITLES, _stub, &_matrix_out, &_column_types); diff --git a/Storage/Database.h b/Storage/Database.h index 13fa64fa3..b13fbed8a 100644 --- a/Storage/Database.h +++ b/Storage/Database.h @@ -160,7 +160,7 @@ bool DropTable(string _name) { /** * Imports data into table. First row must contain column names. Strings must be enclosed with double quotes. */ -bool ImportData(const string _name, MiniMatrix2d &data) { +bool ImportData(const string _name, MatrixMini2d &data) { if (data.SizeY() < 2 || data.SizeX() == 0) { // No data to import or there are no columns in input data (Serialize() serialized no fields). return true; From a5e75c59058088ec4345bfbb7d9a3d835cae96c7 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 18 Jun 2023 23:14:32 +0100 Subject: [PATCH 063/109] Renames Draw.mqh to Platform/Plot.h --- Indicators/DrawIndicator.mqh | 2 +- Draw.mqh => Platform/Plot.h | 14 +++++++------- tests/CompileTest.mq5 | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) rename Draw.mqh => Platform/Plot.h (98%) diff --git a/Indicators/DrawIndicator.mqh b/Indicators/DrawIndicator.mqh index 7360835ca..e5b806612 100644 --- a/Indicators/DrawIndicator.mqh +++ b/Indicators/DrawIndicator.mqh @@ -31,7 +31,7 @@ // Includes. #include "../Storage/Dict/DictObject.h" -#include "../Draw.mqh" +#include "../Platform/Plot.h" #include "../Storage/Object.h" // Forward declaration. diff --git a/Draw.mqh b/Platform/Plot.h similarity index 98% rename from Draw.mqh rename to Platform/Plot.h index b71c0709c..0ec900dee 100644 --- a/Draw.mqh +++ b/Platform/Plot.h @@ -30,13 +30,13 @@ class Chart; class Draw; // Includes. -#include "Storage/Data.define.h" -#include "Storage/Object.extern.h" -#include "Storage/Object.h" -#include "Platform/Platform.extern.h" -#include "Platform/Terminal.define.h" -#include "Platform/Terminal.enum.h" -#include "Platform/Terminal.extern.h" +#include "../Storage/Data.define.h" +#include "../Storage/Object.extern.h" +#include "../Storage/Object.h" +#include "Platform.extern.h" +#include "Terminal.define.h" +#include "Terminal.enum.h" +#include "Terminal.extern.h" #ifndef __MQL4__ // Defines macros (for MQL4 backward compatibility). diff --git a/tests/CompileTest.mq5 b/tests/CompileTest.mq5 index 044a75025..b1fee5348 100644 --- a/tests/CompileTest.mq5 +++ b/tests/CompileTest.mq5 @@ -57,7 +57,7 @@ struct IndicatorParams; #include "../Storage/Dict/DictObject.h" #include "../Storage/Dict/DictSlot.h" #include "../Storage/Dict/DictStruct.h" -#include "../Draw.mqh" +#include "../Platform/Plot.h" #include "../Indicators/DrawIndicator.mqh" #include "../EA.mqh" #include "../File.mqh" From 2b37cc1e4bf28a674d6c6436beba2db87dfc7bc7 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 18 Jun 2023 23:21:24 +0100 Subject: [PATCH 064/109] Renames Draw class to Plot (GH-556) --- .github/workflows/test-platform.yml | 1 + Indicator/Indicator.h | 2 +- Indicator/IndicatorData.struct.h | 22 ++++----- Indicators/DrawIndicator.mqh | 6 +-- Indicators/Indi_Demo.mqh | 2 +- Indicators/Indi_Momentum.mqh | 4 +- Indicators/Indi_PriceFeeder.mqh | 2 +- Indicators/tests/DrawIndicator.test.mq5 | 10 ++--- Platform/Plot.h | 60 ++++++++++++------------- Platform/tests/Plot.test.mq4 | 28 ++++++++++++ Platform/tests/Plot.test.mq5 | 43 ++++++++++++++++++ tests/IndicatorsTest.mq5 | 28 ++++++------ 12 files changed, 140 insertions(+), 68 deletions(-) create mode 100644 Platform/tests/Plot.test.mq4 create mode 100644 Platform/tests/Plot.test.mq5 diff --git a/.github/workflows/test-platform.yml b/.github/workflows/test-platform.yml index 8dcc77815..acad78f40 100644 --- a/.github/workflows/test-platform.yml +++ b/.github/workflows/test-platform.yml @@ -52,6 +52,7 @@ jobs: - OrderQuery.test - Orders.test - Platform.test + - Plot.test - Terminal.test steps: - uses: actions/download-artifact@v3 diff --git a/Indicator/Indicator.h b/Indicator/Indicator.h index 395d5b1dc..e1a896839 100644 --- a/Indicator/Indicator.h +++ b/Indicator/Indicator.h @@ -198,7 +198,7 @@ class Indicator : public IndicatorData { /** * Sets whether indicator's buffers should be drawn on the chart. */ - void SetDraw(bool _value, color _color = clrAquamarine, int _window = 0) { + void SetPlot(bool _value, color _color = clrAquamarine, int _window = 0) { // draw.SetEnabled(_value); // draw.SetColorLine(_color); // draw.SetWindow(_window); diff --git a/Indicator/IndicatorData.struct.h b/Indicator/IndicatorData.struct.h index e62085aa6..806f52167 100644 --- a/Indicator/IndicatorData.struct.h +++ b/Indicator/IndicatorData.struct.h @@ -407,7 +407,7 @@ struct IndicatorDataParams { protected: /* Struct protected variables */ int data_src_mode; // Mode used as input from data source. - int draw_window; // Drawing window. + int plot_window; // Ploting window. ENUM_DATATYPE dtype; // Type of basic data to store values (DTYPE_DOUBLE, DTYPE_INT). unsigned int max_modes; // Max supported indicator modes (values per entry). unsigned int max_buffers; // Max buffers to store. @@ -415,7 +415,7 @@ struct IndicatorDataParams { ENUM_IDATA_VALUE_RANGE idvrange; // Indicator's range value data type. color indi_color; // Indicator color. // @todo: Move to protected. - bool is_draw; // Draw active. + bool is_plot; // Plot active. bool is_fed; // Whether calc_start_bar is already calculated. int src_id; // Id of the indicator to be used as data source. int src_mode; // Mode of source indicator @@ -440,14 +440,14 @@ struct IndicatorDataParams { ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, ENUM_IDATA_VALUE_RANGE _idvrange = IDATA_RANGE_UNKNOWN, int _data_src_mode = 0) : data_src_mode(_data_src_mode), - draw_window(0), + plot_window(0), dtype(_dtype), max_modes(_max_modes), max_buffers(10), idstype(_idstype), idvrange(_idvrange), indi_color(clrNONE), - is_draw(false), + is_plot(false), is_fed(false), src_id(-1), src_mode(-1){}; @@ -523,16 +523,16 @@ struct IndicatorDataParams { } SetUserError(ERR_INVALID_PARAMETER); } - void SetDraw(bool _draw = true, int _window = 0) { - is_draw = _draw; - draw_window = _window; + void SetPlot(bool _plot = true, int _window = 0) { + is_plot = _plot; + plot_window = _window; } - void SetDraw(color _clr, int _window = 0) { - is_draw = true; + void SetPlot(color _clr, int _window = 0) { + is_plot = true; indi_color = _clr; - draw_window = _window; + plot_window = _window; } - bool IsDrawing() { return is_draw; } + bool IsPloting() { return is_plot; } void SetIndicatorColor(color _clr) { indi_color = _clr; } }; diff --git a/Indicators/DrawIndicator.mqh b/Indicators/DrawIndicator.mqh index e5b806612..948a37240 100644 --- a/Indicators/DrawIndicator.mqh +++ b/Indicators/DrawIndicator.mqh @@ -54,7 +54,7 @@ class DrawPoint { class DrawIndicator { protected: color color_line; - Draw* draw; + Plot* draw; IndicatorBase* indi; bool enabled; int window; @@ -70,7 +70,7 @@ class DrawIndicator { */ DrawIndicator(IndicatorBase* _indi) : indi(_indi), enabled(false), window(0) { // color_line = Object::IsValid(_indi) ? _indi.GetParams().indi_color : clrRed; // @fixme - draw = new Draw(); + draw = new Plot(); } /** @@ -112,7 +112,7 @@ class DrawIndicator { void SetWindow(int _window) { window = _window; } /** - * Draw line from the last point. + * Plot a line from the last point. */ void DrawLineTo(string _name, datetime _time, double _value, int _window = -1) { if (!enabled) { diff --git a/Indicators/Indi_Demo.mqh b/Indicators/Indi_Demo.mqh index c6e48a786..8bddabb7f 100644 --- a/Indicators/Indi_Demo.mqh +++ b/Indicators/Indi_Demo.mqh @@ -81,7 +81,7 @@ class Indi_Demo : public Indicator { */ virtual IndicatorDataEntryValue GetEntryValue(int _mode = 0, int _abs_shift = 0) { double _value = Indi_Demo::iDemo(THIS_PTR, ToRelShift(_abs_shift)); - if (idparams.IsDrawing()) { + if (idparams.IsPloting()) { // draw.DrawLineTo(GetName(), GetCandle() PTR_DEREF GetBarTime(ToRelShift(_abs_shift)), _value); } return _value; diff --git a/Indicators/Indi_Momentum.mqh b/Indicators/Indi_Momentum.mqh index 1eaf88d98..035f46649 100644 --- a/Indicators/Indi_Momentum.mqh +++ b/Indicators/Indi_Momentum.mqh @@ -154,7 +154,7 @@ class Indi_Momentum : public Indicator { // @fixit Somehow shift isn't used neither in MT4 nor MT5. _value = Indi_Momentum::iMomentumOnIndicator(GetDataSource(), GetSymbol(), GetTf(), GetPeriod(), iparams.shift + ToRelShift(_abs_shift)); - if (idparams.IsDrawing()) { + if (idparams.IsPloting()) { // draw.DrawLineTo(StringFormat("%s", GetName()), GetBarTime(iparams.shift + ToRelShift(_abs_shift)), _value, // 1); } @@ -169,7 +169,7 @@ class Indi_Momentum : public Indicator { // @fixit Somehow shift isn't used neither in MT4 nor MT5. _value = Indi_Momentum::iMomentumOnIndicator(GetDataSource(), GetSymbol(), GetTf(), GetPeriod(), iparams.shift + ToRelShift(_abs_shift)); - if (idparams.IsDrawing()) { + if (idparams.IsPloting()) { // draw.DrawLineTo(StringFormat("%s", GetName()), GetBarTime(iparams.shift + ToRelShift(_abs_shift)), _value, // 1); } diff --git a/Indicators/Indi_PriceFeeder.mqh b/Indicators/Indi_PriceFeeder.mqh index 0d94e3542..3681a8e98 100644 --- a/Indicators/Indi_PriceFeeder.mqh +++ b/Indicators/Indi_PriceFeeder.mqh @@ -103,7 +103,7 @@ class Indi_PriceFeeder : public Indicator { bool OnTick(int _global_tick_index) override { bool _result = Indicator::OnTick(_global_tick_index); - if (idparams.IsDrawing()) { + if (idparams.IsPloting()) { int _max_modes = Get(STRUCT_ENUM(IndicatorDataParams, IDATA_PARAM_MAX_MODES)); IndicatorDataEntry _entry = GetEntry(0); for (int i = 0; i < _max_modes; ++i) { diff --git a/Indicators/tests/DrawIndicator.test.mq5 b/Indicators/tests/DrawIndicator.test.mq5 index d0f5dfc36..a9ed41fbe 100644 --- a/Indicators/tests/DrawIndicator.test.mq5 +++ b/Indicators/tests/DrawIndicator.test.mq5 @@ -114,7 +114,7 @@ bool InitIndicators() { // @fixme: Make it work for MT4. // Current Price (used by custom indicators) . IndiPriceParams price_params(); - // price_params.SetDraw(clrGreenYellow); + // price_params.SetPlot(clrGreenYellow); Platform::AddWithDefaultBindings(new Indi_Price(price_params), "EURUSD", PERIOD_M1); #endif @@ -124,7 +124,7 @@ bool InitIndicators() { IndiPriceParams price_params_4_bands(); IndicatorBase *indi_price_4_bands = new Indi_Price(price_params_4_bands); IndiBandsParams bands_on_price_params(); - bands_on_price_params.SetDraw(clrCadetBlue); + bands_on_price_params.SetPlot(clrCadetBlue); // bands_on_price_params.SetDataSource(indi_price_4_bands, true, INDI_PRICE_MODE_OPEN); Platform::AddWithDefaultBindings(new Indi_Bands(bands_on_price_params, indi_price_4_bands, true)); */ @@ -134,7 +134,7 @@ bool InitIndicators() { IndiPriceParams price_params_4_ma(); IndicatorBase *indi_price_4_ma = new Indi_Price(price_params_4_ma); IndiMAParams ma_on_price_params(); - ma_on_price_params.SetDraw(clrYellowGreen); + ma_on_price_params.SetPlot(clrYellowGreen); // ma_on_price_params.SetDataSource(indi_price_4_ma, true, INDI_PRICE_MODE_OPEN); ma_on_price_params.SetIndicatorType(INDI_MA_ON_PRICE); Platform::AddWithDefaultBindings(new Indi_MA(ma_on_price_params, indi_price_4_ma)); @@ -143,7 +143,7 @@ bool InitIndicators() { IndiPriceParams price_params_4_rsi(); IndicatorData *indi_price_4_rsi = new Indi_Price(price_params_4_rsi); IndiRSIParams rsi_on_price_params(); - rsi_on_price_params.SetDraw(clrBisque, 1); + rsi_on_price_params.SetPlot(clrBisque, 1); IndicatorBase *indi_rsi_on_price = new Indi_RSI(rsi_on_price_params, IDATA_INDICATOR, indi_price_4_rsi); indis.Set(INDI_RSI_ON_PRICE, indi_rsi_on_price); */ @@ -151,7 +151,7 @@ bool InitIndicators() { // We'll be drawing all indicators' values on the chart. for (DictIterator> iter = Platform::GetIndicators() PTR_DEREF Begin(); iter.IsValid(); ++iter) { - // iter.Value() REF_DEREF SetDraw(true); // @fixme + // iter.Value() REF_DEREF SetPlot(true); // @fixme } return _LastError == ERR_NO_ERROR; diff --git a/Platform/Plot.h b/Platform/Plot.h index 0ec900dee..1802d400b 100644 --- a/Platform/Plot.h +++ b/Platform/Plot.h @@ -27,7 +27,7 @@ // Class dependencies. class Chart; -class Draw; +class Plot; // Includes. #include "../Storage/Data.define.h" @@ -63,9 +63,9 @@ class Draw; #endif /** - * Class to provide drawing methods working with graphic objects. + * Class to provide plotting methods working with graphic objects. */ -class Draw : public Object { +class Plot : public Object { protected: // Variables. long chart_id; @@ -75,7 +75,7 @@ class Draw : public Object { /** * Class constructor. */ - Draw(long _chart_id = 0) : chart_id(_chart_id != 0 ? _chart_id : ::ChartID()) {} + Plot(long _chart_id = 0) : chart_id(_chart_id != 0 ? _chart_id : ::ChartID()) {} /* Graphic object related methods */ @@ -90,7 +90,7 @@ class Draw : public Object { static string ObjectName(long _chart_id, int _pos, int _sub_window = -1, int _type = -1) { return ::ObjectName(_chart_id, _pos, _sub_window, _type); } - static string ObjectName(int _index) { return Draw::ObjectName(0, _index); } + static string ObjectName(int _index) { return Plot::ObjectName(0, _index); } /** * Returns the number of objects in the specified chart, @@ -106,12 +106,12 @@ class Draw : public Object { return ::ObjectsTotal(chart_id, window, type); #endif } - static int ObjectsTotal() { return Draw::ObjectsTotal(0); } + static int ObjectsTotal() { return Plot::ObjectsTotal(0); } /* Setters */ /** - * Sets drawing line description for showing in the DataWindow and in the tooltip. + * Sets plotting line description for showing in the DataWindow and in the tooltip. * * @return * If successful, returns true, otherwise false. @@ -262,22 +262,22 @@ class Draw : public Object { return ::ObjectDelete(chart_id, name); #endif } - static bool ObjectDelete(string name) { return Draw::ObjectDelete(0, name); } + static bool ObjectDelete(string name) { return Plot::ObjectDelete(0, name); } /** - * Draw a vertical line. + * Plot a vertical line. */ bool DrawVLine(string oname, datetime tm) { - bool result = Draw::ObjectCreate(NULL_VALUE, oname, OBJ_VLINE, 0, tm, 0); + bool result = Plot::ObjectCreate(NULL_VALUE, oname, OBJ_VLINE, 0, tm, 0); if (!result) PrintFormat("%(): Can't create vertical line! code #", __FUNCTION__, GetLastError()); return (result); } /** - * Draw a horizontal line. + * Plot a horizontal line. */ bool DrawHLine(string oname, double value) { - bool result = Draw::ObjectCreate(NULL_VALUE, oname, OBJ_HLINE, 0, 0, value); + bool result = Plot::ObjectCreate(NULL_VALUE, oname, OBJ_HLINE, 0, 0, value); if (!result) PrintFormat("%(): Can't create horizontal line! code #", __FUNCTION__, GetLastError()); return (result); } @@ -286,30 +286,30 @@ class Draw : public Object { * Delete a vertical line. */ bool DeleteVertLine(string oname) { - bool result = Draw::ObjectDelete(NULL_VALUE, oname); + bool result = Plot::ObjectDelete(NULL_VALUE, oname); if (!result) PrintFormat("%(): Can't delete vertical line! code #", __FUNCTION__, GetLastError()); return (result); } /** - * Draw a line given the price. + * Plot a line given the price. */ void ShowLine(string oname, double price, int colour = Yellow) { /** @TODO - Draw::ObjectCreate(chart_id, oname, OBJ_HLINE, 0, GetBarTime(), price); - Draw::ObjectSet(oname, OBJPROP_COLOR, colour); - Draw::ObjectMove(oname, 0, GetBarTime(), price); + Plot::ObjectCreate(chart_id, oname, OBJ_HLINE, 0, GetBarTime(), price); + Plot::ObjectSet(oname, OBJPROP_COLOR, colour); + Plot::ObjectMove(oname, 0, GetBarTime(), price); */ } /** - * Draw a trend line. + * Plot a trend line. */ bool TLine(string name, double p1, double p2, datetime d1, datetime d2, color clr = clrYellow, bool ray = false, int window = WINDOW_MAIN) { - if (ObjectFind(chart_id, name) >= 0 && Draw::ObjectMove(name, 0, d1, p1)) { - Draw::ObjectMove(name, 1, d2, p2); - } else if (!Draw::ObjectCreate(chart_id, name, OBJ_TREND, window, d1, p1, d2, p2)) { + if (ObjectFind(chart_id, name) >= 0 && Plot::ObjectMove(name, 0, d1, p1)) { + Plot::ObjectMove(name, 1, d2, p2); + } else if (!Plot::ObjectCreate(chart_id, name, OBJ_TREND, window, d1, p1, d2, p2)) { // Note: In case of error, check the message by GetLastError(). if (GetLastError() == 4206) { // No specified subwindow. @@ -318,11 +318,11 @@ class Draw : public Object { return false; } - if (!Draw::ObjectSet(name, OBJPROP_RAY, ray)) { + if (!Plot::ObjectSet(name, OBJPROP_RAY, ray)) { return false; } - if (clr && !Draw::ObjectSet(name, OBJPROP_COLOR, clr)) { + if (clr && !Plot::ObjectSet(name, OBJPROP_COLOR, clr)) { return false; } @@ -334,14 +334,14 @@ class Draw : public Object { #ifndef __MQL4__ // Defines global functions (for MQL4 backward compatibility). bool ObjectCreate(string _name, ENUM_OBJECT _otype, int _swindow, datetime _t1, double _p1) { - return Draw::ObjectCreate(0, _name, _otype, _swindow, _t1, _p1); + return Plot::ObjectCreate(0, _name, _otype, _swindow, _t1, _p1); } -bool ObjectDelete(string _name) { return Draw::ObjectDelete(_name); } -bool ObjectSet(string _name, int _prop_id, double _value) { return Draw::ObjectSet(_name, _prop_id, _value); } -int ObjectsTotal(int _type = EMPTY) { return Draw::ObjectsTotal(); } -string ObjectName(int _index) { return Draw::ObjectName(_index); } -void SetIndexLabel(int _index, string _text) { Draw::SetIndexLabel(_index, _text); } +bool ObjectDelete(string _name) { return Plot::ObjectDelete(_name); } +bool ObjectSet(string _name, int _prop_id, double _value) { return Plot::ObjectSet(_name, _prop_id, _value); } +int ObjectsTotal(int _type = EMPTY) { return Plot::ObjectsTotal(); } +string ObjectName(int _index) { return Plot::ObjectName(_index); } +void SetIndexLabel(int _index, string _text) { Plot::SetIndexLabel(_index, _text); } void SetIndexStyle(int _index, int _type, int _style = EMPTY, int _width = EMPTY, color _clr = CLR_NONE) { - Draw::SetIndexStyle(_index, _type, _style, _width, _clr); + Plot::SetIndexStyle(_index, _type, _style, _width, _clr); } #endif diff --git a/Platform/tests/Plot.test.mq4 b/Platform/tests/Plot.test.mq4 new file mode 100644 index 000000000..1343ef71e --- /dev/null +++ b/Platform/tests/Plot.test.mq4 @@ -0,0 +1,28 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test functionality of Plot class. + */ + +// Includes. +#include "Plot.test.mq5" diff --git a/Platform/tests/Plot.test.mq5 b/Platform/tests/Plot.test.mq5 new file mode 100644 index 000000000..9a6f7a43b --- /dev/null +++ b/Platform/tests/Plot.test.mq5 @@ -0,0 +1,43 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, 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 . + */ + +/** + * @file + * Test functionality of Plot class. + */ + +// Includes. +#include "../../Test.mqh" +#include "../Plot.h" + +/** + * Implements OnInit(). + */ +int OnInit() { + bool _result = true; + // @todo: Write some tests. + return _result && GetLastError() == 0 ? INIT_SUCCEEDED : INIT_FAILED; +} + +/** + * Implements Tick event handler. + */ +void OnTick() {} diff --git a/tests/IndicatorsTest.mq5 b/tests/IndicatorsTest.mq5 index 4453c8194..f838d31f4 100644 --- a/tests/IndicatorsTest.mq5 +++ b/tests/IndicatorsTest.mq5 @@ -315,7 +315,7 @@ bool InitIndicators() { // Standard Deviation (StdDev). Ref indi_price_for_stdev = new Indi_Price(IndiPriceParams()); IndiStdDevParams stddev_on_price_params(); - // stddev_on_price_params.SetDraw(clrBlue, 1); // @fixme + // stddev_on_price_params.SetPlot(clrBlue, 1); // @fixme Ref indi_stddev_on_price = new Indi_StdDev(stddev_on_price_params, IDATA_BUILTIN, indi_price_for_stdev.Ptr()); indis.Add(indi_stddev_on_price.Ptr()); @@ -341,7 +341,7 @@ bool InitIndicators() { IndiPriceParams price_params_4_bands(); Ref indi_price_4_bands = new Indi_Price(price_params_4_bands); IndiBandsParams bands_on_price_params(); - // bands_on_price_params.SetDraw(clrCadetBlue); // @fixme + // bands_on_price_params.SetPlot(clrCadetBlue); // @fixme Ref indi_bands_on_price = new Indi_Bands(bands_on_price_params, IDATA_BUILTIN, indi_price_4_bands.Ptr()); indis.Add(indi_bands_on_price.Ptr()); @@ -352,7 +352,7 @@ bool InitIndicators() { Ref indi_ma_sma_for_stddev = new Indi_MA(ma_sma_params_for_stddev); IndiStdDevParams stddev_params_on_ma_sma(13, 10); - // stddev_params_on_ma_sma.SetDraw(true, 1); // @fixme + // stddev_params_on_ma_sma.SetPlot(true, 1); // @fixme Ref indi_stddev_on_ma_sma = new Indi_StdDev(stddev_params_on_ma_sma, IDATA_BUILTIN, indi_ma_sma_for_stddev.Ptr()); @@ -362,7 +362,7 @@ bool InitIndicators() { IndiPriceParams price_params_for_stddev_sma(); Ref indi_price_for_stddev_sma = new Indi_Price(price_params_for_stddev_sma); IndiStdDevParams stddev_sma_on_price_params(); - // stddev_sma_on_price_params.SetDraw(true, 1); // @fixme + // stddev_sma_on_price_params.SetPlot(true, 1); // @fixme Ref indi_stddev_on_sma = new Indi_StdDev(stddev_sma_on_price_params, IDATA_BUILTIN, indi_price_for_stddev_sma.Ptr()); indis.Add(indi_stddev_on_sma.Ptr()); @@ -371,7 +371,7 @@ bool InitIndicators() { IndiPriceParams price_params_4_ma(); Ref indi_price_4_ma = new Indi_Price(price_params_4_ma); IndiMAParams ma_on_price_params(13, 0, MODE_SMA, PRICE_OPEN, 0); - // ma_on_price_params.SetDraw(clrYellowGreen); // @fixme + // ma_on_price_params.SetPlot(clrYellowGreen); // @fixme ma_on_price_params.SetIndicatorType(INDI_MA_ON_PRICE); Ref indi_ma_on_price = new Indi_MA(ma_on_price_params, IDATA_BUILTIN, indi_price_4_ma.Ptr()); indis.Add(indi_ma_on_price.Ptr()); @@ -380,7 +380,7 @@ bool InitIndicators() { IndiPriceParams price_params_4_cci(); Ref indi_price_4_cci = new Indi_Price(price_params_4_cci); IndiCCIParams cci_on_price_params(); - // cci_on_price_params.SetDraw(clrYellowGreen, 1); // @fixme + // cci_on_price_params.SetPlot(clrYellowGreen, 1); // @fixme Ref indi_cci_on_price = new Indi_CCI(cci_on_price_params, IDATA_BUILTIN, indi_price_4_cci.Ptr()); indis.Add(indi_cci_on_price.Ptr()); @@ -388,7 +388,7 @@ bool InitIndicators() { IndiPriceParams price_params_4_envelopes(); Ref indi_price_4_envelopes = new Indi_Price(price_params_4_envelopes); IndiEnvelopesParams env_on_price_params(); - // env_on_price_params.SetDraw(clrBrown); // @fixme + // env_on_price_params.SetPlot(clrBrown); // @fixme Ref indi_envelopes_on_price = new Indi_Envelopes(env_on_price_params, IDATA_BUILTIN, indi_price_4_envelopes.Ptr()); indis.Add(indi_envelopes_on_price.Ptr()); @@ -397,7 +397,7 @@ bool InitIndicators() { IndiPriceParams price_params_4_dema(); Ref indi_price_4_dema = new Indi_Price(price_params_4_dema); IndiDEMAParams dema_on_price_params(13, 2, PRICE_OPEN); - // dema_on_price_params.SetDraw(clrRed); // @fixme + // dema_on_price_params.SetPlot(clrRed); // @fixme Ref indi_dema_on_price = new Indi_DEMA(dema_on_price_params, INDI_DEMA_DEFAULT_IDSTYPE, indi_price_4_dema.Ptr()); // indis.Add(indi_dema_on_price.Ptr()); // @fixme @@ -405,7 +405,7 @@ bool InitIndicators() { // Momentum over Price indicator. Ref indi_price_4_momentum = new Indi_Price(); IndiMomentumParams mom_on_price_params(); - // mom_on_price_params.SetDraw(clrDarkCyan); // @fixme + // mom_on_price_params.SetPlot(clrDarkCyan); // @fixme Ref indi_momentum_on_price = new Indi_Momentum(mom_on_price_params, IDATA_BUILTIN, indi_price_4_momentum.Ptr()); indis.Add(indi_momentum_on_price.Ptr()); @@ -414,19 +414,19 @@ bool InitIndicators() { IndiPriceParams price_params_4_rsi(); Ref indi_price_4_rsi = new Indi_Price(price_params_4_rsi); IndiRSIParams rsi_on_price_params(); - // rsi_on_price_params.SetDraw(clrBisque, 1); // @fixme + // rsi_on_price_params.SetPlot(clrBisque, 1); // @fixme Ref indi_rsi_on_price = new Indi_RSI(rsi_on_price_params, IDATA_BUILTIN, indi_price_4_rsi.Ptr()); indis.Add(indi_rsi_on_price.Ptr()); // Drawer (socket-based) indicator over RSI over Price. IndiDrawerParams drawer_params(14, PRICE_OPEN); - // drawer_params.SetDraw(clrBisque, 0); // @fixme + // drawer_params.SetPlot(clrBisque, 0); // @fixme Ref indi_drawer_on_rsi = new Indi_Drawer(drawer_params, IDATA_BUILTIN, indi_rsi_on_price.Ptr()); indis.Add(indi_drawer_on_rsi.Ptr()); // Applied Price over OHCL indicator. IndiAppliedPriceParams applied_price_params(); - // applied_price_params.SetDraw(clrAquamarine, 0); // @fixme + // applied_price_params.SetPlot(clrAquamarine, 0); // @fixme IndiOHLCParams applied_price_ohlc_params(PRICE_TYPICAL); Ref indi_applied_price_on_price = new Indi_AppliedPrice(applied_price_params, IDATA_INDICATOR, new Indi_OHLC(applied_price_ohlc_params)); @@ -535,14 +535,14 @@ bool InitIndicators() { // Math (specialized indicator). IndiMathParams math_params(MATH_OP_SUB, BAND_UPPER, BAND_LOWER, 0, 0); - // math_params.SetDraw(clrBlue); // @fixme + // math_params.SetPlot(clrBlue); // @fixme math_params.SetName("Bands(UP - LO)"); Ref indi_math_1 = new Indi_Math(math_params, IDATA_INDICATOR, indi_bands.Ptr()); indis.Add(indi_math_1.Ptr()); // Math (specialized indicator) via custom math method. IndiMathParams math_custom_params(MathCustomOp, BAND_UPPER, BAND_LOWER, 0, 0); - // math_custom_params.SetDraw(clrBeige); // @fixme + // math_custom_params.SetPlot(clrBeige); // @fixme math_custom_params.SetName("Bands(Custom math fn)"); Ref indi_math_2 = new Indi_Math(math_custom_params, IDATA_INDICATOR, indi_bands.Ptr()); indis.Add(indi_math_2.Ptr()); From 98d41841df1b27acfcba949a4958ec8b7b9d510d Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 18 Jun 2023 23:45:34 +0100 Subject: [PATCH 065/109] Improves copy headers and bumps a year --- Bar.enum.h | 4 ++-- Bar.struct.h | 4 ++-- Candle.struct.h | 4 ++-- Common.define.h | 4 ++-- Common.extern.h | 4 ++-- Config.mqh | 4 ++-- Convert.basic.h | 4 ++-- Convert.extern.h | 4 ++-- Convert.mqh | 4 ++-- EA.enum.h | 4 ++-- EA.mqh | 4 ++-- EA.struct.h | 4 ++-- Exchange/Account/Account.define.h | 4 ++-- Exchange/Account/Account.enum.h | 4 ++-- Exchange/Account/Account.extern.h | 4 ++-- Exchange/Account/Account.h | 4 ++-- Exchange/Account/Account.struct.h | 4 ++-- Exchange/Account/AccountBase.h | 4 ++-- Exchange/Account/AccountBase.struct.h | 4 ++-- Exchange/Account/AccountForex.h | 4 ++-- Exchange/Account/AccountForex.struct.h | 4 ++-- Exchange/Account/AccountMt.h | 4 ++-- Exchange/Account/tests/Account.test.cpp | 2 +- Exchange/Account/tests/Account.test.mq4 | 4 ++-- Exchange/Account/tests/Account.test.mq5 | 4 ++-- Exchange/Account/tests/AccountBase.test.cpp | 2 +- Exchange/Account/tests/AccountForex.test.cpp | 2 +- Exchange/Account/tests/AccountForex.test.mq4 | 4 ++-- Exchange/Account/tests/AccountForex.test.mq5 | 4 ++-- Exchange/Account/tests/AccountMt.test.cpp | 2 +- Exchange/Account/tests/AccountMt.test.mq4 | 4 ++-- Exchange/Account/tests/AccountMt.test.mq5 | 4 ++-- Exchange/Exchange.h | 4 ++-- Exchange/Exchange.struct.h | 4 ++-- Exchange/tests/Exchange.test.cpp | 2 +- Exchange/tests/Exchange.test.mq4 | 4 ++-- Exchange/tests/Exchange.test.mq5 | 4 ++-- File.define.h | 4 ++-- File.extern.h | 4 ++-- File.mqh | 4 ++-- Indicator/Indicator.define.h | 4 ++-- Indicator/Indicator.enum.h | 4 ++-- Indicator/Indicator.h | 4 ++-- Indicator/Indicator.struct.h | 4 ++-- Indicator/Indicator.struct.serialize.h | 4 ++-- Indicator/IndicatorBase.h | 4 ++-- Indicator/IndicatorCandle.h | 4 ++-- Indicator/IndicatorCandle.provider.h | 4 ++-- Indicator/IndicatorData.enum.h | 4 ++-- Indicator/IndicatorData.h | 4 ++-- Indicator/IndicatorData.struct.h | 4 ++-- Indicator/IndicatorData.struct.serialize.h | 4 ++-- Indicator/IndicatorData.struct.signal.h | 4 ++-- Indicator/IndicatorRenko.h | 4 ++-- Indicator/IndicatorRenko.provider.h | 4 ++-- Indicator/IndicatorRenko.struct.h | 4 ++-- Indicator/IndicatorTf.h | 4 ++-- Indicator/IndicatorTf.provider.h | 4 ++-- Indicator/IndicatorTf.struct.h | 4 ++-- Indicator/IndicatorTick.h | 4 ++-- Indicator/IndicatorTick.provider.h | 4 ++-- Indicator/IndicatorTickSource.h | 4 ++-- Indicator/README.md | 2 +- Indicator/TickBarCounter.h | 4 ++-- Indicator/tests/Indicator.test.mq4 | 4 ++-- Indicator/tests/Indicator.test.mq5 | 4 ++-- Indicator/tests/IndicatorBase.test.cpp | 2 +- Indicator/tests/IndicatorBase.test.mq4 | 4 ++-- Indicator/tests/IndicatorBase.test.mq5 | 4 ++-- Indicator/tests/IndicatorCandle.test.mq4 | 4 ++-- Indicator/tests/IndicatorCandle.test.mq5 | 4 ++-- Indicator/tests/IndicatorData.test.mq4 | 4 ++-- Indicator/tests/IndicatorData.test.mq5 | 4 ++-- Indicator/tests/IndicatorRenko.test.mq4 | 4 ++-- Indicator/tests/IndicatorRenko.test.mq5 | 4 ++-- Indicator/tests/IndicatorTf.test.mq4 | 4 ++-- Indicator/tests/IndicatorTf.test.mq5 | 4 ++-- Indicator/tests/IndicatorTick.test.mq4 | 4 ++-- Indicator/tests/IndicatorTick.test.mq5 | 4 ++-- Indicator/tests/classes/IndicatorTfDummy.h | 4 ++-- Indicator/tests/classes/IndicatorTickDummy.h | 4 ++-- Indicator/tests/classes/Indicators.h | 4 ++-- Indicators/Bitwise/Indi_Candle.mqh | 4 ++-- Indicators/Bitwise/Indi_Pattern.mqh | 4 ++-- Indicators/Bitwise/includes.h | 4 ++-- Indicators/Bitwise/tests/Indi_Candle.test.mq4 | 2 +- Indicators/Bitwise/tests/Indi_Candle.test.mq5 | 2 +- .../Bitwise/tests/Indi_Pattern.test.mq4 | 4 ++-- .../Bitwise/tests/Indi_Pattern.test.mq5 | 4 ++-- Indicators/DrawIndicator.mqh | 4 ++-- Indicators/Indi_AC.mqh | 4 ++-- Indicators/Indi_AD.mqh | 4 ++-- Indicators/Indi_ADX.mqh | 4 ++-- Indicators/Indi_ADXW.mqh | 4 ++-- Indicators/Indi_AMA.mqh | 4 ++-- Indicators/Indi_AO.mqh | 4 ++-- Indicators/Indi_ASI.mqh | 4 ++-- Indicators/Indi_ATR.mqh | 4 ++-- Indicators/Indi_BWMFI.mqh | 4 ++-- Indicators/Indi_BWZT.mqh | 4 ++-- Indicators/Indi_BearsPower.mqh | 4 ++-- Indicators/Indi_BullsPower.mqh | 4 ++-- Indicators/Indi_CCI.mqh | 4 ++-- Indicators/Indi_CHO.mqh | 4 ++-- Indicators/Indi_CHV.mqh | 4 ++-- Indicators/Indi_ColorBars.mqh | 4 ++-- Indicators/Indi_ColorCandlesDaily.mqh | 4 ++-- Indicators/Indi_ColorLine.mqh | 4 ++-- Indicators/Indi_CustomMovingAverage.mqh | 4 ++-- Indicators/Indi_DEMA.mqh | 4 ++-- Indicators/Indi_DeMarker.mqh | 4 ++-- Indicators/Indi_Demo.mqh | 4 ++-- Indicators/Indi_DetrendedPrice.mqh | 4 ++-- Indicators/Indi_Drawer.mqh | 4 ++-- Indicators/Indi_Drawer.struct.h | 4 ++-- Indicators/Indi_Force.mqh | 4 ++-- Indicators/Indi_FractalAdaptiveMA.mqh | 4 ++-- Indicators/Indi_Fractals.mqh | 4 ++-- Indicators/Indi_Gator.mqh | 4 ++-- Indicators/Indi_HeikenAshi.mqh | 4 ++-- Indicators/Indi_Ichimoku.mqh | 4 ++-- Indicators/Indi_Killzones.mqh | 4 ++-- Indicators/Indi_MFI.mqh | 4 ++-- Indicators/Indi_MassIndex.mqh | 4 ++-- Indicators/Indi_Momentum.mqh | 4 ++-- Indicators/Indi_OBV.mqh | 4 ++-- Indicators/Indi_OsMA.mqh | 4 ++-- Indicators/Indi_Pivot.mqh | 4 ++-- Indicators/Indi_PriceChannel.mqh | 4 ++-- Indicators/Indi_PriceFeeder.mqh | 4 ++-- Indicators/Indi_PriceVolumeTrend.mqh | 4 ++-- Indicators/Indi_RS.mqh | 4 ++-- Indicators/Indi_RVI.mqh | 4 ++-- Indicators/Indi_RateOfChange.mqh | 4 ++-- Indicators/Indi_StdDev.mqh | 4 ++-- Indicators/Indi_TEMA.mqh | 4 ++-- Indicators/Indi_TRIX.mqh | 4 ++-- Indicators/Indi_UltimateOscillator.mqh | 4 ++-- Indicators/Indi_VIDYA.mqh | 4 ++-- Indicators/Indi_VROC.mqh | 4 ++-- Indicators/Indi_Volumes.mqh | 4 ++-- Indicators/Indi_WilliamsAD.mqh | 4 ++-- Indicators/Indi_ZigZag.mqh | 4 ++-- Indicators/Indi_ZigZagColor.mqh | 4 ++-- Indicators/OHLC/Indi_OHLC.mqh | 4 ++-- Indicators/OHLC/includes.h | 4 ++-- Indicators/OHLC/tests/Indi_OHLC.test.cpp | 2 +- Indicators/OHLC/tests/Indi_OHLC.test.mq4 | 4 ++-- Indicators/OHLC/tests/Indi_OHLC.test.mq5 | 4 ++-- Indicators/Oscillator/Indi_MACD.h | 4 ++-- Indicators/Oscillator/Indi_RSI.h | 4 ++-- Indicators/Oscillator/Indi_Stochastic.h | 4 ++-- Indicators/Oscillator/Indi_WPR.h | 4 ++-- Indicators/Oscillator/includes.h | 2 +- .../Oscillator/tests/Indi_MACD.test.cpp | 2 +- .../Oscillator/tests/Indi_MACD.test.mq4 | 4 ++-- .../Oscillator/tests/Indi_MACD.test.mq5 | 4 ++-- Indicators/Oscillator/tests/Indi_RSI.test.cpp | 2 +- Indicators/Oscillator/tests/Indi_RSI.test.mq4 | 4 ++-- Indicators/Oscillator/tests/Indi_RSI.test.mq5 | 4 ++-- .../Oscillator/tests/Indi_Stochastic.test.mq4 | 4 ++-- .../Oscillator/tests/Indi_Stochastic.test.mq5 | 4 ++-- Indicators/Oscillator/tests/Indi_WPR.test.mq4 | 4 ++-- Indicators/Oscillator/tests/Indi_WPR.test.mq5 | 4 ++-- Indicators/Price/Indi_AppliedPrice.h | 4 ++-- Indicators/Price/Indi_MA.h | 4 ++-- Indicators/Price/Indi_Price.h | 4 ++-- Indicators/Price/includes.h | 4 ++-- .../Price/tests/Indi_AppliedPrice.test.mq4 | 4 ++-- .../Price/tests/Indi_AppliedPrice.test.mq5 | 4 ++-- Indicators/Price/tests/Indi_MA.test.mq4 | 4 ++-- Indicators/Price/tests/Indi_MA.test.mq5 | 4 ++-- Indicators/Price/tests/Indi_Price.test.cpp | 2 +- Indicators/Price/tests/Indi_Price.test.mq4 | 4 ++-- Indicators/Price/tests/Indi_Price.test.mq5 | 4 ++-- Indicators/PriceMulti/Indi_Alligator.h | 4 ++-- Indicators/PriceMulti/includes.h | 4 ++-- .../PriceMulti/tests/Indi_Alligator.test.mq4 | 4 ++-- .../PriceMulti/tests/Indi_Alligator.test.mq5 | 4 ++-- Indicators/PriceRange/Indi_Bands.h | 4 ++-- Indicators/PriceRange/Indi_Envelopes.h | 4 ++-- Indicators/PriceRange/Indi_SAR.h | 4 ++-- Indicators/PriceRange/includes.h | 4 ++-- .../PriceRange/tests/Indi_Bands.test.mq4 | 4 ++-- .../PriceRange/tests/Indi_Bands.test.mq5 | 4 ++-- .../PriceRange/tests/Indi_Envelopes.test.mq4 | 4 ++-- .../PriceRange/tests/Indi_Envelopes.test.mq5 | 4 ++-- Indicators/PriceRange/tests/Indi_SAR.test.mq4 | 4 ++-- Indicators/PriceRange/tests/Indi_SAR.test.mq5 | 4 ++-- Indicators/Special/Indi_Custom.mqh | 5 +++-- Indicators/Special/Indi_Math.mqh | 4 ++-- Indicators/Special/includes.h | 4 ++-- Indicators/Special/tests/Indi_Custom.test.mq4 | 4 ++-- Indicators/Special/tests/Indi_Custom.test.mq5 | 4 ++-- Indicators/Tick/Indi_TickMt.h | 4 ++-- Indicators/Tick/Indi_TickProvider.h | 4 ++-- Indicators/Tick/Indi_TickRandom.h | 4 ++-- Indicators/Tick/includes.h | 2 +- Indicators/Tick/tests/Indi_TickMt.test.mq4 | 4 ++-- Indicators/Tick/tests/Indi_TickMt.test.mq5 | 4 ++-- Indicators/includes.h | 4 ++-- Indicators/tests/DrawIndicator.test.cpp | 2 +- Indicators/tests/DrawIndicator.test.mq4 | 4 ++-- Indicators/tests/DrawIndicator.test.mq5 | 4 ++-- Indicators/tests/Indi_AC.test.mq4 | 4 ++-- Indicators/tests/Indi_AC.test.mq5 | 4 ++-- Indicators/tests/Indi_AD.test.mq4 | 4 ++-- Indicators/tests/Indi_AD.test.mq5 | 4 ++-- Indicators/tests/Indi_ADX.test.mq4 | 4 ++-- Indicators/tests/Indi_ADX.test.mq5 | 4 ++-- Indicators/tests/Indi_ADXW.test.mq4 | 4 ++-- Indicators/tests/Indi_ADXW.test.mq5 | 4 ++-- Indicators/tests/Indi_AMA.test.mq4 | 4 ++-- Indicators/tests/Indi_AMA.test.mq5 | 4 ++-- Indicators/tests/Indi_AO.test.mq4 | 4 ++-- Indicators/tests/Indi_AO.test.mq5 | 4 ++-- Indicators/tests/Indi_ASI.test.mq4 | 4 ++-- Indicators/tests/Indi_ASI.test.mq5 | 4 ++-- Indicators/tests/Indi_ATR.test.mq4 | 4 ++-- Indicators/tests/Indi_ATR.test.mq5 | 4 ++-- Indicators/tests/Indi_BWMFI.test.mq4 | 4 ++-- Indicators/tests/Indi_BWMFI.test.mq5 | 4 ++-- Indicators/tests/Indi_BWZT.test.mq4 | 4 ++-- Indicators/tests/Indi_BWZT.test.mq5 | 4 ++-- Indicators/tests/Indi_BearsPower.test.mq4 | 4 ++-- Indicators/tests/Indi_BearsPower.test.mq5 | 4 ++-- Indicators/tests/Indi_BullsPower.test.mq4 | 4 ++-- Indicators/tests/Indi_BullsPower.test.mq5 | 4 ++-- Indicators/tests/Indi_CCI.test.mq4 | 4 ++-- Indicators/tests/Indi_CCI.test.mq5 | 4 ++-- Indicators/tests/Indi_CHO.test.mq4 | 4 ++-- Indicators/tests/Indi_CHO.test.mq5 | 4 ++-- Indicators/tests/Indi_CHV.test.mq4 | 4 ++-- Indicators/tests/Indi_CHV.test.mq5 | 4 ++-- Indicators/tests/Indi_ColorBars.test.mq4 | 4 ++-- Indicators/tests/Indi_ColorBars.test.mq5 | 4 ++-- .../tests/Indi_ColorCandlesDaily.test.mq4 | 4 ++-- .../tests/Indi_ColorCandlesDaily.test.mq5 | 4 ++-- Indicators/tests/Indi_ColorLine.test.mq4 | 4 ++-- Indicators/tests/Indi_ColorLine.test.mq5 | 4 ++-- .../tests/Indi_CustomMovingAverage.test.mq4 | 4 ++-- .../tests/Indi_CustomMovingAverage.test.mq5 | 4 ++-- Indicators/tests/Indi_DEMA.test.mq4 | 4 ++-- Indicators/tests/Indi_DEMA.test.mq5 | 4 ++-- Indicators/tests/Indi_DeMarker.test.mq4 | 4 ++-- Indicators/tests/Indi_DeMarker.test.mq5 | 4 ++-- Indicators/tests/Indi_Demo.test.mq4 | 4 ++-- Indicators/tests/Indi_Demo.test.mq5 | 4 ++-- Indicators/tests/Indi_DetrendedPrice.test.mq4 | 4 ++-- Indicators/tests/Indi_DetrendedPrice.test.mq5 | 4 ++-- Indicators/tests/Indi_Drawer.test.mq4 | 4 ++-- Indicators/tests/Indi_Drawer.test.mq5 | 4 ++-- Indicators/tests/Indi_Force.test.mq4 | 4 ++-- Indicators/tests/Indi_Force.test.mq5 | 4 ++-- .../tests/Indi_FractalAdaptiveMA.test.mq4 | 4 ++-- .../tests/Indi_FractalAdaptiveMA.test.mq5 | 4 ++-- Indicators/tests/Indi_Fractals.test.mq4 | 4 ++-- Indicators/tests/Indi_Fractals.test.mq5 | 4 ++-- Indicators/tests/Indi_Gator.test.mq4 | 4 ++-- Indicators/tests/Indi_Gator.test.mq5 | 4 ++-- Indicators/tests/Indi_HeikenAshi.test.mq4 | 4 ++-- Indicators/tests/Indi_HeikenAshi.test.mq5 | 4 ++-- Indicators/tests/Indi_Ichimoku.test.mq4 | 4 ++-- Indicators/tests/Indi_Ichimoku.test.mq5 | 4 ++-- Indicators/tests/Indi_Killzones.test.mq4 | 4 ++-- Indicators/tests/Indi_Killzones.test.mq5 | 4 ++-- Indicators/tests/Indi_MFI.test.mq4 | 4 ++-- Indicators/tests/Indi_MFI.test.mq5 | 4 ++-- Indicators/tests/Indi_MassIndex.test.mq4 | 4 ++-- Indicators/tests/Indi_MassIndex.test.mq5 | 4 ++-- Indicators/tests/Indi_Momentum.test.mq4 | 4 ++-- Indicators/tests/Indi_Momentum.test.mq5 | 4 ++-- Indicators/tests/Indi_OBV.test.mq4 | 4 ++-- Indicators/tests/Indi_OBV.test.mq5 | 4 ++-- Indicators/tests/Indi_OsMA.test.mq4 | 4 ++-- Indicators/tests/Indi_OsMA.test.mq5 | 4 ++-- Indicators/tests/Indi_Pivot.test.mq4 | 4 ++-- Indicators/tests/Indi_Pivot.test.mq5 | 4 ++-- Indicators/tests/Indi_PriceChannel.test.mq4 | 4 ++-- Indicators/tests/Indi_PriceChannel.test.mq5 | 4 ++-- Indicators/tests/Indi_PriceFeeder.test.mq4 | 4 ++-- Indicators/tests/Indi_PriceFeeder.test.mq5 | 4 ++-- .../tests/Indi_PriceVolumeTrend.test.mq4 | 4 ++-- .../tests/Indi_PriceVolumeTrend.test.mq5 | 4 ++-- Indicators/tests/Indi_RS.test.mq4 | 4 ++-- Indicators/tests/Indi_RS.test.mq5 | 4 ++-- Indicators/tests/Indi_RVI.test.mq4 | 4 ++-- Indicators/tests/Indi_RVI.test.mq5 | 4 ++-- Indicators/tests/Indi_RateOfChange.test.mq4 | 4 ++-- Indicators/tests/Indi_RateOfChange.test.mq5 | 4 ++-- Indicators/tests/Indi_StdDev.test.mq4 | 4 ++-- Indicators/tests/Indi_StdDev.test.mq5 | 4 ++-- Indicators/tests/Indi_TEMA.test.mq4 | 4 ++-- Indicators/tests/Indi_TEMA.test.mq5 | 4 ++-- Indicators/tests/Indi_TRIX.test.mq4 | 4 ++-- Indicators/tests/Indi_TRIX.test.mq5 | 4 ++-- .../tests/Indi_UltimateOscillator.test.mq4 | 4 ++-- .../tests/Indi_UltimateOscillator.test.mq5 | 4 ++-- Indicators/tests/Indi_VIDYA.test.mq4 | 4 ++-- Indicators/tests/Indi_VIDYA.test.mq5 | 4 ++-- Indicators/tests/Indi_VROC.test.mq4 | 4 ++-- Indicators/tests/Indi_VROC.test.mq5 | 4 ++-- Indicators/tests/Indi_Volumes.test.mq4 | 4 ++-- Indicators/tests/Indi_Volumes.test.mq5 | 4 ++-- Indicators/tests/Indi_WilliamsAD.test.mq4 | 4 ++-- Indicators/tests/Indi_WilliamsAD.test.mq5 | 4 ++-- Indicators/tests/Indi_ZigZag.test.mq4 | 4 ++-- Indicators/tests/Indi_ZigZag.test.mq5 | 4 ++-- Indicators/tests/Indi_ZigZagColor.test.mq4 | 4 ++-- Indicators/tests/Indi_ZigZagColor.test.mq5 | 4 ++-- Indicators/tests/Indicators.test.mq4 | 4 ++-- Indicators/tests/Indicators.test.mq5 | 4 ++-- Instances.h | 4 ++-- Log.mqh | 4 ++-- Mail.mqh | 4 ++-- Market.mqh | 4 ++-- Market.struct.h | 4 ++-- Math/Math.define.h | 4 ++-- Math/Math.enum.h | 4 ++-- Math/Math.extern.h | 4 ++-- Math/Math.h | 4 ++-- Math/Math.struct.h | 4 ++-- Math/Matrix.h | 4 ++-- Math/MatrixMini.h | 4 ++-- Math/tests/Math.test.cpp | 2 +- Math/tests/Math.test.mq4 | 4 ++-- Math/tests/Math.test.mq5 | 4 ++-- Math/tests/Matrix.test.cpp | 2 +- Math/tests/Matrix.test.mq4 | 4 ++-- Math/tests/Matrix.test.mq5 | 4 ++-- Math/tests/MatrixMini.test.mq4 | 2 +- Math/tests/MatrixMini.test.mq5 | 2 +- Pattern.enum.h | 4 ++-- Pattern.mqh | 4 ++-- Pattern.struct.h | 4 ++-- Platform/Chart/Chart.define.h | 4 ++-- Platform/Chart/Chart.enum.h | 4 ++-- Platform/Chart/Chart.h | 4 ++-- Platform/Chart/Chart.struct.h | 4 ++-- Platform/Chart/Chart.struct.serialize.h | 4 ++-- Platform/Chart/Chart.struct.static.h | 4 ++-- Platform/Chart/Chart.struct.tf.h | 4 ++-- Platform/Chart/Chart.symboltf.h | 4 ++-- Platform/Chart/ChartBase.h | 4 ++-- Platform/Chart/ChartMt.h | 4 ++-- Platform/Chart/tests/Chart.test.cpp | 2 +- Platform/Chart/tests/Chart.test.mq4 | 4 ++-- Platform/Chart/tests/Chart.test.mq5 | 4 ++-- Platform/Chart/tests/ChartMt.test.mq4 | 2 +- Platform/Chart/tests/ChartMt.test.mq5 | 2 +- Platform/Chart3D/Chart3D.h | 4 ++-- Platform/Chart3D/Chart3DCandles.h | 4 ++-- Platform/Chart3D/Chart3DType.h | 4 ++-- Platform/Chart3D/Cube.h | 4 ++-- Platform/Chart3D/Device.h | 4 ++-- Platform/Chart3D/Devices/MTDX/MTDXDevice.h | 4 ++-- .../Chart3D/Devices/MTDX/MTDXIndexBuffer.h | 4 ++-- Platform/Chart3D/Devices/MTDX/MTDXShader.h | 4 ++-- .../Chart3D/Devices/MTDX/MTDXVertexBuffer.h | 4 ++-- Platform/Chart3D/Face.h | 4 ++-- Platform/Chart3D/Frontend.h | 4 ++-- Platform/Chart3D/Frontends/MT5Frontend.h | 4 ++-- Platform/Chart3D/IndexBuffer.h | 4 ++-- Platform/Chart3D/Interface.h | 4 ++-- Platform/Chart3D/Material.h | 22 +++++++++++++++++++ Platform/Chart3D/Mesh.h | 4 ++-- Platform/Chart3D/Shader.h | 4 ++-- Platform/Chart3D/ShaderVertexLayout.struct.h | 4 ++-- Platform/Chart3D/TSR.h | 4 ++-- Platform/Chart3D/Vertex.h | 22 +++++++++++++++++++ Platform/Chart3D/VertexBuffer.h | 4 ++-- Platform/Chart3D/tests/Chart3D.test.mq4 | 2 +- Platform/Chart3D/tests/Chart3D.test.mq5 | 8 +++---- Platform/Deal.enum.h | 4 ++-- Platform/MQL5.mqh | 4 ++-- Platform/Order.define.h | 4 ++-- Platform/Order.enum.h | 4 ++-- Platform/Order.h | 4 ++-- Platform/Order.struct.h | 4 ++-- Platform/OrderQuery.h | 4 ++-- Platform/Orders.h | 4 ++-- Platform/Platform.define.h | 4 ++-- Platform/Platform.extern.h | 4 ++-- Platform/Platform.h | 4 ++-- Platform/PlatformTime.h | 4 ++-- Platform/Plot.h | 4 ++-- Platform/Terminal.define.h | 4 ++-- Platform/Terminal.enum.h | 4 ++-- Platform/Terminal.extern.h | 4 ++-- Platform/Terminal.h | 4 ++-- Platform/Terminal.struct.h | 4 ++-- Platform/Web/Web.h | 4 ++-- Platform/Web/tests/Web.test.mq4 | 4 ++-- Platform/Web/tests/Web.test.mq5 | 4 ++-- Platform/tests/Order.test.cpp | 2 +- Platform/tests/Order.test.mq4 | 4 ++-- Platform/tests/Order.test.mq5 | 4 ++-- Platform/tests/OrderQuery.test.cpp | 2 +- Platform/tests/OrderQuery.test.mq4 | 4 ++-- Platform/tests/OrderQuery.test.mq5 | 4 ++-- Platform/tests/Orders.test.cpp | 2 +- Platform/tests/Orders.test.mq4 | 4 ++-- Platform/tests/Orders.test.mq5 | 4 ++-- Platform/tests/Platform.test.cpp | 2 +- Platform/tests/Platform.test.mq4 | 2 +- Platform/tests/Platform.test.mq5 | 2 +- Platform/tests/Plot.test.mq4 | 2 +- Platform/tests/Plot.test.mq5 | 2 +- Platform/tests/Terminal.test.cpp | 2 +- Platform/tests/Terminal.test.mq4 | 4 ++-- Platform/tests/Terminal.test.mq5 | 4 ++-- Profiler.mqh | 4 ++-- README.md | 1 + Refs.mqh | 4 ++-- Refs.rc.h | 4 ++-- Refs.struct.h | 4 ++-- Report.mqh | 4 ++-- Serializer/Serializable.h | 4 ++-- Serializer/Serializer.define.h | 4 ++-- Serializer/Serializer.enum.h | 4 ++-- Serializer/Serializer.h | 4 ++-- Serializer/SerializerBinary.h | 4 ++-- Serializer/SerializerConversions.h | 4 ++-- Serializer/SerializerConverter.h | 4 ++-- Serializer/SerializerCsv.h | 4 ++-- Serializer/SerializerDict.h | 4 ++-- Serializer/SerializerJson.h | 4 ++-- Serializer/SerializerNode.enum.h | 4 ++-- Serializer/SerializerNode.h | 4 ++-- Serializer/SerializerNodeIterator.h | 4 ++-- Serializer/SerializerNodeParam.h | 4 ++-- Serializer/SerializerObject.h | 4 ++-- Serializer/SerializerSqlite.h | 4 ++-- Serializer/tests/Serializable.test.cpp | 2 +- Serializer/tests/Serializer.test.mq4 | 4 ++-- Serializer/tests/Serializer.test.mq5 | 4 ++-- SetFile.mqh | 4 ++-- Socket.mqh | 4 ++-- Stats.mqh | 4 ++-- Std.h | 4 ++-- Storage/Array.extern.h | 4 ++-- Storage/Array.h | 4 ++-- Storage/Cache/IndiBufferCache.h | 4 ++-- Storage/Cache/ObjectsCache.h | 4 ++-- Storage/Cache/tests/IndiBufferCache.test.cpp | 2 +- Storage/Cache/tests/IndiBufferCache.test.mq4 | 2 +- Storage/Cache/tests/IndiBufferCache.test.mq5 | 2 +- Storage/Cache/tests/ObjectsCache.test.cpp | 2 +- Storage/Cache/tests/ObjectsCache.test.mq4 | 2 +- Storage/Cache/tests/ObjectsCache.test.mq5 | 2 +- Storage/Collection.h | 4 ++-- Storage/Data.define.h | 4 ++-- Storage/Data.enum.h | 4 ++-- Storage/Data.struct.h | 4 ++-- Storage/Data.struct.serialize.h | 4 ++-- Storage/Database.h | 4 ++-- Storage/Database.struct.h | 2 +- Storage/DateTime.entry.h | 4 ++-- Storage/DateTime.enum.h | 4 ++-- Storage/DateTime.extern.h | 4 ++-- Storage/DateTime.h | 4 ++-- Storage/DateTime.static.h | 4 ++-- Storage/DateTime.struct.h | 4 ++-- Storage/Dict/Buffer/Buffer.h | 4 ++-- Storage/Dict/Buffer/BufferCandle.h | 4 ++-- Storage/Dict/Buffer/BufferFXT.h | 8 +++---- Storage/Dict/Buffer/BufferStruct.h | 4 ++-- Storage/Dict/Buffer/BufferTick.h | 4 ++-- Storage/Dict/Buffer/tests/Buffer.test.mq4 | 4 ++-- Storage/Dict/Buffer/tests/Buffer.test.mq5 | 4 ++-- .../Dict/Buffer/tests/BufferCandle.test.mq4 | 4 ++-- .../Dict/Buffer/tests/BufferCandle.test.mq5 | 4 ++-- .../Buffer/tests/BufferCompileAll.test.mq4 | 8 +++---- .../Buffer/tests/BufferCompileAll.test.mq5 | 2 +- Storage/Dict/Buffer/tests/BufferFXT.test.mq4 | 8 +++---- Storage/Dict/Buffer/tests/BufferFXT.test.mq5 | 8 +++---- .../Dict/Buffer/tests/BufferStruct.test.mq4 | 4 ++-- .../Dict/Buffer/tests/BufferStruct.test.mq5 | 4 ++-- Storage/Dict/Buffer/tests/BufferTick.test.mq4 | 4 ++-- Storage/Dict/Buffer/tests/BufferTick.test.mq5 | 4 ++-- Storage/Dict/Dict.enum.h | 4 ++-- Storage/Dict/Dict.h | 4 ++-- Storage/Dict/DictBase.h | 4 ++-- Storage/Dict/DictIteratorBase.h | 4 ++-- Storage/Dict/DictObject.h | 4 ++-- Storage/Dict/DictSlot.h | 4 ++-- Storage/Dict/DictSlotsRef.h | 4 ++-- Storage/Dict/DictStruct.h | 4 ++-- Storage/Dict/tests/Dict.test.mq4 | 4 ++-- Storage/Dict/tests/Dict.test.mq5 | 4 ++-- Storage/Flags.struct.h | 4 ++-- Storage/IValueStorage.h | 4 ++-- Storage/ItemsHistory.h | 4 ++-- Storage/MemoryFileSystem.h | 4 ++-- Storage/Object.enum.h | 6 ++--- Storage/Object.extern.h | 4 ++-- Storage/Object.h | 6 ++--- Storage/Objects.h | 4 ++-- Storage/Redis.h | 4 ++-- Storage/Redis.struct.h | 4 ++-- Storage/Singleton.h | 4 ++-- Storage/String.extern.h | 4 ++-- Storage/String.h | 4 ++-- Storage/ValueStorage.accessor.h | 4 ++-- Storage/ValueStorage.all.h | 4 ++-- Storage/ValueStorage.applied_price.h | 4 ++-- Storage/ValueStorage.h | 4 ++-- Storage/ValueStorage.history.h | 4 ++-- Storage/ValueStorage.indicator.h | 4 ++-- Storage/ValueStorage.native.h | 4 ++-- Storage/ValueStorage.price_median.h | 4 ++-- Storage/ValueStorage.price_typical.h | 4 ++-- Storage/ValueStorage.price_weighted.h | 4 ++-- Storage/ValueStorage.spread.h | 4 ++-- Storage/ValueStorage.tick_volume.h | 4 ++-- Storage/ValueStorage.time.h | 4 ++-- Storage/ValueStorage.volume.h | 4 ++-- Storage/tests/Collection.test.cpp | 2 +- Storage/tests/Collection.test.mq4 | 4 ++-- Storage/tests/Collection.test.mq5 | 4 ++-- Storage/tests/Database.test.mq4 | 4 ++-- Storage/tests/Database.test.mq5 | 4 ++-- Storage/tests/DateTime.test.mq4 | 4 ++-- Storage/tests/DateTime.test.mq5 | 4 ++-- Storage/tests/ItemsHistory.test.mq4 | 8 +++---- Storage/tests/ItemsHistory.test.mq5 | 8 +++---- Storage/tests/Object.test.mq4 | 2 +- Storage/tests/Object.test.mq5 | 4 ++-- Storage/tests/Redis.test.mq4 | 4 ++-- Storage/tests/Redis.test.mq5 | 4 ++-- Storage/tests/ValueStorage.test.mq4 | 4 ++-- Storage/tests/ValueStorage.test.mq5 | 4 ++-- Strategy.enum.h | 4 ++-- Strategy.mqh | 4 ++-- Strategy.struct.h | 4 ++-- Strategy.struct.pricestop.h | 4 ++-- SummaryReport.mqh | 4 ++-- SymbolInfo.define.h | 4 ++-- SymbolInfo.enum.h | 4 ++-- SymbolInfo.enum.symbols.h | 4 ++-- SymbolInfo.extern.h | 4 ++-- SymbolInfo.mqh | 4 ++-- SymbolInfo.struct.h | 4 ++-- SymbolInfo.struct.static.h | 4 ++-- Task/Task.enum.h | 4 ++-- Task/Task.h | 4 ++-- Task/Task.struct.h | 4 ++-- Task/TaskAction.enum.h | 4 ++-- Task/TaskAction.h | 4 ++-- Task/TaskAction.struct.h | 4 ++-- Task/TaskAction.struct.serialize.h | 4 ++-- Task/TaskActionBase.h | 4 ++-- Task/TaskCondition.enum.h | 4 ++-- Task/TaskCondition.h | 4 ++-- Task/TaskCondition.struct.h | 4 ++-- Task/TaskCondition.struct.serialize.h | 4 ++-- Task/TaskConditionBase.h | 4 ++-- Task/TaskGetter.h | 4 ++-- Task/TaskGetter.struct.h | 4 ++-- Task/TaskGetter.struct.serialize.h | 4 ++-- Task/TaskGetterBase.h | 4 ++-- Task/TaskManager.h | 4 ++-- Task/TaskObject.h | 4 ++-- Task/TaskSetter.h | 4 ++-- Task/TaskSetter.struct.h | 4 ++-- Task/TaskSetterBase.h | 4 ++-- Task/Taskable.h | 4 ++-- Task/tests/Task.test.cpp | 4 ++-- Task/tests/Task.test.mq4 | 4 ++-- Task/tests/Task.test.mq5 | 4 ++-- Task/tests/TaskAction.test.cpp | 4 ++-- Task/tests/TaskAction.test.mq4 | 4 ++-- Task/tests/TaskAction.test.mq5 | 4 ++-- Task/tests/TaskActionBase.test.cpp | 4 ++-- Task/tests/TaskCondition.test.cpp | 4 ++-- Task/tests/TaskCondition.test.mq4 | 4 ++-- Task/tests/TaskCondition.test.mq5 | 4 ++-- Task/tests/TaskConditionBase.test.cpp | 4 ++-- Task/tests/TaskGetter.test.cpp | 4 ++-- Task/tests/TaskGetter.test.mq4 | 4 ++-- Task/tests/TaskGetter.test.mq5 | 4 ++-- Task/tests/TaskGetterBase.test.cpp | 4 ++-- Task/tests/TaskManager.test.cpp | 4 ++-- Task/tests/TaskManager.test.mq4 | 4 ++-- Task/tests/TaskManager.test.mq5 | 4 ++-- Task/tests/TaskObject.test.cpp | 4 ++-- Task/tests/TaskObject.test.mq4 | 4 ++-- Task/tests/TaskObject.test.mq5 | 4 ++-- Task/tests/TaskSetter.test.cpp | 4 ++-- Task/tests/TaskSetter.test.mq4 | 4 ++-- Task/tests/TaskSetter.test.mq5 | 4 ++-- Task/tests/Taskable.car.test.mq4 | 4 ++-- Task/tests/Taskable.car.test.mq5 | 4 ++-- Task/tests/Taskable.test.cpp | 4 ++-- Task/tests/Taskable.test.mq4 | 4 ++-- Task/tests/Taskable.test.mq5 | 4 ++-- Test.mqh | 4 ++-- Tester.mqh | 4 ++-- Tests.mqh | 4 ++-- Tick/Tick.struct.h | 4 ++-- Tick/TickManager.h | 4 ++-- Tick/tests/TickManager.test.cpp | 4 ++-- Tick/tests/TickManager.test.mq4 | 4 ++-- Tick/tests/TickManager.test.mq5 | 4 ++-- Ticker.mqh | 4 ++-- Timer.mqh | 4 ++-- Trade.enum.h | 4 ++-- Trade.mqh | 4 ++-- Trade.struct.h | 4 ++-- Trade/TradeSignal.h | 4 ++-- Trade/TradeSignal.struct.h | 4 ++-- Trade/TradeSignalManager.h | 4 ++-- Trade/TradeSignalManager.struct.h | 4 ++-- Trade/tests/TradeSignal.test.cpp | 4 ++-- Trade/tests/TradeSignal.test.mq4 | 4 ++-- Trade/tests/TradeSignal.test.mq5 | 4 ++-- Trade/tests/TradeSignalManager.test.cpp | 4 ++-- Trade/tests/TradeSignalManager.test.mq4 | 4 ++-- Trade/tests/TradeSignalManager.test.mq5 | 4 ++-- Util.h | 4 ++-- tests/CompileTest.mq4 | 4 ++-- tests/CompileTest.mq5 | 4 ++-- tests/ConfigTest.mq4 | 4 ++-- tests/ConfigTest.mq5 | 4 ++-- tests/ConvertTest.mq4 | 4 ++-- tests/ConvertTest.mq5 | 4 ++-- tests/EATest.mq4 | 4 ++-- tests/EATest.mq5 | 4 ++-- tests/IndicatorsTest.mq4 | 4 ++-- tests/IndicatorsTest.mq5 | 4 ++-- tests/LogTest.mq4 | 4 ++-- tests/LogTest.mq5 | 4 ++-- tests/MD5Test.mq4 | 4 ++-- tests/MD5Test.mq5 | 4 ++-- tests/MailTest.mq4 | 4 ++-- tests/MailTest.mq5 | 4 ++-- tests/MarketTest.mq4 | 4 ++-- tests/MarketTest.mq5 | 4 ++-- tests/ProfilerTest.mq4 | 4 ++-- tests/ProfilerTest.mq5 | 4 ++-- tests/RefsTest.mq4 | 4 ++-- tests/RefsTest.mq5 | 4 ++-- tests/StatsTest.mq4 | 4 ++-- tests/StatsTest.mq5 | 4 ++-- tests/StrategyTest-RSI.mq4 | 4 ++-- tests/StrategyTest-RSI.mq5 | 4 ++-- tests/StrategyTest.mq4 | 4 ++-- tests/StrategyTest.mq5 | 4 ++-- tests/SummaryReportTest.mq4 | 4 ++-- tests/SummaryReportTest.mq5 | 4 ++-- tests/SymbolInfoTest.mq4 | 4 ++-- tests/SymbolInfoTest.mq5 | 4 ++-- tests/TickerTest.mq4 | 4 ++-- tests/TickerTest.mq5 | 4 ++-- tests/TimerTest.mq4 | 4 ++-- tests/TimerTest.mq5 | 4 ++-- tests/TradeTest.mq4 | 4 ++-- tests/TradeTest.mq5 | 4 ++-- 658 files changed, 1328 insertions(+), 1282 deletions(-) diff --git a/Bar.enum.h b/Bar.enum.h index ac73beba5..84a79ce37 100644 --- a/Bar.enum.h +++ b/Bar.enum.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Bar.struct.h b/Bar.struct.h index 7eb348fb2..63d77eea9 100644 --- a/Bar.struct.h +++ b/Bar.struct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Candle.struct.h b/Candle.struct.h index 9dc7137ef..596ddbb89 100644 --- a/Candle.struct.h +++ b/Candle.struct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Common.define.h b/Common.define.h index f95e124ae..26767d7fb 100644 --- a/Common.define.h +++ b/Common.define.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Common.extern.h b/Common.extern.h index 984d4d9cc..433e1a994 100644 --- a/Common.extern.h +++ b/Common.extern.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Config.mqh b/Config.mqh index ffacec2a9..8213b902e 100644 --- a/Config.mqh +++ b/Config.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Convert.basic.h b/Convert.basic.h index 04d83a26e..9dd8bc9b4 100644 --- a/Convert.basic.h +++ b/Convert.basic.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Convert.extern.h b/Convert.extern.h index a21d6599e..8d0eebce4 100644 --- a/Convert.extern.h +++ b/Convert.extern.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Convert.mqh b/Convert.mqh index b4ae88493..07f02c2bd 100644 --- a/Convert.mqh +++ b/Convert.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/EA.enum.h b/EA.enum.h index 717f9b21f..61dc17094 100644 --- a/EA.enum.h +++ b/EA.enum.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/EA.mqh b/EA.mqh index 24341e79d..b878d774a 100644 --- a/EA.mqh +++ b/EA.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/EA.struct.h b/EA.struct.h index bcad6fd3e..48e260ecb 100644 --- a/EA.struct.h +++ b/EA.struct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Exchange/Account/Account.define.h b/Exchange/Account/Account.define.h index 3f04e50b1..165a588b4 100644 --- a/Exchange/Account/Account.define.h +++ b/Exchange/Account/Account.define.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Exchange/Account/Account.enum.h b/Exchange/Account/Account.enum.h index db5c77592..4305878da 100644 --- a/Exchange/Account/Account.enum.h +++ b/Exchange/Account/Account.enum.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Exchange/Account/Account.extern.h b/Exchange/Account/Account.extern.h index 17d5a39b8..678b1f5ed 100644 --- a/Exchange/Account/Account.extern.h +++ b/Exchange/Account/Account.extern.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Exchange/Account/Account.h b/Exchange/Account/Account.h index 95222e345..a787c53c8 100644 --- a/Exchange/Account/Account.h +++ b/Exchange/Account/Account.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Exchange/Account/Account.struct.h b/Exchange/Account/Account.struct.h index eafb6ce62..8e1434e63 100644 --- a/Exchange/Account/Account.struct.h +++ b/Exchange/Account/Account.struct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Exchange/Account/AccountBase.h b/Exchange/Account/AccountBase.h index 7861461ca..f8191256c 100644 --- a/Exchange/Account/AccountBase.h +++ b/Exchange/Account/AccountBase.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Exchange/Account/AccountBase.struct.h b/Exchange/Account/AccountBase.struct.h index 450d970cf..dd17e281f 100644 --- a/Exchange/Account/AccountBase.struct.h +++ b/Exchange/Account/AccountBase.struct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Exchange/Account/AccountForex.h b/Exchange/Account/AccountForex.h index 6df312f80..e26810b62 100644 --- a/Exchange/Account/AccountForex.h +++ b/Exchange/Account/AccountForex.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Exchange/Account/AccountForex.struct.h b/Exchange/Account/AccountForex.struct.h index af59483a0..e994a8a5e 100644 --- a/Exchange/Account/AccountForex.struct.h +++ b/Exchange/Account/AccountForex.struct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Exchange/Account/AccountMt.h b/Exchange/Account/AccountMt.h index a6e4b2440..eb53bed17 100644 --- a/Exchange/Account/AccountMt.h +++ b/Exchange/Account/AccountMt.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Exchange/Account/tests/Account.test.cpp b/Exchange/Account/tests/Account.test.cpp index 964cb84e1..a71e2714b 100644 --- a/Exchange/Account/tests/Account.test.cpp +++ b/Exchange/Account/tests/Account.test.cpp @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Exchange/Account/tests/Account.test.mq4 b/Exchange/Account/tests/Account.test.mq4 index 98597aef7..a427166df 100644 --- a/Exchange/Account/tests/Account.test.mq4 +++ b/Exchange/Account/tests/Account.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Exchange/Account/tests/Account.test.mq5 b/Exchange/Account/tests/Account.test.mq5 index d03fd578f..17f0e8c30 100644 --- a/Exchange/Account/tests/Account.test.mq5 +++ b/Exchange/Account/tests/Account.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Exchange/Account/tests/AccountBase.test.cpp b/Exchange/Account/tests/AccountBase.test.cpp index 2dbf0ea84..923fe7791 100644 --- a/Exchange/Account/tests/AccountBase.test.cpp +++ b/Exchange/Account/tests/AccountBase.test.cpp @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Exchange/Account/tests/AccountForex.test.cpp b/Exchange/Account/tests/AccountForex.test.cpp index 308734d8f..a2004df86 100644 --- a/Exchange/Account/tests/AccountForex.test.cpp +++ b/Exchange/Account/tests/AccountForex.test.cpp @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Exchange/Account/tests/AccountForex.test.mq4 b/Exchange/Account/tests/AccountForex.test.mq4 index 21bbbae72..2c60b2b7d 100644 --- a/Exchange/Account/tests/AccountForex.test.mq4 +++ b/Exchange/Account/tests/AccountForex.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Exchange/Account/tests/AccountForex.test.mq5 b/Exchange/Account/tests/AccountForex.test.mq5 index d1d5c71fa..5c987ba53 100644 --- a/Exchange/Account/tests/AccountForex.test.mq5 +++ b/Exchange/Account/tests/AccountForex.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Exchange/Account/tests/AccountMt.test.cpp b/Exchange/Account/tests/AccountMt.test.cpp index ac3946948..f89b71f07 100644 --- a/Exchange/Account/tests/AccountMt.test.cpp +++ b/Exchange/Account/tests/AccountMt.test.cpp @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Exchange/Account/tests/AccountMt.test.mq4 b/Exchange/Account/tests/AccountMt.test.mq4 index 8720ac436..157f585ca 100644 --- a/Exchange/Account/tests/AccountMt.test.mq4 +++ b/Exchange/Account/tests/AccountMt.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Exchange/Account/tests/AccountMt.test.mq5 b/Exchange/Account/tests/AccountMt.test.mq5 index 156c03a93..b8dd2bf72 100644 --- a/Exchange/Account/tests/AccountMt.test.mq5 +++ b/Exchange/Account/tests/AccountMt.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Exchange/Exchange.h b/Exchange/Exchange.h index 6468da7f3..784416e9b 100644 --- a/Exchange/Exchange.h +++ b/Exchange/Exchange.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Exchange/Exchange.struct.h b/Exchange/Exchange.struct.h index d63290d4f..cf73a8e0d 100644 --- a/Exchange/Exchange.struct.h +++ b/Exchange/Exchange.struct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Exchange/tests/Exchange.test.cpp b/Exchange/tests/Exchange.test.cpp index dda339de0..4af791d0f 100644 --- a/Exchange/tests/Exchange.test.cpp +++ b/Exchange/tests/Exchange.test.cpp @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Exchange/tests/Exchange.test.mq4 b/Exchange/tests/Exchange.test.mq4 index 2b3fdf2da..ab7c97f11 100644 --- a/Exchange/tests/Exchange.test.mq4 +++ b/Exchange/tests/Exchange.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Exchange/tests/Exchange.test.mq5 b/Exchange/tests/Exchange.test.mq5 index 52a12a7af..46ec72a4e 100644 --- a/Exchange/tests/Exchange.test.mq5 +++ b/Exchange/tests/Exchange.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/File.define.h b/File.define.h index 39b5ce3d9..491258389 100644 --- a/File.define.h +++ b/File.define.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/File.extern.h b/File.extern.h index 946501846..1ba5dbba5 100644 --- a/File.extern.h +++ b/File.extern.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/File.mqh b/File.mqh index afa9a2ef8..b5e364f44 100644 --- a/File.mqh +++ b/File.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/Indicator.define.h b/Indicator/Indicator.define.h index b6f51a62d..498b8eb66 100644 --- a/Indicator/Indicator.define.h +++ b/Indicator/Indicator.define.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/Indicator.enum.h b/Indicator/Indicator.enum.h index fcbf71f51..891e3c024 100644 --- a/Indicator/Indicator.enum.h +++ b/Indicator/Indicator.enum.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/Indicator.h b/Indicator/Indicator.h index e1a896839..26e2d644d 100644 --- a/Indicator/Indicator.h +++ b/Indicator/Indicator.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/Indicator.struct.h b/Indicator/Indicator.struct.h index f54490444..357ec397b 100644 --- a/Indicator/Indicator.struct.h +++ b/Indicator/Indicator.struct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/Indicator.struct.serialize.h b/Indicator/Indicator.struct.serialize.h index 8855aa9f3..0a3e2a67d 100644 --- a/Indicator/Indicator.struct.serialize.h +++ b/Indicator/Indicator.struct.serialize.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/IndicatorBase.h b/Indicator/IndicatorBase.h index fec1d2589..0fee25412 100644 --- a/Indicator/IndicatorBase.h +++ b/Indicator/IndicatorBase.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/IndicatorCandle.h b/Indicator/IndicatorCandle.h index 77917b081..d071c57a1 100644 --- a/Indicator/IndicatorCandle.h +++ b/Indicator/IndicatorCandle.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/IndicatorCandle.provider.h b/Indicator/IndicatorCandle.provider.h index ccecbd14e..d0f12734e 100644 --- a/Indicator/IndicatorCandle.provider.h +++ b/Indicator/IndicatorCandle.provider.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/IndicatorData.enum.h b/Indicator/IndicatorData.enum.h index f3128fffd..fa7e38823 100644 --- a/Indicator/IndicatorData.enum.h +++ b/Indicator/IndicatorData.enum.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/IndicatorData.h b/Indicator/IndicatorData.h index 14cf5ad2d..55715f30b 100644 --- a/Indicator/IndicatorData.h +++ b/Indicator/IndicatorData.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/IndicatorData.struct.h b/Indicator/IndicatorData.struct.h index 806f52167..b9d8608d0 100644 --- a/Indicator/IndicatorData.struct.h +++ b/Indicator/IndicatorData.struct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/IndicatorData.struct.serialize.h b/Indicator/IndicatorData.struct.serialize.h index d2d8067dd..42be20963 100644 --- a/Indicator/IndicatorData.struct.serialize.h +++ b/Indicator/IndicatorData.struct.serialize.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/IndicatorData.struct.signal.h b/Indicator/IndicatorData.struct.signal.h index 0ea5024a6..2ea30daea 100644 --- a/Indicator/IndicatorData.struct.signal.h +++ b/Indicator/IndicatorData.struct.signal.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/IndicatorRenko.h b/Indicator/IndicatorRenko.h index c6f541ff5..cb5bb5f72 100644 --- a/Indicator/IndicatorRenko.h +++ b/Indicator/IndicatorRenko.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/IndicatorRenko.provider.h b/Indicator/IndicatorRenko.provider.h index e987f12ba..028627d5e 100644 --- a/Indicator/IndicatorRenko.provider.h +++ b/Indicator/IndicatorRenko.provider.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/IndicatorRenko.struct.h b/Indicator/IndicatorRenko.struct.h index d7e160798..f2785506f 100644 --- a/Indicator/IndicatorRenko.struct.h +++ b/Indicator/IndicatorRenko.struct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/IndicatorTf.h b/Indicator/IndicatorTf.h index 00f2ec094..1562a24f6 100644 --- a/Indicator/IndicatorTf.h +++ b/Indicator/IndicatorTf.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/IndicatorTf.provider.h b/Indicator/IndicatorTf.provider.h index 6e4556705..43b92aa71 100644 --- a/Indicator/IndicatorTf.provider.h +++ b/Indicator/IndicatorTf.provider.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/IndicatorTf.struct.h b/Indicator/IndicatorTf.struct.h index 5edab144c..d3e0a7c0e 100644 --- a/Indicator/IndicatorTf.struct.h +++ b/Indicator/IndicatorTf.struct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/IndicatorTick.h b/Indicator/IndicatorTick.h index c5be17898..0dfdaa89c 100644 --- a/Indicator/IndicatorTick.h +++ b/Indicator/IndicatorTick.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/IndicatorTick.provider.h b/Indicator/IndicatorTick.provider.h index 660b6f0ab..40c690d34 100644 --- a/Indicator/IndicatorTick.provider.h +++ b/Indicator/IndicatorTick.provider.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/IndicatorTickSource.h b/Indicator/IndicatorTickSource.h index b2c911c9c..d780536c1 100644 --- a/Indicator/IndicatorTickSource.h +++ b/Indicator/IndicatorTickSource.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/README.md b/Indicator/README.md index 3394a87b5..efe21e8ca 100644 --- a/Indicator/README.md +++ b/Indicator/README.md @@ -29,7 +29,7 @@ The purpose of `IndicatorData` class is to store indicator data. It is basically alternative implementation of `Indicator` class. For more details, please read: -[Class to hold indicator values](https://github.com/EA31337/EA31337-classes/issues/23). +[Class to hold indicator values]( https://ea31337.github.io/EA31337-classes/issues/23). For implementation example, check [`tests/IndicatorDataTest.mq5`](tests/IndicatorDataTest.mq5). diff --git a/Indicator/TickBarCounter.h b/Indicator/TickBarCounter.h index 45f0a102c..81eaa17a3 100644 --- a/Indicator/TickBarCounter.h +++ b/Indicator/TickBarCounter.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/tests/Indicator.test.mq4 b/Indicator/tests/Indicator.test.mq4 index 81a7da627..7f1702a4c 100644 --- a/Indicator/tests/Indicator.test.mq4 +++ b/Indicator/tests/Indicator.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/tests/Indicator.test.mq5 b/Indicator/tests/Indicator.test.mq5 index 437dfb252..e19ea6711 100644 --- a/Indicator/tests/Indicator.test.mq5 +++ b/Indicator/tests/Indicator.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/tests/IndicatorBase.test.cpp b/Indicator/tests/IndicatorBase.test.cpp index 46f7d0410..4f1a4cfb4 100644 --- a/Indicator/tests/IndicatorBase.test.cpp +++ b/Indicator/tests/IndicatorBase.test.cpp @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/tests/IndicatorBase.test.mq4 b/Indicator/tests/IndicatorBase.test.mq4 index e350d5630..e6de15f4f 100644 --- a/Indicator/tests/IndicatorBase.test.mq4 +++ b/Indicator/tests/IndicatorBase.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/tests/IndicatorBase.test.mq5 b/Indicator/tests/IndicatorBase.test.mq5 index 49ff02872..4913ea7af 100644 --- a/Indicator/tests/IndicatorBase.test.mq5 +++ b/Indicator/tests/IndicatorBase.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/tests/IndicatorCandle.test.mq4 b/Indicator/tests/IndicatorCandle.test.mq4 index 93a0098bb..4b4e501cd 100644 --- a/Indicator/tests/IndicatorCandle.test.mq4 +++ b/Indicator/tests/IndicatorCandle.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/tests/IndicatorCandle.test.mq5 b/Indicator/tests/IndicatorCandle.test.mq5 index fd0c1b68f..b1d700591 100644 --- a/Indicator/tests/IndicatorCandle.test.mq5 +++ b/Indicator/tests/IndicatorCandle.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/tests/IndicatorData.test.mq4 b/Indicator/tests/IndicatorData.test.mq4 index 354e8a763..55e098f31 100644 --- a/Indicator/tests/IndicatorData.test.mq4 +++ b/Indicator/tests/IndicatorData.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/tests/IndicatorData.test.mq5 b/Indicator/tests/IndicatorData.test.mq5 index d78133913..7147f077b 100644 --- a/Indicator/tests/IndicatorData.test.mq5 +++ b/Indicator/tests/IndicatorData.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/tests/IndicatorRenko.test.mq4 b/Indicator/tests/IndicatorRenko.test.mq4 index c1e3ff307..f33c4a776 100644 --- a/Indicator/tests/IndicatorRenko.test.mq4 +++ b/Indicator/tests/IndicatorRenko.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/tests/IndicatorRenko.test.mq5 b/Indicator/tests/IndicatorRenko.test.mq5 index 1beebb52c..e28e4d959 100644 --- a/Indicator/tests/IndicatorRenko.test.mq5 +++ b/Indicator/tests/IndicatorRenko.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/tests/IndicatorTf.test.mq4 b/Indicator/tests/IndicatorTf.test.mq4 index 360408073..3fa0265a5 100644 --- a/Indicator/tests/IndicatorTf.test.mq4 +++ b/Indicator/tests/IndicatorTf.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/tests/IndicatorTf.test.mq5 b/Indicator/tests/IndicatorTf.test.mq5 index 0dc176d6e..bdb902f51 100644 --- a/Indicator/tests/IndicatorTf.test.mq5 +++ b/Indicator/tests/IndicatorTf.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/tests/IndicatorTick.test.mq4 b/Indicator/tests/IndicatorTick.test.mq4 index 430e9d0e3..1ad443e27 100644 --- a/Indicator/tests/IndicatorTick.test.mq4 +++ b/Indicator/tests/IndicatorTick.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/tests/IndicatorTick.test.mq5 b/Indicator/tests/IndicatorTick.test.mq5 index b5e133e5a..5a59968f3 100644 --- a/Indicator/tests/IndicatorTick.test.mq5 +++ b/Indicator/tests/IndicatorTick.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/tests/classes/IndicatorTfDummy.h b/Indicator/tests/classes/IndicatorTfDummy.h index 844c20931..137a13186 100644 --- a/Indicator/tests/classes/IndicatorTfDummy.h +++ b/Indicator/tests/classes/IndicatorTfDummy.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/tests/classes/IndicatorTickDummy.h b/Indicator/tests/classes/IndicatorTickDummy.h index 14e459ca0..185c439d4 100644 --- a/Indicator/tests/classes/IndicatorTickDummy.h +++ b/Indicator/tests/classes/IndicatorTickDummy.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicator/tests/classes/Indicators.h b/Indicator/tests/classes/Indicators.h index f5676139d..e5c0e4b57 100644 --- a/Indicator/tests/classes/Indicators.h +++ b/Indicator/tests/classes/Indicators.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Bitwise/Indi_Candle.mqh b/Indicators/Bitwise/Indi_Candle.mqh index d6f81947e..1be84c6f7 100644 --- a/Indicators/Bitwise/Indi_Candle.mqh +++ b/Indicators/Bitwise/Indi_Candle.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Bitwise/Indi_Pattern.mqh b/Indicators/Bitwise/Indi_Pattern.mqh index 12f313ff2..4931c2531 100644 --- a/Indicators/Bitwise/Indi_Pattern.mqh +++ b/Indicators/Bitwise/Indi_Pattern.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Bitwise/includes.h b/Indicators/Bitwise/includes.h index 2cb3bb23c..f6bd6e906 100644 --- a/Indicators/Bitwise/includes.h +++ b/Indicators/Bitwise/includes.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Bitwise/tests/Indi_Candle.test.mq4 b/Indicators/Bitwise/tests/Indi_Candle.test.mq4 index 29583b3a8..7d47515c3 100644 --- a/Indicators/Bitwise/tests/Indi_Candle.test.mq4 +++ b/Indicators/Bitwise/tests/Indi_Candle.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Bitwise/tests/Indi_Candle.test.mq5 b/Indicators/Bitwise/tests/Indi_Candle.test.mq5 index cc1588f1d..1ae0955ab 100644 --- a/Indicators/Bitwise/tests/Indi_Candle.test.mq5 +++ b/Indicators/Bitwise/tests/Indi_Candle.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Bitwise/tests/Indi_Pattern.test.mq4 b/Indicators/Bitwise/tests/Indi_Pattern.test.mq4 index 155c7b60a..4710361a9 100644 --- a/Indicators/Bitwise/tests/Indi_Pattern.test.mq4 +++ b/Indicators/Bitwise/tests/Indi_Pattern.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Bitwise/tests/Indi_Pattern.test.mq5 b/Indicators/Bitwise/tests/Indi_Pattern.test.mq5 index 351c9a0c7..4e8e4d837 100644 --- a/Indicators/Bitwise/tests/Indi_Pattern.test.mq5 +++ b/Indicators/Bitwise/tests/Indi_Pattern.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/DrawIndicator.mqh b/Indicators/DrawIndicator.mqh index 948a37240..2815f05b9 100644 --- a/Indicators/DrawIndicator.mqh +++ b/Indicators/DrawIndicator.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_AC.mqh b/Indicators/Indi_AC.mqh index b055758c4..c67bd47a7 100644 --- a/Indicators/Indi_AC.mqh +++ b/Indicators/Indi_AC.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_AD.mqh b/Indicators/Indi_AD.mqh index 3fffd899b..3d965fcde 100644 --- a/Indicators/Indi_AD.mqh +++ b/Indicators/Indi_AD.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_ADX.mqh b/Indicators/Indi_ADX.mqh index 865cec1d4..ee957a559 100644 --- a/Indicators/Indi_ADX.mqh +++ b/Indicators/Indi_ADX.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_ADXW.mqh b/Indicators/Indi_ADXW.mqh index b9dcca041..397406f65 100644 --- a/Indicators/Indi_ADXW.mqh +++ b/Indicators/Indi_ADXW.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_AMA.mqh b/Indicators/Indi_AMA.mqh index f32f31c25..584b73ea0 100644 --- a/Indicators/Indi_AMA.mqh +++ b/Indicators/Indi_AMA.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_AO.mqh b/Indicators/Indi_AO.mqh index d7b606107..f8fed165b 100644 --- a/Indicators/Indi_AO.mqh +++ b/Indicators/Indi_AO.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_ASI.mqh b/Indicators/Indi_ASI.mqh index 75fa5cfe0..63a486753 100644 --- a/Indicators/Indi_ASI.mqh +++ b/Indicators/Indi_ASI.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_ATR.mqh b/Indicators/Indi_ATR.mqh index 289c80b6c..5ec6d295b 100644 --- a/Indicators/Indi_ATR.mqh +++ b/Indicators/Indi_ATR.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_BWMFI.mqh b/Indicators/Indi_BWMFI.mqh index d0e6cc5aa..9ce48421d 100644 --- a/Indicators/Indi_BWMFI.mqh +++ b/Indicators/Indi_BWMFI.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_BWZT.mqh b/Indicators/Indi_BWZT.mqh index 66e3a0d87..e1f8310de 100644 --- a/Indicators/Indi_BWZT.mqh +++ b/Indicators/Indi_BWZT.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_BearsPower.mqh b/Indicators/Indi_BearsPower.mqh index a287be519..e7183fb19 100644 --- a/Indicators/Indi_BearsPower.mqh +++ b/Indicators/Indi_BearsPower.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_BullsPower.mqh b/Indicators/Indi_BullsPower.mqh index d5cf365dd..115339eb0 100644 --- a/Indicators/Indi_BullsPower.mqh +++ b/Indicators/Indi_BullsPower.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_CCI.mqh b/Indicators/Indi_CCI.mqh index 1a7e757d4..07197ad8b 100644 --- a/Indicators/Indi_CCI.mqh +++ b/Indicators/Indi_CCI.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_CHO.mqh b/Indicators/Indi_CHO.mqh index 97622a207..a57e613e5 100644 --- a/Indicators/Indi_CHO.mqh +++ b/Indicators/Indi_CHO.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_CHV.mqh b/Indicators/Indi_CHV.mqh index 18b249494..317193aed 100644 --- a/Indicators/Indi_CHV.mqh +++ b/Indicators/Indi_CHV.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_ColorBars.mqh b/Indicators/Indi_ColorBars.mqh index 9563ada32..f89acef27 100644 --- a/Indicators/Indi_ColorBars.mqh +++ b/Indicators/Indi_ColorBars.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_ColorCandlesDaily.mqh b/Indicators/Indi_ColorCandlesDaily.mqh index 943243b5f..b282f4d34 100644 --- a/Indicators/Indi_ColorCandlesDaily.mqh +++ b/Indicators/Indi_ColorCandlesDaily.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_ColorLine.mqh b/Indicators/Indi_ColorLine.mqh index ac494c31b..5ebdd3c5f 100644 --- a/Indicators/Indi_ColorLine.mqh +++ b/Indicators/Indi_ColorLine.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_CustomMovingAverage.mqh b/Indicators/Indi_CustomMovingAverage.mqh index 925065b54..46dfc04ae 100644 --- a/Indicators/Indi_CustomMovingAverage.mqh +++ b/Indicators/Indi_CustomMovingAverage.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_DEMA.mqh b/Indicators/Indi_DEMA.mqh index 299bd009a..ef1db357f 100644 --- a/Indicators/Indi_DEMA.mqh +++ b/Indicators/Indi_DEMA.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_DeMarker.mqh b/Indicators/Indi_DeMarker.mqh index 745f62e6c..a6e5bafc1 100644 --- a/Indicators/Indi_DeMarker.mqh +++ b/Indicators/Indi_DeMarker.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_Demo.mqh b/Indicators/Indi_Demo.mqh index 8bddabb7f..9acaa188a 100644 --- a/Indicators/Indi_Demo.mqh +++ b/Indicators/Indi_Demo.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_DetrendedPrice.mqh b/Indicators/Indi_DetrendedPrice.mqh index b492b2a2b..009c5e4ae 100644 --- a/Indicators/Indi_DetrendedPrice.mqh +++ b/Indicators/Indi_DetrendedPrice.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_Drawer.mqh b/Indicators/Indi_Drawer.mqh index 90db2d859..9f879f7d7 100644 --- a/Indicators/Indi_Drawer.mqh +++ b/Indicators/Indi_Drawer.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2020, 31337 Investments Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_Drawer.struct.h b/Indicators/Indi_Drawer.struct.h index 2014e8894..01ed8cbf2 100644 --- a/Indicators/Indi_Drawer.struct.h +++ b/Indicators/Indi_Drawer.struct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2020, 31337 Investments Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_Force.mqh b/Indicators/Indi_Force.mqh index bab7d7314..dff85cead 100644 --- a/Indicators/Indi_Force.mqh +++ b/Indicators/Indi_Force.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_FractalAdaptiveMA.mqh b/Indicators/Indi_FractalAdaptiveMA.mqh index 0e518ce63..5c0d8f991 100644 --- a/Indicators/Indi_FractalAdaptiveMA.mqh +++ b/Indicators/Indi_FractalAdaptiveMA.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_Fractals.mqh b/Indicators/Indi_Fractals.mqh index 75551bf05..62b04a460 100644 --- a/Indicators/Indi_Fractals.mqh +++ b/Indicators/Indi_Fractals.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_Gator.mqh b/Indicators/Indi_Gator.mqh index c3a909365..d6ec611e4 100644 --- a/Indicators/Indi_Gator.mqh +++ b/Indicators/Indi_Gator.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_HeikenAshi.mqh b/Indicators/Indi_HeikenAshi.mqh index f12b639d9..cb269bf0b 100644 --- a/Indicators/Indi_HeikenAshi.mqh +++ b/Indicators/Indi_HeikenAshi.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_Ichimoku.mqh b/Indicators/Indi_Ichimoku.mqh index 8155ebf4f..39415960c 100644 --- a/Indicators/Indi_Ichimoku.mqh +++ b/Indicators/Indi_Ichimoku.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_Killzones.mqh b/Indicators/Indi_Killzones.mqh index eb71c61e1..462a067ca 100644 --- a/Indicators/Indi_Killzones.mqh +++ b/Indicators/Indi_Killzones.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_MFI.mqh b/Indicators/Indi_MFI.mqh index 8fe9bf484..acbc48104 100644 --- a/Indicators/Indi_MFI.mqh +++ b/Indicators/Indi_MFI.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_MassIndex.mqh b/Indicators/Indi_MassIndex.mqh index 88cbd3dfd..e410bfd27 100644 --- a/Indicators/Indi_MassIndex.mqh +++ b/Indicators/Indi_MassIndex.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_Momentum.mqh b/Indicators/Indi_Momentum.mqh index 035f46649..3cd980fc4 100644 --- a/Indicators/Indi_Momentum.mqh +++ b/Indicators/Indi_Momentum.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_OBV.mqh b/Indicators/Indi_OBV.mqh index 7c100911c..797063793 100644 --- a/Indicators/Indi_OBV.mqh +++ b/Indicators/Indi_OBV.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_OsMA.mqh b/Indicators/Indi_OsMA.mqh index 5c13e6a84..d30861ac0 100644 --- a/Indicators/Indi_OsMA.mqh +++ b/Indicators/Indi_OsMA.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_Pivot.mqh b/Indicators/Indi_Pivot.mqh index 5a767296d..3a3f4e8eb 100644 --- a/Indicators/Indi_Pivot.mqh +++ b/Indicators/Indi_Pivot.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_PriceChannel.mqh b/Indicators/Indi_PriceChannel.mqh index 2b5c6ec68..16297c51d 100644 --- a/Indicators/Indi_PriceChannel.mqh +++ b/Indicators/Indi_PriceChannel.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_PriceFeeder.mqh b/Indicators/Indi_PriceFeeder.mqh index 3681a8e98..1bcfeabc5 100644 --- a/Indicators/Indi_PriceFeeder.mqh +++ b/Indicators/Indi_PriceFeeder.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_PriceVolumeTrend.mqh b/Indicators/Indi_PriceVolumeTrend.mqh index 28719fc81..11313b93c 100644 --- a/Indicators/Indi_PriceVolumeTrend.mqh +++ b/Indicators/Indi_PriceVolumeTrend.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_RS.mqh b/Indicators/Indi_RS.mqh index 0e07e6281..28f9681e2 100644 --- a/Indicators/Indi_RS.mqh +++ b/Indicators/Indi_RS.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_RVI.mqh b/Indicators/Indi_RVI.mqh index 463afa97c..e18250b0b 100644 --- a/Indicators/Indi_RVI.mqh +++ b/Indicators/Indi_RVI.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_RateOfChange.mqh b/Indicators/Indi_RateOfChange.mqh index 0c49c953d..a3b764aa1 100644 --- a/Indicators/Indi_RateOfChange.mqh +++ b/Indicators/Indi_RateOfChange.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_StdDev.mqh b/Indicators/Indi_StdDev.mqh index 992478f9e..1d9aa1683 100644 --- a/Indicators/Indi_StdDev.mqh +++ b/Indicators/Indi_StdDev.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_TEMA.mqh b/Indicators/Indi_TEMA.mqh index 8476623b8..115d5b01c 100644 --- a/Indicators/Indi_TEMA.mqh +++ b/Indicators/Indi_TEMA.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_TRIX.mqh b/Indicators/Indi_TRIX.mqh index db602af97..5233bc1f0 100644 --- a/Indicators/Indi_TRIX.mqh +++ b/Indicators/Indi_TRIX.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_UltimateOscillator.mqh b/Indicators/Indi_UltimateOscillator.mqh index 1897c9d1d..28788e12f 100644 --- a/Indicators/Indi_UltimateOscillator.mqh +++ b/Indicators/Indi_UltimateOscillator.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_VIDYA.mqh b/Indicators/Indi_VIDYA.mqh index 6d3217f84..8a134d88e 100644 --- a/Indicators/Indi_VIDYA.mqh +++ b/Indicators/Indi_VIDYA.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_VROC.mqh b/Indicators/Indi_VROC.mqh index 34d124de9..ba3e3412f 100644 --- a/Indicators/Indi_VROC.mqh +++ b/Indicators/Indi_VROC.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_Volumes.mqh b/Indicators/Indi_Volumes.mqh index c720b8d3c..e60e60262 100644 --- a/Indicators/Indi_Volumes.mqh +++ b/Indicators/Indi_Volumes.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_WilliamsAD.mqh b/Indicators/Indi_WilliamsAD.mqh index ef47ec6a3..b777db663 100644 --- a/Indicators/Indi_WilliamsAD.mqh +++ b/Indicators/Indi_WilliamsAD.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_ZigZag.mqh b/Indicators/Indi_ZigZag.mqh index 46d46713b..d8cf471a3 100644 --- a/Indicators/Indi_ZigZag.mqh +++ b/Indicators/Indi_ZigZag.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Indi_ZigZagColor.mqh b/Indicators/Indi_ZigZagColor.mqh index a1ee4237a..55100a2f7 100644 --- a/Indicators/Indi_ZigZagColor.mqh +++ b/Indicators/Indi_ZigZagColor.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/OHLC/Indi_OHLC.mqh b/Indicators/OHLC/Indi_OHLC.mqh index 080da645d..8f81bbd59 100644 --- a/Indicators/OHLC/Indi_OHLC.mqh +++ b/Indicators/OHLC/Indi_OHLC.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/OHLC/includes.h b/Indicators/OHLC/includes.h index be9752c28..2c6de4d7a 100644 --- a/Indicators/OHLC/includes.h +++ b/Indicators/OHLC/includes.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/OHLC/tests/Indi_OHLC.test.cpp b/Indicators/OHLC/tests/Indi_OHLC.test.cpp index bc4c95d4b..437877e8e 100644 --- a/Indicators/OHLC/tests/Indi_OHLC.test.cpp +++ b/Indicators/OHLC/tests/Indi_OHLC.test.cpp @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/OHLC/tests/Indi_OHLC.test.mq4 b/Indicators/OHLC/tests/Indi_OHLC.test.mq4 index 86c9f2cdf..9733e0f1c 100644 --- a/Indicators/OHLC/tests/Indi_OHLC.test.mq4 +++ b/Indicators/OHLC/tests/Indi_OHLC.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/OHLC/tests/Indi_OHLC.test.mq5 b/Indicators/OHLC/tests/Indi_OHLC.test.mq5 index cb5e0d2a3..8af7f3e73 100644 --- a/Indicators/OHLC/tests/Indi_OHLC.test.mq5 +++ b/Indicators/OHLC/tests/Indi_OHLC.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Oscillator/Indi_MACD.h b/Indicators/Oscillator/Indi_MACD.h index 756b3e161..d93fc3780 100644 --- a/Indicators/Oscillator/Indi_MACD.h +++ b/Indicators/Oscillator/Indi_MACD.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Oscillator/Indi_RSI.h b/Indicators/Oscillator/Indi_RSI.h index 2be6ae675..34650fc5a 100644 --- a/Indicators/Oscillator/Indi_RSI.h +++ b/Indicators/Oscillator/Indi_RSI.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Oscillator/Indi_Stochastic.h b/Indicators/Oscillator/Indi_Stochastic.h index b89c29069..7893f4ff8 100644 --- a/Indicators/Oscillator/Indi_Stochastic.h +++ b/Indicators/Oscillator/Indi_Stochastic.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Oscillator/Indi_WPR.h b/Indicators/Oscillator/Indi_WPR.h index 962068758..3ed9b7c9e 100644 --- a/Indicators/Oscillator/Indi_WPR.h +++ b/Indicators/Oscillator/Indi_WPR.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Oscillator/includes.h b/Indicators/Oscillator/includes.h index f3a79636d..0b971dd52 100644 --- a/Indicators/Oscillator/includes.h +++ b/Indicators/Oscillator/includes.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Oscillator/tests/Indi_MACD.test.cpp b/Indicators/Oscillator/tests/Indi_MACD.test.cpp index 288bc3d99..4185d5d69 100644 --- a/Indicators/Oscillator/tests/Indi_MACD.test.cpp +++ b/Indicators/Oscillator/tests/Indi_MACD.test.cpp @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Oscillator/tests/Indi_MACD.test.mq4 b/Indicators/Oscillator/tests/Indi_MACD.test.mq4 index e03f0a44b..d2b88e2c6 100644 --- a/Indicators/Oscillator/tests/Indi_MACD.test.mq4 +++ b/Indicators/Oscillator/tests/Indi_MACD.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Oscillator/tests/Indi_MACD.test.mq5 b/Indicators/Oscillator/tests/Indi_MACD.test.mq5 index 69f069190..7a369df59 100644 --- a/Indicators/Oscillator/tests/Indi_MACD.test.mq5 +++ b/Indicators/Oscillator/tests/Indi_MACD.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Oscillator/tests/Indi_RSI.test.cpp b/Indicators/Oscillator/tests/Indi_RSI.test.cpp index 860b2181a..f0c2b2e85 100644 --- a/Indicators/Oscillator/tests/Indi_RSI.test.cpp +++ b/Indicators/Oscillator/tests/Indi_RSI.test.cpp @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Oscillator/tests/Indi_RSI.test.mq4 b/Indicators/Oscillator/tests/Indi_RSI.test.mq4 index b7f5e55d3..760a0f96c 100644 --- a/Indicators/Oscillator/tests/Indi_RSI.test.mq4 +++ b/Indicators/Oscillator/tests/Indi_RSI.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Oscillator/tests/Indi_RSI.test.mq5 b/Indicators/Oscillator/tests/Indi_RSI.test.mq5 index 5d8016307..cb44990ae 100644 --- a/Indicators/Oscillator/tests/Indi_RSI.test.mq5 +++ b/Indicators/Oscillator/tests/Indi_RSI.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Oscillator/tests/Indi_Stochastic.test.mq4 b/Indicators/Oscillator/tests/Indi_Stochastic.test.mq4 index 54658083e..0583b0c58 100644 --- a/Indicators/Oscillator/tests/Indi_Stochastic.test.mq4 +++ b/Indicators/Oscillator/tests/Indi_Stochastic.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Oscillator/tests/Indi_Stochastic.test.mq5 b/Indicators/Oscillator/tests/Indi_Stochastic.test.mq5 index d61c7a741..1de4ad1ae 100644 --- a/Indicators/Oscillator/tests/Indi_Stochastic.test.mq5 +++ b/Indicators/Oscillator/tests/Indi_Stochastic.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Oscillator/tests/Indi_WPR.test.mq4 b/Indicators/Oscillator/tests/Indi_WPR.test.mq4 index 7e3e27097..a345e3aa8 100644 --- a/Indicators/Oscillator/tests/Indi_WPR.test.mq4 +++ b/Indicators/Oscillator/tests/Indi_WPR.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Oscillator/tests/Indi_WPR.test.mq5 b/Indicators/Oscillator/tests/Indi_WPR.test.mq5 index 58a8b97be..a25b80c1f 100644 --- a/Indicators/Oscillator/tests/Indi_WPR.test.mq5 +++ b/Indicators/Oscillator/tests/Indi_WPR.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Price/Indi_AppliedPrice.h b/Indicators/Price/Indi_AppliedPrice.h index a0d561549..9183e7bae 100644 --- a/Indicators/Price/Indi_AppliedPrice.h +++ b/Indicators/Price/Indi_AppliedPrice.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Price/Indi_MA.h b/Indicators/Price/Indi_MA.h index 7d85e06e0..d82c76a45 100644 --- a/Indicators/Price/Indi_MA.h +++ b/Indicators/Price/Indi_MA.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Price/Indi_Price.h b/Indicators/Price/Indi_Price.h index 4994ce97d..9c8e87753 100644 --- a/Indicators/Price/Indi_Price.h +++ b/Indicators/Price/Indi_Price.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Price/includes.h b/Indicators/Price/includes.h index c021ad24a..b24e244aa 100644 --- a/Indicators/Price/includes.h +++ b/Indicators/Price/includes.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Price/tests/Indi_AppliedPrice.test.mq4 b/Indicators/Price/tests/Indi_AppliedPrice.test.mq4 index b0ce7cd3d..f9eb0e996 100644 --- a/Indicators/Price/tests/Indi_AppliedPrice.test.mq4 +++ b/Indicators/Price/tests/Indi_AppliedPrice.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Price/tests/Indi_AppliedPrice.test.mq5 b/Indicators/Price/tests/Indi_AppliedPrice.test.mq5 index d5a5914a8..f7195308b 100644 --- a/Indicators/Price/tests/Indi_AppliedPrice.test.mq5 +++ b/Indicators/Price/tests/Indi_AppliedPrice.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Price/tests/Indi_MA.test.mq4 b/Indicators/Price/tests/Indi_MA.test.mq4 index 89d4ee4b4..1a045fdce 100644 --- a/Indicators/Price/tests/Indi_MA.test.mq4 +++ b/Indicators/Price/tests/Indi_MA.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Price/tests/Indi_MA.test.mq5 b/Indicators/Price/tests/Indi_MA.test.mq5 index 8d45119bb..e63a99ab1 100644 --- a/Indicators/Price/tests/Indi_MA.test.mq5 +++ b/Indicators/Price/tests/Indi_MA.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Price/tests/Indi_Price.test.cpp b/Indicators/Price/tests/Indi_Price.test.cpp index fd2e8e0cf..39876aef4 100644 --- a/Indicators/Price/tests/Indi_Price.test.cpp +++ b/Indicators/Price/tests/Indi_Price.test.cpp @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Price/tests/Indi_Price.test.mq4 b/Indicators/Price/tests/Indi_Price.test.mq4 index 5f07803bc..ef7042a55 100644 --- a/Indicators/Price/tests/Indi_Price.test.mq4 +++ b/Indicators/Price/tests/Indi_Price.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Price/tests/Indi_Price.test.mq5 b/Indicators/Price/tests/Indi_Price.test.mq5 index 8289aecd8..b21378c8f 100644 --- a/Indicators/Price/tests/Indi_Price.test.mq5 +++ b/Indicators/Price/tests/Indi_Price.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/PriceMulti/Indi_Alligator.h b/Indicators/PriceMulti/Indi_Alligator.h index eb79041bb..47ee1efe3 100644 --- a/Indicators/PriceMulti/Indi_Alligator.h +++ b/Indicators/PriceMulti/Indi_Alligator.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/PriceMulti/includes.h b/Indicators/PriceMulti/includes.h index e221ee7c4..c8112d71a 100644 --- a/Indicators/PriceMulti/includes.h +++ b/Indicators/PriceMulti/includes.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/PriceMulti/tests/Indi_Alligator.test.mq4 b/Indicators/PriceMulti/tests/Indi_Alligator.test.mq4 index 06855e38d..8b3ece789 100644 --- a/Indicators/PriceMulti/tests/Indi_Alligator.test.mq4 +++ b/Indicators/PriceMulti/tests/Indi_Alligator.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/PriceMulti/tests/Indi_Alligator.test.mq5 b/Indicators/PriceMulti/tests/Indi_Alligator.test.mq5 index 17501d957..425f3834d 100644 --- a/Indicators/PriceMulti/tests/Indi_Alligator.test.mq5 +++ b/Indicators/PriceMulti/tests/Indi_Alligator.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/PriceRange/Indi_Bands.h b/Indicators/PriceRange/Indi_Bands.h index c19e04987..2f54bea7d 100644 --- a/Indicators/PriceRange/Indi_Bands.h +++ b/Indicators/PriceRange/Indi_Bands.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/PriceRange/Indi_Envelopes.h b/Indicators/PriceRange/Indi_Envelopes.h index 9e93bb311..3ccd7eedf 100644 --- a/Indicators/PriceRange/Indi_Envelopes.h +++ b/Indicators/PriceRange/Indi_Envelopes.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/PriceRange/Indi_SAR.h b/Indicators/PriceRange/Indi_SAR.h index 4e5c7ca57..c8c3bc8ce 100644 --- a/Indicators/PriceRange/Indi_SAR.h +++ b/Indicators/PriceRange/Indi_SAR.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/PriceRange/includes.h b/Indicators/PriceRange/includes.h index 3fe123383..9275ab9b4 100644 --- a/Indicators/PriceRange/includes.h +++ b/Indicators/PriceRange/includes.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/PriceRange/tests/Indi_Bands.test.mq4 b/Indicators/PriceRange/tests/Indi_Bands.test.mq4 index 78e550018..ebf6bc84b 100644 --- a/Indicators/PriceRange/tests/Indi_Bands.test.mq4 +++ b/Indicators/PriceRange/tests/Indi_Bands.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/PriceRange/tests/Indi_Bands.test.mq5 b/Indicators/PriceRange/tests/Indi_Bands.test.mq5 index 4afa3348b..925bddef0 100644 --- a/Indicators/PriceRange/tests/Indi_Bands.test.mq5 +++ b/Indicators/PriceRange/tests/Indi_Bands.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/PriceRange/tests/Indi_Envelopes.test.mq4 b/Indicators/PriceRange/tests/Indi_Envelopes.test.mq4 index af9885c8e..3d36b1e2a 100644 --- a/Indicators/PriceRange/tests/Indi_Envelopes.test.mq4 +++ b/Indicators/PriceRange/tests/Indi_Envelopes.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/PriceRange/tests/Indi_Envelopes.test.mq5 b/Indicators/PriceRange/tests/Indi_Envelopes.test.mq5 index bd6a6a721..2731f8b4c 100644 --- a/Indicators/PriceRange/tests/Indi_Envelopes.test.mq5 +++ b/Indicators/PriceRange/tests/Indi_Envelopes.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/PriceRange/tests/Indi_SAR.test.mq4 b/Indicators/PriceRange/tests/Indi_SAR.test.mq4 index cb64f79b4..b17095867 100644 --- a/Indicators/PriceRange/tests/Indi_SAR.test.mq4 +++ b/Indicators/PriceRange/tests/Indi_SAR.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/PriceRange/tests/Indi_SAR.test.mq5 b/Indicators/PriceRange/tests/Indi_SAR.test.mq5 index 6decbbdbc..319f2f602 100644 --- a/Indicators/PriceRange/tests/Indi_SAR.test.mq5 +++ b/Indicators/PriceRange/tests/Indi_SAR.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Special/Indi_Custom.mqh b/Indicators/Special/Indi_Custom.mqh index 3d94d5ffa..c12f5390a 100644 --- a/Indicators/Special/Indi_Custom.mqh +++ b/Indicators/Special/Indi_Custom.mqh @@ -1,6 +1,7 @@ //+------------------------------------------------------------------+ -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Special/Indi_Math.mqh b/Indicators/Special/Indi_Math.mqh index f42dcd4c9..4f2d03242 100644 --- a/Indicators/Special/Indi_Math.mqh +++ b/Indicators/Special/Indi_Math.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Special/includes.h b/Indicators/Special/includes.h index a99faecca..f8c2c8624 100644 --- a/Indicators/Special/includes.h +++ b/Indicators/Special/includes.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Special/tests/Indi_Custom.test.mq4 b/Indicators/Special/tests/Indi_Custom.test.mq4 index bb3fffd61..1fd3962e9 100644 --- a/Indicators/Special/tests/Indi_Custom.test.mq4 +++ b/Indicators/Special/tests/Indi_Custom.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Special/tests/Indi_Custom.test.mq5 b/Indicators/Special/tests/Indi_Custom.test.mq5 index 501650511..cc2ba4893 100644 --- a/Indicators/Special/tests/Indi_Custom.test.mq5 +++ b/Indicators/Special/tests/Indi_Custom.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Tick/Indi_TickMt.h b/Indicators/Tick/Indi_TickMt.h index 37bdedfdc..853356601 100644 --- a/Indicators/Tick/Indi_TickMt.h +++ b/Indicators/Tick/Indi_TickMt.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Tick/Indi_TickProvider.h b/Indicators/Tick/Indi_TickProvider.h index 28e9b9f93..2fb91090c 100644 --- a/Indicators/Tick/Indi_TickProvider.h +++ b/Indicators/Tick/Indi_TickProvider.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Tick/Indi_TickRandom.h b/Indicators/Tick/Indi_TickRandom.h index f44c7713f..6e7b6097c 100644 --- a/Indicators/Tick/Indi_TickRandom.h +++ b/Indicators/Tick/Indi_TickRandom.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Tick/includes.h b/Indicators/Tick/includes.h index 5af8b3d50..39d290932 100644 --- a/Indicators/Tick/includes.h +++ b/Indicators/Tick/includes.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Tick/tests/Indi_TickMt.test.mq4 b/Indicators/Tick/tests/Indi_TickMt.test.mq4 index 091a1ba01..be3251ae1 100644 --- a/Indicators/Tick/tests/Indi_TickMt.test.mq4 +++ b/Indicators/Tick/tests/Indi_TickMt.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/Tick/tests/Indi_TickMt.test.mq5 b/Indicators/Tick/tests/Indi_TickMt.test.mq5 index 1366a2905..0e4f9c813 100644 --- a/Indicators/Tick/tests/Indi_TickMt.test.mq5 +++ b/Indicators/Tick/tests/Indi_TickMt.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/includes.h b/Indicators/includes.h index 6d397c882..02c2c29e5 100644 --- a/Indicators/includes.h +++ b/Indicators/includes.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/DrawIndicator.test.cpp b/Indicators/tests/DrawIndicator.test.cpp index c89cee28c..3cfc1587e 100644 --- a/Indicators/tests/DrawIndicator.test.cpp +++ b/Indicators/tests/DrawIndicator.test.cpp @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/DrawIndicator.test.mq4 b/Indicators/tests/DrawIndicator.test.mq4 index f2d267e93..40b72d9e6 100644 --- a/Indicators/tests/DrawIndicator.test.mq4 +++ b/Indicators/tests/DrawIndicator.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/DrawIndicator.test.mq5 b/Indicators/tests/DrawIndicator.test.mq5 index a9ed41fbe..8dbe43521 100644 --- a/Indicators/tests/DrawIndicator.test.mq5 +++ b/Indicators/tests/DrawIndicator.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_AC.test.mq4 b/Indicators/tests/Indi_AC.test.mq4 index 8356c50b5..35602dd1b 100644 --- a/Indicators/tests/Indi_AC.test.mq4 +++ b/Indicators/tests/Indi_AC.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_AC.test.mq5 b/Indicators/tests/Indi_AC.test.mq5 index c73b2beac..ea65837dc 100644 --- a/Indicators/tests/Indi_AC.test.mq5 +++ b/Indicators/tests/Indi_AC.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_AD.test.mq4 b/Indicators/tests/Indi_AD.test.mq4 index ed7ed321f..55765e99d 100644 --- a/Indicators/tests/Indi_AD.test.mq4 +++ b/Indicators/tests/Indi_AD.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_AD.test.mq5 b/Indicators/tests/Indi_AD.test.mq5 index 744811a8c..ce8637637 100644 --- a/Indicators/tests/Indi_AD.test.mq5 +++ b/Indicators/tests/Indi_AD.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_ADX.test.mq4 b/Indicators/tests/Indi_ADX.test.mq4 index 15561c2ed..1a733a9b6 100644 --- a/Indicators/tests/Indi_ADX.test.mq4 +++ b/Indicators/tests/Indi_ADX.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_ADX.test.mq5 b/Indicators/tests/Indi_ADX.test.mq5 index ae42e788b..38488599b 100644 --- a/Indicators/tests/Indi_ADX.test.mq5 +++ b/Indicators/tests/Indi_ADX.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_ADXW.test.mq4 b/Indicators/tests/Indi_ADXW.test.mq4 index 5ec7cd7b8..24baf369a 100644 --- a/Indicators/tests/Indi_ADXW.test.mq4 +++ b/Indicators/tests/Indi_ADXW.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_ADXW.test.mq5 b/Indicators/tests/Indi_ADXW.test.mq5 index 6fbae36cf..d9fee0c72 100644 --- a/Indicators/tests/Indi_ADXW.test.mq5 +++ b/Indicators/tests/Indi_ADXW.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_AMA.test.mq4 b/Indicators/tests/Indi_AMA.test.mq4 index 3e63b0cff..602daf7fb 100644 --- a/Indicators/tests/Indi_AMA.test.mq4 +++ b/Indicators/tests/Indi_AMA.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_AMA.test.mq5 b/Indicators/tests/Indi_AMA.test.mq5 index 47a8697a0..741267787 100644 --- a/Indicators/tests/Indi_AMA.test.mq5 +++ b/Indicators/tests/Indi_AMA.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_AO.test.mq4 b/Indicators/tests/Indi_AO.test.mq4 index 4465f02af..c43616d7d 100644 --- a/Indicators/tests/Indi_AO.test.mq4 +++ b/Indicators/tests/Indi_AO.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_AO.test.mq5 b/Indicators/tests/Indi_AO.test.mq5 index aaacb3aa6..fcc14e78e 100644 --- a/Indicators/tests/Indi_AO.test.mq5 +++ b/Indicators/tests/Indi_AO.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_ASI.test.mq4 b/Indicators/tests/Indi_ASI.test.mq4 index cb752b7b5..eb8f0413f 100644 --- a/Indicators/tests/Indi_ASI.test.mq4 +++ b/Indicators/tests/Indi_ASI.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_ASI.test.mq5 b/Indicators/tests/Indi_ASI.test.mq5 index bd7ef040b..4717cee23 100644 --- a/Indicators/tests/Indi_ASI.test.mq5 +++ b/Indicators/tests/Indi_ASI.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_ATR.test.mq4 b/Indicators/tests/Indi_ATR.test.mq4 index 40b9b1c95..510529ba4 100644 --- a/Indicators/tests/Indi_ATR.test.mq4 +++ b/Indicators/tests/Indi_ATR.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_ATR.test.mq5 b/Indicators/tests/Indi_ATR.test.mq5 index 8b2a48816..b59bfee3d 100644 --- a/Indicators/tests/Indi_ATR.test.mq5 +++ b/Indicators/tests/Indi_ATR.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_BWMFI.test.mq4 b/Indicators/tests/Indi_BWMFI.test.mq4 index 3db17f482..7446b0ea0 100644 --- a/Indicators/tests/Indi_BWMFI.test.mq4 +++ b/Indicators/tests/Indi_BWMFI.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_BWMFI.test.mq5 b/Indicators/tests/Indi_BWMFI.test.mq5 index 3ab4423a0..ddff3ebb1 100644 --- a/Indicators/tests/Indi_BWMFI.test.mq5 +++ b/Indicators/tests/Indi_BWMFI.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_BWZT.test.mq4 b/Indicators/tests/Indi_BWZT.test.mq4 index 63b312f58..93c19e29e 100644 --- a/Indicators/tests/Indi_BWZT.test.mq4 +++ b/Indicators/tests/Indi_BWZT.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_BWZT.test.mq5 b/Indicators/tests/Indi_BWZT.test.mq5 index 079cebb8e..62de7a147 100644 --- a/Indicators/tests/Indi_BWZT.test.mq5 +++ b/Indicators/tests/Indi_BWZT.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_BearsPower.test.mq4 b/Indicators/tests/Indi_BearsPower.test.mq4 index 8d43b3c60..30661635f 100644 --- a/Indicators/tests/Indi_BearsPower.test.mq4 +++ b/Indicators/tests/Indi_BearsPower.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_BearsPower.test.mq5 b/Indicators/tests/Indi_BearsPower.test.mq5 index e19fa7504..dc324cfb3 100644 --- a/Indicators/tests/Indi_BearsPower.test.mq5 +++ b/Indicators/tests/Indi_BearsPower.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_BullsPower.test.mq4 b/Indicators/tests/Indi_BullsPower.test.mq4 index d9fc05869..f123b3c7d 100644 --- a/Indicators/tests/Indi_BullsPower.test.mq4 +++ b/Indicators/tests/Indi_BullsPower.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_BullsPower.test.mq5 b/Indicators/tests/Indi_BullsPower.test.mq5 index ad10c0a9c..07dda315b 100644 --- a/Indicators/tests/Indi_BullsPower.test.mq5 +++ b/Indicators/tests/Indi_BullsPower.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_CCI.test.mq4 b/Indicators/tests/Indi_CCI.test.mq4 index 309271938..76d37304e 100644 --- a/Indicators/tests/Indi_CCI.test.mq4 +++ b/Indicators/tests/Indi_CCI.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_CCI.test.mq5 b/Indicators/tests/Indi_CCI.test.mq5 index 89b38f368..451e2f93b 100644 --- a/Indicators/tests/Indi_CCI.test.mq5 +++ b/Indicators/tests/Indi_CCI.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_CHO.test.mq4 b/Indicators/tests/Indi_CHO.test.mq4 index 11acc3005..b56199da1 100644 --- a/Indicators/tests/Indi_CHO.test.mq4 +++ b/Indicators/tests/Indi_CHO.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_CHO.test.mq5 b/Indicators/tests/Indi_CHO.test.mq5 index 5f9c8c7b8..18bbd3a50 100644 --- a/Indicators/tests/Indi_CHO.test.mq5 +++ b/Indicators/tests/Indi_CHO.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_CHV.test.mq4 b/Indicators/tests/Indi_CHV.test.mq4 index e190dc77d..8ae4cfaf2 100644 --- a/Indicators/tests/Indi_CHV.test.mq4 +++ b/Indicators/tests/Indi_CHV.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_CHV.test.mq5 b/Indicators/tests/Indi_CHV.test.mq5 index a16794958..e193fa65e 100644 --- a/Indicators/tests/Indi_CHV.test.mq5 +++ b/Indicators/tests/Indi_CHV.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_ColorBars.test.mq4 b/Indicators/tests/Indi_ColorBars.test.mq4 index 0858213d2..f752b4613 100644 --- a/Indicators/tests/Indi_ColorBars.test.mq4 +++ b/Indicators/tests/Indi_ColorBars.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_ColorBars.test.mq5 b/Indicators/tests/Indi_ColorBars.test.mq5 index dea42594b..cc01d47e1 100644 --- a/Indicators/tests/Indi_ColorBars.test.mq5 +++ b/Indicators/tests/Indi_ColorBars.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_ColorCandlesDaily.test.mq4 b/Indicators/tests/Indi_ColorCandlesDaily.test.mq4 index d77adc574..e4790c792 100644 --- a/Indicators/tests/Indi_ColorCandlesDaily.test.mq4 +++ b/Indicators/tests/Indi_ColorCandlesDaily.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_ColorCandlesDaily.test.mq5 b/Indicators/tests/Indi_ColorCandlesDaily.test.mq5 index 7aadea996..0fb1c846b 100644 --- a/Indicators/tests/Indi_ColorCandlesDaily.test.mq5 +++ b/Indicators/tests/Indi_ColorCandlesDaily.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_ColorLine.test.mq4 b/Indicators/tests/Indi_ColorLine.test.mq4 index 0199b7560..c48d4d6f1 100644 --- a/Indicators/tests/Indi_ColorLine.test.mq4 +++ b/Indicators/tests/Indi_ColorLine.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_ColorLine.test.mq5 b/Indicators/tests/Indi_ColorLine.test.mq5 index 04f87c582..204b15a67 100644 --- a/Indicators/tests/Indi_ColorLine.test.mq5 +++ b/Indicators/tests/Indi_ColorLine.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_CustomMovingAverage.test.mq4 b/Indicators/tests/Indi_CustomMovingAverage.test.mq4 index b42e19e49..ea53110f7 100644 --- a/Indicators/tests/Indi_CustomMovingAverage.test.mq4 +++ b/Indicators/tests/Indi_CustomMovingAverage.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_CustomMovingAverage.test.mq5 b/Indicators/tests/Indi_CustomMovingAverage.test.mq5 index 5815eb263..703ad75fc 100644 --- a/Indicators/tests/Indi_CustomMovingAverage.test.mq5 +++ b/Indicators/tests/Indi_CustomMovingAverage.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_DEMA.test.mq4 b/Indicators/tests/Indi_DEMA.test.mq4 index c2a168889..c36101033 100644 --- a/Indicators/tests/Indi_DEMA.test.mq4 +++ b/Indicators/tests/Indi_DEMA.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_DEMA.test.mq5 b/Indicators/tests/Indi_DEMA.test.mq5 index 1428b2dd3..d59f46df0 100644 --- a/Indicators/tests/Indi_DEMA.test.mq5 +++ b/Indicators/tests/Indi_DEMA.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_DeMarker.test.mq4 b/Indicators/tests/Indi_DeMarker.test.mq4 index cc63b04c8..eeafabfb9 100644 --- a/Indicators/tests/Indi_DeMarker.test.mq4 +++ b/Indicators/tests/Indi_DeMarker.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_DeMarker.test.mq5 b/Indicators/tests/Indi_DeMarker.test.mq5 index 853a724b8..1993d7fba 100644 --- a/Indicators/tests/Indi_DeMarker.test.mq5 +++ b/Indicators/tests/Indi_DeMarker.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_Demo.test.mq4 b/Indicators/tests/Indi_Demo.test.mq4 index d5056995e..ba1d2df67 100644 --- a/Indicators/tests/Indi_Demo.test.mq4 +++ b/Indicators/tests/Indi_Demo.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_Demo.test.mq5 b/Indicators/tests/Indi_Demo.test.mq5 index c23e7a243..1b0fb53b5 100644 --- a/Indicators/tests/Indi_Demo.test.mq5 +++ b/Indicators/tests/Indi_Demo.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_DetrendedPrice.test.mq4 b/Indicators/tests/Indi_DetrendedPrice.test.mq4 index 297f2c81a..423ccb38c 100644 --- a/Indicators/tests/Indi_DetrendedPrice.test.mq4 +++ b/Indicators/tests/Indi_DetrendedPrice.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_DetrendedPrice.test.mq5 b/Indicators/tests/Indi_DetrendedPrice.test.mq5 index e4bf4a88b..fc19117b4 100644 --- a/Indicators/tests/Indi_DetrendedPrice.test.mq5 +++ b/Indicators/tests/Indi_DetrendedPrice.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_Drawer.test.mq4 b/Indicators/tests/Indi_Drawer.test.mq4 index 32cf4a1e2..8c4d9cf82 100644 --- a/Indicators/tests/Indi_Drawer.test.mq4 +++ b/Indicators/tests/Indi_Drawer.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_Drawer.test.mq5 b/Indicators/tests/Indi_Drawer.test.mq5 index 390ebc223..c5f48c19d 100644 --- a/Indicators/tests/Indi_Drawer.test.mq5 +++ b/Indicators/tests/Indi_Drawer.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_Force.test.mq4 b/Indicators/tests/Indi_Force.test.mq4 index aefa93e28..7c2cc7732 100644 --- a/Indicators/tests/Indi_Force.test.mq4 +++ b/Indicators/tests/Indi_Force.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_Force.test.mq5 b/Indicators/tests/Indi_Force.test.mq5 index e2808fb8d..7e47ece73 100644 --- a/Indicators/tests/Indi_Force.test.mq5 +++ b/Indicators/tests/Indi_Force.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_FractalAdaptiveMA.test.mq4 b/Indicators/tests/Indi_FractalAdaptiveMA.test.mq4 index 1073b537d..fcda0528a 100644 --- a/Indicators/tests/Indi_FractalAdaptiveMA.test.mq4 +++ b/Indicators/tests/Indi_FractalAdaptiveMA.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_FractalAdaptiveMA.test.mq5 b/Indicators/tests/Indi_FractalAdaptiveMA.test.mq5 index 788fcb5cf..2c195921f 100644 --- a/Indicators/tests/Indi_FractalAdaptiveMA.test.mq5 +++ b/Indicators/tests/Indi_FractalAdaptiveMA.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_Fractals.test.mq4 b/Indicators/tests/Indi_Fractals.test.mq4 index 74575bfef..4817f83ba 100644 --- a/Indicators/tests/Indi_Fractals.test.mq4 +++ b/Indicators/tests/Indi_Fractals.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_Fractals.test.mq5 b/Indicators/tests/Indi_Fractals.test.mq5 index 6c9b84ec7..68594838b 100644 --- a/Indicators/tests/Indi_Fractals.test.mq5 +++ b/Indicators/tests/Indi_Fractals.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_Gator.test.mq4 b/Indicators/tests/Indi_Gator.test.mq4 index 017e97229..2e92adec4 100644 --- a/Indicators/tests/Indi_Gator.test.mq4 +++ b/Indicators/tests/Indi_Gator.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_Gator.test.mq5 b/Indicators/tests/Indi_Gator.test.mq5 index 30877bdfe..cb6401b17 100644 --- a/Indicators/tests/Indi_Gator.test.mq5 +++ b/Indicators/tests/Indi_Gator.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_HeikenAshi.test.mq4 b/Indicators/tests/Indi_HeikenAshi.test.mq4 index 7412e5399..2173a99e1 100644 --- a/Indicators/tests/Indi_HeikenAshi.test.mq4 +++ b/Indicators/tests/Indi_HeikenAshi.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_HeikenAshi.test.mq5 b/Indicators/tests/Indi_HeikenAshi.test.mq5 index 15b21c3a3..2aac31c4e 100644 --- a/Indicators/tests/Indi_HeikenAshi.test.mq5 +++ b/Indicators/tests/Indi_HeikenAshi.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_Ichimoku.test.mq4 b/Indicators/tests/Indi_Ichimoku.test.mq4 index 942b84bd7..6ca304f3c 100644 --- a/Indicators/tests/Indi_Ichimoku.test.mq4 +++ b/Indicators/tests/Indi_Ichimoku.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_Ichimoku.test.mq5 b/Indicators/tests/Indi_Ichimoku.test.mq5 index 39f18cf6f..5a94cef33 100644 --- a/Indicators/tests/Indi_Ichimoku.test.mq5 +++ b/Indicators/tests/Indi_Ichimoku.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_Killzones.test.mq4 b/Indicators/tests/Indi_Killzones.test.mq4 index 12f792f2c..f236fa0d8 100644 --- a/Indicators/tests/Indi_Killzones.test.mq4 +++ b/Indicators/tests/Indi_Killzones.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_Killzones.test.mq5 b/Indicators/tests/Indi_Killzones.test.mq5 index 82dd006e4..5e8fd991a 100644 --- a/Indicators/tests/Indi_Killzones.test.mq5 +++ b/Indicators/tests/Indi_Killzones.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_MFI.test.mq4 b/Indicators/tests/Indi_MFI.test.mq4 index d6e3a1c9e..13f46e5de 100644 --- a/Indicators/tests/Indi_MFI.test.mq4 +++ b/Indicators/tests/Indi_MFI.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_MFI.test.mq5 b/Indicators/tests/Indi_MFI.test.mq5 index f347cadf8..4e2c6322d 100644 --- a/Indicators/tests/Indi_MFI.test.mq5 +++ b/Indicators/tests/Indi_MFI.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_MassIndex.test.mq4 b/Indicators/tests/Indi_MassIndex.test.mq4 index 9a53fa65f..f29b1c9c1 100644 --- a/Indicators/tests/Indi_MassIndex.test.mq4 +++ b/Indicators/tests/Indi_MassIndex.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_MassIndex.test.mq5 b/Indicators/tests/Indi_MassIndex.test.mq5 index 9f895d691..e751e3512 100644 --- a/Indicators/tests/Indi_MassIndex.test.mq5 +++ b/Indicators/tests/Indi_MassIndex.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_Momentum.test.mq4 b/Indicators/tests/Indi_Momentum.test.mq4 index 31fb68c33..3d1fb1f31 100644 --- a/Indicators/tests/Indi_Momentum.test.mq4 +++ b/Indicators/tests/Indi_Momentum.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_Momentum.test.mq5 b/Indicators/tests/Indi_Momentum.test.mq5 index b1f3ce6e7..abd3dfd1b 100644 --- a/Indicators/tests/Indi_Momentum.test.mq5 +++ b/Indicators/tests/Indi_Momentum.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_OBV.test.mq4 b/Indicators/tests/Indi_OBV.test.mq4 index 372045b77..7e27fe32f 100644 --- a/Indicators/tests/Indi_OBV.test.mq4 +++ b/Indicators/tests/Indi_OBV.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_OBV.test.mq5 b/Indicators/tests/Indi_OBV.test.mq5 index ab84dedb7..f62cabbf5 100644 --- a/Indicators/tests/Indi_OBV.test.mq5 +++ b/Indicators/tests/Indi_OBV.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_OsMA.test.mq4 b/Indicators/tests/Indi_OsMA.test.mq4 index 476dfe415..7ed180a8d 100644 --- a/Indicators/tests/Indi_OsMA.test.mq4 +++ b/Indicators/tests/Indi_OsMA.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_OsMA.test.mq5 b/Indicators/tests/Indi_OsMA.test.mq5 index f9f30b23d..19d02a0ce 100644 --- a/Indicators/tests/Indi_OsMA.test.mq5 +++ b/Indicators/tests/Indi_OsMA.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_Pivot.test.mq4 b/Indicators/tests/Indi_Pivot.test.mq4 index b1d3c5773..2e208d20c 100644 --- a/Indicators/tests/Indi_Pivot.test.mq4 +++ b/Indicators/tests/Indi_Pivot.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_Pivot.test.mq5 b/Indicators/tests/Indi_Pivot.test.mq5 index a5d2b6c8e..8aa9a0135 100644 --- a/Indicators/tests/Indi_Pivot.test.mq5 +++ b/Indicators/tests/Indi_Pivot.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_PriceChannel.test.mq4 b/Indicators/tests/Indi_PriceChannel.test.mq4 index 23b54fa5e..cd831c4bd 100644 --- a/Indicators/tests/Indi_PriceChannel.test.mq4 +++ b/Indicators/tests/Indi_PriceChannel.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_PriceChannel.test.mq5 b/Indicators/tests/Indi_PriceChannel.test.mq5 index db5d4a7f1..ae0125d4f 100644 --- a/Indicators/tests/Indi_PriceChannel.test.mq5 +++ b/Indicators/tests/Indi_PriceChannel.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_PriceFeeder.test.mq4 b/Indicators/tests/Indi_PriceFeeder.test.mq4 index 6976c01ec..505a3a203 100644 --- a/Indicators/tests/Indi_PriceFeeder.test.mq4 +++ b/Indicators/tests/Indi_PriceFeeder.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_PriceFeeder.test.mq5 b/Indicators/tests/Indi_PriceFeeder.test.mq5 index a857158e9..ace30d022 100644 --- a/Indicators/tests/Indi_PriceFeeder.test.mq5 +++ b/Indicators/tests/Indi_PriceFeeder.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_PriceVolumeTrend.test.mq4 b/Indicators/tests/Indi_PriceVolumeTrend.test.mq4 index 45a6e2c09..2106730b9 100644 --- a/Indicators/tests/Indi_PriceVolumeTrend.test.mq4 +++ b/Indicators/tests/Indi_PriceVolumeTrend.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_PriceVolumeTrend.test.mq5 b/Indicators/tests/Indi_PriceVolumeTrend.test.mq5 index 0b2d5e39c..4abb14c30 100644 --- a/Indicators/tests/Indi_PriceVolumeTrend.test.mq5 +++ b/Indicators/tests/Indi_PriceVolumeTrend.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_RS.test.mq4 b/Indicators/tests/Indi_RS.test.mq4 index 5f191c9ea..921435d99 100644 --- a/Indicators/tests/Indi_RS.test.mq4 +++ b/Indicators/tests/Indi_RS.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_RS.test.mq5 b/Indicators/tests/Indi_RS.test.mq5 index 2f2f7f1ee..1cff6ff15 100644 --- a/Indicators/tests/Indi_RS.test.mq5 +++ b/Indicators/tests/Indi_RS.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_RVI.test.mq4 b/Indicators/tests/Indi_RVI.test.mq4 index cfd5e372f..7d3c347c3 100644 --- a/Indicators/tests/Indi_RVI.test.mq4 +++ b/Indicators/tests/Indi_RVI.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_RVI.test.mq5 b/Indicators/tests/Indi_RVI.test.mq5 index c7269887f..3a549652d 100644 --- a/Indicators/tests/Indi_RVI.test.mq5 +++ b/Indicators/tests/Indi_RVI.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_RateOfChange.test.mq4 b/Indicators/tests/Indi_RateOfChange.test.mq4 index 6ca89fbef..b3f721fe2 100644 --- a/Indicators/tests/Indi_RateOfChange.test.mq4 +++ b/Indicators/tests/Indi_RateOfChange.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_RateOfChange.test.mq5 b/Indicators/tests/Indi_RateOfChange.test.mq5 index b59242ac5..a23542227 100644 --- a/Indicators/tests/Indi_RateOfChange.test.mq5 +++ b/Indicators/tests/Indi_RateOfChange.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_StdDev.test.mq4 b/Indicators/tests/Indi_StdDev.test.mq4 index e36c47034..8a18f77d8 100644 --- a/Indicators/tests/Indi_StdDev.test.mq4 +++ b/Indicators/tests/Indi_StdDev.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_StdDev.test.mq5 b/Indicators/tests/Indi_StdDev.test.mq5 index eb15c0961..9c5059fae 100644 --- a/Indicators/tests/Indi_StdDev.test.mq5 +++ b/Indicators/tests/Indi_StdDev.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_TEMA.test.mq4 b/Indicators/tests/Indi_TEMA.test.mq4 index 41332b6a6..e320b7be2 100644 --- a/Indicators/tests/Indi_TEMA.test.mq4 +++ b/Indicators/tests/Indi_TEMA.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_TEMA.test.mq5 b/Indicators/tests/Indi_TEMA.test.mq5 index e8580038a..3c16829c5 100644 --- a/Indicators/tests/Indi_TEMA.test.mq5 +++ b/Indicators/tests/Indi_TEMA.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_TRIX.test.mq4 b/Indicators/tests/Indi_TRIX.test.mq4 index be5579c93..160e49496 100644 --- a/Indicators/tests/Indi_TRIX.test.mq4 +++ b/Indicators/tests/Indi_TRIX.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_TRIX.test.mq5 b/Indicators/tests/Indi_TRIX.test.mq5 index 01436a50c..44fd1569b 100644 --- a/Indicators/tests/Indi_TRIX.test.mq5 +++ b/Indicators/tests/Indi_TRIX.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_UltimateOscillator.test.mq4 b/Indicators/tests/Indi_UltimateOscillator.test.mq4 index ec6d67e78..9041e15dd 100644 --- a/Indicators/tests/Indi_UltimateOscillator.test.mq4 +++ b/Indicators/tests/Indi_UltimateOscillator.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_UltimateOscillator.test.mq5 b/Indicators/tests/Indi_UltimateOscillator.test.mq5 index 588399532..79dde51a7 100644 --- a/Indicators/tests/Indi_UltimateOscillator.test.mq5 +++ b/Indicators/tests/Indi_UltimateOscillator.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_VIDYA.test.mq4 b/Indicators/tests/Indi_VIDYA.test.mq4 index a222007f1..899941f55 100644 --- a/Indicators/tests/Indi_VIDYA.test.mq4 +++ b/Indicators/tests/Indi_VIDYA.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_VIDYA.test.mq5 b/Indicators/tests/Indi_VIDYA.test.mq5 index 4b944e477..8dcbca6b8 100644 --- a/Indicators/tests/Indi_VIDYA.test.mq5 +++ b/Indicators/tests/Indi_VIDYA.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_VROC.test.mq4 b/Indicators/tests/Indi_VROC.test.mq4 index 307567add..432d66422 100644 --- a/Indicators/tests/Indi_VROC.test.mq4 +++ b/Indicators/tests/Indi_VROC.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_VROC.test.mq5 b/Indicators/tests/Indi_VROC.test.mq5 index 74307eda6..a811d5383 100644 --- a/Indicators/tests/Indi_VROC.test.mq5 +++ b/Indicators/tests/Indi_VROC.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_Volumes.test.mq4 b/Indicators/tests/Indi_Volumes.test.mq4 index 3b85b25ff..07b463108 100644 --- a/Indicators/tests/Indi_Volumes.test.mq4 +++ b/Indicators/tests/Indi_Volumes.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_Volumes.test.mq5 b/Indicators/tests/Indi_Volumes.test.mq5 index 255bf0993..b5075ea99 100644 --- a/Indicators/tests/Indi_Volumes.test.mq5 +++ b/Indicators/tests/Indi_Volumes.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_WilliamsAD.test.mq4 b/Indicators/tests/Indi_WilliamsAD.test.mq4 index c3aa0468a..5b2392a1d 100644 --- a/Indicators/tests/Indi_WilliamsAD.test.mq4 +++ b/Indicators/tests/Indi_WilliamsAD.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_WilliamsAD.test.mq5 b/Indicators/tests/Indi_WilliamsAD.test.mq5 index 486a39cd1..7ff0411f3 100644 --- a/Indicators/tests/Indi_WilliamsAD.test.mq5 +++ b/Indicators/tests/Indi_WilliamsAD.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_ZigZag.test.mq4 b/Indicators/tests/Indi_ZigZag.test.mq4 index dfe9dc22a..e316a7e87 100644 --- a/Indicators/tests/Indi_ZigZag.test.mq4 +++ b/Indicators/tests/Indi_ZigZag.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_ZigZag.test.mq5 b/Indicators/tests/Indi_ZigZag.test.mq5 index 9e87d579f..8994874a2 100644 --- a/Indicators/tests/Indi_ZigZag.test.mq5 +++ b/Indicators/tests/Indi_ZigZag.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_ZigZagColor.test.mq4 b/Indicators/tests/Indi_ZigZagColor.test.mq4 index 750d34430..42f28b652 100644 --- a/Indicators/tests/Indi_ZigZagColor.test.mq4 +++ b/Indicators/tests/Indi_ZigZagColor.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indi_ZigZagColor.test.mq5 b/Indicators/tests/Indi_ZigZagColor.test.mq5 index 84b697e01..776b0180d 100644 --- a/Indicators/tests/Indi_ZigZagColor.test.mq5 +++ b/Indicators/tests/Indi_ZigZagColor.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indicators.test.mq4 b/Indicators/tests/Indicators.test.mq4 index ee10e238c..9da308ce3 100644 --- a/Indicators/tests/Indicators.test.mq4 +++ b/Indicators/tests/Indicators.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Indicators/tests/Indicators.test.mq5 b/Indicators/tests/Indicators.test.mq5 index a17d5b994..55f42305a 100644 --- a/Indicators/tests/Indicators.test.mq5 +++ b/Indicators/tests/Indicators.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Instances.h b/Instances.h index 780f07bd3..02cfcfd1e 100644 --- a/Instances.h +++ b/Instances.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Log.mqh b/Log.mqh index 852104bb1..fb7a6d1ba 100644 --- a/Log.mqh +++ b/Log.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Mail.mqh b/Mail.mqh index fdab3a93b..80fd09022 100644 --- a/Mail.mqh +++ b/Mail.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Market.mqh b/Market.mqh index 2a2c9cedb..b78fa7977 100644 --- a/Market.mqh +++ b/Market.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Market.struct.h b/Market.struct.h index 2d3367264..361985015 100644 --- a/Market.struct.h +++ b/Market.struct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Math/Math.define.h b/Math/Math.define.h index 6a69aad1d..27c2409a6 100644 --- a/Math/Math.define.h +++ b/Math/Math.define.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Math/Math.enum.h b/Math/Math.enum.h index 1b2d3a250..8dc22efe0 100644 --- a/Math/Math.enum.h +++ b/Math/Math.enum.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Math/Math.extern.h b/Math/Math.extern.h index d63691eb4..cfe6d3b32 100644 --- a/Math/Math.extern.h +++ b/Math/Math.extern.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Math/Math.h b/Math/Math.h index b3c171c6f..5df7476b2 100644 --- a/Math/Math.h +++ b/Math/Math.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Math/Math.struct.h b/Math/Math.struct.h index 50c9bfa7b..267de00be 100644 --- a/Math/Math.struct.h +++ b/Math/Math.struct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Math/Matrix.h b/Math/Matrix.h index 0893870d6..06e89cbf4 100644 --- a/Math/Matrix.h +++ b/Math/Matrix.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Math/MatrixMini.h b/Math/MatrixMini.h index 0e4731a26..d4371b581 100644 --- a/Math/MatrixMini.h +++ b/Math/MatrixMini.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Math/tests/Math.test.cpp b/Math/tests/Math.test.cpp index 3d50de2d9..882438be3 100644 --- a/Math/tests/Math.test.cpp +++ b/Math/tests/Math.test.cpp @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Math/tests/Math.test.mq4 b/Math/tests/Math.test.mq4 index 06408cfb8..08b2427cc 100644 --- a/Math/tests/Math.test.mq4 +++ b/Math/tests/Math.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Math/tests/Math.test.mq5 b/Math/tests/Math.test.mq5 index dd3a25a83..55d13a65f 100644 --- a/Math/tests/Math.test.mq5 +++ b/Math/tests/Math.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Math/tests/Matrix.test.cpp b/Math/tests/Matrix.test.cpp index c0e816206..97f6e0784 100644 --- a/Math/tests/Matrix.test.cpp +++ b/Math/tests/Matrix.test.cpp @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Math/tests/Matrix.test.mq4 b/Math/tests/Matrix.test.mq4 index 843ce8731..b787e449a 100644 --- a/Math/tests/Matrix.test.mq4 +++ b/Math/tests/Matrix.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Math/tests/Matrix.test.mq5 b/Math/tests/Matrix.test.mq5 index 44524f92d..d7efd4c89 100644 --- a/Math/tests/Matrix.test.mq5 +++ b/Math/tests/Matrix.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Math/tests/MatrixMini.test.mq4 b/Math/tests/MatrixMini.test.mq4 index d7b57ea11..7287c57fc 100644 --- a/Math/tests/MatrixMini.test.mq4 +++ b/Math/tests/MatrixMini.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Math/tests/MatrixMini.test.mq5 b/Math/tests/MatrixMini.test.mq5 index 6089aed2e..4ffe5f337 100644 --- a/Math/tests/MatrixMini.test.mq5 +++ b/Math/tests/MatrixMini.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Pattern.enum.h b/Pattern.enum.h index 8448472f3..e1f295ac2 100644 --- a/Pattern.enum.h +++ b/Pattern.enum.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Pattern.mqh b/Pattern.mqh index 477d401bf..2990db07c 100644 --- a/Pattern.mqh +++ b/Pattern.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Pattern.struct.h b/Pattern.struct.h index 657d9ad4e..b71c4d709 100644 --- a/Pattern.struct.h +++ b/Pattern.struct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Chart/Chart.define.h b/Platform/Chart/Chart.define.h index 7f06e374a..18af886c7 100644 --- a/Platform/Chart/Chart.define.h +++ b/Platform/Chart/Chart.define.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Chart/Chart.enum.h b/Platform/Chart/Chart.enum.h index 23feefcc9..acd9c7e44 100644 --- a/Platform/Chart/Chart.enum.h +++ b/Platform/Chart/Chart.enum.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Chart/Chart.h b/Platform/Chart/Chart.h index 83ee53eff..56a499281 100644 --- a/Platform/Chart/Chart.h +++ b/Platform/Chart/Chart.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Chart/Chart.struct.h b/Platform/Chart/Chart.struct.h index bcb47c018..0570bd4ca 100644 --- a/Platform/Chart/Chart.struct.h +++ b/Platform/Chart/Chart.struct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Chart/Chart.struct.serialize.h b/Platform/Chart/Chart.struct.serialize.h index 3b483bff8..8c2b9205b 100644 --- a/Platform/Chart/Chart.struct.serialize.h +++ b/Platform/Chart/Chart.struct.serialize.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Chart/Chart.struct.static.h b/Platform/Chart/Chart.struct.static.h index ee766f5c1..7c5269129 100644 --- a/Platform/Chart/Chart.struct.static.h +++ b/Platform/Chart/Chart.struct.static.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Chart/Chart.struct.tf.h b/Platform/Chart/Chart.struct.tf.h index 6e095aafc..aa6857283 100644 --- a/Platform/Chart/Chart.struct.tf.h +++ b/Platform/Chart/Chart.struct.tf.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Chart/Chart.symboltf.h b/Platform/Chart/Chart.symboltf.h index f8c8dc3d0..2710c4c78 100644 --- a/Platform/Chart/Chart.symboltf.h +++ b/Platform/Chart/Chart.symboltf.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Chart/ChartBase.h b/Platform/Chart/ChartBase.h index 091015fe3..ab7160bef 100644 --- a/Platform/Chart/ChartBase.h +++ b/Platform/Chart/ChartBase.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Chart/ChartMt.h b/Platform/Chart/ChartMt.h index 343bd7938..da5b895b1 100644 --- a/Platform/Chart/ChartMt.h +++ b/Platform/Chart/ChartMt.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Chart/tests/Chart.test.cpp b/Platform/Chart/tests/Chart.test.cpp index 6349776c1..92e062837 100644 --- a/Platform/Chart/tests/Chart.test.cpp +++ b/Platform/Chart/tests/Chart.test.cpp @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Chart/tests/Chart.test.mq4 b/Platform/Chart/tests/Chart.test.mq4 index 81cbb7297..780efbac9 100644 --- a/Platform/Chart/tests/Chart.test.mq4 +++ b/Platform/Chart/tests/Chart.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Chart/tests/Chart.test.mq5 b/Platform/Chart/tests/Chart.test.mq5 index 6c179fc44..9c214a1d3 100644 --- a/Platform/Chart/tests/Chart.test.mq5 +++ b/Platform/Chart/tests/Chart.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Chart/tests/ChartMt.test.mq4 b/Platform/Chart/tests/ChartMt.test.mq4 index 65e4dc65f..e431ba656 100644 --- a/Platform/Chart/tests/ChartMt.test.mq4 +++ b/Platform/Chart/tests/ChartMt.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Chart/tests/ChartMt.test.mq5 b/Platform/Chart/tests/ChartMt.test.mq5 index 118a2342f..db7e0f9c0 100644 --- a/Platform/Chart/tests/ChartMt.test.mq5 +++ b/Platform/Chart/tests/ChartMt.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Chart3D/Chart3D.h b/Platform/Chart3D/Chart3D.h index 36c2b6cfe..d97115759 100644 --- a/Platform/Chart3D/Chart3D.h +++ b/Platform/Chart3D/Chart3D.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Chart3D/Chart3DCandles.h b/Platform/Chart3D/Chart3DCandles.h index 39489115d..3344b8682 100644 --- a/Platform/Chart3D/Chart3DCandles.h +++ b/Platform/Chart3D/Chart3DCandles.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Chart3D/Chart3DType.h b/Platform/Chart3D/Chart3DType.h index a320a9aa7..588d596f8 100644 --- a/Platform/Chart3D/Chart3DType.h +++ b/Platform/Chart3D/Chart3DType.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Chart3D/Cube.h b/Platform/Chart3D/Cube.h index 5ed20a8b9..5e6b1d6e1 100644 --- a/Platform/Chart3D/Cube.h +++ b/Platform/Chart3D/Cube.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Chart3D/Device.h b/Platform/Chart3D/Device.h index 181391eca..b28c55ce8 100644 --- a/Platform/Chart3D/Device.h +++ b/Platform/Chart3D/Device.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Chart3D/Devices/MTDX/MTDXDevice.h b/Platform/Chart3D/Devices/MTDX/MTDXDevice.h index 166a924ed..8e0c6554f 100644 --- a/Platform/Chart3D/Devices/MTDX/MTDXDevice.h +++ b/Platform/Chart3D/Devices/MTDX/MTDXDevice.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Chart3D/Devices/MTDX/MTDXIndexBuffer.h b/Platform/Chart3D/Devices/MTDX/MTDXIndexBuffer.h index 6662aacab..43ddbfccb 100644 --- a/Platform/Chart3D/Devices/MTDX/MTDXIndexBuffer.h +++ b/Platform/Chart3D/Devices/MTDX/MTDXIndexBuffer.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Chart3D/Devices/MTDX/MTDXShader.h b/Platform/Chart3D/Devices/MTDX/MTDXShader.h index c3dad254a..ff75425a8 100644 --- a/Platform/Chart3D/Devices/MTDX/MTDXShader.h +++ b/Platform/Chart3D/Devices/MTDX/MTDXShader.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Chart3D/Devices/MTDX/MTDXVertexBuffer.h b/Platform/Chart3D/Devices/MTDX/MTDXVertexBuffer.h index e96b9c7b7..3a6163f4e 100644 --- a/Platform/Chart3D/Devices/MTDX/MTDXVertexBuffer.h +++ b/Platform/Chart3D/Devices/MTDX/MTDXVertexBuffer.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Chart3D/Face.h b/Platform/Chart3D/Face.h index 558c0bc4e..c298cfb9e 100644 --- a/Platform/Chart3D/Face.h +++ b/Platform/Chart3D/Face.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Chart3D/Frontend.h b/Platform/Chart3D/Frontend.h index 50e33e082..39b727d83 100644 --- a/Platform/Chart3D/Frontend.h +++ b/Platform/Chart3D/Frontend.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Chart3D/Frontends/MT5Frontend.h b/Platform/Chart3D/Frontends/MT5Frontend.h index 9bcec9e73..7f5532550 100644 --- a/Platform/Chart3D/Frontends/MT5Frontend.h +++ b/Platform/Chart3D/Frontends/MT5Frontend.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Chart3D/IndexBuffer.h b/Platform/Chart3D/IndexBuffer.h index 5e9f9ceea..2ddabdd63 100644 --- a/Platform/Chart3D/IndexBuffer.h +++ b/Platform/Chart3D/IndexBuffer.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Chart3D/Interface.h b/Platform/Chart3D/Interface.h index 72fd0e5d2..27d56457e 100644 --- a/Platform/Chart3D/Interface.h +++ b/Platform/Chart3D/Interface.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Chart3D/Material.h b/Platform/Chart3D/Material.h index 1cb05704b..6c084ca8c 100644 --- a/Platform/Chart3D/Material.h +++ b/Platform/Chart3D/Material.h @@ -1,3 +1,25 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + * + */ + #include "Math.h" /** diff --git a/Platform/Chart3D/Mesh.h b/Platform/Chart3D/Mesh.h index 754ee5c5f..d962ab138 100644 --- a/Platform/Chart3D/Mesh.h +++ b/Platform/Chart3D/Mesh.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Chart3D/Shader.h b/Platform/Chart3D/Shader.h index 7c4919c2c..05e237d63 100644 --- a/Platform/Chart3D/Shader.h +++ b/Platform/Chart3D/Shader.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Chart3D/ShaderVertexLayout.struct.h b/Platform/Chart3D/ShaderVertexLayout.struct.h index 240ef4462..f6332e9c5 100644 --- a/Platform/Chart3D/ShaderVertexLayout.struct.h +++ b/Platform/Chart3D/ShaderVertexLayout.struct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2023, 31337 Investments Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Chart3D/TSR.h b/Platform/Chart3D/TSR.h index ee015a01f..e6843e449 100644 --- a/Platform/Chart3D/TSR.h +++ b/Platform/Chart3D/TSR.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Chart3D/Vertex.h b/Platform/Chart3D/Vertex.h index 908e2f18c..29965fcef 100644 --- a/Platform/Chart3D/Vertex.h +++ b/Platform/Chart3D/Vertex.h @@ -1,3 +1,25 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + * + */ + #include "../../Refs.mqh" /** diff --git a/Platform/Chart3D/VertexBuffer.h b/Platform/Chart3D/VertexBuffer.h index 2abda66b5..3e7567ae1 100644 --- a/Platform/Chart3D/VertexBuffer.h +++ b/Platform/Chart3D/VertexBuffer.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Chart3D/tests/Chart3D.test.mq4 b/Platform/Chart3D/tests/Chart3D.test.mq4 index 6f02f1d0f..9f34bcfa4 100644 --- a/Platform/Chart3D/tests/Chart3D.test.mq4 +++ b/Platform/Chart3D/tests/Chart3D.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Chart3D/tests/Chart3D.test.mq5 b/Platform/Chart3D/tests/Chart3D.test.mq5 index ed735ac05..1f6b0479f 100644 --- a/Platform/Chart3D/tests/Chart3D.test.mq5 +++ b/Platform/Chart3D/tests/Chart3D.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* @@ -9,12 +9,12 @@ * 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 . */ diff --git a/Platform/Deal.enum.h b/Platform/Deal.enum.h index 41c3ca747..2efb635fd 100644 --- a/Platform/Deal.enum.h +++ b/Platform/Deal.enum.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/MQL5.mqh b/Platform/MQL5.mqh index 584a74fd2..1138325b6 100644 --- a/Platform/MQL5.mqh +++ b/Platform/MQL5.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Order.define.h b/Platform/Order.define.h index 930fac47e..af96f14ef 100644 --- a/Platform/Order.define.h +++ b/Platform/Order.define.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Order.enum.h b/Platform/Order.enum.h index d9e9f3a20..812aae995 100644 --- a/Platform/Order.enum.h +++ b/Platform/Order.enum.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Order.h b/Platform/Order.h index 697630a62..ef1aa45e8 100644 --- a/Platform/Order.h +++ b/Platform/Order.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Order.struct.h b/Platform/Order.struct.h index 86a26bb77..0b6aa9d61 100644 --- a/Platform/Order.struct.h +++ b/Platform/Order.struct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/OrderQuery.h b/Platform/OrderQuery.h index 27d2f251e..412740df1 100644 --- a/Platform/OrderQuery.h +++ b/Platform/OrderQuery.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Orders.h b/Platform/Orders.h index 2f498d852..93fc2ded7 100644 --- a/Platform/Orders.h +++ b/Platform/Orders.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Platform.define.h b/Platform/Platform.define.h index 31d4919e3..d3ff58339 100644 --- a/Platform/Platform.define.h +++ b/Platform/Platform.define.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Platform.extern.h b/Platform/Platform.extern.h index 3d0d67211..da578fe28 100644 --- a/Platform/Platform.extern.h +++ b/Platform/Platform.extern.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Platform.h b/Platform/Platform.h index e0189134d..35903ea95 100644 --- a/Platform/Platform.h +++ b/Platform/Platform.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/PlatformTime.h b/Platform/PlatformTime.h index 6f53b4e2f..1588185dc 100644 --- a/Platform/PlatformTime.h +++ b/Platform/PlatformTime.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Plot.h b/Platform/Plot.h index 1802d400b..3d630769f 100644 --- a/Platform/Plot.h +++ b/Platform/Plot.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Terminal.define.h b/Platform/Terminal.define.h index fd66662aa..d99fb5c98 100644 --- a/Platform/Terminal.define.h +++ b/Platform/Terminal.define.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Terminal.enum.h b/Platform/Terminal.enum.h index 38bb88052..743073144 100644 --- a/Platform/Terminal.enum.h +++ b/Platform/Terminal.enum.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Terminal.extern.h b/Platform/Terminal.extern.h index 77ca8c894..ced281bf9 100644 --- a/Platform/Terminal.extern.h +++ b/Platform/Terminal.extern.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Terminal.h b/Platform/Terminal.h index 65fd270aa..1103cafc1 100644 --- a/Platform/Terminal.h +++ b/Platform/Terminal.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Terminal.struct.h b/Platform/Terminal.struct.h index cb4e58da7..aafb7d1fb 100644 --- a/Platform/Terminal.struct.h +++ b/Platform/Terminal.struct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Web/Web.h b/Platform/Web/Web.h index 75fbe6643..65ee14d20 100644 --- a/Platform/Web/Web.h +++ b/Platform/Web/Web.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Web/tests/Web.test.mq4 b/Platform/Web/tests/Web.test.mq4 index 9c02f114d..e0afdc132 100644 --- a/Platform/Web/tests/Web.test.mq4 +++ b/Platform/Web/tests/Web.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/Web/tests/Web.test.mq5 b/Platform/Web/tests/Web.test.mq5 index 81726160e..48c57321c 100644 --- a/Platform/Web/tests/Web.test.mq5 +++ b/Platform/Web/tests/Web.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/tests/Order.test.cpp b/Platform/tests/Order.test.cpp index 392294030..0035008bd 100644 --- a/Platform/tests/Order.test.cpp +++ b/Platform/tests/Order.test.cpp @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/tests/Order.test.mq4 b/Platform/tests/Order.test.mq4 index 45c7a788c..6c662cdf5 100644 --- a/Platform/tests/Order.test.mq4 +++ b/Platform/tests/Order.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/tests/Order.test.mq5 b/Platform/tests/Order.test.mq5 index 89eccb50b..99f10111b 100644 --- a/Platform/tests/Order.test.mq5 +++ b/Platform/tests/Order.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/tests/OrderQuery.test.cpp b/Platform/tests/OrderQuery.test.cpp index 4a05d2324..274b23c3d 100644 --- a/Platform/tests/OrderQuery.test.cpp +++ b/Platform/tests/OrderQuery.test.cpp @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/tests/OrderQuery.test.mq4 b/Platform/tests/OrderQuery.test.mq4 index 5832eb4ce..9be1ee462 100644 --- a/Platform/tests/OrderQuery.test.mq4 +++ b/Platform/tests/OrderQuery.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/tests/OrderQuery.test.mq5 b/Platform/tests/OrderQuery.test.mq5 index 863066e0c..0e7e02065 100644 --- a/Platform/tests/OrderQuery.test.mq5 +++ b/Platform/tests/OrderQuery.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/tests/Orders.test.cpp b/Platform/tests/Orders.test.cpp index 2c79be8e4..910aa0d62 100644 --- a/Platform/tests/Orders.test.cpp +++ b/Platform/tests/Orders.test.cpp @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/tests/Orders.test.mq4 b/Platform/tests/Orders.test.mq4 index 4ba6bb5ae..63353b33c 100644 --- a/Platform/tests/Orders.test.mq4 +++ b/Platform/tests/Orders.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/tests/Orders.test.mq5 b/Platform/tests/Orders.test.mq5 index ef687ddd1..a195ba4fd 100644 --- a/Platform/tests/Orders.test.mq5 +++ b/Platform/tests/Orders.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/tests/Platform.test.cpp b/Platform/tests/Platform.test.cpp index 157cab9f8..c7cd29333 100644 --- a/Platform/tests/Platform.test.cpp +++ b/Platform/tests/Platform.test.cpp @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/tests/Platform.test.mq4 b/Platform/tests/Platform.test.mq4 index afaa714dc..0de14c04b 100644 --- a/Platform/tests/Platform.test.mq4 +++ b/Platform/tests/Platform.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/tests/Platform.test.mq5 b/Platform/tests/Platform.test.mq5 index 726b826b8..f7df7c7a6 100644 --- a/Platform/tests/Platform.test.mq5 +++ b/Platform/tests/Platform.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/tests/Plot.test.mq4 b/Platform/tests/Plot.test.mq4 index 1343ef71e..7a91795da 100644 --- a/Platform/tests/Plot.test.mq4 +++ b/Platform/tests/Plot.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/tests/Plot.test.mq5 b/Platform/tests/Plot.test.mq5 index 9a6f7a43b..30027b835 100644 --- a/Platform/tests/Plot.test.mq5 +++ b/Platform/tests/Plot.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/tests/Terminal.test.cpp b/Platform/tests/Terminal.test.cpp index 6adab5122..9760c4b95 100644 --- a/Platform/tests/Terminal.test.cpp +++ b/Platform/tests/Terminal.test.cpp @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/tests/Terminal.test.mq4 b/Platform/tests/Terminal.test.mq4 index 19aaf80f5..08d774a56 100644 --- a/Platform/tests/Terminal.test.mq4 +++ b/Platform/tests/Terminal.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Platform/tests/Terminal.test.mq5 b/Platform/tests/Terminal.test.mq5 index 07664ba39..14e9efcb9 100644 --- a/Platform/tests/Terminal.test.mq5 +++ b/Platform/tests/Terminal.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Profiler.mqh b/Profiler.mqh index 4c329ed8a..7f5e7710a 100644 --- a/Profiler.mqh +++ b/Profiler.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/README.md b/README.md index 45838609a..5794e4269 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,7 @@ Projects implementing this framework: EA strategies. - [EA31337-indicators-other](https://github.com/EA31337/EA31337-indicators-other): 3rd party indicators +- Check [EA31337 website](https://ea31337.github.io) for more. ## Conversion diff --git a/Refs.mqh b/Refs.mqh index 15d23704d..5641a4d97 100644 --- a/Refs.mqh +++ b/Refs.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Refs.rc.h b/Refs.rc.h index f7fdc85c9..3c053b028 100644 --- a/Refs.rc.h +++ b/Refs.rc.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Refs.struct.h b/Refs.struct.h index 92e667791..089a0a2f7 100644 --- a/Refs.struct.h +++ b/Refs.struct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Report.mqh b/Report.mqh index 6273e65ed..991cc2919 100644 --- a/Report.mqh +++ b/Report.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Serializer/Serializable.h b/Serializer/Serializable.h index b845f22c9..4535dfde2 100644 --- a/Serializer/Serializable.h +++ b/Serializer/Serializable.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Serializer/Serializer.define.h b/Serializer/Serializer.define.h index 651192781..bff8d7f1c 100644 --- a/Serializer/Serializer.define.h +++ b/Serializer/Serializer.define.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Serializer/Serializer.enum.h b/Serializer/Serializer.enum.h index bf5c12d3f..7efff47ad 100644 --- a/Serializer/Serializer.enum.h +++ b/Serializer/Serializer.enum.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Serializer/Serializer.h b/Serializer/Serializer.h index d0446e6d3..128a1c9ac 100644 --- a/Serializer/Serializer.h +++ b/Serializer/Serializer.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Serializer/SerializerBinary.h b/Serializer/SerializerBinary.h index 2c213eee1..940e9805b 100644 --- a/Serializer/SerializerBinary.h +++ b/Serializer/SerializerBinary.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Serializer/SerializerConversions.h b/Serializer/SerializerConversions.h index 027928321..20f1269a1 100644 --- a/Serializer/SerializerConversions.h +++ b/Serializer/SerializerConversions.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Serializer/SerializerConverter.h b/Serializer/SerializerConverter.h index 8774f5f95..0c46435e8 100644 --- a/Serializer/SerializerConverter.h +++ b/Serializer/SerializerConverter.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Serializer/SerializerCsv.h b/Serializer/SerializerCsv.h index 845949a65..46352f157 100644 --- a/Serializer/SerializerCsv.h +++ b/Serializer/SerializerCsv.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Serializer/SerializerDict.h b/Serializer/SerializerDict.h index 098ade629..647a7ab3d 100644 --- a/Serializer/SerializerDict.h +++ b/Serializer/SerializerDict.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Serializer/SerializerJson.h b/Serializer/SerializerJson.h index ad79679b0..682fbf919 100644 --- a/Serializer/SerializerJson.h +++ b/Serializer/SerializerJson.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Serializer/SerializerNode.enum.h b/Serializer/SerializerNode.enum.h index efc9a4d28..f951f5610 100644 --- a/Serializer/SerializerNode.enum.h +++ b/Serializer/SerializerNode.enum.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Serializer/SerializerNode.h b/Serializer/SerializerNode.h index 00c981d1f..d4eb4cf63 100644 --- a/Serializer/SerializerNode.h +++ b/Serializer/SerializerNode.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Serializer/SerializerNodeIterator.h b/Serializer/SerializerNodeIterator.h index 2be711439..a20a8fb4a 100644 --- a/Serializer/SerializerNodeIterator.h +++ b/Serializer/SerializerNodeIterator.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Serializer/SerializerNodeParam.h b/Serializer/SerializerNodeParam.h index b37d68c63..147be46f4 100644 --- a/Serializer/SerializerNodeParam.h +++ b/Serializer/SerializerNodeParam.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Serializer/SerializerObject.h b/Serializer/SerializerObject.h index cb758557a..a1132e5c0 100644 --- a/Serializer/SerializerObject.h +++ b/Serializer/SerializerObject.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Serializer/SerializerSqlite.h b/Serializer/SerializerSqlite.h index 4544aba34..01eab37e0 100644 --- a/Serializer/SerializerSqlite.h +++ b/Serializer/SerializerSqlite.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Serializer/tests/Serializable.test.cpp b/Serializer/tests/Serializable.test.cpp index 072fca720..83cc7fe1c 100644 --- a/Serializer/tests/Serializable.test.cpp +++ b/Serializer/tests/Serializable.test.cpp @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Serializer/tests/Serializer.test.mq4 b/Serializer/tests/Serializer.test.mq4 index 1117647d4..ceb8f3645 100644 --- a/Serializer/tests/Serializer.test.mq4 +++ b/Serializer/tests/Serializer.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Serializer/tests/Serializer.test.mq5 b/Serializer/tests/Serializer.test.mq5 index fa703369c..4b7190dbb 100644 --- a/Serializer/tests/Serializer.test.mq5 +++ b/Serializer/tests/Serializer.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/SetFile.mqh b/SetFile.mqh index b5255dc3b..e7d8d802d 100644 --- a/SetFile.mqh +++ b/SetFile.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Socket.mqh b/Socket.mqh index e1023634d..aa17c2ab1 100644 --- a/Socket.mqh +++ b/Socket.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Stats.mqh b/Stats.mqh index 0d45045ba..c3a265747 100644 --- a/Stats.mqh +++ b/Stats.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Std.h b/Std.h index 84f290e47..fcd91ab3a 100644 --- a/Std.h +++ b/Std.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Array.extern.h b/Storage/Array.extern.h index 19eaf0406..80209f126 100644 --- a/Storage/Array.extern.h +++ b/Storage/Array.extern.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Array.h b/Storage/Array.h index d71102230..0952802b7 100644 --- a/Storage/Array.h +++ b/Storage/Array.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Cache/IndiBufferCache.h b/Storage/Cache/IndiBufferCache.h index 2fd474f03..99831d74c 100644 --- a/Storage/Cache/IndiBufferCache.h +++ b/Storage/Cache/IndiBufferCache.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Cache/ObjectsCache.h b/Storage/Cache/ObjectsCache.h index 132fbef1c..05f1ce2eb 100644 --- a/Storage/Cache/ObjectsCache.h +++ b/Storage/Cache/ObjectsCache.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Cache/tests/IndiBufferCache.test.cpp b/Storage/Cache/tests/IndiBufferCache.test.cpp index 5e7a40004..374cbd8df 100644 --- a/Storage/Cache/tests/IndiBufferCache.test.cpp +++ b/Storage/Cache/tests/IndiBufferCache.test.cpp @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Cache/tests/IndiBufferCache.test.mq4 b/Storage/Cache/tests/IndiBufferCache.test.mq4 index dda5bacf9..816bd354b 100644 --- a/Storage/Cache/tests/IndiBufferCache.test.mq4 +++ b/Storage/Cache/tests/IndiBufferCache.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Cache/tests/IndiBufferCache.test.mq5 b/Storage/Cache/tests/IndiBufferCache.test.mq5 index 7ff72d85c..73c06569d 100644 --- a/Storage/Cache/tests/IndiBufferCache.test.mq5 +++ b/Storage/Cache/tests/IndiBufferCache.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Cache/tests/ObjectsCache.test.cpp b/Storage/Cache/tests/ObjectsCache.test.cpp index 3f5d792fc..d76651100 100644 --- a/Storage/Cache/tests/ObjectsCache.test.cpp +++ b/Storage/Cache/tests/ObjectsCache.test.cpp @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Cache/tests/ObjectsCache.test.mq4 b/Storage/Cache/tests/ObjectsCache.test.mq4 index 47374a5de..a2860056a 100644 --- a/Storage/Cache/tests/ObjectsCache.test.mq4 +++ b/Storage/Cache/tests/ObjectsCache.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Cache/tests/ObjectsCache.test.mq5 b/Storage/Cache/tests/ObjectsCache.test.mq5 index b0ec18056..455fede3c 100644 --- a/Storage/Cache/tests/ObjectsCache.test.mq5 +++ b/Storage/Cache/tests/ObjectsCache.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Collection.h b/Storage/Collection.h index 9866a0f1d..98934caf2 100644 --- a/Storage/Collection.h +++ b/Storage/Collection.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Data.define.h b/Storage/Data.define.h index 822fcc323..a66e5fdd5 100644 --- a/Storage/Data.define.h +++ b/Storage/Data.define.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Data.enum.h b/Storage/Data.enum.h index 6b76c3732..a3f7c1f19 100644 --- a/Storage/Data.enum.h +++ b/Storage/Data.enum.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Data.struct.h b/Storage/Data.struct.h index be5239e84..743cc9c7e 100644 --- a/Storage/Data.struct.h +++ b/Storage/Data.struct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Data.struct.serialize.h b/Storage/Data.struct.serialize.h index f4b6f7a07..9ad9d88e2 100644 --- a/Storage/Data.struct.serialize.h +++ b/Storage/Data.struct.serialize.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Database.h b/Storage/Database.h index b13fbed8a..b4952b83f 100644 --- a/Storage/Database.h +++ b/Storage/Database.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Database.struct.h b/Storage/Database.struct.h index 45e378c99..21af84f59 100644 --- a/Storage/Database.struct.h +++ b/Storage/Database.struct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/DateTime.entry.h b/Storage/DateTime.entry.h index 10c3ab060..d662fb545 100644 --- a/Storage/DateTime.entry.h +++ b/Storage/DateTime.entry.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/DateTime.enum.h b/Storage/DateTime.enum.h index 73e7facbe..97177455f 100644 --- a/Storage/DateTime.enum.h +++ b/Storage/DateTime.enum.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/DateTime.extern.h b/Storage/DateTime.extern.h index 217e36d3f..4f2fb4e47 100644 --- a/Storage/DateTime.extern.h +++ b/Storage/DateTime.extern.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/DateTime.h b/Storage/DateTime.h index 159ada1b2..a1dab3d8e 100644 --- a/Storage/DateTime.h +++ b/Storage/DateTime.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/DateTime.static.h b/Storage/DateTime.static.h index b7f237bb2..cb932ce6c 100644 --- a/Storage/DateTime.static.h +++ b/Storage/DateTime.static.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/DateTime.struct.h b/Storage/DateTime.struct.h index 788b8dc9f..3755740b5 100644 --- a/Storage/DateTime.struct.h +++ b/Storage/DateTime.struct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Dict/Buffer/Buffer.h b/Storage/Dict/Buffer/Buffer.h index d534befc1..6fb6e427c 100644 --- a/Storage/Dict/Buffer/Buffer.h +++ b/Storage/Dict/Buffer/Buffer.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Dict/Buffer/BufferCandle.h b/Storage/Dict/Buffer/BufferCandle.h index 7522a8a3e..f68b62edb 100644 --- a/Storage/Dict/Buffer/BufferCandle.h +++ b/Storage/Dict/Buffer/BufferCandle.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Dict/Buffer/BufferFXT.h b/Storage/Dict/Buffer/BufferFXT.h index 40ae28ebf..df765a52a 100644 --- a/Storage/Dict/Buffer/BufferFXT.h +++ b/Storage/Dict/Buffer/BufferFXT.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, 31337 Investments Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* @@ -9,12 +9,12 @@ * 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 . */ diff --git a/Storage/Dict/Buffer/BufferStruct.h b/Storage/Dict/Buffer/BufferStruct.h index 23acd6dc0..d8688e5c8 100644 --- a/Storage/Dict/Buffer/BufferStruct.h +++ b/Storage/Dict/Buffer/BufferStruct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Dict/Buffer/BufferTick.h b/Storage/Dict/Buffer/BufferTick.h index d196a7454..e074fb0fe 100644 --- a/Storage/Dict/Buffer/BufferTick.h +++ b/Storage/Dict/Buffer/BufferTick.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Dict/Buffer/tests/Buffer.test.mq4 b/Storage/Dict/Buffer/tests/Buffer.test.mq4 index e9d93924a..cdeb006bf 100644 --- a/Storage/Dict/Buffer/tests/Buffer.test.mq4 +++ b/Storage/Dict/Buffer/tests/Buffer.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Dict/Buffer/tests/Buffer.test.mq5 b/Storage/Dict/Buffer/tests/Buffer.test.mq5 index 80f66b727..4f387b15b 100644 --- a/Storage/Dict/Buffer/tests/Buffer.test.mq5 +++ b/Storage/Dict/Buffer/tests/Buffer.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Dict/Buffer/tests/BufferCandle.test.mq4 b/Storage/Dict/Buffer/tests/BufferCandle.test.mq4 index fe6c0a00d..c356675f7 100644 --- a/Storage/Dict/Buffer/tests/BufferCandle.test.mq4 +++ b/Storage/Dict/Buffer/tests/BufferCandle.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Dict/Buffer/tests/BufferCandle.test.mq5 b/Storage/Dict/Buffer/tests/BufferCandle.test.mq5 index c2c47031b..cb6fbfb72 100644 --- a/Storage/Dict/Buffer/tests/BufferCandle.test.mq5 +++ b/Storage/Dict/Buffer/tests/BufferCandle.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Dict/Buffer/tests/BufferCompileAll.test.mq4 b/Storage/Dict/Buffer/tests/BufferCompileAll.test.mq4 index 2902f4244..10cdd614e 100644 --- a/Storage/Dict/Buffer/tests/BufferCompileAll.test.mq4 +++ b/Storage/Dict/Buffer/tests/BufferCompileAll.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2023, 31337 Investments Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* @@ -9,12 +9,12 @@ * 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 . */ diff --git a/Storage/Dict/Buffer/tests/BufferCompileAll.test.mq5 b/Storage/Dict/Buffer/tests/BufferCompileAll.test.mq5 index 18a58a19a..39013e5d2 100644 --- a/Storage/Dict/Buffer/tests/BufferCompileAll.test.mq5 +++ b/Storage/Dict/Buffer/tests/BufferCompileAll.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Dict/Buffer/tests/BufferFXT.test.mq4 b/Storage/Dict/Buffer/tests/BufferFXT.test.mq4 index 498f7967a..584f7bb1a 100644 --- a/Storage/Dict/Buffer/tests/BufferFXT.test.mq4 +++ b/Storage/Dict/Buffer/tests/BufferFXT.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2020, 31337 Investments Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* @@ -9,12 +9,12 @@ * 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 . */ diff --git a/Storage/Dict/Buffer/tests/BufferFXT.test.mq5 b/Storage/Dict/Buffer/tests/BufferFXT.test.mq5 index 2657efe4d..4035ef991 100644 --- a/Storage/Dict/Buffer/tests/BufferFXT.test.mq5 +++ b/Storage/Dict/Buffer/tests/BufferFXT.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2020, 31337 Investments Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* @@ -9,12 +9,12 @@ * 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 . */ diff --git a/Storage/Dict/Buffer/tests/BufferStruct.test.mq4 b/Storage/Dict/Buffer/tests/BufferStruct.test.mq4 index 3d6317d56..5ea7b3568 100644 --- a/Storage/Dict/Buffer/tests/BufferStruct.test.mq4 +++ b/Storage/Dict/Buffer/tests/BufferStruct.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Dict/Buffer/tests/BufferStruct.test.mq5 b/Storage/Dict/Buffer/tests/BufferStruct.test.mq5 index 5193e7ebf..2310d0981 100644 --- a/Storage/Dict/Buffer/tests/BufferStruct.test.mq5 +++ b/Storage/Dict/Buffer/tests/BufferStruct.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Dict/Buffer/tests/BufferTick.test.mq4 b/Storage/Dict/Buffer/tests/BufferTick.test.mq4 index 5a45ef4fa..ab2fb2b6f 100644 --- a/Storage/Dict/Buffer/tests/BufferTick.test.mq4 +++ b/Storage/Dict/Buffer/tests/BufferTick.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Dict/Buffer/tests/BufferTick.test.mq5 b/Storage/Dict/Buffer/tests/BufferTick.test.mq5 index d0b022e65..05adf29d1 100644 --- a/Storage/Dict/Buffer/tests/BufferTick.test.mq5 +++ b/Storage/Dict/Buffer/tests/BufferTick.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Dict/Dict.enum.h b/Storage/Dict/Dict.enum.h index a56671b41..f80ff471b 100644 --- a/Storage/Dict/Dict.enum.h +++ b/Storage/Dict/Dict.enum.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Dict/Dict.h b/Storage/Dict/Dict.h index 473627e18..001606545 100644 --- a/Storage/Dict/Dict.h +++ b/Storage/Dict/Dict.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Dict/DictBase.h b/Storage/Dict/DictBase.h index afd19a82e..a01d14535 100644 --- a/Storage/Dict/DictBase.h +++ b/Storage/Dict/DictBase.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Dict/DictIteratorBase.h b/Storage/Dict/DictIteratorBase.h index a73cf160d..a50760bbf 100644 --- a/Storage/Dict/DictIteratorBase.h +++ b/Storage/Dict/DictIteratorBase.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Dict/DictObject.h b/Storage/Dict/DictObject.h index 0809673b8..39de1edfb 100644 --- a/Storage/Dict/DictObject.h +++ b/Storage/Dict/DictObject.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Dict/DictSlot.h b/Storage/Dict/DictSlot.h index 74ed6838c..00925d3f5 100644 --- a/Storage/Dict/DictSlot.h +++ b/Storage/Dict/DictSlot.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Dict/DictSlotsRef.h b/Storage/Dict/DictSlotsRef.h index 8b7fd651d..78bf4e854 100644 --- a/Storage/Dict/DictSlotsRef.h +++ b/Storage/Dict/DictSlotsRef.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Dict/DictStruct.h b/Storage/Dict/DictStruct.h index 7bc733977..cbd4ea7dc 100644 --- a/Storage/Dict/DictStruct.h +++ b/Storage/Dict/DictStruct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Dict/tests/Dict.test.mq4 b/Storage/Dict/tests/Dict.test.mq4 index b4eae2671..290bca741 100644 --- a/Storage/Dict/tests/Dict.test.mq4 +++ b/Storage/Dict/tests/Dict.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Dict/tests/Dict.test.mq5 b/Storage/Dict/tests/Dict.test.mq5 index 0d25d7860..f68feb22d 100644 --- a/Storage/Dict/tests/Dict.test.mq5 +++ b/Storage/Dict/tests/Dict.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Flags.struct.h b/Storage/Flags.struct.h index 8807629b4..9876cdff1 100644 --- a/Storage/Flags.struct.h +++ b/Storage/Flags.struct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/IValueStorage.h b/Storage/IValueStorage.h index 290c2552d..d79509ec4 100644 --- a/Storage/IValueStorage.h +++ b/Storage/IValueStorage.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/ItemsHistory.h b/Storage/ItemsHistory.h index 551c26f36..1764fb7c2 100644 --- a/Storage/ItemsHistory.h +++ b/Storage/ItemsHistory.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/MemoryFileSystem.h b/Storage/MemoryFileSystem.h index 74b08eb48..24deae0ab 100644 --- a/Storage/MemoryFileSystem.h +++ b/Storage/MemoryFileSystem.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Object.enum.h b/Storage/Object.enum.h index 04d83c42b..021ccd22e 100644 --- a/Storage/Object.enum.h +++ b/Storage/Object.enum.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ -//| EA31337 - multi-strategy advanced trading robot. | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Object.extern.h b/Storage/Object.extern.h index 68f44de50..d166ea319 100644 --- a/Storage/Object.extern.h +++ b/Storage/Object.extern.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Object.h b/Storage/Object.h index e8467cd01..ce9287394 100644 --- a/Storage/Object.h +++ b/Storage/Object.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ -//| EA31337 - multi-strategy advanced trading robot. | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Objects.h b/Storage/Objects.h index 523e56805..158f45a7a 100644 --- a/Storage/Objects.h +++ b/Storage/Objects.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Redis.h b/Storage/Redis.h index f86f5057f..6daebb9c3 100644 --- a/Storage/Redis.h +++ b/Storage/Redis.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Redis.struct.h b/Storage/Redis.struct.h index cddace0c1..719d6f69f 100644 --- a/Storage/Redis.struct.h +++ b/Storage/Redis.struct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/Singleton.h b/Storage/Singleton.h index 713d73bf0..ccc0f4b32 100644 --- a/Storage/Singleton.h +++ b/Storage/Singleton.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/String.extern.h b/Storage/String.extern.h index 7f54cb43a..401d5a9a4 100644 --- a/Storage/String.extern.h +++ b/Storage/String.extern.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/String.h b/Storage/String.h index aeff16710..e0e198885 100644 --- a/Storage/String.h +++ b/Storage/String.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/ValueStorage.accessor.h b/Storage/ValueStorage.accessor.h index d4fc60aee..29696a8d4 100644 --- a/Storage/ValueStorage.accessor.h +++ b/Storage/ValueStorage.accessor.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/ValueStorage.all.h b/Storage/ValueStorage.all.h index 3e842b803..6961d2cf4 100644 --- a/Storage/ValueStorage.all.h +++ b/Storage/ValueStorage.all.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/ValueStorage.applied_price.h b/Storage/ValueStorage.applied_price.h index 34f772d16..5b513e056 100644 --- a/Storage/ValueStorage.applied_price.h +++ b/Storage/ValueStorage.applied_price.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/ValueStorage.h b/Storage/ValueStorage.h index 09714f138..b512c55c0 100644 --- a/Storage/ValueStorage.h +++ b/Storage/ValueStorage.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/ValueStorage.history.h b/Storage/ValueStorage.history.h index 722bf422e..7beb64ce7 100644 --- a/Storage/ValueStorage.history.h +++ b/Storage/ValueStorage.history.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/ValueStorage.indicator.h b/Storage/ValueStorage.indicator.h index eb52f8b21..50c9d300e 100644 --- a/Storage/ValueStorage.indicator.h +++ b/Storage/ValueStorage.indicator.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/ValueStorage.native.h b/Storage/ValueStorage.native.h index fca81357d..95f8e351c 100644 --- a/Storage/ValueStorage.native.h +++ b/Storage/ValueStorage.native.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/ValueStorage.price_median.h b/Storage/ValueStorage.price_median.h index 3e0e62d5c..db29ac942 100644 --- a/Storage/ValueStorage.price_median.h +++ b/Storage/ValueStorage.price_median.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/ValueStorage.price_typical.h b/Storage/ValueStorage.price_typical.h index 8f6609ba0..7a38c19a8 100644 --- a/Storage/ValueStorage.price_typical.h +++ b/Storage/ValueStorage.price_typical.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/ValueStorage.price_weighted.h b/Storage/ValueStorage.price_weighted.h index 38b6aa411..9de66029b 100644 --- a/Storage/ValueStorage.price_weighted.h +++ b/Storage/ValueStorage.price_weighted.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/ValueStorage.spread.h b/Storage/ValueStorage.spread.h index ee2e1cf3c..8f84bcd71 100644 --- a/Storage/ValueStorage.spread.h +++ b/Storage/ValueStorage.spread.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/ValueStorage.tick_volume.h b/Storage/ValueStorage.tick_volume.h index cad534e28..f8061b092 100644 --- a/Storage/ValueStorage.tick_volume.h +++ b/Storage/ValueStorage.tick_volume.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/ValueStorage.time.h b/Storage/ValueStorage.time.h index 0f73a3b04..964bf5709 100644 --- a/Storage/ValueStorage.time.h +++ b/Storage/ValueStorage.time.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/ValueStorage.volume.h b/Storage/ValueStorage.volume.h index e68f96e82..396f2ce03 100644 --- a/Storage/ValueStorage.volume.h +++ b/Storage/ValueStorage.volume.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/tests/Collection.test.cpp b/Storage/tests/Collection.test.cpp index 7096c99da..5a4b7b859 100644 --- a/Storage/tests/Collection.test.cpp +++ b/Storage/tests/Collection.test.cpp @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/tests/Collection.test.mq4 b/Storage/tests/Collection.test.mq4 index e31946256..37716e764 100644 --- a/Storage/tests/Collection.test.mq4 +++ b/Storage/tests/Collection.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/tests/Collection.test.mq5 b/Storage/tests/Collection.test.mq5 index 23073b990..2ad418f16 100644 --- a/Storage/tests/Collection.test.mq5 +++ b/Storage/tests/Collection.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/tests/Database.test.mq4 b/Storage/tests/Database.test.mq4 index e9c63ce6c..91b8b8b3f 100644 --- a/Storage/tests/Database.test.mq4 +++ b/Storage/tests/Database.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/tests/Database.test.mq5 b/Storage/tests/Database.test.mq5 index b781f8549..a14a2880c 100644 --- a/Storage/tests/Database.test.mq5 +++ b/Storage/tests/Database.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/tests/DateTime.test.mq4 b/Storage/tests/DateTime.test.mq4 index 75da6eeda..491f66149 100644 --- a/Storage/tests/DateTime.test.mq4 +++ b/Storage/tests/DateTime.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/tests/DateTime.test.mq5 b/Storage/tests/DateTime.test.mq5 index 3ad92bd86..8a1711188 100644 --- a/Storage/tests/DateTime.test.mq5 +++ b/Storage/tests/DateTime.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/tests/ItemsHistory.test.mq4 b/Storage/tests/ItemsHistory.test.mq4 index 6b106661f..e65c781e4 100644 --- a/Storage/tests/ItemsHistory.test.mq4 +++ b/Storage/tests/ItemsHistory.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2020, 31337 Investments Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* @@ -9,12 +9,12 @@ * 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 . */ diff --git a/Storage/tests/ItemsHistory.test.mq5 b/Storage/tests/ItemsHistory.test.mq5 index 06af30eee..d9f928b63 100644 --- a/Storage/tests/ItemsHistory.test.mq5 +++ b/Storage/tests/ItemsHistory.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2020, 31337 Investments Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* @@ -9,12 +9,12 @@ * 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 . */ diff --git a/Storage/tests/Object.test.mq4 b/Storage/tests/Object.test.mq4 index db29ab091..75fa8274e 100644 --- a/Storage/tests/Object.test.mq4 +++ b/Storage/tests/Object.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | //| Copyright 2016-2023, EA31337 Ltd | -//| https://github.com/EA31337 | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/tests/Object.test.mq5 b/Storage/tests/Object.test.mq5 index 577e27712..f9dbfbc6e 100644 --- a/Storage/tests/Object.test.mq5 +++ b/Storage/tests/Object.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/tests/Redis.test.mq4 b/Storage/tests/Redis.test.mq4 index 41d497228..c69992a2d 100644 --- a/Storage/tests/Redis.test.mq4 +++ b/Storage/tests/Redis.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/tests/Redis.test.mq5 b/Storage/tests/Redis.test.mq5 index 2e3b254af..aedb069b9 100644 --- a/Storage/tests/Redis.test.mq5 +++ b/Storage/tests/Redis.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/tests/ValueStorage.test.mq4 b/Storage/tests/ValueStorage.test.mq4 index ce84e4183..63633af23 100644 --- a/Storage/tests/ValueStorage.test.mq4 +++ b/Storage/tests/ValueStorage.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Storage/tests/ValueStorage.test.mq5 b/Storage/tests/ValueStorage.test.mq5 index 69e3a08ae..2f7f08efa 100644 --- a/Storage/tests/ValueStorage.test.mq5 +++ b/Storage/tests/ValueStorage.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Strategy.enum.h b/Strategy.enum.h index 8a0bd5924..61f3633a4 100644 --- a/Strategy.enum.h +++ b/Strategy.enum.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Strategy.mqh b/Strategy.mqh index 806b6712a..6cd991674 100644 --- a/Strategy.mqh +++ b/Strategy.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Strategy.struct.h b/Strategy.struct.h index 19dce3bcd..d7e852c04 100644 --- a/Strategy.struct.h +++ b/Strategy.struct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Strategy.struct.pricestop.h b/Strategy.struct.pricestop.h index c79902900..8a14b983d 100644 --- a/Strategy.struct.pricestop.h +++ b/Strategy.struct.pricestop.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/SummaryReport.mqh b/SummaryReport.mqh index 3edfb96b4..84eb08feb 100644 --- a/SummaryReport.mqh +++ b/SummaryReport.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/SymbolInfo.define.h b/SymbolInfo.define.h index 960369f2d..74f19e889 100644 --- a/SymbolInfo.define.h +++ b/SymbolInfo.define.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/SymbolInfo.enum.h b/SymbolInfo.enum.h index 43b625853..2e1ed9ed3 100644 --- a/SymbolInfo.enum.h +++ b/SymbolInfo.enum.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/SymbolInfo.enum.symbols.h b/SymbolInfo.enum.symbols.h index fb9c39dc1..a17ee4ecf 100644 --- a/SymbolInfo.enum.symbols.h +++ b/SymbolInfo.enum.symbols.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/SymbolInfo.extern.h b/SymbolInfo.extern.h index 24716a8fb..d95799228 100644 --- a/SymbolInfo.extern.h +++ b/SymbolInfo.extern.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/SymbolInfo.mqh b/SymbolInfo.mqh index d68a68ede..6e7581194 100644 --- a/SymbolInfo.mqh +++ b/SymbolInfo.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/SymbolInfo.struct.h b/SymbolInfo.struct.h index ba167a187..46c91e477 100644 --- a/SymbolInfo.struct.h +++ b/SymbolInfo.struct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/SymbolInfo.struct.static.h b/SymbolInfo.struct.static.h index 8018b7b1f..d6ff0c70e 100644 --- a/SymbolInfo.struct.static.h +++ b/SymbolInfo.struct.static.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/Task.enum.h b/Task/Task.enum.h index 66b180b1f..bb295dce3 100644 --- a/Task/Task.enum.h +++ b/Task/Task.enum.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/Task.h b/Task/Task.h index 21bfa98a4..12fb9cf7b 100644 --- a/Task/Task.h +++ b/Task/Task.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/Task.struct.h b/Task/Task.struct.h index 226c306e1..8b9544ce0 100644 --- a/Task/Task.struct.h +++ b/Task/Task.struct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/TaskAction.enum.h b/Task/TaskAction.enum.h index 3756722ea..e190c47c5 100644 --- a/Task/TaskAction.enum.h +++ b/Task/TaskAction.enum.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/TaskAction.h b/Task/TaskAction.h index 5c2b5c2ec..5d28b0c46 100644 --- a/Task/TaskAction.h +++ b/Task/TaskAction.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/TaskAction.struct.h b/Task/TaskAction.struct.h index aac6c3935..6a35dc0c8 100644 --- a/Task/TaskAction.struct.h +++ b/Task/TaskAction.struct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/TaskAction.struct.serialize.h b/Task/TaskAction.struct.serialize.h index 54d0fc39e..f0091ee45 100644 --- a/Task/TaskAction.struct.serialize.h +++ b/Task/TaskAction.struct.serialize.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/TaskActionBase.h b/Task/TaskActionBase.h index 805105160..ef8d58957 100644 --- a/Task/TaskActionBase.h +++ b/Task/TaskActionBase.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/TaskCondition.enum.h b/Task/TaskCondition.enum.h index 3a8a9fbee..fc31d19c5 100644 --- a/Task/TaskCondition.enum.h +++ b/Task/TaskCondition.enum.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/TaskCondition.h b/Task/TaskCondition.h index c0a3b4fdf..f346fa60f 100644 --- a/Task/TaskCondition.h +++ b/Task/TaskCondition.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/TaskCondition.struct.h b/Task/TaskCondition.struct.h index 52547f291..f675b7e58 100644 --- a/Task/TaskCondition.struct.h +++ b/Task/TaskCondition.struct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/TaskCondition.struct.serialize.h b/Task/TaskCondition.struct.serialize.h index 36385b572..72f9d6dad 100644 --- a/Task/TaskCondition.struct.serialize.h +++ b/Task/TaskCondition.struct.serialize.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/TaskConditionBase.h b/Task/TaskConditionBase.h index 831cdfef6..0f4b5738a 100644 --- a/Task/TaskConditionBase.h +++ b/Task/TaskConditionBase.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/TaskGetter.h b/Task/TaskGetter.h index 1824dac80..5dd1cebd3 100644 --- a/Task/TaskGetter.h +++ b/Task/TaskGetter.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/TaskGetter.struct.h b/Task/TaskGetter.struct.h index 6e23d1a9d..c0d1b1772 100644 --- a/Task/TaskGetter.struct.h +++ b/Task/TaskGetter.struct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/TaskGetter.struct.serialize.h b/Task/TaskGetter.struct.serialize.h index 6afcaa1ac..982f724a6 100644 --- a/Task/TaskGetter.struct.serialize.h +++ b/Task/TaskGetter.struct.serialize.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/TaskGetterBase.h b/Task/TaskGetterBase.h index 249670822..7a183c2be 100644 --- a/Task/TaskGetterBase.h +++ b/Task/TaskGetterBase.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/TaskManager.h b/Task/TaskManager.h index d7a0dcf59..e0e12389c 100644 --- a/Task/TaskManager.h +++ b/Task/TaskManager.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/TaskObject.h b/Task/TaskObject.h index 3258b38a5..610303035 100644 --- a/Task/TaskObject.h +++ b/Task/TaskObject.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/TaskSetter.h b/Task/TaskSetter.h index a08f01957..038c0155c 100644 --- a/Task/TaskSetter.h +++ b/Task/TaskSetter.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/TaskSetter.struct.h b/Task/TaskSetter.struct.h index 822db9c88..0459e4bf0 100644 --- a/Task/TaskSetter.struct.h +++ b/Task/TaskSetter.struct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/TaskSetterBase.h b/Task/TaskSetterBase.h index 06023dd80..94810e61d 100644 --- a/Task/TaskSetterBase.h +++ b/Task/TaskSetterBase.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/Taskable.h b/Task/Taskable.h index 9e3115543..ef3f7d222 100644 --- a/Task/Taskable.h +++ b/Task/Taskable.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/tests/Task.test.cpp b/Task/tests/Task.test.cpp index 3941f0689..55c3571bd 100644 --- a/Task/tests/Task.test.cpp +++ b/Task/tests/Task.test.cpp @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/tests/Task.test.mq4 b/Task/tests/Task.test.mq4 index 3ab46d4b9..454fdee92 100644 --- a/Task/tests/Task.test.mq4 +++ b/Task/tests/Task.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/tests/Task.test.mq5 b/Task/tests/Task.test.mq5 index 8c37998b7..17e9c7f8e 100644 --- a/Task/tests/Task.test.mq5 +++ b/Task/tests/Task.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/tests/TaskAction.test.cpp b/Task/tests/TaskAction.test.cpp index 9839c3672..0f38435f0 100644 --- a/Task/tests/TaskAction.test.cpp +++ b/Task/tests/TaskAction.test.cpp @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/tests/TaskAction.test.mq4 b/Task/tests/TaskAction.test.mq4 index 080ea3c49..80bc62fee 100644 --- a/Task/tests/TaskAction.test.mq4 +++ b/Task/tests/TaskAction.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/tests/TaskAction.test.mq5 b/Task/tests/TaskAction.test.mq5 index 84177251a..5523bbfd7 100644 --- a/Task/tests/TaskAction.test.mq5 +++ b/Task/tests/TaskAction.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/tests/TaskActionBase.test.cpp b/Task/tests/TaskActionBase.test.cpp index 4cef3defe..5bced8553 100644 --- a/Task/tests/TaskActionBase.test.cpp +++ b/Task/tests/TaskActionBase.test.cpp @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/tests/TaskCondition.test.cpp b/Task/tests/TaskCondition.test.cpp index aa915e7f4..11dcab44f 100644 --- a/Task/tests/TaskCondition.test.cpp +++ b/Task/tests/TaskCondition.test.cpp @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/tests/TaskCondition.test.mq4 b/Task/tests/TaskCondition.test.mq4 index 961feb86a..cb5af46ab 100644 --- a/Task/tests/TaskCondition.test.mq4 +++ b/Task/tests/TaskCondition.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/tests/TaskCondition.test.mq5 b/Task/tests/TaskCondition.test.mq5 index a8a1f7e44..0af6e94da 100644 --- a/Task/tests/TaskCondition.test.mq5 +++ b/Task/tests/TaskCondition.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/tests/TaskConditionBase.test.cpp b/Task/tests/TaskConditionBase.test.cpp index 8cc28e132..51ead7272 100644 --- a/Task/tests/TaskConditionBase.test.cpp +++ b/Task/tests/TaskConditionBase.test.cpp @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/tests/TaskGetter.test.cpp b/Task/tests/TaskGetter.test.cpp index 794e49bf7..b858d2b6e 100644 --- a/Task/tests/TaskGetter.test.cpp +++ b/Task/tests/TaskGetter.test.cpp @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/tests/TaskGetter.test.mq4 b/Task/tests/TaskGetter.test.mq4 index 688c4942e..16cda3ca8 100644 --- a/Task/tests/TaskGetter.test.mq4 +++ b/Task/tests/TaskGetter.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/tests/TaskGetter.test.mq5 b/Task/tests/TaskGetter.test.mq5 index 77fd0e12d..fe2a72d0e 100644 --- a/Task/tests/TaskGetter.test.mq5 +++ b/Task/tests/TaskGetter.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/tests/TaskGetterBase.test.cpp b/Task/tests/TaskGetterBase.test.cpp index 219e7ded2..fff088185 100644 --- a/Task/tests/TaskGetterBase.test.cpp +++ b/Task/tests/TaskGetterBase.test.cpp @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/tests/TaskManager.test.cpp b/Task/tests/TaskManager.test.cpp index 08edcf2a1..ec09eb589 100644 --- a/Task/tests/TaskManager.test.cpp +++ b/Task/tests/TaskManager.test.cpp @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/tests/TaskManager.test.mq4 b/Task/tests/TaskManager.test.mq4 index 1092ba332..551f79c30 100644 --- a/Task/tests/TaskManager.test.mq4 +++ b/Task/tests/TaskManager.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/tests/TaskManager.test.mq5 b/Task/tests/TaskManager.test.mq5 index d93e5d718..4ccbdc3a2 100644 --- a/Task/tests/TaskManager.test.mq5 +++ b/Task/tests/TaskManager.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/tests/TaskObject.test.cpp b/Task/tests/TaskObject.test.cpp index 25588fd9e..1ab2f0d1c 100644 --- a/Task/tests/TaskObject.test.cpp +++ b/Task/tests/TaskObject.test.cpp @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/tests/TaskObject.test.mq4 b/Task/tests/TaskObject.test.mq4 index a6d856946..6da10c126 100644 --- a/Task/tests/TaskObject.test.mq4 +++ b/Task/tests/TaskObject.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/tests/TaskObject.test.mq5 b/Task/tests/TaskObject.test.mq5 index 4d8ebcc0a..b26581b71 100644 --- a/Task/tests/TaskObject.test.mq5 +++ b/Task/tests/TaskObject.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/tests/TaskSetter.test.cpp b/Task/tests/TaskSetter.test.cpp index 0db4f7705..bd2ba057f 100644 --- a/Task/tests/TaskSetter.test.cpp +++ b/Task/tests/TaskSetter.test.cpp @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/tests/TaskSetter.test.mq4 b/Task/tests/TaskSetter.test.mq4 index 8c3ebc2c1..4abe14316 100644 --- a/Task/tests/TaskSetter.test.mq4 +++ b/Task/tests/TaskSetter.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/tests/TaskSetter.test.mq5 b/Task/tests/TaskSetter.test.mq5 index a7963993c..23ef6365a 100644 --- a/Task/tests/TaskSetter.test.mq5 +++ b/Task/tests/TaskSetter.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/tests/Taskable.car.test.mq4 b/Task/tests/Taskable.car.test.mq4 index ad723ca6d..554f86ff4 100644 --- a/Task/tests/Taskable.car.test.mq4 +++ b/Task/tests/Taskable.car.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/tests/Taskable.car.test.mq5 b/Task/tests/Taskable.car.test.mq5 index 154cc0856..fd9ea3dd2 100644 --- a/Task/tests/Taskable.car.test.mq5 +++ b/Task/tests/Taskable.car.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/tests/Taskable.test.cpp b/Task/tests/Taskable.test.cpp index a872db8e2..f3aab6ea4 100644 --- a/Task/tests/Taskable.test.cpp +++ b/Task/tests/Taskable.test.cpp @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/tests/Taskable.test.mq4 b/Task/tests/Taskable.test.mq4 index 47e309712..08aef7c67 100644 --- a/Task/tests/Taskable.test.mq4 +++ b/Task/tests/Taskable.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Task/tests/Taskable.test.mq5 b/Task/tests/Taskable.test.mq5 index 69ea94626..c06f9abfb 100644 --- a/Task/tests/Taskable.test.mq5 +++ b/Task/tests/Taskable.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Test.mqh b/Test.mqh index 9bda8098c..ebb9a463d 100644 --- a/Test.mqh +++ b/Test.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Tester.mqh b/Tester.mqh index b796265aa..9f4fb4ed3 100644 --- a/Tester.mqh +++ b/Tester.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Tests.mqh b/Tests.mqh index d4a3d3463..f40cb9fec 100644 --- a/Tests.mqh +++ b/Tests.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Tick/Tick.struct.h b/Tick/Tick.struct.h index dd3ebe5ec..3308089e8 100644 --- a/Tick/Tick.struct.h +++ b/Tick/Tick.struct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Tick/TickManager.h b/Tick/TickManager.h index dde71ff9d..6dccc4e88 100644 --- a/Tick/TickManager.h +++ b/Tick/TickManager.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Tick/tests/TickManager.test.cpp b/Tick/tests/TickManager.test.cpp index dd57455ec..a3f4f40e6 100644 --- a/Tick/tests/TickManager.test.cpp +++ b/Tick/tests/TickManager.test.cpp @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Tick/tests/TickManager.test.mq4 b/Tick/tests/TickManager.test.mq4 index 0956d46bf..7df1ed0af 100644 --- a/Tick/tests/TickManager.test.mq4 +++ b/Tick/tests/TickManager.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Tick/tests/TickManager.test.mq5 b/Tick/tests/TickManager.test.mq5 index 1c54f9b2a..d18bebeb6 100644 --- a/Tick/tests/TickManager.test.mq5 +++ b/Tick/tests/TickManager.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Ticker.mqh b/Ticker.mqh index 51476a249..53b7097d7 100644 --- a/Ticker.mqh +++ b/Ticker.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Timer.mqh b/Timer.mqh index d0c111dc7..d18ac4ebb 100644 --- a/Timer.mqh +++ b/Timer.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Trade.enum.h b/Trade.enum.h index 0c4fa402d..f04ff6af8 100644 --- a/Trade.enum.h +++ b/Trade.enum.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Trade.mqh b/Trade.mqh index b09d876cb..3bea5a760 100644 --- a/Trade.mqh +++ b/Trade.mqh @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Trade.struct.h b/Trade.struct.h index 3ab728e55..c581db218 100644 --- a/Trade.struct.h +++ b/Trade.struct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Trade/TradeSignal.h b/Trade/TradeSignal.h index 4a11e43de..16cb3d33a 100644 --- a/Trade/TradeSignal.h +++ b/Trade/TradeSignal.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Trade/TradeSignal.struct.h b/Trade/TradeSignal.struct.h index 724a4f90a..b5ce076e7 100644 --- a/Trade/TradeSignal.struct.h +++ b/Trade/TradeSignal.struct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Trade/TradeSignalManager.h b/Trade/TradeSignalManager.h index 26de28668..7a955d55c 100644 --- a/Trade/TradeSignalManager.h +++ b/Trade/TradeSignalManager.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Trade/TradeSignalManager.struct.h b/Trade/TradeSignalManager.struct.h index d4be49393..67aa68c6b 100644 --- a/Trade/TradeSignalManager.struct.h +++ b/Trade/TradeSignalManager.struct.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Trade/tests/TradeSignal.test.cpp b/Trade/tests/TradeSignal.test.cpp index 4d687cd8d..950cc45f2 100644 --- a/Trade/tests/TradeSignal.test.cpp +++ b/Trade/tests/TradeSignal.test.cpp @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Trade/tests/TradeSignal.test.mq4 b/Trade/tests/TradeSignal.test.mq4 index c22f1d857..04b83b902 100644 --- a/Trade/tests/TradeSignal.test.mq4 +++ b/Trade/tests/TradeSignal.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Trade/tests/TradeSignal.test.mq5 b/Trade/tests/TradeSignal.test.mq5 index 7514a630a..fae860269 100644 --- a/Trade/tests/TradeSignal.test.mq5 +++ b/Trade/tests/TradeSignal.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Trade/tests/TradeSignalManager.test.cpp b/Trade/tests/TradeSignalManager.test.cpp index 90576a2f7..35ba0e9f0 100644 --- a/Trade/tests/TradeSignalManager.test.cpp +++ b/Trade/tests/TradeSignalManager.test.cpp @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Trade/tests/TradeSignalManager.test.mq4 b/Trade/tests/TradeSignalManager.test.mq4 index 3309a1f63..65af6e945 100644 --- a/Trade/tests/TradeSignalManager.test.mq4 +++ b/Trade/tests/TradeSignalManager.test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Trade/tests/TradeSignalManager.test.mq5 b/Trade/tests/TradeSignalManager.test.mq5 index f08fc242f..94e21c112 100644 --- a/Trade/tests/TradeSignalManager.test.mq5 +++ b/Trade/tests/TradeSignalManager.test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/Util.h b/Util.h index 143f0d11a..ae4b1ffd1 100644 --- a/Util.h +++ b/Util.h @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/CompileTest.mq4 b/tests/CompileTest.mq4 index 19320e3f5..5c83d319c 100644 --- a/tests/CompileTest.mq4 +++ b/tests/CompileTest.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/CompileTest.mq5 b/tests/CompileTest.mq5 index b1fee5348..0fc665dbf 100644 --- a/tests/CompileTest.mq5 +++ b/tests/CompileTest.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/ConfigTest.mq4 b/tests/ConfigTest.mq4 index 77a590a15..ab1d4398f 100644 --- a/tests/ConfigTest.mq4 +++ b/tests/ConfigTest.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/ConfigTest.mq5 b/tests/ConfigTest.mq5 index 578664161..8dc4372c9 100644 --- a/tests/ConfigTest.mq5 +++ b/tests/ConfigTest.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/ConvertTest.mq4 b/tests/ConvertTest.mq4 index c88dad353..21efcecec 100644 --- a/tests/ConvertTest.mq4 +++ b/tests/ConvertTest.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/ConvertTest.mq5 b/tests/ConvertTest.mq5 index fd1313264..b518d5146 100644 --- a/tests/ConvertTest.mq5 +++ b/tests/ConvertTest.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/EATest.mq4 b/tests/EATest.mq4 index cc4665d32..8f4ad937a 100644 --- a/tests/EATest.mq4 +++ b/tests/EATest.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/EATest.mq5 b/tests/EATest.mq5 index eec908e1b..777b518c4 100644 --- a/tests/EATest.mq5 +++ b/tests/EATest.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/IndicatorsTest.mq4 b/tests/IndicatorsTest.mq4 index 45083af4a..2db3abe73 100644 --- a/tests/IndicatorsTest.mq4 +++ b/tests/IndicatorsTest.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/IndicatorsTest.mq5 b/tests/IndicatorsTest.mq5 index f838d31f4..92168b883 100644 --- a/tests/IndicatorsTest.mq5 +++ b/tests/IndicatorsTest.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/LogTest.mq4 b/tests/LogTest.mq4 index 873e0a0ef..ea09c5c95 100644 --- a/tests/LogTest.mq4 +++ b/tests/LogTest.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/LogTest.mq5 b/tests/LogTest.mq5 index 0d90a83ae..1ce7d5a2a 100644 --- a/tests/LogTest.mq5 +++ b/tests/LogTest.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/MD5Test.mq4 b/tests/MD5Test.mq4 index 2321596e9..8c70e1c40 100644 --- a/tests/MD5Test.mq4 +++ b/tests/MD5Test.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/MD5Test.mq5 b/tests/MD5Test.mq5 index cceaaf214..d7000a9e2 100644 --- a/tests/MD5Test.mq5 +++ b/tests/MD5Test.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/MailTest.mq4 b/tests/MailTest.mq4 index a170a48d5..d836abec6 100644 --- a/tests/MailTest.mq4 +++ b/tests/MailTest.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/MailTest.mq5 b/tests/MailTest.mq5 index 8f90f1415..b34acf407 100644 --- a/tests/MailTest.mq5 +++ b/tests/MailTest.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/MarketTest.mq4 b/tests/MarketTest.mq4 index 2266f4d7c..b1b8958d5 100644 --- a/tests/MarketTest.mq4 +++ b/tests/MarketTest.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/MarketTest.mq5 b/tests/MarketTest.mq5 index 5e0cd341c..f7f281ca2 100644 --- a/tests/MarketTest.mq5 +++ b/tests/MarketTest.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/ProfilerTest.mq4 b/tests/ProfilerTest.mq4 index 2189d3522..c89cb9eb1 100644 --- a/tests/ProfilerTest.mq4 +++ b/tests/ProfilerTest.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/ProfilerTest.mq5 b/tests/ProfilerTest.mq5 index 81e4cff72..564398ccd 100644 --- a/tests/ProfilerTest.mq5 +++ b/tests/ProfilerTest.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/RefsTest.mq4 b/tests/RefsTest.mq4 index 99661abd6..dc9772218 100644 --- a/tests/RefsTest.mq4 +++ b/tests/RefsTest.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/RefsTest.mq5 b/tests/RefsTest.mq5 index 646fc7b23..73cbf9cff 100644 --- a/tests/RefsTest.mq5 +++ b/tests/RefsTest.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/StatsTest.mq4 b/tests/StatsTest.mq4 index 761a345d5..a0b59e48c 100644 --- a/tests/StatsTest.mq4 +++ b/tests/StatsTest.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/StatsTest.mq5 b/tests/StatsTest.mq5 index 92ee64500..9182da3c2 100644 --- a/tests/StatsTest.mq5 +++ b/tests/StatsTest.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/StrategyTest-RSI.mq4 b/tests/StrategyTest-RSI.mq4 index dd36bba1e..3acf24f4b 100644 --- a/tests/StrategyTest-RSI.mq4 +++ b/tests/StrategyTest-RSI.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/StrategyTest-RSI.mq5 b/tests/StrategyTest-RSI.mq5 index 1c21ee3b1..489ababc1 100644 --- a/tests/StrategyTest-RSI.mq5 +++ b/tests/StrategyTest-RSI.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/StrategyTest.mq4 b/tests/StrategyTest.mq4 index 52b2c9a07..be2787046 100644 --- a/tests/StrategyTest.mq4 +++ b/tests/StrategyTest.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/StrategyTest.mq5 b/tests/StrategyTest.mq5 index 2253b7e49..f608507e3 100644 --- a/tests/StrategyTest.mq5 +++ b/tests/StrategyTest.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/SummaryReportTest.mq4 b/tests/SummaryReportTest.mq4 index bc8d84c45..fdccf84e4 100644 --- a/tests/SummaryReportTest.mq4 +++ b/tests/SummaryReportTest.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/SummaryReportTest.mq5 b/tests/SummaryReportTest.mq5 index d1159b5be..982a9c147 100644 --- a/tests/SummaryReportTest.mq5 +++ b/tests/SummaryReportTest.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/SymbolInfoTest.mq4 b/tests/SymbolInfoTest.mq4 index 1d6351fc9..7ef7c4c2c 100644 --- a/tests/SymbolInfoTest.mq4 +++ b/tests/SymbolInfoTest.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/SymbolInfoTest.mq5 b/tests/SymbolInfoTest.mq5 index 812ff341a..3318f213b 100644 --- a/tests/SymbolInfoTest.mq5 +++ b/tests/SymbolInfoTest.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/TickerTest.mq4 b/tests/TickerTest.mq4 index 7b2143ce4..b7d0838a2 100644 --- a/tests/TickerTest.mq4 +++ b/tests/TickerTest.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/TickerTest.mq5 b/tests/TickerTest.mq5 index 73383609a..b1f8870d5 100644 --- a/tests/TickerTest.mq5 +++ b/tests/TickerTest.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/TimerTest.mq4 b/tests/TimerTest.mq4 index c09cb1fea..2d8b99b8e 100644 --- a/tests/TimerTest.mq4 +++ b/tests/TimerTest.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/TimerTest.mq5 b/tests/TimerTest.mq5 index 8ed0f1e83..006aa5341 100644 --- a/tests/TimerTest.mq5 +++ b/tests/TimerTest.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/TradeTest.mq4 b/tests/TradeTest.mq4 index 211ec8d08..6ce8b1fbe 100644 --- a/tests/TradeTest.mq4 +++ b/tests/TradeTest.mq4 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* diff --git a/tests/TradeTest.mq5 b/tests/TradeTest.mq5 index 7f97d85c9..dbfb28db3 100644 --- a/tests/TradeTest.mq5 +++ b/tests/TradeTest.mq5 @@ -1,7 +1,7 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | -//| https://github.com/EA31337 | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | //+------------------------------------------------------------------+ /* From 8bf5527145c27e329eecb208321bf622cdf58d07 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 18 Jun 2023 23:47:46 +0100 Subject: [PATCH 066/109] Code reformats for .mqh files --- Indicators/Bitwise/Indi_Candle.mqh | 2 +- Indicators/Bitwise/Indi_Pattern.mqh | 2 +- Indicators/DrawIndicator.mqh | 2 +- Indicators/Indi_AC.mqh | 4 ++-- Indicators/Indi_AD.mqh | 2 +- Indicators/Indi_ADX.mqh | 2 +- Indicators/Indi_ADXW.mqh | 6 +++--- Indicators/Indi_AMA.mqh | 4 ++-- Indicators/Indi_AO.mqh | 2 +- Indicators/Indi_ASI.mqh | 2 +- Indicators/Indi_ATR.mqh | 2 +- Indicators/Indi_BWMFI.mqh | 2 +- Indicators/Indi_BWZT.mqh | 2 +- Indicators/Indi_BearsPower.mqh | 2 +- Indicators/Indi_BullsPower.mqh | 2 +- Indicators/Indi_CCI.mqh | 4 ++-- Indicators/Indi_CHO.mqh | 4 ++-- Indicators/Indi_CHV.mqh | 2 +- Indicators/Indi_ColorBars.mqh | 2 +- Indicators/Indi_ColorCandlesDaily.mqh | 6 +++--- Indicators/Indi_ColorLine.mqh | 5 ++--- Indicators/Indi_CustomMovingAverage.mqh | 2 +- Indicators/Indi_DEMA.mqh | 11 +++++------ Indicators/Indi_DeMarker.mqh | 2 +- Indicators/Indi_Demo.mqh | 2 +- Indicators/Indi_DetrendedPrice.mqh | 2 +- Indicators/Indi_Drawer.mqh | 2 +- Indicators/Indi_Force.mqh | 2 +- Indicators/Indi_FractalAdaptiveMA.mqh | 7 +++---- Indicators/Indi_Fractals.mqh | 2 +- Indicators/Indi_Gator.mqh | 2 +- Indicators/Indi_HeikenAshi.mqh | 2 +- Indicators/Indi_Ichimoku.mqh | 2 +- Indicators/Indi_MFI.mqh | 4 ++-- Indicators/Indi_MassIndex.mqh | 2 +- Indicators/Indi_Momentum.mqh | 2 +- Indicators/Indi_OBV.mqh | 2 +- Indicators/Indi_OsMA.mqh | 2 +- Indicators/Indi_PriceChannel.mqh | 2 +- Indicators/Indi_PriceFeeder.mqh | 2 +- Indicators/Indi_PriceVolumeTrend.mqh | 2 +- Indicators/Indi_RS.mqh | 2 +- Indicators/Indi_RVI.mqh | 2 +- Indicators/Indi_RateOfChange.mqh | 2 +- Indicators/Indi_StdDev.mqh | 4 ++-- Indicators/Indi_TEMA.mqh | 4 ++-- Indicators/Indi_TRIX.mqh | 4 ++-- Indicators/Indi_UltimateOscillator.mqh | 2 +- Indicators/Indi_VIDYA.mqh | 9 ++++----- Indicators/Indi_VROC.mqh | 2 +- Indicators/Indi_Volumes.mqh | 2 +- Indicators/Indi_WilliamsAD.mqh | 6 +++--- Indicators/Indi_ZigZag.mqh | 2 +- Indicators/Indi_ZigZagColor.mqh | 2 +- Indicators/OHLC/Indi_OHLC.mqh | 2 +- Indicators/Special/Indi_Math.mqh | 2 +- 56 files changed, 80 insertions(+), 84 deletions(-) diff --git a/Indicators/Bitwise/Indi_Candle.mqh b/Indicators/Bitwise/Indi_Candle.mqh index 1be84c6f7..27d6e3233 100644 --- a/Indicators/Bitwise/Indi_Candle.mqh +++ b/Indicators/Bitwise/Indi_Candle.mqh @@ -22,10 +22,10 @@ // Includes. #include "../../Bar.struct.h" -#include "../../Storage/Dict/Buffer/BufferStruct.h" #include "../../Indicator/Indicator.h" #include "../../Pattern.struct.h" #include "../../Serializer/Serializer.h" +#include "../../Storage/Dict/Buffer/BufferStruct.h" #include "../Price/Indi_Price.h" #include "../Special/Indi_Math.mqh" diff --git a/Indicators/Bitwise/Indi_Pattern.mqh b/Indicators/Bitwise/Indi_Pattern.mqh index 4931c2531..7fa156adb 100644 --- a/Indicators/Bitwise/Indi_Pattern.mqh +++ b/Indicators/Bitwise/Indi_Pattern.mqh @@ -22,11 +22,11 @@ // Includes. #include "../../Bar.struct.h" -#include "../../Storage/Dict/Buffer/BufferStruct.h" #include "../../Indicator/Indicator.define.h" #include "../../Indicator/Indicator.h" #include "../../Pattern.struct.h" #include "../../Serializer/Serializer.h" +#include "../../Storage/Dict/Buffer/BufferStruct.h" #include "../Price/Indi_Price.h" #include "../Special/Indi_Math.mqh" diff --git a/Indicators/DrawIndicator.mqh b/Indicators/DrawIndicator.mqh index 2815f05b9..a34e8b708 100644 --- a/Indicators/DrawIndicator.mqh +++ b/Indicators/DrawIndicator.mqh @@ -30,8 +30,8 @@ #define DRAW_INDICATOR_MQH // Includes. -#include "../Storage/Dict/DictObject.h" #include "../Platform/Plot.h" +#include "../Storage/Dict/DictObject.h" #include "../Storage/Object.h" // Forward declaration. diff --git a/Indicators/Indi_AC.mqh b/Indicators/Indi_AC.mqh index c67bd47a7..c54961599 100644 --- a/Indicators/Indi_AC.mqh +++ b/Indicators/Indi_AC.mqh @@ -26,8 +26,8 @@ #endif // Includes. -#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" +#include "../Storage/Dict/Buffer/BufferStruct.h" // Structs. struct IndiACParams : IndicatorParams { @@ -101,7 +101,7 @@ class Indi_AC : public Indicator { #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iAC(_symbol, _tf), 0, _shift); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " diff --git a/Indicators/Indi_AD.mqh b/Indicators/Indi_AD.mqh index 3d965fcde..30efa4106 100644 --- a/Indicators/Indi_AD.mqh +++ b/Indicators/Indi_AD.mqh @@ -92,7 +92,7 @@ class Indi_AD : public Indicator { #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iAD(_symbol, _tf, VOLUME_TICK), 0, _shift); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " diff --git a/Indicators/Indi_ADX.mqh b/Indicators/Indi_ADX.mqh index ee957a559..e2cdd7702 100644 --- a/Indicators/Indi_ADX.mqh +++ b/Indicators/Indi_ADX.mqh @@ -112,7 +112,7 @@ class Indi_ADX : public Indicator { #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iADX(_symbol, _tf, _period), _mode, _shift); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " diff --git a/Indicators/Indi_ADXW.mqh b/Indicators/Indi_ADXW.mqh index 397406f65..5f37980dc 100644 --- a/Indicators/Indi_ADXW.mqh +++ b/Indicators/Indi_ADXW.mqh @@ -21,8 +21,8 @@ */ // Includes. -#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Storage/ValueStorage.applied_price.h" #include "../Storage/ValueStorage.h" #include "../Storage/ValueStorage.spread.h" @@ -108,7 +108,7 @@ class Indi_ADXW : public Indicator { #ifdef __MQL__ #ifdef __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iADXWilder(_symbol, _tf, _ma_period), _mode, _shift); -#else // __MQL5__ +#else // __MQL5__ if (_obj == nullptr) { Print( "Indi_ADXW::iADXWilder() can work without supplying pointer to IndicatorData only in MQL5. In this platform " @@ -118,7 +118,7 @@ class Indi_ADXW : public Indicator { } return iADXWilder(_obj, _ma_period, _mode, _shift); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " diff --git a/Indicators/Indi_AMA.mqh b/Indicators/Indi_AMA.mqh index 584b73ea0..38e9dda16 100644 --- a/Indicators/Indi_AMA.mqh +++ b/Indicators/Indi_AMA.mqh @@ -21,8 +21,8 @@ */ // Includes. -#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Storage/ValueStorage.h" #include "Price/Indi_Price.h" @@ -107,7 +107,7 @@ class Indi_AMA : public Indicator { } return iAMAOnIndicator(_obj, _ama_period, _fast_ema_period, _slow_ema_period, _ama_shift, _ap, _mode, _shift); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " diff --git a/Indicators/Indi_AO.mqh b/Indicators/Indi_AO.mqh index f8fed165b..c2d972279 100644 --- a/Indicators/Indi_AO.mqh +++ b/Indicators/Indi_AO.mqh @@ -103,7 +103,7 @@ class Indi_AO : public Indicator { #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iAO(_symbol, _tf), _mode, _shift); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " diff --git a/Indicators/Indi_ASI.mqh b/Indicators/Indi_ASI.mqh index 63a486753..0919c855d 100644 --- a/Indicators/Indi_ASI.mqh +++ b/Indicators/Indi_ASI.mqh @@ -21,8 +21,8 @@ */ // Includes. -#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Storage/ValueStorage.all.h" // Defines. diff --git a/Indicators/Indi_ATR.mqh b/Indicators/Indi_ATR.mqh index 5ec6d295b..55043c5b0 100644 --- a/Indicators/Indi_ATR.mqh +++ b/Indicators/Indi_ATR.mqh @@ -86,7 +86,7 @@ class Indi_ATR : public Indicator { #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iATR(_symbol, _tf, _period), 0, _shift); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " diff --git a/Indicators/Indi_BWMFI.mqh b/Indicators/Indi_BWMFI.mqh index 9ce48421d..ee7fb57e5 100644 --- a/Indicators/Indi_BWMFI.mqh +++ b/Indicators/Indi_BWMFI.mqh @@ -113,7 +113,7 @@ class Indi_BWMFI : public Indicator { #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iBWMFI(_symbol, _tf, VOLUME_TICK), _mode, _shift); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " diff --git a/Indicators/Indi_BWZT.mqh b/Indicators/Indi_BWZT.mqh index e1f8310de..15c5dbf8d 100644 --- a/Indicators/Indi_BWZT.mqh +++ b/Indicators/Indi_BWZT.mqh @@ -25,8 +25,8 @@ #define INDI_BWZT_DATA_LIMIT 100 // Includes. -#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/IndicatorTf.h" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Storage/ValueStorage.all.h" #include "Indi_AC.mqh" #include "Indi_AO.mqh" diff --git a/Indicators/Indi_BearsPower.mqh b/Indicators/Indi_BearsPower.mqh index e7183fb19..2301ac84b 100644 --- a/Indicators/Indi_BearsPower.mqh +++ b/Indicators/Indi_BearsPower.mqh @@ -87,7 +87,7 @@ class Indi_BearsPower : public Indicator { #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iBearsPower(_symbol, _tf, _period), 0, _shift); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " diff --git a/Indicators/Indi_BullsPower.mqh b/Indicators/Indi_BullsPower.mqh index 115339eb0..0efe8c5e2 100644 --- a/Indicators/Indi_BullsPower.mqh +++ b/Indicators/Indi_BullsPower.mqh @@ -87,7 +87,7 @@ class Indi_BullsPower : public Indicator { #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iBullsPower(_symbol, _tf, _period), 0, _shift); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " diff --git a/Indicators/Indi_CCI.mqh b/Indicators/Indi_CCI.mqh index 07197ad8b..81901f1cb 100644 --- a/Indicators/Indi_CCI.mqh +++ b/Indicators/Indi_CCI.mqh @@ -22,8 +22,8 @@ // Includes. #include "../Indicator/Indicator.h" -#include "Price/Indi_MA.h" #include "Indi_PriceFeeder.mqh" +#include "Price/Indi_MA.h" #include "Price/Indi_Price.h" #ifndef __MQL4__ @@ -97,7 +97,7 @@ class Indi_CCI : public Indicator { #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iCCI(_symbol, _tf, _period, _applied_price), 0, _shift); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " diff --git a/Indicators/Indi_CHO.mqh b/Indicators/Indi_CHO.mqh index a57e613e5..6fff098c3 100644 --- a/Indicators/Indi_CHO.mqh +++ b/Indicators/Indi_CHO.mqh @@ -25,8 +25,8 @@ #define INDI_CHO_MIN_BARS 2 // Includes. -#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Storage/ValueStorage.all.h" #include "../Util.h" #include "Price/Indi_MA.h" @@ -104,7 +104,7 @@ class Indi_CHO : public Indicator { return iChaikinOnArray(INDICATOR_CALCULATE_POPULATED_PARAMS_LONG, _fast_ma_period, _slow_ma_period, _ma_method, _av, _mode, _shift, _cache); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " diff --git a/Indicators/Indi_CHV.mqh b/Indicators/Indi_CHV.mqh index 317193aed..bfcd1847f 100644 --- a/Indicators/Indi_CHV.mqh +++ b/Indicators/Indi_CHV.mqh @@ -21,8 +21,8 @@ */ // Includes. -#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Storage/ValueStorage.all.h" #include "../Util.h" #include "Price/Indi_MA.h" diff --git a/Indicators/Indi_ColorBars.mqh b/Indicators/Indi_ColorBars.mqh index f89acef27..6721eed7c 100644 --- a/Indicators/Indi_ColorBars.mqh +++ b/Indicators/Indi_ColorBars.mqh @@ -21,8 +21,8 @@ */ // Includes. -#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Storage/ValueStorage.all.h" // Structs. diff --git a/Indicators/Indi_ColorCandlesDaily.mqh b/Indicators/Indi_ColorCandlesDaily.mqh index b282f4d34..9c5f2a545 100644 --- a/Indicators/Indi_ColorCandlesDaily.mqh +++ b/Indicators/Indi_ColorCandlesDaily.mqh @@ -21,8 +21,8 @@ */ // Includes. -#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Storage/ValueStorage.all.h" // Structs. @@ -89,8 +89,8 @@ class Indi_ColorCandlesDaily : public Indicator { /** * Calculates Color Candles Daily on the array of values. */ - static double iCCDOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _mode, int _abs_shift, - IndiBufferCache *_cache, bool _recalculate = false) { + static double iCCDOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _mode, int _abs_shift, IndiBufferCache *_cache, + bool _recalculate = false) { _cache.SetPriceBuffer(_open, _high, _low, _close); if (!_cache.HasBuffers()) { diff --git a/Indicators/Indi_ColorLine.mqh b/Indicators/Indi_ColorLine.mqh index 5ebdd3c5f..e5afbe3a7 100644 --- a/Indicators/Indi_ColorLine.mqh +++ b/Indicators/Indi_ColorLine.mqh @@ -21,8 +21,8 @@ */ // Includes. -#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Storage/ValueStorage.all.h" #include "Price/Indi_MA.h" @@ -95,8 +95,7 @@ class Indi_ColorLine : public Indicator { * Calculates Color Line on the array of values. */ static double iColorLineOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _mode, int _abs_shift, - IndiBufferCache *_cache, IndicatorData *_indi_ma, - bool _recalculate = false) { + IndiBufferCache *_cache, IndicatorData *_indi_ma, bool _recalculate = false) { _cache.SetPriceBuffer(_open, _high, _low, _close); if (!_cache.HasBuffers()) { diff --git a/Indicators/Indi_CustomMovingAverage.mqh b/Indicators/Indi_CustomMovingAverage.mqh index 46dfc04ae..b0cc0fb4e 100644 --- a/Indicators/Indi_CustomMovingAverage.mqh +++ b/Indicators/Indi_CustomMovingAverage.mqh @@ -21,8 +21,8 @@ */ // Includes. -#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" +#include "../Storage/Dict/Buffer/BufferStruct.h" // Structs. struct IndiCustomMovingAverageParams : IndicatorParams { diff --git a/Indicators/Indi_DEMA.mqh b/Indicators/Indi_DEMA.mqh index ef1db357f..d78d7736c 100644 --- a/Indicators/Indi_DEMA.mqh +++ b/Indicators/Indi_DEMA.mqh @@ -32,13 +32,13 @@ #endif // Includes. -#include "../Storage/Dict/Dict.h" -#include "../Storage/Dict/DictObject.h" #include "../Indicator/Indicator.h" #include "../Refs.mqh" +#include "../Storage/Dict/Dict.h" +#include "../Storage/Dict/DictObject.h" #include "../Storage/Objects.h" -#include "../Storage/ValueStorage.h" #include "../Storage/String.h" +#include "../Storage/ValueStorage.h" #include "Price/Indi_MA.h" #include "Price/Indi_Price.h" @@ -117,7 +117,7 @@ class Indi_DEMA : public Indicator { return iDEMAOnIndicator(_obj, _period, _ma_shift, _applied_price, _mode, _shift); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " @@ -127,8 +127,7 @@ class Indi_DEMA : public Indicator { } static double iDEMAOnArray(INDICATOR_CALCULATE_PARAMS_SHORT, unsigned int _ma_period, unsigned int _ma_shift, - int _mode, int _shift, IndiBufferCache *_cache = NULL, - bool _recalculate = false) { + int _mode, int _shift, IndiBufferCache *_cache = NULL, bool _recalculate = false) { if (_cache == nullptr) { Print("iDEMAOnArray() cannot yet work without cache object!"); DebugBreak(); diff --git a/Indicators/Indi_DeMarker.mqh b/Indicators/Indi_DeMarker.mqh index a6e5bafc1..61ae7f172 100644 --- a/Indicators/Indi_DeMarker.mqh +++ b/Indicators/Indi_DeMarker.mqh @@ -84,7 +84,7 @@ class Indi_DeMarker : public Indicator { #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iDeMarker(_symbol, _tf, _period), 0, _shift); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " diff --git a/Indicators/Indi_Demo.mqh b/Indicators/Indi_Demo.mqh index 9acaa188a..25b747228 100644 --- a/Indicators/Indi_Demo.mqh +++ b/Indicators/Indi_Demo.mqh @@ -21,8 +21,8 @@ */ // Includes. -#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "Price/Indi_Price.h" /** diff --git a/Indicators/Indi_DetrendedPrice.mqh b/Indicators/Indi_DetrendedPrice.mqh index 009c5e4ae..7e23d9b49 100644 --- a/Indicators/Indi_DetrendedPrice.mqh +++ b/Indicators/Indi_DetrendedPrice.mqh @@ -21,8 +21,8 @@ */ // Includes. -#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "Price/Indi_MA.h" // Structs. diff --git a/Indicators/Indi_Drawer.mqh b/Indicators/Indi_Drawer.mqh index 9f879f7d7..4c4b63f5b 100644 --- a/Indicators/Indi_Drawer.mqh +++ b/Indicators/Indi_Drawer.mqh @@ -21,8 +21,8 @@ */ // Includes. -#include "../Storage/Dict/DictStruct.h" #include "../Indicator/Indicator.h" +#include "../Storage/Dict/DictStruct.h" #include "../Storage/Redis.h" #include "../Task/TaskAction.h" #include "Indi_Drawer.struct.h" diff --git a/Indicators/Indi_Force.mqh b/Indicators/Indi_Force.mqh index dff85cead..773f44c16 100644 --- a/Indicators/Indi_Force.mqh +++ b/Indicators/Indi_Force.mqh @@ -101,7 +101,7 @@ class Indi_Force : public Indicator { #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iForce(_symbol, _tf, _period, _ma_method, VOLUME_TICK), 0, _shift); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " diff --git a/Indicators/Indi_FractalAdaptiveMA.mqh b/Indicators/Indi_FractalAdaptiveMA.mqh index 5c0d8f991..ce6682374 100644 --- a/Indicators/Indi_FractalAdaptiveMA.mqh +++ b/Indicators/Indi_FractalAdaptiveMA.mqh @@ -21,8 +21,8 @@ */ // Includes. -#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Storage/ValueStorage.all.h" // Structs. @@ -109,7 +109,7 @@ class Indi_FrAMA : public Indicator { return iFrAMAOnArray(INDICATOR_CALCULATE_POPULATED_PARAMS_LONG, _ma_period, _ma_shift, _ap, _mode, _obj PTR_DEREF ToAbsShift(_rel_shift), _cache); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " @@ -122,8 +122,7 @@ class Indi_FrAMA : public Indicator { * Calculates FrAMA on the array of values. */ static double iFrAMAOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _ma_period, int _ma_shift, ENUM_APPLIED_PRICE _ap, - int _mode, int _abs_shift, IndiBufferCache *_cache, - bool _recalculate = false) { + int _mode, int _abs_shift, IndiBufferCache *_cache, bool _recalculate = false) { _cache.SetPriceBuffer(_open, _high, _low, _close); if (!_cache.HasBuffers()) { diff --git a/Indicators/Indi_Fractals.mqh b/Indicators/Indi_Fractals.mqh index 62b04a460..ed7a2636a 100644 --- a/Indicators/Indi_Fractals.mqh +++ b/Indicators/Indi_Fractals.mqh @@ -100,7 +100,7 @@ class Indi_Fractals : public Indicator { #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iFractals(_symbol, _tf), _mode, _shift); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " diff --git a/Indicators/Indi_Gator.mqh b/Indicators/Indi_Gator.mqh index d6ec611e4..510a30ae9 100644 --- a/Indicators/Indi_Gator.mqh +++ b/Indicators/Indi_Gator.mqh @@ -171,7 +171,7 @@ class Indi_Gator : public Indicator { _lips_period, _lips_shift, _ma_method, _applied_price), _mode, _shift); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " diff --git a/Indicators/Indi_HeikenAshi.mqh b/Indicators/Indi_HeikenAshi.mqh index cb269bf0b..6fddda9d1 100644 --- a/Indicators/Indi_HeikenAshi.mqh +++ b/Indicators/Indi_HeikenAshi.mqh @@ -146,7 +146,7 @@ class Indi_HeikenAshi : public Indicator { #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iCustom(_symbol, _tf, "Examples\\Heiken_Ashi"), _mode, _shift); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " diff --git a/Indicators/Indi_Ichimoku.mqh b/Indicators/Indi_Ichimoku.mqh index 39415960c..a5b790165 100644 --- a/Indicators/Indi_Ichimoku.mqh +++ b/Indicators/Indi_Ichimoku.mqh @@ -140,7 +140,7 @@ class Indi_Ichimoku : public Indicator { INDICATOR_BUILTIN_CALL_AND_RETURN(::iIchimoku(_symbol, _tf, _tenkan_sen, _kijun_sen, _senkou_span_b), _mode, _shift); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " diff --git a/Indicators/Indi_MFI.mqh b/Indicators/Indi_MFI.mqh index acbc48104..93e712ffb 100644 --- a/Indicators/Indi_MFI.mqh +++ b/Indicators/Indi_MFI.mqh @@ -86,7 +86,7 @@ class Indi_MFI : public Indicator { #else // __MQL5__ return Indi_MFI::iMFI(_symbol, _tf, _period, VOLUME_TICK, _shift, _obj); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " @@ -103,7 +103,7 @@ class Indi_MFI : public Indicator { #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iMFI(_symbol, _tf, _period, VOLUME_TICK), 0, _shift); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " diff --git a/Indicators/Indi_MassIndex.mqh b/Indicators/Indi_MassIndex.mqh index e410bfd27..da802dc18 100644 --- a/Indicators/Indi_MassIndex.mqh +++ b/Indicators/Indi_MassIndex.mqh @@ -21,8 +21,8 @@ */ // Includes. -#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Storage/ValueStorage.all.h" #include "Price/Indi_MA.h" diff --git a/Indicators/Indi_Momentum.mqh b/Indicators/Indi_Momentum.mqh index 3cd980fc4..5b9eeca44 100644 --- a/Indicators/Indi_Momentum.mqh +++ b/Indicators/Indi_Momentum.mqh @@ -101,7 +101,7 @@ class Indi_Momentum : public Indicator { #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iMomentum(_symbol, _tf, _period, _ap), 0, _shift); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " diff --git a/Indicators/Indi_OBV.mqh b/Indicators/Indi_OBV.mqh index 797063793..3578134e4 100644 --- a/Indicators/Indi_OBV.mqh +++ b/Indicators/Indi_OBV.mqh @@ -110,7 +110,7 @@ class Indi_OBV : public Indicator { #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iOBV(_symbol, _tf, _applied), 0, _shift); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " diff --git a/Indicators/Indi_OsMA.mqh b/Indicators/Indi_OsMA.mqh index d30861ac0..f4f85b0da 100644 --- a/Indicators/Indi_OsMA.mqh +++ b/Indicators/Indi_OsMA.mqh @@ -95,7 +95,7 @@ class Indi_OsMA : public Indicator { INDICATOR_BUILTIN_CALL_AND_RETURN( ::iOsMA(_symbol, _tf, _ema_fast_period, _ema_slow_period, _signal_period, _applied_price), 0, _shift); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " diff --git a/Indicators/Indi_PriceChannel.mqh b/Indicators/Indi_PriceChannel.mqh index 16297c51d..c3cb344fc 100644 --- a/Indicators/Indi_PriceChannel.mqh +++ b/Indicators/Indi_PriceChannel.mqh @@ -21,8 +21,8 @@ */ // Includes. -#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "Indi_ZigZag.mqh" // Structs. diff --git a/Indicators/Indi_PriceFeeder.mqh b/Indicators/Indi_PriceFeeder.mqh index 1bcfeabc5..aa6f683b0 100644 --- a/Indicators/Indi_PriceFeeder.mqh +++ b/Indicators/Indi_PriceFeeder.mqh @@ -21,8 +21,8 @@ */ // Includes. -#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" +#include "../Storage/Dict/Buffer/BufferStruct.h" // Structs. struct IndiPriceFeederParams : IndicatorParams { diff --git a/Indicators/Indi_PriceVolumeTrend.mqh b/Indicators/Indi_PriceVolumeTrend.mqh index 11313b93c..0e6daf990 100644 --- a/Indicators/Indi_PriceVolumeTrend.mqh +++ b/Indicators/Indi_PriceVolumeTrend.mqh @@ -25,8 +25,8 @@ #define INDI_PVT_MIN_BARS 2 // Includes. -#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Storage/ValueStorage.all.h" // Structs. diff --git a/Indicators/Indi_RS.mqh b/Indicators/Indi_RS.mqh index 28f9681e2..c5c4f5b04 100644 --- a/Indicators/Indi_RS.mqh +++ b/Indicators/Indi_RS.mqh @@ -21,8 +21,8 @@ */ // Includes. -#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "OHLC/Indi_OHLC.mqh" #include "Special/Indi_Math.mqh" diff --git a/Indicators/Indi_RVI.mqh b/Indicators/Indi_RVI.mqh index e18250b0b..00f1f4ad7 100644 --- a/Indicators/Indi_RVI.mqh +++ b/Indicators/Indi_RVI.mqh @@ -90,7 +90,7 @@ class Indi_RVI : public Indicator { #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iRVI(_symbol, _tf, _period), _mode, _shift); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " diff --git a/Indicators/Indi_RateOfChange.mqh b/Indicators/Indi_RateOfChange.mqh index a3b764aa1..9691edb63 100644 --- a/Indicators/Indi_RateOfChange.mqh +++ b/Indicators/Indi_RateOfChange.mqh @@ -21,8 +21,8 @@ */ // Includes. -#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" +#include "../Storage/Dict/Buffer/BufferStruct.h" // Structs. struct IndiRateOfChangeParams : IndicatorParams { diff --git a/Indicators/Indi_StdDev.mqh b/Indicators/Indi_StdDev.mqh index 1d9aa1683..3be952ed0 100644 --- a/Indicators/Indi_StdDev.mqh +++ b/Indicators/Indi_StdDev.mqh @@ -30,8 +30,8 @@ // Includes. #include "../Indicator/Indicator.h" #include "../Storage/Cache/ObjectsCache.h" -#include "Price/Indi_MA.h" #include "Indi_PriceFeeder.mqh" +#include "Price/Indi_MA.h" #ifndef __MQL4__ // Defines global functions (for MQL4 backward compability). @@ -111,7 +111,7 @@ class Indi_StdDev : public Indicator { INDICATOR_BUILTIN_CALL_AND_RETURN(::iStdDev(_symbol, _tf, _ma_period, _ma_shift, _ma_method, _applied_price), 0, _shift); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " diff --git a/Indicators/Indi_TEMA.mqh b/Indicators/Indi_TEMA.mqh index 115d5b01c..3529aa46f 100644 --- a/Indicators/Indi_TEMA.mqh +++ b/Indicators/Indi_TEMA.mqh @@ -21,8 +21,8 @@ */ // Includes. -#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "Price/Indi_MA.h" // Structs. @@ -90,7 +90,7 @@ class Indi_TEMA : public Indicator { return iTEMAOnIndicator(_obj, _ma_period, _ma_shift, _ap, _mode, _shift); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " diff --git a/Indicators/Indi_TRIX.mqh b/Indicators/Indi_TRIX.mqh index 5233bc1f0..31c7cd3c4 100644 --- a/Indicators/Indi_TRIX.mqh +++ b/Indicators/Indi_TRIX.mqh @@ -21,8 +21,8 @@ */ // Includes. -#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "Price/Indi_MA.h" // Structs. @@ -88,7 +88,7 @@ class Indi_TRIX : public Indicator { return iTriXOnIndicator(_obj, _ma_period, _ap, _mode, _shift); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " diff --git a/Indicators/Indi_UltimateOscillator.mqh b/Indicators/Indi_UltimateOscillator.mqh index 28788e12f..8c5bb3481 100644 --- a/Indicators/Indi_UltimateOscillator.mqh +++ b/Indicators/Indi_UltimateOscillator.mqh @@ -21,8 +21,8 @@ */ // Includes. -#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Storage/ValueStorage.all.h" #include "Indi_ATR.mqh" #include "Price/Indi_MA.h" diff --git a/Indicators/Indi_VIDYA.mqh b/Indicators/Indi_VIDYA.mqh index 8a134d88e..25238207a 100644 --- a/Indicators/Indi_VIDYA.mqh +++ b/Indicators/Indi_VIDYA.mqh @@ -21,8 +21,8 @@ */ // Includes. -#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" +#include "../Storage/Dict/Buffer/BufferStruct.h" // Structs. struct IndiVIDYAParams : IndicatorParams { @@ -82,7 +82,7 @@ class Indi_VIDYA : public Indicator { #ifdef __MQL__ #ifdef __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iVIDyA(_symbol, _tf, _cmo_period, _ema_period, _ma_shift, _ap), _mode, _shift); -#else // __MQL5__ +#else // __MQL5__ if (_obj == nullptr) { Print( "Indi_VIDYA::iVIDyA() can work without supplying pointer to IndicatorData only in MQL5. In this platform " @@ -93,7 +93,7 @@ class Indi_VIDYA : public Indicator { return iVIDyAOnIndicator(_obj, _symbol, _tf, _cmo_period, _ema_period, _ma_shift, _ap, _mode, _shift); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " @@ -106,8 +106,7 @@ class Indi_VIDYA : public Indicator { * Calculates iVIDyA on the array of values. */ static double iVIDyAOnArray(INDICATOR_CALCULATE_PARAMS_SHORT, int _cmo_period, int _ema_period, int _ma_shift, - int _mode, int _abs_shift, IndiBufferCache *_cache, - bool _recalculate = false) { + int _mode, int _abs_shift, IndiBufferCache *_cache, bool _recalculate = false) { _cache.SetPriceBuffer(_price); if (!_cache.HasBuffers()) { diff --git a/Indicators/Indi_VROC.mqh b/Indicators/Indi_VROC.mqh index ba3e3412f..b7e869aac 100644 --- a/Indicators/Indi_VROC.mqh +++ b/Indicators/Indi_VROC.mqh @@ -21,8 +21,8 @@ */ // Includes. -#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Storage/ValueStorage.all.h" // Structs. diff --git a/Indicators/Indi_Volumes.mqh b/Indicators/Indi_Volumes.mqh index e60e60262..8ae7f687f 100644 --- a/Indicators/Indi_Volumes.mqh +++ b/Indicators/Indi_Volumes.mqh @@ -25,8 +25,8 @@ #define INDI_VOLUMES_MIN_BARS 2 // Includes. -#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Storage/ValueStorage.all.h" // Structs. diff --git a/Indicators/Indi_WilliamsAD.mqh b/Indicators/Indi_WilliamsAD.mqh index b777db663..b828039aa 100644 --- a/Indicators/Indi_WilliamsAD.mqh +++ b/Indicators/Indi_WilliamsAD.mqh @@ -25,8 +25,8 @@ #define INDI_WAD_MIN_BARS 100 // Includes. -#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Storage/ValueStorage.all.h" // Structs. @@ -93,8 +93,8 @@ class Indi_WilliamsAD : public Indicator { /** * Calculates William's AD on the array of values. */ - static double iWADOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _mode, int _abs_shift, - IndiBufferCache *_cache, bool _recalculate = false) { + static double iWADOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _mode, int _abs_shift, IndiBufferCache *_cache, + bool _recalculate = false) { _cache.SetPriceBuffer(_open, _high, _low, _close); if (!_cache.HasBuffers()) { diff --git a/Indicators/Indi_ZigZag.mqh b/Indicators/Indi_ZigZag.mqh index d8cf471a3..38886a9ea 100644 --- a/Indicators/Indi_ZigZag.mqh +++ b/Indicators/Indi_ZigZag.mqh @@ -26,8 +26,8 @@ // Includes. #include "../Indicator/Indicator.h" -#include "../Storage/ValueStorage.all.h" #include "../Platform/Terminal.h" +#include "../Storage/ValueStorage.all.h" // Defines. #ifdef __MQL4__ diff --git a/Indicators/Indi_ZigZagColor.mqh b/Indicators/Indi_ZigZagColor.mqh index 55100a2f7..c26a08007 100644 --- a/Indicators/Indi_ZigZagColor.mqh +++ b/Indicators/Indi_ZigZagColor.mqh @@ -25,8 +25,8 @@ #define INDI_ZIGZAG_COLOR_MIN_BARS 100 // Includes. -#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Indicator/Indicator.h" +#include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Storage/ValueStorage.all.h" #include "Indi_ZigZag.mqh" diff --git a/Indicators/OHLC/Indi_OHLC.mqh b/Indicators/OHLC/Indi_OHLC.mqh index 8f81bbd59..0dcbddc25 100644 --- a/Indicators/OHLC/Indi_OHLC.mqh +++ b/Indicators/OHLC/Indi_OHLC.mqh @@ -21,8 +21,8 @@ */ // Includes. -#include "../../Storage/Dict/Buffer/BufferStruct.h" #include "../../Indicator/Indicator.h" +#include "../../Storage/Dict/Buffer/BufferStruct.h" #include "../../Storage/Objects.h" // Enums. diff --git a/Indicators/Special/Indi_Math.mqh b/Indicators/Special/Indi_Math.mqh index 4f2d03242..4c622c46b 100644 --- a/Indicators/Special/Indi_Math.mqh +++ b/Indicators/Special/Indi_Math.mqh @@ -21,9 +21,9 @@ */ // Includes. -#include "../../Storage/Dict/Buffer/BufferStruct.h" #include "../../Indicator/Indicator.h" #include "../../Math/Math.enum.h" +#include "../../Storage/Dict/Buffer/BufferStruct.h" enum ENUM_MATH_OP_MODE { MATH_OP_MODE_BUILTIN, MATH_OP_MODE_CUSTOM_FUNCTION }; From 224c8b1df5f52c23ed0dc8d73e948fb74f481c6d Mon Sep 17 00:00:00 2001 From: kenorb Date: Mon, 19 Jun 2023 00:18:56 +0100 Subject: [PATCH 067/109] Indicator/Storage: Code reformats --- Indicator/Indicator.define.h | 53 ++++++++++--------- Indicator/Indicator.h | 10 ++-- Indicator/Indicator.struct.h | 6 +-- Indicator/IndicatorBase.h | 10 ++-- Indicator/IndicatorData.enum.h | 2 +- Indicator/IndicatorData.h | 21 ++++---- Indicator/tests/Indicator.test.mq5 | 2 +- Indicator/tests/IndicatorTf.test.mq5 | 2 +- Storage/Array.h | 2 +- Storage/Cache/tests/IndiBufferCache.test.mq5 | 1 - Storage/Cache/tests/ObjectsCache.test.mq5 | 1 - Storage/Data.struct.h | 4 +- Storage/Data.struct.serialize.h | 2 +- Storage/Database.h | 2 +- Storage/DateTime.entry.h | 2 +- Storage/DateTime.h | 2 +- Storage/DateTime.struct.h | 2 +- Storage/Dict/Buffer/BufferCandle.h | 2 +- Storage/Dict/Buffer/BufferFXT.h | 2 +- Storage/Dict/Buffer/BufferStruct.h | 2 +- Storage/Dict/Buffer/BufferTick.h | 8 +-- Storage/Dict/Buffer/tests/Buffer.test.mq5 | 2 +- .../Dict/Buffer/tests/BufferCandle.test.mq5 | 2 +- Storage/Dict/Buffer/tests/BufferFXT.test.mq5 | 2 +- .../Dict/Buffer/tests/BufferStruct.test.mq5 | 8 +-- Storage/Dict/Dict.h | 4 +- Storage/Dict/DictIteratorBase.h | 2 +- Storage/Dict/DictObject.h | 2 +- Storage/Dict/DictSlotsRef.h | 4 +- Storage/Dict/DictStruct.h | 4 +- Storage/Dict/tests/Dict.test.mq5 | 8 +-- Storage/ItemsHistory.h | 2 +- Storage/MemoryFileSystem.h | 2 +- Storage/Object.h | 4 +- Storage/Objects.h | 2 +- Storage/Redis.h | 6 +-- Storage/String.extern.h | 2 +- Storage/String.h | 2 +- Storage/ValueStorage.h | 30 +++++------ Storage/tests/Collection.test.mq5 | 2 +- Storage/tests/Database.test.mq5 | 4 +- Storage/tests/DateTime.test.mq5 | 2 +- Storage/tests/Redis.test.mq5 | 2 +- Storage/tests/ValueStorage.test.mq5 | 2 +- 44 files changed, 120 insertions(+), 118 deletions(-) diff --git a/Indicator/Indicator.define.h b/Indicator/Indicator.define.h index 498b8eb66..58ee36af8 100644 --- a/Indicator/Indicator.define.h +++ b/Indicator/Indicator.define.h @@ -100,32 +100,33 @@ #define EMPTY_VALUE DBL_MAX #endif -#define INDICATOR_BUILTIN_CALL_AND_RETURN(NATIVE_METHOD_CALL, MODE, SHIFT) \ - int _handle = Object::IsValid(_obj) ? _obj PTR_DEREF Get(IndicatorDataState::INDICATOR_DATA_STATE_PROP_HANDLE) : 0; \ - ARRAY(double, _res); \ - ResetLastError(); \ - if (_handle == 0 || _handle == INVALID_HANDLE) { \ - if ((_handle = NATIVE_METHOD_CALL) == INVALID_HANDLE) { \ - SetUserError(ERR_USER_INVALID_HANDLE); \ - return EMPTY_VALUE; \ - } else if (Object::IsValid(_obj)) { \ - _obj PTR_DEREF SetHandle(_handle); \ - } \ - } \ - if (Terminal::IsVisualMode()) { \ - /* To avoid error 4806 (ERR_INDICATOR_DATA_NOT_FOUND), */ \ - /* we check the number of calculated data only in visual mode. */ \ - int _bars_calc = BarsCalculated(_handle); \ - if (GetLastError() > 0) { \ - return EMPTY_VALUE; \ - } else if (_bars_calc <= 2) { \ - SetUserError(ERR_USER_INVALID_BUFF_NUM); \ - return EMPTY_VALUE; \ - } \ - } \ - if (CopyBuffer(_handle, MODE, SHIFT, 1, _res) < 0) { \ - return ArraySize(_res) > 0 ? _res[0] : EMPTY_VALUE; \ - } \ +#define INDICATOR_BUILTIN_CALL_AND_RETURN(NATIVE_METHOD_CALL, MODE, SHIFT) \ + int _handle = \ + Object::IsValid(_obj) ? _obj PTR_DEREF Get(IndicatorDataState::INDICATOR_DATA_STATE_PROP_HANDLE) : 0; \ + ARRAY(double, _res); \ + ResetLastError(); \ + if (_handle == 0 || _handle == INVALID_HANDLE) { \ + if ((_handle = NATIVE_METHOD_CALL) == INVALID_HANDLE) { \ + SetUserError(ERR_USER_INVALID_HANDLE); \ + return EMPTY_VALUE; \ + } else if (Object::IsValid(_obj)) { \ + _obj PTR_DEREF SetHandle(_handle); \ + } \ + } \ + if (Terminal::IsVisualMode()) { \ + /* To avoid error 4806 (ERR_INDICATOR_DATA_NOT_FOUND), */ \ + /* we check the number of calculated data only in visual mode. */ \ + int _bars_calc = BarsCalculated(_handle); \ + if (GetLastError() > 0) { \ + return EMPTY_VALUE; \ + } else if (_bars_calc <= 2) { \ + SetUserError(ERR_USER_INVALID_BUFF_NUM); \ + return EMPTY_VALUE; \ + } \ + } \ + if (CopyBuffer(_handle, MODE, SHIFT, 1, _res) < 0) { \ + return ArraySize(_res) > 0 ? _res[0] : EMPTY_VALUE; \ + } \ return _res[0]; #define INDI_REQUIRE_BARS_OR_RETURN(_indi, _period, _ret) \ diff --git a/Indicator/Indicator.h b/Indicator/Indicator.h index 26e2d644d..cbc963777 100644 --- a/Indicator/Indicator.h +++ b/Indicator/Indicator.h @@ -28,17 +28,17 @@ struct IndicatorParams; // Includes. -#include "../Storage/Array.h" -#include "../Storage/Dict/Buffer/BufferStruct.h" -#include "../Storage/DateTime.h" #include "../Indicators/DrawIndicator.mqh" -#include "../Storage/Flags.struct.h" #include "../Math/Math.h" -#include "../Storage/Object.h" #include "../Refs.mqh" #include "../Serializer/Serializer.h" #include "../Serializer/SerializerCsv.h" #include "../Serializer/SerializerJson.h" +#include "../Storage/Array.h" +#include "../Storage/DateTime.h" +#include "../Storage/Dict/Buffer/BufferStruct.h" +#include "../Storage/Flags.struct.h" +#include "../Storage/Object.h" #include "../Storage/ValueStorage.h" #include "../Storage/ValueStorage.indicator.h" #include "../Storage/ValueStorage.native.h" diff --git a/Indicator/Indicator.struct.h b/Indicator/Indicator.struct.h index 357ec397b..63c5240ee 100644 --- a/Indicator/Indicator.struct.h +++ b/Indicator/Indicator.struct.h @@ -36,13 +36,13 @@ class Indicator; struct ChartParams; // Includes. -#include "../Storage/Array.h" #include "../Platform/Chart/Chart.struct.tf.h" +#include "../Serializer/SerializerNode.enum.h" +#include "../Storage/Array.h" +#include "../Storage/Cache/IndiBufferCache.h" #include "../Storage/Data.struct.h" #include "../Storage/DateTime.struct.h" -#include "../Serializer/SerializerNode.enum.h" #include "Indicator.enum.h" -#include "../Storage/Cache/IndiBufferCache.h" //#include "Indicator.struct.serialize.h" /* Structure for indicator parameters. */ diff --git a/Indicator/IndicatorBase.h b/Indicator/IndicatorBase.h index 0fee25412..56a4f3274 100644 --- a/Indicator/IndicatorBase.h +++ b/Indicator/IndicatorBase.h @@ -31,17 +31,17 @@ #endif // Includes. -#include "../Storage/Array.h" -#include "../Storage/Dict/Buffer/BufferStruct.h" -#include "../Platform/Chart/Chart.struct.tf.h" -#include "../Storage/DateTime.h" #include "../Log.mqh" -#include "../Storage/Object.h" +#include "../Platform/Chart/Chart.struct.tf.h" #include "../Platform/Platform.extern.h" #include "../Refs.mqh" #include "../Serializer/Serializer.h" #include "../Serializer/SerializerCsv.h" #include "../Serializer/SerializerJson.h" +#include "../Storage/Array.h" +#include "../Storage/DateTime.h" +#include "../Storage/Dict/Buffer/BufferStruct.h" +#include "../Storage/Object.h" #include "../Util.h" /** diff --git a/Indicator/IndicatorData.enum.h b/Indicator/IndicatorData.enum.h index fa7e38823..2a29107e1 100644 --- a/Indicator/IndicatorData.enum.h +++ b/Indicator/IndicatorData.enum.h @@ -67,7 +67,7 @@ enum ENUM_INDI_DATA_VS_TYPE { INDI_DATA_VS_TYPE_PRICE_WEIGHTED, // Candle. INDI_DATA_VS_TYPE_PRICE_BID, // Tick. INDI_DATA_VS_TYPE_PRICE_ASK, // Tick. - // Indexed value storages, available if indicator have buffer at this index: + // Indexed value storages, available if indicator have buffer at this index: INDI_DATA_VS_TYPE_INDEX_0, INDI_DATA_VS_TYPE_INDEX_1, INDI_DATA_VS_TYPE_INDEX_2, diff --git a/Indicator/IndicatorData.h b/Indicator/IndicatorData.h index 55715f30b..80a5b4881 100644 --- a/Indicator/IndicatorData.h +++ b/Indicator/IndicatorData.h @@ -41,6 +41,7 @@ struct ExternInstantiateIndicatorBufferValueStorageDouble { // Includes. #include "../Bar.struct.h" #include "../Platform/Chart/Chart.struct.tf.h" +#include "../Storage/Cache/IndiBufferCache.h" #include "../Storage/Flags.struct.h" #include "../Storage/IValueStorage.h" #include "../Storage/ItemsHistory.h" @@ -48,7 +49,6 @@ struct ExternInstantiateIndicatorBufferValueStorageDouble { #include "Indicator.enum.h" #include "IndicatorBase.h" #include "IndicatorData.enum.h" -#include "../Storage/Cache/IndiBufferCache.h" #include "IndicatorData.struct.h" #include "IndicatorData.struct.serialize.h" #include "IndicatorData.struct.signal.h" @@ -67,7 +67,7 @@ class IndicatorData : public IndicatorBase { int last_tick_index; // Index of the last tick. long first_tick_time_ms; // Time of the first ask/bid tick. void* mydata; - bool last_tick_result; // Result of the last Tick() invocation. + bool last_tick_result; // Result of the last Tick() invocation. ENUM_INDI_DATA_VS_TYPE retarget_ap_av; // Value storage type to be used as applied price/volume. ARRAY(Ref, value_storages); ARRAY(WeakRef, listeners); // List of indicators that listens for events from this one. @@ -854,10 +854,13 @@ class IndicatorData : public IndicatorBase { * Checks whether current indicator has all buffers required to be a Candle-compatible indicator. */ bool IsCandleIndicator() { - return HasSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_OPEN) && HasSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_HIGH) && - HasSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_LOW) && HasSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_CLOSE) && - HasSpecificValueStorage(INDI_DATA_VS_TYPE_SPREAD) && HasSpecificValueStorage(INDI_DATA_VS_TYPE_TICK_VOLUME) && - HasSpecificValueStorage(INDI_DATA_VS_TYPE_TIME) && HasSpecificValueStorage(INDI_DATA_VS_TYPE_VOLUME); + return HasSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_OPEN) && + HasSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_HIGH) && + HasSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_LOW) && + HasSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_CLOSE) && + HasSpecificValueStorage(INDI_DATA_VS_TYPE_SPREAD) && + HasSpecificValueStorage(INDI_DATA_VS_TYPE_TICK_VOLUME) && HasSpecificValueStorage(INDI_DATA_VS_TYPE_TIME) && + HasSpecificValueStorage(INDI_DATA_VS_TYPE_VOLUME); } /* Tick methods */ @@ -866,9 +869,9 @@ class IndicatorData : public IndicatorBase { * Checks whether current indicator has all buffers required to be a Tick-compatible indicator. */ bool IsTickIndicator() { - return HasSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_ASK) && HasSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_BID) && - HasSpecificValueStorage(INDI_DATA_VS_TYPE_SPREAD) && HasSpecificValueStorage(INDI_DATA_VS_TYPE_VOLUME) && - HasSpecificValueStorage(INDI_DATA_VS_TYPE_TICK_VOLUME); + return HasSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_ASK) && + HasSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_BID) && HasSpecificValueStorage(INDI_DATA_VS_TYPE_SPREAD) && + HasSpecificValueStorage(INDI_DATA_VS_TYPE_VOLUME) && HasSpecificValueStorage(INDI_DATA_VS_TYPE_TICK_VOLUME); } bool Tick(int _global_tick_index) { diff --git a/Indicator/tests/Indicator.test.mq5 b/Indicator/tests/Indicator.test.mq5 index e19ea6711..ccea13b35 100644 --- a/Indicator/tests/Indicator.test.mq5 +++ b/Indicator/tests/Indicator.test.mq5 @@ -25,8 +25,8 @@ */ // Includes. -#include "../Indicator.h" #include "../../Test.mqh" +#include "../Indicator.h" /** * Implements OnInit(). diff --git a/Indicator/tests/IndicatorTf.test.mq5 b/Indicator/tests/IndicatorTf.test.mq5 index bdb902f51..a136b6801 100644 --- a/Indicator/tests/IndicatorTf.test.mq5 +++ b/Indicator/tests/IndicatorTf.test.mq5 @@ -27,11 +27,11 @@ */ // Includes. -#include "../../Storage/Dict/DictBase.h" #include "../../Indicators/Indi_AMA.mqh" #include "../../Indicators/Tick/Indi_TickMt.h" #include "../../Log.mqh" #include "../../Platform/Platform.h" +#include "../../Storage/Dict/DictBase.h" #include "../../SymbolInfo.mqh" #include "../../Test.mqh" #include "../../Util.h" diff --git a/Storage/Array.h b/Storage/Array.h index 0952802b7..5486e3ee9 100644 --- a/Storage/Array.h +++ b/Storage/Array.h @@ -26,11 +26,11 @@ #endif // Includes. -#include "Array.extern.h" #include "../Common.extern.h" #include "../Convert.extern.h" #include "../Math/Math.extern.h" #include "../Std.h" +#include "Array.extern.h" #include "String.extern.h" // Defines. diff --git a/Storage/Cache/tests/IndiBufferCache.test.mq5 b/Storage/Cache/tests/IndiBufferCache.test.mq5 index 73c06569d..39ae3bbe0 100644 --- a/Storage/Cache/tests/IndiBufferCache.test.mq5 +++ b/Storage/Cache/tests/IndiBufferCache.test.mq5 @@ -32,7 +32,6 @@ * Implements OnInit(). */ int OnInit() { - // @todo: Add more tests. // ... diff --git a/Storage/Cache/tests/ObjectsCache.test.mq5 b/Storage/Cache/tests/ObjectsCache.test.mq5 index 455fede3c..5fcf02d1a 100644 --- a/Storage/Cache/tests/ObjectsCache.test.mq5 +++ b/Storage/Cache/tests/ObjectsCache.test.mq5 @@ -32,7 +32,6 @@ * Implements OnInit(). */ int OnInit() { - // @todo: Add more tests. // ... diff --git a/Storage/Data.struct.h b/Storage/Data.struct.h index 743cc9c7e..028f560be 100644 --- a/Storage/Data.struct.h +++ b/Storage/Data.struct.h @@ -36,11 +36,11 @@ struct MqlParam; struct MqlRates; // Includes. -#include "Data.enum.h" -#include "DateTime.extern.h" #include "../Serializer/Serializer.enum.h" #include "../Serializer/SerializerNode.enum.h" #include "../Std.h" +#include "Data.enum.h" +#include "DateTime.extern.h" #include "String.h" #ifndef __MQL__ diff --git a/Storage/Data.struct.serialize.h b/Storage/Data.struct.serialize.h index 9ad9d88e2..7ea683617 100644 --- a/Storage/Data.struct.serialize.h +++ b/Storage/Data.struct.serialize.h @@ -31,8 +31,8 @@ #endif // Includes. -#include "Data.struct.h" #include "../Serializer/Serializer.h" +#include "Data.struct.h" /* Method to serialize DataParamEntry struct. */ SerializerNodeType DataParamEntry::Serialize(Serializer &s) { diff --git a/Storage/Database.h b/Storage/Database.h index b4952b83f..c22a17b2d 100644 --- a/Storage/Database.h +++ b/Storage/Database.h @@ -33,8 +33,8 @@ #define DATABASE_H // Includes. -#include "../Storage/Dict/DictStruct.h" #include "../Math/MatrixMini.h" +#include "../Storage/Dict/DictStruct.h" #include "Database.struct.h" // Enums. diff --git a/Storage/DateTime.entry.h b/Storage/DateTime.entry.h index d662fb545..176c43417 100644 --- a/Storage/DateTime.entry.h +++ b/Storage/DateTime.entry.h @@ -31,9 +31,9 @@ #endif // Includes. -#include "DateTime.static.h" #include "../Platform/PlatformTime.h" #include "../Std.h" +#include "DateTime.static.h" struct DateTimeEntry : MqlDateTime { int week_of_year; diff --git a/Storage/DateTime.h b/Storage/DateTime.h index a1dab3d8e..c820bf37d 100644 --- a/Storage/DateTime.h +++ b/Storage/DateTime.h @@ -37,6 +37,7 @@ struct DataParamEntry; // Includes class enum and structs. +#include "../Platform/PlatformTime.h" #include "Array.h" #include "Data.struct.h" #include "DateTime.entry.h" @@ -44,7 +45,6 @@ struct DataParamEntry; #include "DateTime.extern.h" #include "DateTime.static.h" #include "DateTime.struct.h" -#include "../Platform/PlatformTime.h" #ifndef __MQL4__ // Defines global functions (for MQL4 backward compatibility). diff --git a/Storage/DateTime.struct.h b/Storage/DateTime.struct.h index 3755740b5..7e47cabff 100644 --- a/Storage/DateTime.struct.h +++ b/Storage/DateTime.struct.h @@ -31,8 +31,8 @@ #endif // Includes. -#include "DateTime.enum.h" #include "../Std.h" +#include "DateTime.enum.h" #ifndef __MQLBUILD__ /** diff --git a/Storage/Dict/Buffer/BufferCandle.h b/Storage/Dict/Buffer/BufferCandle.h index f68b62edb..e616796ee 100644 --- a/Storage/Dict/Buffer/BufferCandle.h +++ b/Storage/Dict/Buffer/BufferCandle.h @@ -25,10 +25,10 @@ #define BUFFER_CANDLE_H // Includes. -#include "BufferStruct.h" #include "../../../Candle.struct.h" #include "../../../Serializer/SerializerConverter.h" #include "../../../Serializer/SerializerJson.h" +#include "BufferStruct.h" /** * Class to store struct data. diff --git a/Storage/Dict/Buffer/BufferFXT.h b/Storage/Dict/Buffer/BufferFXT.h index df765a52a..1a8f42803 100644 --- a/Storage/Dict/Buffer/BufferFXT.h +++ b/Storage/Dict/Buffer/BufferFXT.h @@ -25,9 +25,9 @@ // Includes. #include "../../../Exchange/Account/AccountMt.h" -#include "../DictStruct.h" #include "../../../Indicator/IndicatorData.h" #include "../../../Storage/Object.h" +#include "../DictStruct.h" // Defines. #define FXT_VERSION 405 diff --git a/Storage/Dict/Buffer/BufferStruct.h b/Storage/Dict/Buffer/BufferStruct.h index d8688e5c8..ca5906759 100644 --- a/Storage/Dict/Buffer/BufferStruct.h +++ b/Storage/Dict/Buffer/BufferStruct.h @@ -25,9 +25,9 @@ #define BUFFER_STRUCT_H // Includes. +#include "../../../Serializer/Serializer.h" #include "../DictBase.h" #include "../DictStruct.h" -#include "../../../Serializer/Serializer.h" /** * Implements BufferStruct's Overflow Listener. diff --git a/Storage/Dict/Buffer/BufferTick.h b/Storage/Dict/Buffer/BufferTick.h index e074fb0fe..4998cd4e9 100644 --- a/Storage/Dict/Buffer/BufferTick.h +++ b/Storage/Dict/Buffer/BufferTick.h @@ -25,10 +25,10 @@ #define BUFFER_TICK_H // Includes. -#include "BufferStruct.h" #include "../../../Platform/Chart/Chart.enum.h" -#include "../../IValueStorage.h" #include "../../../Tick/Tick.struct.h" +#include "../../IValueStorage.h" +#include "BufferStruct.h" // Forward declarations. template @@ -40,8 +40,8 @@ class BufferTickValueStorage : ValueStorage { // Poiner to buffer to take tick from. BufferTick *buffer_tick; - // INDI_DATA_VS_TYPE_PRICE_ASK, INDI_DATA_VS_TYPE_PRICE_BID, INDI_DATA_VS_TYPE_SPREAD, INDI_DATA_VS_TYPE_TICK_VOLUME or - // INDI_DATA_VS_TYPE_VOLUME. + // INDI_DATA_VS_TYPE_PRICE_ASK, INDI_DATA_VS_TYPE_PRICE_BID, INDI_DATA_VS_TYPE_SPREAD, INDI_DATA_VS_TYPE_TICK_VOLUME + // or INDI_DATA_VS_TYPE_VOLUME. ENUM_INDI_DATA_VS_TYPE vs_type; public: diff --git a/Storage/Dict/Buffer/tests/Buffer.test.mq5 b/Storage/Dict/Buffer/tests/Buffer.test.mq5 index 4f387b15b..051c2bae9 100644 --- a/Storage/Dict/Buffer/tests/Buffer.test.mq5 +++ b/Storage/Dict/Buffer/tests/Buffer.test.mq5 @@ -25,8 +25,8 @@ */ // Includes -#include "../Buffer.h" #include "../../../../Test.mqh" +#include "../Buffer.h" /** * Implements OnInit(). diff --git a/Storage/Dict/Buffer/tests/BufferCandle.test.mq5 b/Storage/Dict/Buffer/tests/BufferCandle.test.mq5 index cb6fbfb72..97aa9b86d 100644 --- a/Storage/Dict/Buffer/tests/BufferCandle.test.mq5 +++ b/Storage/Dict/Buffer/tests/BufferCandle.test.mq5 @@ -32,7 +32,7 @@ * Implements OnInit(). */ int OnInit() { - BufferCandle buffer1; // 128 + BufferCandle buffer1; // 128 CandleOHLC _ohlc_d; // 32 CandleOHLC _ohlc_f; // 16 CandleTOHLC _tohlc_d; // 32 diff --git a/Storage/Dict/Buffer/tests/BufferFXT.test.mq5 b/Storage/Dict/Buffer/tests/BufferFXT.test.mq5 index 4035ef991..72ee367bb 100644 --- a/Storage/Dict/Buffer/tests/BufferFXT.test.mq5 +++ b/Storage/Dict/Buffer/tests/BufferFXT.test.mq5 @@ -25,9 +25,9 @@ */ // Includes -#include "../BufferFXT.h" #include "../../../../Platform/Platform.h" #include "../../../../Test.mqh" +#include "../BufferFXT.h" BufferFXT *ticks; diff --git a/Storage/Dict/Buffer/tests/BufferStruct.test.mq5 b/Storage/Dict/Buffer/tests/BufferStruct.test.mq5 index 2310d0981..59f0308a7 100644 --- a/Storage/Dict/Buffer/tests/BufferStruct.test.mq5 +++ b/Storage/Dict/Buffer/tests/BufferStruct.test.mq5 @@ -25,14 +25,14 @@ */ // Includes -#include "../BufferStruct.h" -#include "../../../Data.define.h" -#include "../../../Data.struct.h" -#include "../../../Data.struct.serialize.h" #include "../../../../Serializer/SerializerConverter.h" #include "../../../../Serializer/SerializerJSON.h" #include "../../../../Std.h" #include "../../../../Test.mqh" +#include "../../../Data.define.h" +#include "../../../Data.struct.h" +#include "../../../Data.struct.serialize.h" +#include "../BufferStruct.h" /** * Implements OnInit(). diff --git a/Storage/Dict/Dict.h b/Storage/Dict/Dict.h index 001606545..3e23885e3 100644 --- a/Storage/Dict/Dict.h +++ b/Storage/Dict/Dict.h @@ -25,11 +25,11 @@ #define DICT_H #include "../../Convert.basic.h" -#include "DictBase.h" -#include "DictIteratorBase.h" #include "../../Math/Matrix.h" #include "../../Serializer/Serializer.h" #include "../../Serializer/SerializerNodeIterator.h" +#include "DictBase.h" +#include "DictIteratorBase.h" template class DictIterator : public DictIteratorBase { diff --git a/Storage/Dict/DictIteratorBase.h b/Storage/Dict/DictIteratorBase.h index a50760bbf..4714239ab 100644 --- a/Storage/Dict/DictIteratorBase.h +++ b/Storage/Dict/DictIteratorBase.h @@ -29,9 +29,9 @@ template class DictBase; +#include "../../Serializer/SerializerConversions.h" #include "DictBase.h" #include "DictSlotsRef.h" -#include "../../Serializer/SerializerConversions.h" template class DictIteratorBase { diff --git a/Storage/Dict/DictObject.h b/Storage/Dict/DictObject.h index 39de1edfb..f48f48513 100644 --- a/Storage/Dict/DictObject.h +++ b/Storage/Dict/DictObject.h @@ -26,9 +26,9 @@ #endif #include "../../Convert.basic.h" -#include "DictBase.h" #include "../../Serializer/Serializer.h" #include "../../Serializer/SerializerNodeIterator.h" +#include "DictBase.h" template class DictObjectIterator : public DictIteratorBase { diff --git a/Storage/Dict/DictSlotsRef.h b/Storage/Dict/DictSlotsRef.h index 78bf4e854..4166d829c 100644 --- a/Storage/Dict/DictSlotsRef.h +++ b/Storage/Dict/DictSlotsRef.h @@ -31,11 +31,11 @@ #endif // Includes. +#include "../../Std.h" #include "../../Storage/Array.h" +#include "../../Util.h" #include "Dict.enum.h" #include "DictSlot.h" -#include "../../Std.h" -#include "../../Util.h" // Forward class declaration. template diff --git a/Storage/Dict/DictStruct.h b/Storage/Dict/DictStruct.h index cbd4ea7dc..fd1ca79c6 100644 --- a/Storage/Dict/DictStruct.h +++ b/Storage/Dict/DictStruct.h @@ -27,10 +27,10 @@ // Includes. #include "../../Convert.basic.h" -#include "DictBase.h" -#include "DictIteratorBase.h" #include "../../Serializer/Serializer.h" #include "../../Serializer/SerializerNodeIterator.h" +#include "DictBase.h" +#include "DictIteratorBase.h" // DictIterator could be used as DictStruct iterator. #define DictStructIterator DictIteratorBase diff --git a/Storage/Dict/tests/Dict.test.mq5 b/Storage/Dict/tests/Dict.test.mq5 index f68feb22d..206856ec7 100644 --- a/Storage/Dict/tests/Dict.test.mq5 +++ b/Storage/Dict/tests/Dict.test.mq5 @@ -25,14 +25,14 @@ */ // Includes. -#include "../Dict.h" -#include "../DictObject.h" -#include "../DictStruct.h" -#include "../../../Storage/Object.h" #include "../../../Serializer/Serializer.h" #include "../../../Serializer/SerializerConverter.h" #include "../../../Serializer/SerializerJson.h" +#include "../../../Storage/Object.h" #include "../../../Test.mqh" +#include "../Dict.h" +#include "../DictObject.h" +#include "../DictStruct.h" class DictTestClass { public: diff --git a/Storage/ItemsHistory.h b/Storage/ItemsHistory.h index 1764fb7c2..c5454b894 100644 --- a/Storage/ItemsHistory.h +++ b/Storage/ItemsHistory.h @@ -29,8 +29,8 @@ #pragma once #endif -#include "../Storage/Dict/DictStruct.h" #include "../Refs.mqh" +#include "../Storage/Dict/DictStruct.h" /** * Direction used by ItemsHistoryItemProvider's methods. diff --git a/Storage/MemoryFileSystem.h b/Storage/MemoryFileSystem.h index 24deae0ab..dd8272fd7 100644 --- a/Storage/MemoryFileSystem.h +++ b/Storage/MemoryFileSystem.h @@ -31,8 +31,8 @@ // Includes. #include -#include "../Storage/Dict/DictStruct.h" #include "../File.define.h" +#include "../Storage/Dict/DictStruct.h" #include "../Storage/String.h" class MemoryFileSystemFile : public Dynamic { diff --git a/Storage/Object.h b/Storage/Object.h index ce9287394..85bd312f9 100644 --- a/Storage/Object.h +++ b/Storage/Object.h @@ -25,10 +25,10 @@ #define OBJECT_H // Includes. -#include "Object.enum.h" -#include "Object.extern.h" #include "../Refs.mqh" #include "../Refs.struct.h" +#include "Object.enum.h" +#include "Object.extern.h" #include "String.h" /** diff --git a/Storage/Objects.h b/Storage/Objects.h index 158f45a7a..329028333 100644 --- a/Storage/Objects.h +++ b/Storage/Objects.h @@ -30,8 +30,8 @@ #endif // Includes. -#include "../Storage/Dict/DictStruct.h" #include "../Refs.mqh" +#include "../Storage/Dict/DictStruct.h" /** * Stores objects to be reused using a string-based key. diff --git a/Storage/Redis.h b/Storage/Redis.h index 6daebb9c3..995eabf86 100644 --- a/Storage/Redis.h +++ b/Storage/Redis.h @@ -24,13 +24,13 @@ * @file * Implements class for storing/retrieving Redis database data. */ -#include "Dict/Dict.h" -#include "Object.h" -#include "Redis.struct.h" #include "../Serializer/Serializer.h" #include "../Serializer/SerializerConversions.h" #include "../Serializer/SerializerJson.h" #include "../Socket.mqh" +#include "Dict/Dict.h" +#include "Object.h" +#include "Redis.struct.h" enum ENUM_REDIS_VALUE_SET { REDIS_VALUE_SET_ALWAYS, REDIS_VALUE_SET_IF_NOT_EXIST, REDIS_VALUE_SET_IF_ALREADY_EXIST }; diff --git a/Storage/String.extern.h b/Storage/String.extern.h index 401d5a9a4..e5dcc76dc 100644 --- a/Storage/String.extern.h +++ b/Storage/String.extern.h @@ -34,8 +34,8 @@ #include #include "../Math/Math.extern.h" -#include "../Std.h" #include "../Platform/Terminal.define.h" +#include "../Std.h" // Define external global functions. double StringToDouble(string value) { return std::stod(value); } diff --git a/Storage/String.h b/Storage/String.h index e0e198885..73ced295d 100644 --- a/Storage/String.h +++ b/Storage/String.h @@ -25,9 +25,9 @@ #define STRING_MQH // Includes. -#include "Array.extern.h" #include "../Common.extern.h" #include "../Std.h" +#include "Array.extern.h" #include "String.extern.h" // Defines. diff --git a/Storage/ValueStorage.h b/Storage/ValueStorage.h index b512c55c0..6eb3c4277 100644 --- a/Storage/ValueStorage.h +++ b/Storage/ValueStorage.h @@ -67,10 +67,10 @@ enum ENUM_IPEAK { IPEAK_LOWEST, IPEAK_HIGHEST }; #define INDICATOR_CALCULATE_GET_PARAMS_SHORT _cache.GetTotal(), _cache.GetPrevCalculated(), 0, _cache.GetPriceBuffer() -#define INDICATOR_CALCULATE_POPULATE_CACHE(INDI, KEY) \ - IndiBufferCache *_cache; \ - string _key = Util::MakeKey(INDI PTR_DEREF GetId(), KEY); \ - if (!Objects>::TryGet(_key, _cache)) { \ +#define INDICATOR_CALCULATE_POPULATE_CACHE(INDI, KEY) \ + IndiBufferCache *_cache; \ + string _key = Util::MakeKey(INDI PTR_DEREF GetId(), KEY); \ + if (!Objects>::TryGet(_key, _cache)) { \ _cache = Objects>::Set(_key, new IndiBufferCache()); \ } @@ -95,23 +95,23 @@ enum ENUM_IPEAK { IPEAK_LOWEST, IPEAK_HIGHEST }; } \ INDICATOR_CALCULATE_POPULATE_CACHE(INDI, KEY) -#define INDICATOR_CALCULATE_POPULATE_PARAMS_AND_CACHE_LONG(INDI, KEY) \ - IndicatorData *_suitable_ds = INDI PTR_DEREF GetSuitableDataSource(); \ - ValueStorage *_time = \ +#define INDICATOR_CALCULATE_POPULATE_PARAMS_AND_CACHE_LONG(INDI, KEY) \ + IndicatorData *_suitable_ds = INDI PTR_DEREF GetSuitableDataSource(); \ + ValueStorage *_time = \ (ValueStorage *)_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_TIME); \ - ValueStorage *_tick_volume = \ + ValueStorage *_tick_volume = \ (ValueStorage *)_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_TICK_VOLUME); \ - ValueStorage *_volume = \ + ValueStorage *_volume = \ (ValueStorage *)_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_VOLUME); \ - ValueStorage *_spread = \ + ValueStorage *_spread = \ (ValueStorage *)_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_SPREAD); \ - ValueStorage *_price_open = \ + ValueStorage *_price_open = \ (ValueStorage *)_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_OPEN); \ - ValueStorage *_price_high = \ + ValueStorage *_price_high = \ (ValueStorage *)_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_HIGH); \ - ValueStorage *_price_low = \ + ValueStorage *_price_low = \ (ValueStorage *)_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_LOW); \ - ValueStorage *_price_close = \ + ValueStorage *_price_close = \ (ValueStorage *)_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_CLOSE); \ INDICATOR_CALCULATE_POPULATE_CACHE(INDI, KEY) @@ -121,8 +121,8 @@ enum ENUM_IPEAK { IPEAK_LOWEST, IPEAK_HIGHEST }; #define INDICATOR_CALCULATE_POPULATED_PARAMS_SHORT _price // Includes. -#include "Array.h" #include "../Util.h" +#include "Array.h" #include "IValueStorage.h" #include "ValueStorage.accessor.h" diff --git a/Storage/tests/Collection.test.mq5 b/Storage/tests/Collection.test.mq5 index 2ad418f16..c5cd3fa8b 100644 --- a/Storage/tests/Collection.test.mq5 +++ b/Storage/tests/Collection.test.mq5 @@ -25,8 +25,8 @@ */ // Includes. -#include "../Collection.h" #include "../../Test.mqh" +#include "../Collection.h" // Define classes. class Stack : public Object { diff --git a/Storage/tests/Database.test.mq5 b/Storage/tests/Database.test.mq5 index a14a2880c..94d709e79 100644 --- a/Storage/tests/Database.test.mq5 +++ b/Storage/tests/Database.test.mq5 @@ -28,9 +28,9 @@ #include "../../SymbolInfo.mqh" // FOOBAR pragma: keep // Includes. -#include "../Dict/Buffer/BufferStruct.h" -#include "../Database.h" #include "../../Test.mqh" +#include "../Database.h" +#include "../Dict/Buffer/BufferStruct.h" // Global variables. Database *db; diff --git a/Storage/tests/DateTime.test.mq5 b/Storage/tests/DateTime.test.mq5 index 8a1711188..af54bf4ce 100644 --- a/Storage/tests/DateTime.test.mq5 +++ b/Storage/tests/DateTime.test.mq5 @@ -25,8 +25,8 @@ */ // Includes. -#include "../DateTime.h" #include "../../Test.mqh" +#include "../DateTime.h" /** * Implements OnInit(). diff --git a/Storage/tests/Redis.test.mq5 b/Storage/tests/Redis.test.mq5 index aedb069b9..a8419078d 100644 --- a/Storage/tests/Redis.test.mq5 +++ b/Storage/tests/Redis.test.mq5 @@ -25,9 +25,9 @@ */ // Includes. -#include "../Redis.h" #include "../../Socket.mqh" #include "../../Test.mqh" +#include "../Redis.h" // Properties. #property strict diff --git a/Storage/tests/ValueStorage.test.mq5 b/Storage/tests/ValueStorage.test.mq5 index 2f7f08efa..4cdad4840 100644 --- a/Storage/tests/ValueStorage.test.mq5 +++ b/Storage/tests/ValueStorage.test.mq5 @@ -32,8 +32,8 @@ #include "../../Indicators/Price/Indi_Price.h" #include "../../Serializer/SerializerConverter.h" #include "../../Serializer/SerializerJson.h" -#include "../ValueStorage.h" #include "../../Test.mqh" +#include "../ValueStorage.h" // Global variables. double _test_values[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; From cbb1286a44f28c977603fb043a2d20c69ddc29a4 Mon Sep 17 00:00:00 2001 From: kenorb Date: Mon, 19 Jun 2023 00:47:05 +0100 Subject: [PATCH 068/109] Moves SymbolInfo under Exchange/ --- .../workflows/test-exchange-symbolinfo.yml | 60 +++++++++++++++++++ Convert.mqh | 6 +- Exchange/Account/AccountMt.h | 2 +- Exchange/Exchange.h | 2 +- .../SymbolInfo/SymbolInfo.define.h | 0 .../SymbolInfo/SymbolInfo.enum.h | 0 .../SymbolInfo/SymbolInfo.enum.symbols.h | 0 .../SymbolInfo/SymbolInfo.extern.h | 4 +- .../SymbolInfo/SymbolInfo.h | 6 +- .../SymbolInfo/SymbolInfo.struct.h | 8 +-- .../SymbolInfo/SymbolInfo.struct.static.h | 10 ++-- Exchange/SymbolInfo/tests/Makefile | 12 ++++ Exchange/SymbolInfo/tests/SymbolInfo.test.cpp | 36 +++++++++++ .../SymbolInfo/tests/SymbolInfo.test.mq4 | 2 +- .../SymbolInfo/tests/SymbolInfo.test.mq5 | 4 +- Indicator/IndicatorData.h | 2 +- Indicator/tests/IndicatorTf.test.mq5 | 2 +- Market.mqh | 4 +- Platform/Order.h | 2 +- Platform/Order.struct.h | 2 +- Platform/Orders.h | 1 + Platform/Platform.h | 2 +- Storage/tests/Database.test.mq5 | 2 +- Tester.mqh | 2 +- Ticker.mqh | 2 +- tests/CompileTest.mq5 | 2 +- 26 files changed, 142 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/test-exchange-symbolinfo.yml rename SymbolInfo.define.h => Exchange/SymbolInfo/SymbolInfo.define.h (100%) rename SymbolInfo.enum.h => Exchange/SymbolInfo/SymbolInfo.enum.h (100%) rename SymbolInfo.enum.symbols.h => Exchange/SymbolInfo/SymbolInfo.enum.symbols.h (100%) rename SymbolInfo.extern.h => Exchange/SymbolInfo/SymbolInfo.extern.h (95%) rename SymbolInfo.mqh => Exchange/SymbolInfo/SymbolInfo.h (99%) rename SymbolInfo.struct.h => Exchange/SymbolInfo/SymbolInfo.struct.h (97%) rename SymbolInfo.struct.static.h => Exchange/SymbolInfo/SymbolInfo.struct.static.h (99%) create mode 100644 Exchange/SymbolInfo/tests/Makefile create mode 100644 Exchange/SymbolInfo/tests/SymbolInfo.test.cpp rename tests/SymbolInfoTest.mq4 => Exchange/SymbolInfo/tests/SymbolInfo.test.mq4 (97%) rename tests/SymbolInfoTest.mq5 => Exchange/SymbolInfo/tests/SymbolInfo.test.mq5 (99%) diff --git a/.github/workflows/test-exchange-symbolinfo.yml b/.github/workflows/test-exchange-symbolinfo.yml new file mode 100644 index 000000000..230dfccc2 --- /dev/null +++ b/.github/workflows/test-exchange-symbolinfo.yml @@ -0,0 +1,60 @@ +--- +name: Test Exchange/SymbolInfo + +# yamllint disable-line rule:truthy +on: + pull_request: + paths: + - 'Exchange/SymbolInfo/**' + - '.github/workflows/test-exchange/symbolinfo.yml' + push: + paths: + - 'Exchange/SymbolInfo/**' + - '.github/workflows/test-exchange/symbolinfo.yml' + +jobs: + + Compile: + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + - name: Compile + uses: fx31337/mql-compile-action@master + with: + init-platform: true + path: 'Exchange/SymbolInfo/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@v3 + with: + name: files-ex4 + path: '**/*.ex4' + - name: Upload artifacts (MQL5) + uses: actions/upload-artifact@v3 + with: + name: files-ex5 + path: '**/*.ex5' + + Tests-MQL4: + defaults: + run: + shell: bash + working-directory: Exchange/SymbolInfo/tests + needs: Compile + runs-on: ubuntu-latest + strategy: + matrix: + test: + - SymbolInfo.test + steps: + - uses: actions/download-artifact@v3 + with: + name: files-ex4 + - name: Run ${{ matrix.test }} + uses: fx31337/mql-tester-action@master + with: + Script: ${{ matrix.test }} + timeout-minutes: 10 diff --git a/Convert.mqh b/Convert.mqh index 07f02c2bd..1103756d2 100644 --- a/Convert.mqh +++ b/Convert.mqh @@ -34,9 +34,9 @@ #include "Storage/DateTime.h" #include "Math/Math.extern.h" #include "Platform/Order.enum.h" -#include "SymbolInfo.enum.h" -#include "SymbolInfo.extern.h" -#include "SymbolInfo.struct.static.h" +#include "Exchange/SymbolInfo/SymbolInfo.enum.h" +#include "Exchange/SymbolInfo/SymbolInfo.extern.h" +#include "Exchange/SymbolInfo/SymbolInfo.struct.static.h" /** * Class to provide conversion methods. diff --git a/Exchange/Account/AccountMt.h b/Exchange/Account/AccountMt.h index eb53bed17..36f7fa12f 100644 --- a/Exchange/Account/AccountMt.h +++ b/Exchange/Account/AccountMt.h @@ -36,7 +36,7 @@ class AccountMt; #include "../../Platform/Order.struct.h" #include "../../Platform/Orders.h" #include "../../Serializer/Serializer.h" -#include "../../SymbolInfo.mqh" +#include "../../Exchange/SymbolInfo/SymbolInfo.h" #include "../../Task/TaskCondition.enum.h" #include "../../Trade.struct.h" #include "Account.define.h" diff --git a/Exchange/Exchange.h b/Exchange/Exchange.h index 784416e9b..cefd5847b 100644 --- a/Exchange/Exchange.h +++ b/Exchange/Exchange.h @@ -29,7 +29,7 @@ // Includes. #include "Account/Account.h" #include "../Storage/Dict/DictObject.h" -#include "../SymbolInfo.mqh" +#include "../Exchange/SymbolInfo/SymbolInfo.h" #include "../Trade.mqh" #include "Exchange.struct.h" diff --git a/SymbolInfo.define.h b/Exchange/SymbolInfo/SymbolInfo.define.h similarity index 100% rename from SymbolInfo.define.h rename to Exchange/SymbolInfo/SymbolInfo.define.h diff --git a/SymbolInfo.enum.h b/Exchange/SymbolInfo/SymbolInfo.enum.h similarity index 100% rename from SymbolInfo.enum.h rename to Exchange/SymbolInfo/SymbolInfo.enum.h diff --git a/SymbolInfo.enum.symbols.h b/Exchange/SymbolInfo/SymbolInfo.enum.symbols.h similarity index 100% rename from SymbolInfo.enum.symbols.h rename to Exchange/SymbolInfo/SymbolInfo.enum.symbols.h diff --git a/SymbolInfo.extern.h b/Exchange/SymbolInfo/SymbolInfo.extern.h similarity index 95% rename from SymbolInfo.extern.h rename to Exchange/SymbolInfo/SymbolInfo.extern.h index d95799228..e6577ec2b 100644 --- a/SymbolInfo.extern.h +++ b/Exchange/SymbolInfo/SymbolInfo.extern.h @@ -21,9 +21,9 @@ */ // Includes. -#include "Platform/Order.enum.h" +#include "../../Platform/Order.enum.h" #include "SymbolInfo.enum.h" -#include "Tick/Tick.struct.h" +#include "../../Tick/Tick.struct.h" // Define external global functions. #ifndef __MQL__ diff --git a/SymbolInfo.mqh b/Exchange/SymbolInfo/SymbolInfo.h similarity index 99% rename from SymbolInfo.mqh rename to Exchange/SymbolInfo/SymbolInfo.h index 6e7581194..f62ed4443 100644 --- a/SymbolInfo.mqh +++ b/Exchange/SymbolInfo/SymbolInfo.h @@ -37,9 +37,9 @@ class Log; class SymbolInfo; // Includes. -#include "Log.mqh" -#include "Serializer/Serializer.h" -#include "Serializer/SerializerNode.enum.h" +#include "../../Log.mqh" +#include "../../Serializer/Serializer.h" +#include "../../Serializer/SerializerNode.enum.h" /** * Class to provide symbol information. diff --git a/SymbolInfo.struct.h b/Exchange/SymbolInfo/SymbolInfo.struct.h similarity index 97% rename from SymbolInfo.struct.h rename to Exchange/SymbolInfo/SymbolInfo.struct.h index 46c91e477..866fcd088 100644 --- a/SymbolInfo.struct.h +++ b/Exchange/SymbolInfo/SymbolInfo.struct.h @@ -31,11 +31,11 @@ #endif // Includes. -#include "Serializer/Serializable.h" -#include "Serializer/Serializer.h" -#include "Std.h" +#include "../../Serializer/Serializable.h" +#include "../../Serializer/Serializer.h" +#include "../../Std.h" #include "SymbolInfo.struct.static.h" -#include "Tick/Tick.struct.h" +#include "../../Tick/Tick.struct.h" // Defines struct to store symbol data. struct SymbolInfoEntry diff --git a/SymbolInfo.struct.static.h b/Exchange/SymbolInfo/SymbolInfo.struct.static.h similarity index 99% rename from SymbolInfo.struct.static.h rename to Exchange/SymbolInfo/SymbolInfo.struct.static.h index d6ff0c70e..2ab5f6257 100644 --- a/SymbolInfo.struct.static.h +++ b/Exchange/SymbolInfo/SymbolInfo.struct.static.h @@ -25,13 +25,13 @@ #pragma once #endif -#include "Platform/MQL5.mqh" -#include "Platform/Order.enum.h" -#include "Platform/Platform.extern.h" -#include "Std.h" +#include "../../Platform/MQL5.mqh" +#include "../../Platform/Order.enum.h" +#include "../../Platform/Platform.extern.h" +#include "../../Std.h" #include "SymbolInfo.enum.h" #include "SymbolInfo.extern.h" -#include "Tick/Tick.struct.h" +#include "../../Tick/Tick.struct.h" /** * Struct to provide symbol information. diff --git a/Exchange/SymbolInfo/tests/Makefile b/Exchange/SymbolInfo/tests/Makefile new file mode 100644 index 000000000..e792364f0 --- /dev/null +++ b/Exchange/SymbolInfo/tests/Makefile @@ -0,0 +1,12 @@ +CC := g++ # C++ compiler +CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags +SRCS := $(wildcard *.cpp) # Get all .cpp files in the current directory +OBJS := $(SRCS:.cpp=.o) # Object files corresponding to the source files + +all: $(OBJS) + +%.o: %.cpp + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -v $(OBJS) diff --git a/Exchange/SymbolInfo/tests/SymbolInfo.test.cpp b/Exchange/SymbolInfo/tests/SymbolInfo.test.cpp new file mode 100644 index 000000000..2ac8589ce --- /dev/null +++ b/Exchange/SymbolInfo/tests/SymbolInfo.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of SymbolInfo class. + */ + +// Includes. +#include "../SymbolInfo.h" +#include "../../../Platform/Platform.h" + +int main(int argc, char **argv) { + + // @todo + + return 0; +} diff --git a/tests/SymbolInfoTest.mq4 b/Exchange/SymbolInfo/tests/SymbolInfo.test.mq4 similarity index 97% rename from tests/SymbolInfoTest.mq4 rename to Exchange/SymbolInfo/tests/SymbolInfo.test.mq4 index 7ef7c4c2c..972bc282e 100644 --- a/tests/SymbolInfoTest.mq4 +++ b/Exchange/SymbolInfo/tests/SymbolInfo.test.mq4 @@ -25,4 +25,4 @@ */ // Includes. -#include "SymbolInfoTest.mq5" +#include "SymbolInfo.test.mq5" diff --git a/tests/SymbolInfoTest.mq5 b/Exchange/SymbolInfo/tests/SymbolInfo.test.mq5 similarity index 99% rename from tests/SymbolInfoTest.mq5 rename to Exchange/SymbolInfo/tests/SymbolInfo.test.mq5 index 3318f213b..55f2e2448 100644 --- a/tests/SymbolInfoTest.mq5 +++ b/Exchange/SymbolInfo/tests/SymbolInfo.test.mq5 @@ -25,8 +25,8 @@ */ // Includes. -#include "../SymbolInfo.mqh" -#include "../Test.mqh" +#include "../SymbolInfo.h" +#include "../../../Test.mqh" /** * Implements OnInit(). diff --git a/Indicator/IndicatorData.h b/Indicator/IndicatorData.h index 80a5b4881..fe415e9df 100644 --- a/Indicator/IndicatorData.h +++ b/Indicator/IndicatorData.h @@ -45,7 +45,7 @@ struct ExternInstantiateIndicatorBufferValueStorageDouble { #include "../Storage/Flags.struct.h" #include "../Storage/IValueStorage.h" #include "../Storage/ItemsHistory.h" -#include "../SymbolInfo.struct.h" +#include "../Exchange/SymbolInfo/SymbolInfo.struct.h" #include "Indicator.enum.h" #include "IndicatorBase.h" #include "IndicatorData.enum.h" diff --git a/Indicator/tests/IndicatorTf.test.mq5 b/Indicator/tests/IndicatorTf.test.mq5 index a136b6801..58f48f951 100644 --- a/Indicator/tests/IndicatorTf.test.mq5 +++ b/Indicator/tests/IndicatorTf.test.mq5 @@ -32,7 +32,7 @@ #include "../../Log.mqh" #include "../../Platform/Platform.h" #include "../../Storage/Dict/DictBase.h" -#include "../../SymbolInfo.mqh" +#include "../../Exchange/SymbolInfo/SymbolInfo.h" #include "../../Test.mqh" #include "../../Util.h" #include "../IndicatorTf.h" diff --git a/Market.mqh b/Market.mqh index b78fa7977..47d7a516c 100644 --- a/Market.mqh +++ b/Market.mqh @@ -28,8 +28,8 @@ #include "Market.struct.h" #include "Math/Math.h" #include "Serializer/Serializer.h" -#include "SymbolInfo.mqh" -#include "SymbolInfo.struct.static.h" +#include "Exchange/SymbolInfo/SymbolInfo.h" +#include "Exchange/SymbolInfo/SymbolInfo.struct.static.h" #include "Task/TaskCondition.enum.h" /** diff --git a/Platform/Order.h b/Platform/Order.h index ef1aa45e8..4e0f14a19 100644 --- a/Platform/Order.h +++ b/Platform/Order.h @@ -47,7 +47,7 @@ class SymbolInfo; #include "../Serializer/SerializerJson.h" #include "../Std.h" #include "../Storage/String.h" -#include "../SymbolInfo.mqh" +#include "../Exchange/SymbolInfo/SymbolInfo.h" #include "../Task/TaskAction.enum.h" /* Defines for backward compatibility. */ diff --git a/Platform/Order.struct.h b/Platform/Order.struct.h index 0b6aa9d61..be4d53b2b 100644 --- a/Platform/Order.struct.h +++ b/Platform/Order.struct.h @@ -35,7 +35,7 @@ #include "Order.enum.h" #include "Platform.extern.h" #include "../Serializer/Serializer.h" -#include "../SymbolInfo.struct.static.h" +#include "../Exchange/SymbolInfo/SymbolInfo.struct.static.h" #include "Terminal.h" #ifndef __MQL5__ diff --git a/Platform/Orders.h b/Platform/Orders.h index 93fc2ded7..6341f2002 100644 --- a/Platform/Orders.h +++ b/Platform/Orders.h @@ -25,6 +25,7 @@ class Orders; // Includes. #include "../Exchange/Account/Account.h" +#include "../Exchange/SymbolInfo/SymbolInfo.struct.static.h" #include "Chart/Chart.struct.static.h" #include "../Log.mqh" #include "../Math/Math.h" diff --git a/Platform/Platform.h b/Platform/Platform.h index 35903ea95..e5910add4 100644 --- a/Platform/Platform.h +++ b/Platform/Platform.h @@ -59,7 +59,7 @@ extern int Bars(CONST_REF_TO(string) _symbol, ENUM_TIMEFRAMES _tf); #include "../Indicators/Tick/Indi_TickProvider.h" #define PLATFORM_DEFAULT_INDICATOR_TICK Indi_TickProvider #endif -#include "../SymbolInfo.struct.static.h" +#include "../Exchange/SymbolInfo/SymbolInfo.struct.static.h" class Platform { // Whether Init() was already called. diff --git a/Storage/tests/Database.test.mq5 b/Storage/tests/Database.test.mq5 index 94d709e79..0ddda6d1d 100644 --- a/Storage/tests/Database.test.mq5 +++ b/Storage/tests/Database.test.mq5 @@ -25,7 +25,7 @@ */ // Need to be include before Database.h. -#include "../../SymbolInfo.mqh" // FOOBAR pragma: keep +#include "../../Exchange/SymbolInfo/SymbolInfo.h" // FOOBAR pragma: keep // Includes. #include "../../Test.mqh" diff --git a/Tester.mqh b/Tester.mqh index 9f4fb4ed3..0538230cf 100644 --- a/Tester.mqh +++ b/Tester.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "SymbolInfo.mqh" +#include "Exchange/SymbolInfo/SymbolInfo.h" #include "Platform/Terminal.h" /** diff --git a/Ticker.mqh b/Ticker.mqh index 53b7097d7..a1d90d55c 100644 --- a/Ticker.mqh +++ b/Ticker.mqh @@ -30,7 +30,7 @@ class Chart; // Includes. #include "Platform/Chart/Chart.h" #include "Log.mqh" -#include "SymbolInfo.mqh" +#include "Exchange/SymbolInfo/SymbolInfo.h" //#include "Market.mqh" // Define an assert macros. diff --git a/tests/CompileTest.mq5 b/tests/CompileTest.mq5 index 0fc665dbf..e00a17cbd 100644 --- a/tests/CompileTest.mq5 +++ b/tests/CompileTest.mq5 @@ -88,7 +88,7 @@ struct IndicatorParams; #include "../Strategy.mqh" #include "../Storage/String.h" #include "../SummaryReport.mqh" -#include "../SymbolInfo.mqh" +#include "../Exchange/SymbolInfo/SymbolInfo.h" #include "../Task/Task.h" #include "../Task/TaskAction.h" #include "../Task/TaskCondition.h" From 157ea063d722447b6edfd0e2ad808b9c5ef7353b Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 18 Jun 2023 23:55:54 +0100 Subject: [PATCH 069/109] Adds more CPP tests --- Exchange/Account/tests/Account.test.cpp | 2 +- Exchange/Account/tests/AccountBase.test.cpp | 2 +- Exchange/Account/tests/AccountForex.test.cpp | 2 +- Exchange/Account/tests/AccountMt.test.cpp | 2 +- Exchange/SymbolInfo/tests/SymbolInfo.test.cpp | 2 +- Exchange/tests/Exchange.test.cpp | 2 +- Indicator/tests/Indicator.test.cpp | 36 ++++++++++++++ Indicator/tests/IndicatorBase.test.cpp | 2 +- Indicator/tests/IndicatorCandle.test.cpp | 36 ++++++++++++++ Indicator/tests/IndicatorData.test.cpp | 36 ++++++++++++++ Indicator/tests/IndicatorRenko.test.cpp | 36 ++++++++++++++ Indicator/tests/IndicatorTf.test.cpp | 37 ++++++++++++++ Indicator/tests/IndicatorTick.test.cpp | 36 ++++++++++++++ Indicators/OHLC/tests/Indi_OHLC.test.cpp | 1 + Indicators/Price/tests/Indi_Price.test.cpp | 2 +- Indicators/tests/DrawIndicator.test.cpp | 2 +- Math/tests/Math.test.cpp | 2 +- Math/tests/Matrix.test.cpp | 2 +- Math/tests/MatrixMini.test.cpp | 36 ++++++++++++++ Platform/Chart/README.md | 1 + Platform/Chart/tests/Chart.test.cpp | 2 +- Platform/Chart/tests/ChartMt.test.cpp | 36 ++++++++++++++ Platform/Chart3D/tests/Chart3D.test.cpp | 36 ++++++++++++++ Platform/Chart3D/tests/Makefile | 12 +++++ Platform/Web/tests/Makefile | 12 +++++ Platform/Web/tests/Web.test.cpp | 48 +++++++++++++++++++ Platform/tests/Order.test.cpp | 1 - Platform/tests/OrderQuery.test.cpp | 2 +- Platform/tests/Orders.test.cpp | 1 - Platform/tests/Platform.test.cpp | 1 - Platform/tests/Plot.test.cpp | 34 +++++++++++++ Platform/tests/Terminal.test.cpp | 1 - Serializer/tests/Serializable.test.cpp | 2 +- Serializer/tests/Serializer.test.cpp | 36 ++++++++++++++ Serializer/tests/SerializerBinary.test.cpp | 36 ++++++++++++++ .../tests/SerializerConversions.test.cpp | 36 ++++++++++++++ Serializer/tests/SerializerConverter.test.cpp | 36 ++++++++++++++ Serializer/tests/SerializerCsv.test.cpp | 36 ++++++++++++++ Serializer/tests/SerializerDict.test.cpp | 36 ++++++++++++++ Serializer/tests/SerializerJson.test.cpp | 36 ++++++++++++++ Serializer/tests/SerializerNode.test.cpp | 36 ++++++++++++++ .../tests/SerializerNodeIterator.test.cpp | 36 ++++++++++++++ Serializer/tests/SerializerNodeParam.test.cpp | 36 ++++++++++++++ Serializer/tests/SerializerObject.test.cpp | 36 ++++++++++++++ Serializer/tests/SerializerSqlite.test.cpp | 36 ++++++++++++++ Storage/Cache/tests/IndiBufferCache.test.cpp | 1 - Storage/Cache/tests/ObjectsCache.test.cpp | 1 - Storage/Dict/Buffer/tests/Buffer.test.cpp | 36 ++++++++++++++ .../Dict/Buffer/tests/BufferCandle.test.cpp | 36 ++++++++++++++ .../Buffer/tests/BufferCompileAll.test.cpp | 38 +++++++++++++++ Storage/Dict/Buffer/tests/BufferFXT.test.cpp | 36 ++++++++++++++ .../Dict/Buffer/tests/BufferStruct.test.cpp | 36 ++++++++++++++ Storage/Dict/Buffer/tests/BufferTick.test.cpp | 36 ++++++++++++++ Storage/Dict/tests/Dict.test.cpp | 36 ++++++++++++++ Storage/tests/Database.test.cpp | 36 ++++++++++++++ Storage/tests/ItemsHistory.test.cpp | 34 +++++++++++++ Storage/tests/Object.test.cpp | 41 ++++++++++++++++ Storage/tests/Redis.test.cpp | 36 ++++++++++++++ Storage/tests/ValueStorage.test.cpp | 36 ++++++++++++++ Task/tests/TaskSetter.test.cpp | 3 +- Tick/tests/TickManager.test.cpp | 1 + Trade/tests/TradeSignal.test.cpp | 2 +- Trade/tests/TradeSignalManager.test.cpp | 2 +- 63 files changed, 1321 insertions(+), 23 deletions(-) create mode 100644 Indicator/tests/Indicator.test.cpp create mode 100644 Indicator/tests/IndicatorCandle.test.cpp create mode 100644 Indicator/tests/IndicatorData.test.cpp create mode 100644 Indicator/tests/IndicatorRenko.test.cpp create mode 100644 Indicator/tests/IndicatorTf.test.cpp create mode 100644 Indicator/tests/IndicatorTick.test.cpp create mode 100644 Math/tests/MatrixMini.test.cpp create mode 100644 Platform/Chart/README.md create mode 100644 Platform/Chart/tests/ChartMt.test.cpp create mode 100644 Platform/Chart3D/tests/Chart3D.test.cpp create mode 100644 Platform/Chart3D/tests/Makefile create mode 100644 Platform/Web/tests/Makefile create mode 100644 Platform/Web/tests/Web.test.cpp create mode 100644 Platform/tests/Plot.test.cpp create mode 100644 Serializer/tests/Serializer.test.cpp create mode 100644 Serializer/tests/SerializerBinary.test.cpp create mode 100644 Serializer/tests/SerializerConversions.test.cpp create mode 100644 Serializer/tests/SerializerConverter.test.cpp create mode 100644 Serializer/tests/SerializerCsv.test.cpp create mode 100644 Serializer/tests/SerializerDict.test.cpp create mode 100644 Serializer/tests/SerializerJson.test.cpp create mode 100644 Serializer/tests/SerializerNode.test.cpp create mode 100644 Serializer/tests/SerializerNodeIterator.test.cpp create mode 100644 Serializer/tests/SerializerNodeParam.test.cpp create mode 100644 Serializer/tests/SerializerObject.test.cpp create mode 100644 Serializer/tests/SerializerSqlite.test.cpp create mode 100644 Storage/Dict/Buffer/tests/Buffer.test.cpp create mode 100644 Storage/Dict/Buffer/tests/BufferCandle.test.cpp create mode 100644 Storage/Dict/Buffer/tests/BufferCompileAll.test.cpp create mode 100644 Storage/Dict/Buffer/tests/BufferFXT.test.cpp create mode 100644 Storage/Dict/Buffer/tests/BufferStruct.test.cpp create mode 100644 Storage/Dict/Buffer/tests/BufferTick.test.cpp create mode 100644 Storage/Dict/tests/Dict.test.cpp create mode 100644 Storage/tests/Database.test.cpp create mode 100644 Storage/tests/ItemsHistory.test.cpp create mode 100644 Storage/tests/Object.test.cpp create mode 100644 Storage/tests/Redis.test.cpp create mode 100644 Storage/tests/ValueStorage.test.cpp diff --git a/Exchange/Account/tests/Account.test.cpp b/Exchange/Account/tests/Account.test.cpp index a71e2714b..c5bb725bf 100644 --- a/Exchange/Account/tests/Account.test.cpp +++ b/Exchange/Account/tests/Account.test.cpp @@ -26,10 +26,10 @@ // Includes. #include "../Account.h" + #include "../../../Platform/Platform.h" int main(int argc, char **argv) { - // @todo return 0; diff --git a/Exchange/Account/tests/AccountBase.test.cpp b/Exchange/Account/tests/AccountBase.test.cpp index 923fe7791..70b25df78 100644 --- a/Exchange/Account/tests/AccountBase.test.cpp +++ b/Exchange/Account/tests/AccountBase.test.cpp @@ -26,10 +26,10 @@ // Includes. #include "../AccountBase.h" + #include "../../../Platform/Platform.h" int main(int argc, char **argv) { - // @todo return 0; diff --git a/Exchange/Account/tests/AccountForex.test.cpp b/Exchange/Account/tests/AccountForex.test.cpp index a2004df86..b112b792f 100644 --- a/Exchange/Account/tests/AccountForex.test.cpp +++ b/Exchange/Account/tests/AccountForex.test.cpp @@ -26,10 +26,10 @@ // Includes. #include "../AccountForex.h" + #include "../../../Platform/Platform.h" int main(int argc, char **argv) { - // @todo return 0; diff --git a/Exchange/Account/tests/AccountMt.test.cpp b/Exchange/Account/tests/AccountMt.test.cpp index f89b71f07..534ed683d 100644 --- a/Exchange/Account/tests/AccountMt.test.cpp +++ b/Exchange/Account/tests/AccountMt.test.cpp @@ -26,10 +26,10 @@ // Includes. #include "../AccountMt.h" + #include "../../../Platform/Platform.h" int main(int argc, char **argv) { - // @todo return 0; diff --git a/Exchange/SymbolInfo/tests/SymbolInfo.test.cpp b/Exchange/SymbolInfo/tests/SymbolInfo.test.cpp index 2ac8589ce..ecda34f31 100644 --- a/Exchange/SymbolInfo/tests/SymbolInfo.test.cpp +++ b/Exchange/SymbolInfo/tests/SymbolInfo.test.cpp @@ -26,10 +26,10 @@ // Includes. #include "../SymbolInfo.h" + #include "../../../Platform/Platform.h" int main(int argc, char **argv) { - // @todo return 0; diff --git a/Exchange/tests/Exchange.test.cpp b/Exchange/tests/Exchange.test.cpp index 4af791d0f..968da6b53 100644 --- a/Exchange/tests/Exchange.test.cpp +++ b/Exchange/tests/Exchange.test.cpp @@ -26,10 +26,10 @@ // Includes. #include "../Exchange.h" + #include "../../Platform/Platform.h" int main(int argc, char **argv) { - // @todo return 0; diff --git a/Indicator/tests/Indicator.test.cpp b/Indicator/tests/Indicator.test.cpp new file mode 100644 index 000000000..fda0b8620 --- /dev/null +++ b/Indicator/tests/Indicator.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of IndicatorBase class. + */ + +// Includes. +#include "../Indicator.h" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicator/tests/IndicatorBase.test.cpp b/Indicator/tests/IndicatorBase.test.cpp index 4f1a4cfb4..b63b617b4 100644 --- a/Indicator/tests/IndicatorBase.test.cpp +++ b/Indicator/tests/IndicatorBase.test.cpp @@ -26,10 +26,10 @@ // Includes. #include "../IndicatorBase.h" + #include "../../Platform/Platform.h" int main(int argc, char **argv) { - // @todo return 0; diff --git a/Indicator/tests/IndicatorCandle.test.cpp b/Indicator/tests/IndicatorCandle.test.cpp new file mode 100644 index 000000000..ccc03a921 --- /dev/null +++ b/Indicator/tests/IndicatorCandle.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of IndicatorCandle class. + */ + +// Includes. +#include "../IndicatorCandle.h" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicator/tests/IndicatorData.test.cpp b/Indicator/tests/IndicatorData.test.cpp new file mode 100644 index 000000000..8ee025c3f --- /dev/null +++ b/Indicator/tests/IndicatorData.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of IndicatorData class. + */ + +// Includes. +#include "../IndicatorData.h" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicator/tests/IndicatorRenko.test.cpp b/Indicator/tests/IndicatorRenko.test.cpp new file mode 100644 index 000000000..89ab2fc4e --- /dev/null +++ b/Indicator/tests/IndicatorRenko.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of IndicatorBase class. + */ + +// Includes. +#include "../IndicatorRenko.h" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicator/tests/IndicatorTf.test.cpp b/Indicator/tests/IndicatorTf.test.cpp new file mode 100644 index 000000000..3109604ef --- /dev/null +++ b/Indicator/tests/IndicatorTf.test.cpp @@ -0,0 +1,37 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test functionality of IndicatorTf class. + * Test C++ compilation of IndicatorBase class. + */ + +// Includes. +#include "../IndicatorTf.h" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicator/tests/IndicatorTick.test.cpp b/Indicator/tests/IndicatorTick.test.cpp new file mode 100644 index 000000000..123f8d6eb --- /dev/null +++ b/Indicator/tests/IndicatorTick.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test functionality of IndicatorTick class. + */ + +// Includes. +#include "../IndicatorTick.h" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/OHLC/tests/Indi_OHLC.test.cpp b/Indicators/OHLC/tests/Indi_OHLC.test.cpp index 437877e8e..770ec0f86 100644 --- a/Indicators/OHLC/tests/Indi_OHLC.test.cpp +++ b/Indicators/OHLC/tests/Indi_OHLC.test.cpp @@ -26,6 +26,7 @@ // Includes. #include "../Indi_OHLC.mqh" + #include "../../../Platform/Platform.h" int main(int argc, char **argv) { diff --git a/Indicators/Price/tests/Indi_Price.test.cpp b/Indicators/Price/tests/Indi_Price.test.cpp index 39876aef4..f18a39de3 100644 --- a/Indicators/Price/tests/Indi_Price.test.cpp +++ b/Indicators/Price/tests/Indi_Price.test.cpp @@ -26,10 +26,10 @@ // Includes. #include "../Indi_Price.h" + #include "../../../Platform/Platform.h" int main(int argc, char **argv) { - // @todo return 0; diff --git a/Indicators/tests/DrawIndicator.test.cpp b/Indicators/tests/DrawIndicator.test.cpp index 3cfc1587e..0314a440b 100644 --- a/Indicators/tests/DrawIndicator.test.cpp +++ b/Indicators/tests/DrawIndicator.test.cpp @@ -26,10 +26,10 @@ // Includes. #include "../DrawIndicator.mqh" + #include "../../Platform/Platform.h" int main(int argc, char **argv) { - // @todo return 0; diff --git a/Math/tests/Math.test.cpp b/Math/tests/Math.test.cpp index 882438be3..863e00e42 100644 --- a/Math/tests/Math.test.cpp +++ b/Math/tests/Math.test.cpp @@ -26,10 +26,10 @@ // Includes. #include "../Math.h" + #include "../../Platform/Platform.h" int main(int argc, char **argv) { - // @todo return 0; diff --git a/Math/tests/Matrix.test.cpp b/Math/tests/Matrix.test.cpp index 97f6e0784..929cef6ba 100644 --- a/Math/tests/Matrix.test.cpp +++ b/Math/tests/Matrix.test.cpp @@ -26,10 +26,10 @@ // Includes. #include "../Matrix.h" + #include "../../Platform/Platform.h" int main(int argc, char **argv) { - // @todo return 0; diff --git a/Math/tests/MatrixMini.test.cpp b/Math/tests/MatrixMini.test.cpp new file mode 100644 index 000000000..d6370b8bf --- /dev/null +++ b/Math/tests/MatrixMini.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of MatrixMini class. + */ + +// Includes. +#include "../MatrixMini.h" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Platform/Chart/README.md b/Platform/Chart/README.md new file mode 100644 index 000000000..fdb99daea --- /dev/null +++ b/Platform/Chart/README.md @@ -0,0 +1 @@ +# Chart diff --git a/Platform/Chart/tests/Chart.test.cpp b/Platform/Chart/tests/Chart.test.cpp index 92e062837..a74173e9b 100644 --- a/Platform/Chart/tests/Chart.test.cpp +++ b/Platform/Chart/tests/Chart.test.cpp @@ -26,10 +26,10 @@ // Includes. #include "../Chart.h" + #include "../../../Platform/Platform.h" int main(int argc, char **argv) { - // @todo return 0; diff --git a/Platform/Chart/tests/ChartMt.test.cpp b/Platform/Chart/tests/ChartMt.test.cpp new file mode 100644 index 000000000..e2bad718e --- /dev/null +++ b/Platform/Chart/tests/ChartMt.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of ChartMt class. + */ + +// Includes. +#include "../ChartMt.h" + +#include "../../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Platform/Chart3D/tests/Chart3D.test.cpp b/Platform/Chart3D/tests/Chart3D.test.cpp new file mode 100644 index 000000000..1d7c0be3e --- /dev/null +++ b/Platform/Chart3D/tests/Chart3D.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Chart3D class. + */ + +// Includes. +#include "../Chart3D.h" + +#include "../../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Platform/Chart3D/tests/Makefile b/Platform/Chart3D/tests/Makefile new file mode 100644 index 000000000..e792364f0 --- /dev/null +++ b/Platform/Chart3D/tests/Makefile @@ -0,0 +1,12 @@ +CC := g++ # C++ compiler +CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags +SRCS := $(wildcard *.cpp) # Get all .cpp files in the current directory +OBJS := $(SRCS:.cpp=.o) # Object files corresponding to the source files + +all: $(OBJS) + +%.o: %.cpp + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -v $(OBJS) diff --git a/Platform/Web/tests/Makefile b/Platform/Web/tests/Makefile new file mode 100644 index 000000000..e792364f0 --- /dev/null +++ b/Platform/Web/tests/Makefile @@ -0,0 +1,12 @@ +CC := g++ # C++ compiler +CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags +SRCS := $(wildcard *.cpp) # Get all .cpp files in the current directory +OBJS := $(SRCS:.cpp=.o) # Object files corresponding to the source files + +all: $(OBJS) + +%.o: %.cpp + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -v $(OBJS) diff --git a/Platform/Web/tests/Web.test.cpp b/Platform/Web/tests/Web.test.cpp new file mode 100644 index 000000000..41a909c76 --- /dev/null +++ b/Platform/Web/tests/Web.test.cpp @@ -0,0 +1,48 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Web class. + */ + +// External functions. +extern int WebRequest(const string method, // HTTP method + const string url, // URL + const string cookie, // cookie + const string referer, // referer + int timeout, // timeout + const char &data[], // the array of the HTTP message body + int data_size, // data[] array size in bytes + char &result[], // an array containing server response data + string &result_headers // headers of server response +); + +// Includes. +#include "../Web.h" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Platform/tests/Order.test.cpp b/Platform/tests/Order.test.cpp index 0035008bd..0cc7ffd52 100644 --- a/Platform/tests/Order.test.cpp +++ b/Platform/tests/Order.test.cpp @@ -28,7 +28,6 @@ #include "../Order.h" int main(int argc, char **argv) { - // @todo return 0; diff --git a/Platform/tests/OrderQuery.test.cpp b/Platform/tests/OrderQuery.test.cpp index 274b23c3d..5b39ef57b 100644 --- a/Platform/tests/OrderQuery.test.cpp +++ b/Platform/tests/OrderQuery.test.cpp @@ -26,10 +26,10 @@ // Includes. #include "../OrderQuery.h" + #include "../Platform.h" int main(int argc, char **argv) { - // @todo return 0; diff --git a/Platform/tests/Orders.test.cpp b/Platform/tests/Orders.test.cpp index 910aa0d62..daec152fc 100644 --- a/Platform/tests/Orders.test.cpp +++ b/Platform/tests/Orders.test.cpp @@ -28,7 +28,6 @@ #include "../Orders.h" int main(int argc, char **argv) { - // @todo return 0; diff --git a/Platform/tests/Platform.test.cpp b/Platform/tests/Platform.test.cpp index c7cd29333..f4a0fce4f 100644 --- a/Platform/tests/Platform.test.cpp +++ b/Platform/tests/Platform.test.cpp @@ -28,7 +28,6 @@ #include "../Platform.h" int main(int argc, char **argv) { - // @todo return 0; diff --git a/Platform/tests/Plot.test.cpp b/Platform/tests/Plot.test.cpp new file mode 100644 index 000000000..eb1f2dd5a --- /dev/null +++ b/Platform/tests/Plot.test.cpp @@ -0,0 +1,34 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Plot class. + */ + +// Includes. +#include "../Plot.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Platform/tests/Terminal.test.cpp b/Platform/tests/Terminal.test.cpp index 9760c4b95..df5b8f272 100644 --- a/Platform/tests/Terminal.test.cpp +++ b/Platform/tests/Terminal.test.cpp @@ -28,7 +28,6 @@ #include "../Terminal.h" int main(int argc, char **argv) { - // @todo return 0; diff --git a/Serializer/tests/Serializable.test.cpp b/Serializer/tests/Serializable.test.cpp index 83cc7fe1c..ad60d7be0 100644 --- a/Serializer/tests/Serializable.test.cpp +++ b/Serializer/tests/Serializable.test.cpp @@ -26,10 +26,10 @@ // Includes. #include "../Serializable.h" + #include "../../Platform/Platform.h" int main(int argc, char **argv) { - // @todo return 0; diff --git a/Serializer/tests/Serializer.test.cpp b/Serializer/tests/Serializer.test.cpp new file mode 100644 index 000000000..cd6cad5f9 --- /dev/null +++ b/Serializer/tests/Serializer.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Serializer class. + */ + +// Includes. +#include "../Serializer.h" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Serializer/tests/SerializerBinary.test.cpp b/Serializer/tests/SerializerBinary.test.cpp new file mode 100644 index 000000000..1b784bab3 --- /dev/null +++ b/Serializer/tests/SerializerBinary.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of SerializerBinary class. + */ + +// Includes. +#include "../SerializerBinary.h" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Serializer/tests/SerializerConversions.test.cpp b/Serializer/tests/SerializerConversions.test.cpp new file mode 100644 index 000000000..0b06b3943 --- /dev/null +++ b/Serializer/tests/SerializerConversions.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of SerializerConversions class. + */ + +// Includes. +#include "../SerializerConversions.h" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Serializer/tests/SerializerConverter.test.cpp b/Serializer/tests/SerializerConverter.test.cpp new file mode 100644 index 000000000..b5156758b --- /dev/null +++ b/Serializer/tests/SerializerConverter.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of SerializerConverter class. + */ + +// Includes. +#include "../SerializerConverter.h" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Serializer/tests/SerializerCsv.test.cpp b/Serializer/tests/SerializerCsv.test.cpp new file mode 100644 index 000000000..65e1ddb5f --- /dev/null +++ b/Serializer/tests/SerializerCsv.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of SerializerCsv class. + */ + +// Includes. +#include "../SerializerCsv.h" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Serializer/tests/SerializerDict.test.cpp b/Serializer/tests/SerializerDict.test.cpp new file mode 100644 index 000000000..68b01a7d4 --- /dev/null +++ b/Serializer/tests/SerializerDict.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of SerializerDict class. + */ + +// Includes. +#include "../SerializerDict.h" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Serializer/tests/SerializerJson.test.cpp b/Serializer/tests/SerializerJson.test.cpp new file mode 100644 index 000000000..bb3975a0e --- /dev/null +++ b/Serializer/tests/SerializerJson.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of SerializerJson class. + */ + +// Includes. +#include "../SerializerJson.h" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Serializer/tests/SerializerNode.test.cpp b/Serializer/tests/SerializerNode.test.cpp new file mode 100644 index 000000000..cc4f28237 --- /dev/null +++ b/Serializer/tests/SerializerNode.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of SerializerNode class. + */ + +// Includes. +#include "../SerializerNode.h" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Serializer/tests/SerializerNodeIterator.test.cpp b/Serializer/tests/SerializerNodeIterator.test.cpp new file mode 100644 index 000000000..f11e9ee51 --- /dev/null +++ b/Serializer/tests/SerializerNodeIterator.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of SerializerNodeIterator class. + */ + +// Includes. +#include "../SerializerNodeIterator.h" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Serializer/tests/SerializerNodeParam.test.cpp b/Serializer/tests/SerializerNodeParam.test.cpp new file mode 100644 index 000000000..de4601e87 --- /dev/null +++ b/Serializer/tests/SerializerNodeParam.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of SerializerNodeParam class. + */ + +// Includes. +#include "../SerializerNodeParam.h" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Serializer/tests/SerializerObject.test.cpp b/Serializer/tests/SerializerObject.test.cpp new file mode 100644 index 000000000..66bef2d08 --- /dev/null +++ b/Serializer/tests/SerializerObject.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of SerializerObject class. + */ + +// Includes. +#include "../SerializerObject.h" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Serializer/tests/SerializerSqlite.test.cpp b/Serializer/tests/SerializerSqlite.test.cpp new file mode 100644 index 000000000..13f4002e8 --- /dev/null +++ b/Serializer/tests/SerializerSqlite.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of SerializerSqlite class. + */ + +// Includes. +#include "../SerializerSqlite.h" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Storage/Cache/tests/IndiBufferCache.test.cpp b/Storage/Cache/tests/IndiBufferCache.test.cpp index 374cbd8df..9934b467c 100644 --- a/Storage/Cache/tests/IndiBufferCache.test.cpp +++ b/Storage/Cache/tests/IndiBufferCache.test.cpp @@ -28,7 +28,6 @@ #include "../IndiBufferCache.h" int main(int argc, char **argv) { - // @todo: Add more tests. // ... diff --git a/Storage/Cache/tests/ObjectsCache.test.cpp b/Storage/Cache/tests/ObjectsCache.test.cpp index d76651100..b4b11635d 100644 --- a/Storage/Cache/tests/ObjectsCache.test.cpp +++ b/Storage/Cache/tests/ObjectsCache.test.cpp @@ -28,7 +28,6 @@ #include "../ObjectsCache.h" int main(int argc, char **argv) { - // @todo: Add more tests. // ... diff --git a/Storage/Dict/Buffer/tests/Buffer.test.cpp b/Storage/Dict/Buffer/tests/Buffer.test.cpp new file mode 100644 index 000000000..6ef3b0d38 --- /dev/null +++ b/Storage/Dict/Buffer/tests/Buffer.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Buffer class. + */ + +// Includes. +#include "../Buffer.h" + +#include "../../../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Storage/Dict/Buffer/tests/BufferCandle.test.cpp b/Storage/Dict/Buffer/tests/BufferCandle.test.cpp new file mode 100644 index 000000000..c876d4f5c --- /dev/null +++ b/Storage/Dict/Buffer/tests/BufferCandle.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of BufferCandle class. + */ + +// Includes. +#include "../BufferCandle.h" + +#include "../../../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Storage/Dict/Buffer/tests/BufferCompileAll.test.cpp b/Storage/Dict/Buffer/tests/BufferCompileAll.test.cpp new file mode 100644 index 000000000..406cbcb6b --- /dev/null +++ b/Storage/Dict/Buffer/tests/BufferCompileAll.test.cpp @@ -0,0 +1,38 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of all Buffer related classes + */ + +// Includes. +#include "../../../../Platform/Platform.h" +#include "../BufferCandle.h" +#include "../BufferFXT.h" +#include "../BufferStruct.h" +#include "../BufferTick.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Storage/Dict/Buffer/tests/BufferFXT.test.cpp b/Storage/Dict/Buffer/tests/BufferFXT.test.cpp new file mode 100644 index 000000000..121059ac5 --- /dev/null +++ b/Storage/Dict/Buffer/tests/BufferFXT.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Dict class. + */ + +// Includes. +#include "../BufferFXT.h" + +#include "../../../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Storage/Dict/Buffer/tests/BufferStruct.test.cpp b/Storage/Dict/Buffer/tests/BufferStruct.test.cpp new file mode 100644 index 000000000..1df21adc3 --- /dev/null +++ b/Storage/Dict/Buffer/tests/BufferStruct.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Dict class. + */ + +// Includes. +#include "../BufferStruct.h" + +#include "../../../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Storage/Dict/Buffer/tests/BufferTick.test.cpp b/Storage/Dict/Buffer/tests/BufferTick.test.cpp new file mode 100644 index 000000000..5c47f6d58 --- /dev/null +++ b/Storage/Dict/Buffer/tests/BufferTick.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Dict class. + */ + +// Includes. +#include "../BufferTick.h" + +#include "../../../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Storage/Dict/tests/Dict.test.cpp b/Storage/Dict/tests/Dict.test.cpp new file mode 100644 index 000000000..165e312d1 --- /dev/null +++ b/Storage/Dict/tests/Dict.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Dict class. + */ + +// Includes. +#include "../Dict.h" + +#include "../../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Storage/tests/Database.test.cpp b/Storage/tests/Database.test.cpp new file mode 100644 index 000000000..6074ef4a3 --- /dev/null +++ b/Storage/tests/Database.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test functionality of Database class. + */ + +// Includes. +#include "../Database.h" + +#include "../../Test.mqh" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Storage/tests/ItemsHistory.test.cpp b/Storage/tests/ItemsHistory.test.cpp new file mode 100644 index 000000000..6465dbc36 --- /dev/null +++ b/Storage/tests/ItemsHistory.test.cpp @@ -0,0 +1,34 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of ItemsHistory class. + */ + +// Includes. +#include "../ItemsHistory.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Storage/tests/Object.test.cpp b/Storage/tests/Object.test.cpp new file mode 100644 index 000000000..dc6b4889f --- /dev/null +++ b/Storage/tests/Object.test.cpp @@ -0,0 +1,41 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Object class. + */ + +// Includes. +#include "../Object.h" + +int main(int argc, char **argv) { + // Create a new object. + Object *obj = new Object(); + + // @todo: Add more tests. + // ... + + // Clean up. + Object::Delete(obj); + + return 0; +} diff --git a/Storage/tests/Redis.test.cpp b/Storage/tests/Redis.test.cpp new file mode 100644 index 000000000..5eaafae69 --- /dev/null +++ b/Storage/tests/Redis.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of RedisTest class. + */ + +// Includes. +#include "../Redis.h" + +#include "../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Storage/tests/ValueStorage.test.cpp b/Storage/tests/ValueStorage.test.cpp new file mode 100644 index 000000000..15061eda1 --- /dev/null +++ b/Storage/tests/ValueStorage.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of ValueStorage class. + */ + +// Includes. +#include "../ValueStorage.h" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Task/tests/TaskSetter.test.cpp b/Task/tests/TaskSetter.test.cpp index bd2ba057f..7e7a42f3e 100644 --- a/Task/tests/TaskSetter.test.cpp +++ b/Task/tests/TaskSetter.test.cpp @@ -25,10 +25,11 @@ */ // Includes. +#include "../TaskSetter.h" + #include "../../Common.define.h" #include "../../Common.extern.h" #include "../../Std.h" #include "../../Storage/String.extern.h" -#include "../TaskSetter.h" int main(int argc, char **argv) {} diff --git a/Tick/tests/TickManager.test.cpp b/Tick/tests/TickManager.test.cpp index a3f4f40e6..650a84fbc 100644 --- a/Tick/tests/TickManager.test.cpp +++ b/Tick/tests/TickManager.test.cpp @@ -26,6 +26,7 @@ // Includes. #include "../TickManager.h" + #include "../../Platform/Platform.h" int main(int argc, char **argv) {} diff --git a/Trade/tests/TradeSignal.test.cpp b/Trade/tests/TradeSignal.test.cpp index 950cc45f2..53ab50b17 100644 --- a/Trade/tests/TradeSignal.test.cpp +++ b/Trade/tests/TradeSignal.test.cpp @@ -26,10 +26,10 @@ // Includes. #include "../TradeSignal.h" + #include "../../Platform/Platform.h" int main(int argc, char **argv) { - // @todo return 0; diff --git a/Trade/tests/TradeSignalManager.test.cpp b/Trade/tests/TradeSignalManager.test.cpp index 35ba0e9f0..784edba9b 100644 --- a/Trade/tests/TradeSignalManager.test.cpp +++ b/Trade/tests/TradeSignalManager.test.cpp @@ -26,10 +26,10 @@ // Includes. #include "../TradeSignalManager.h" + #include "../../Platform/Platform.h" int main(int argc, char **argv) { - // @todo return 0; From 8c947211a5079a29e247d0bb19eb303abc34ebf2 Mon Sep 17 00:00:00 2001 From: Adrian Kierzkowski Date: Mon, 19 Jun 2023 20:53:13 +0200 Subject: [PATCH 070/109] Fixing C++ compile errors. --- Convert.extern.h | 2 + Indicator/IndicatorBase.h | 62 +++++++++++++++++++++++ Indicator/IndicatorData.h | 44 +++++------------ Indicator/IndicatorData.struct.h | 5 ++ Indicator/IndicatorRenko.h | 1 + Indicators/Price/Indi_MA.h | 35 +++++++------ Instances.h | 15 +++--- Platform/Chart/Chart.symboltf.h | 1 + Platform/Chart3D/Frontend.h | 2 +- Platform/Chart3D/IndexBuffer.h | 4 +- Platform/Platform.extern.h | 7 ++- Platform/Platform.h | 52 +++++++++----------- Platform/Web/Web.h | 71 ++++++++++++--------------- Platform/Web/tests/Web.test.cpp | 34 ++++++++----- Serializer/SerializerBinary.h | 22 ++++----- Std.h | 2 + Storage/Dict/Buffer/BufferTick.h | 3 +- Storage/Singleton.h | 2 +- Storage/ValueStorage.h | 3 +- Storage/ValueStorage.history.h | 8 +-- Storage/ValueStorage.indicator.h | 6 +-- Storage/ValueStorage.price_median.h | 6 +-- Storage/ValueStorage.price_typical.h | 2 +- Storage/ValueStorage.price_weighted.h | 2 +- Storage/ValueStorage.spread.h | 2 +- Storage/ValueStorage.tick_volume.h | 2 +- Storage/ValueStorage.time.h | 2 +- Storage/ValueStorage.volume.h | 2 +- 28 files changed, 228 insertions(+), 171 deletions(-) diff --git a/Convert.extern.h b/Convert.extern.h index 8d0eebce4..f7a2861fd 100644 --- a/Convert.extern.h +++ b/Convert.extern.h @@ -28,6 +28,8 @@ #include #include +#include "Storage/String.h" + // Define external global functions. double NormalizeDouble(double value, int digits) { return std::round(value / digits) * digits; } diff --git a/Indicator/IndicatorBase.h b/Indicator/IndicatorBase.h index 56a4f3274..6c7c3e214 100644 --- a/Indicator/IndicatorBase.h +++ b/Indicator/IndicatorBase.h @@ -31,6 +31,7 @@ #endif // Includes. +#include "../Bar.struct.h" #include "../Log.mqh" #include "../Platform/Chart/Chart.struct.tf.h" #include "../Platform/Platform.extern.h" @@ -43,6 +44,10 @@ #include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Storage/Object.h" #include "../Util.h" +#include "IndicatorData.struct.h" + +// Forward declarations. +class IndicatorData; /** * Class to deal with indicators. @@ -186,8 +191,30 @@ class IndicatorBase : public Object { */ // void SetSymbol(string _symbol) { Set(CHART_PARAM_SYMBOL, _symbol); } + template + T GetValue(int _mode = 0, int _rel_shift = 0) { + T _out; + GetEntryValue(_mode, ToAbsShift(_rel_shift)).Get(_out); + return _out; + } + /* Virtual methods */ + /** + * Returns the indicator's entry value. + */ + virtual IndicatorDataEntryValue GetEntryValue(int _mode = 0, int _abs_shift = 0) = 0; + + /** + * Converts relative shift into absolute one. + */ + virtual int ToAbsShift(int _rel_shift) = 0; + + /** + * Converts absolute shift into relative one. + */ + virtual int ToRelShift(int _abs_shift) = 0; + /** * Get name of the indicator. */ @@ -203,6 +230,41 @@ class IndicatorBase : public Object { */ virtual string GetDescriptiveName() { return GetName(); } + /** + * Traverses source indicators' hierarchy and tries to find OHLC-featured + * indicator. IndicatorCandle satisfies such requirements. + */ + virtual IndicatorData* GetCandle(bool _warn_if_not_found = true, IndicatorData* _originator = nullptr) = 0; + + /** + * Returns the number of bars on the chart decremented by iparams.shift. + */ + virtual int GetBars() = 0; + + /** + * Returns time of the bar for a given shift. + */ + virtual datetime GetBarTime(int _rel_shift = 0) = 0; + + /** + * Gets OHLC price values. + */ + virtual BarOHLC GetOHLC(int _rel_shift = 0) = 0; + + /** + * Returns spread for the bar. + * + * If local history is empty (not loaded), function returns 0. + */ + virtual long GetSpread(int _shift = 0) = 0; + + /** + * Returns volume value for the bar. + * + * If local history is empty (not loaded), function returns 0. + */ + virtual long GetVolume(int _shift = 0) = 0; + /** * Returns indicator value for a given shift and mode. */ diff --git a/Indicator/IndicatorData.h b/Indicator/IndicatorData.h index fe415e9df..a11c8240a 100644 --- a/Indicator/IndicatorData.h +++ b/Indicator/IndicatorData.h @@ -40,12 +40,12 @@ struct ExternInstantiateIndicatorBufferValueStorageDouble { // Includes. #include "../Bar.struct.h" +#include "../Exchange/SymbolInfo/SymbolInfo.struct.h" #include "../Platform/Chart/Chart.struct.tf.h" #include "../Storage/Cache/IndiBufferCache.h" #include "../Storage/Flags.struct.h" #include "../Storage/IValueStorage.h" #include "../Storage/ItemsHistory.h" -#include "../Exchange/SymbolInfo/SymbolInfo.struct.h" #include "Indicator.enum.h" #include "IndicatorBase.h" #include "IndicatorData.enum.h" @@ -1053,13 +1053,6 @@ class IndicatorData : public IndicatorBase { return SerializerConverter::FromObject(_entry, _serializer_flags).ToString(0, &_stub); } - template - T GetValue(int _mode = 0, int _rel_shift = 0) { - T _out; - GetEntryValue(_mode, ToAbsShift(_rel_shift)).Get(_out); - return _out; - } - /* Virtual methods */ /** @@ -1150,10 +1143,15 @@ class IndicatorData : public IndicatorBase { */ virtual double GetBid(int _shift = 0) { return GetTick() PTR_DEREF GetBid(_shift); } + /** + * Gets OHLC price values. + */ + virtual BarOHLC GetOHLC(int _rel_shift = 0) { return GetCandle() PTR_DEREF GetOHLC(_rel_shift); } + /** * Returns the number of bars on the chart decremented by iparams.shift. */ - virtual int GetBars() { return GetCandle() PTR_DEREF GetBars(); } + int GetBars() override { return GetCandle() PTR_DEREF GetBars(); } /** * Returns index of the current bar. @@ -1163,7 +1161,7 @@ class IndicatorData : public IndicatorBase { /** * Returns time of the bar for a given shift. */ - virtual datetime GetBarTime(int _rel_shift = 0) { + datetime GetBarTime(int _rel_shift = 0) override { IndicatorData* _indi = GetCandle(false); if (_indi == nullptr) _indi = GetTick(false); @@ -1194,7 +1192,7 @@ class IndicatorData : public IndicatorBase { * Traverses source indicators' hierarchy and tries to find OHLC-featured * indicator. IndicatorCandle satisfies such requirements. */ - virtual IndicatorData* GetCandle(bool _warn_if_not_found = true, IndicatorData* _originator = nullptr) { + IndicatorData* GetCandle(bool _warn_if_not_found = true, IndicatorData* _originator = nullptr) override { if (_originator == nullptr) { _originator = THIS_PTR; } @@ -1251,11 +1249,6 @@ class IndicatorData : public IndicatorBase { // virtual ENUM_IDATA_VALUE_RANGE GetIDataValueRange() = NULL; - /** - * Returns the indicator's entry value. - */ - virtual IndicatorDataEntryValue GetEntryValue(int _mode = 0, int _abs_shift = 0) = 0; - /** * Returns the shift of the maximum value over a specific number of periods depending on type. */ @@ -1297,11 +1290,6 @@ class IndicatorData : public IndicatorBase { */ virtual double GetOpen(int _shift = 0) { return GetCandle() PTR_DEREF GetOpen(_shift); } - /** - * Gets OHLC price values. - */ - virtual BarOHLC GetOHLC(int _rel_shift = 0) { return GetCandle() PTR_DEREF GetOHLC(_rel_shift); } - /** * Get peak price at given number of bars. * @@ -1330,7 +1318,7 @@ class IndicatorData : public IndicatorBase { * * If local history is empty (not loaded), function returns 0. */ - virtual long GetSpread(int _shift = 0) { return GetCandle() PTR_DEREF GetSpread(_shift); } + long GetSpread(int _shift = 0) override { return GetCandle() PTR_DEREF GetSpread(_shift); } /** * Returns spread in pips. @@ -1789,7 +1777,7 @@ class IndicatorData : public IndicatorBase { * * If local history is empty (not loaded), function returns 0. */ - virtual long GetVolume(int _shift = 0) { return GetCandle() PTR_DEREF GetVolume(_shift); } + long GetVolume(int _shift = 0) override { return GetCandle() PTR_DEREF GetVolume(_shift); } /** * Sends entry to listening indicators. @@ -1919,16 +1907,6 @@ class IndicatorData : public IndicatorBase { return false; }; - /** - * Converts relative shift into absolute one. - */ - virtual int ToAbsShift(int _rel_shift) = 0; - - /** - * Converts absolute shift into relative one. - */ - virtual int ToRelShift(int _abs_shift) = 0; - /** * Loads and validates built-in indicators whose can be used as data source. */ diff --git a/Indicator/IndicatorData.struct.h b/Indicator/IndicatorData.struct.h index b9d8608d0..ab660f3f9 100644 --- a/Indicator/IndicatorData.struct.h +++ b/Indicator/IndicatorData.struct.h @@ -25,6 +25,11 @@ * Includes IndicatorData's structs. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Defines. #define STRUCT_ENUM_IDATA_PARAM STRUCT_ENUM(IndicatorDataParams, ENUM_IDATA_PARAM) #define STRUCT_ENUM_INDICATOR_DATA_STATE_PROP STRUCT_ENUM(IndicatorDataState, ENUM_INDICATOR_DATA_STATE_PROP) diff --git a/Indicator/IndicatorRenko.h b/Indicator/IndicatorRenko.h index cb5bb5f72..9821526f6 100644 --- a/Indicator/IndicatorRenko.h +++ b/Indicator/IndicatorRenko.h @@ -39,6 +39,7 @@ #include "IndicatorCandle.h" #include "IndicatorRenko.provider.h" #include "IndicatorRenko.struct.h" +#include "IndicatorTf.struct.h" /** * Renko candle type. diff --git a/Indicators/Price/Indi_MA.h b/Indicators/Price/Indi_MA.h index d82c76a45..16dcd6f57 100644 --- a/Indicators/Price/Indi_MA.h +++ b/Indicators/Price/Indi_MA.h @@ -25,22 +25,22 @@ #define INDI_MA_H // Includes. -#include "../../Storage/Dict/Dict.h" -#include "../../Storage/Dict/DictObject.h" #include "../../Indicator/Indicator.h" #include "../../Refs.mqh" +#include "../../Storage/Dict/Dict.h" +#include "../../Storage/Dict/DictObject.h" #include "../../Storage/Singleton.h" -#include "../../Storage/ValueStorage.h" #include "../../Storage/String.h" +#include "../../Storage/ValueStorage.h" #ifndef __MQL__ // Enums. // @see: https://www.mql5.com/en/docs/constants/indicatorconstants/enum_ma_method enum ENUM_MA_METHOD { - MODE_SMA = 0, // Simple averaging. - MODE_EMA, // Exponential averaging. - MODE_SMMA, // Smoothed averaging. - MODE_LWMA, // Linear-weighted averaging. + MODE_SMA = 0, // Simple averaging. + MODE_EMA, // Exponential averaging. + MODE_SMMA, // Smoothed averaging. + MODE_LWMA, // Linear-weighted averaging. }; #endif @@ -140,7 +140,7 @@ class Indi_MA : public Indicator { INDICATOR_BUILTIN_CALL_AND_RETURN(::iMA(_symbol, _tf, _ma_period, _ma_shift, _ma_method, _applied_price), 0, _shift); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " @@ -153,13 +153,14 @@ class Indi_MA : public Indicator { * Calculates MA on another indicator. */ static double iMAOnIndicator(IndicatorData *_target, IndicatorData *_source, string symbol, ENUM_TIMEFRAMES tf, - unsigned int ma_period, unsigned int ma_shift, + int ma_period, int ma_shift, ENUM_MA_METHOD ma_method, // (MT4/MT5): MODE_SMA, MODE_EMA, MODE_SMMA, MODE_LWMA ENUM_APPLIED_PRICE _ap, int shift = 0) { // We need 1 bar more because MA methods assumes we have historic bars. INDI_REQUIRE_BARS_OR_RETURN_EMPTY(_source, int(ma_period + ma_shift + shift + 1)); - ValueStorage *_data = (ValueStorage *)_source.GetSpecificAppliedPriceValueStorage(_ap, _target); - return iMAOnArray(_data, 0, ma_period, ma_shift, ma_method, shift, _target PTR_DEREF GetCache()); + ValueStorage *_data = + (ValueStorage *)_source PTR_DEREF GetSpecificAppliedPriceValueStorage(_ap, _target); + return iMAOnArray(PTR_TO_REF(_data), 0, ma_period, ma_shift, ma_method, shift, _target PTR_DEREF GetCache()); } /** @@ -174,7 +175,8 @@ class Indi_MA : public Indicator { NativeValueStorage *_array_storage = Singleton>::Get(); _array_storage PTR_DEREF SetData(price); - return iMAOnArray((ValueStorage *)_array_storage, total, ma_period, ma_shift, ma_method, shift, cache); + return iMAOnArray(PTR_TO_REF((ValueStorage *)_array_storage), total, ma_period, ma_shift, ma_method, shift, + cache); #endif } @@ -184,18 +186,19 @@ class Indi_MA : public Indicator { static double iMAOnArray(ValueStorage &price, int total, int ma_period, int ma_shift, int ma_method, int shift, IndiBufferCache *_cache = NULL, bool recalculate = false) { if (_cache != NULL) { - _cache.SetPriceBuffer(price); + _cache PTR_DEREF SetPriceBuffer(price); if (!_cache PTR_DEREF HasBuffers()) { _cache PTR_DEREF AddBuffer>(); } if (recalculate) { - _cache.ResetPrevCalculated(); + _cache PTR_DEREF ResetPrevCalculated(); } - _cache.SetPrevCalculated( - Indi_MA::Calculate(INDICATOR_CALCULATE_GET_PARAMS_SHORT, _cache.GetBuffer(0), ma_method, ma_period)); + _cache PTR_DEREF SetPrevCalculated(Indi_MA::Calculate(INDICATOR_CALCULATE_GET_PARAMS_SHORT, + PTR_TO_REF(_cache PTR_DEREF GetBuffer(0)), + ma_method, ma_period)); // Returns value from the first calculation buffer. // Returns first value for as-series array or last value for non-as-series array. diff --git a/Instances.h b/Instances.h index 02cfcfd1e..161e0609d 100644 --- a/Instances.h +++ b/Instances.h @@ -37,21 +37,18 @@ #include "Storage/Dict/Dict.h" #include "Util.h" -template +template class Instances { -public: - + public: static T* instances[]; - Instances(T* _self) { - Util::ArrayPush(instances, _self); - } + Instances(T* _self) { Util::ArrayPush(instances, _self); } ~Instances() { - //Util::ArrayRemove(instances, &this); + // Util::ArrayRemove(instances, &this); } }; -template -T* Instances::instances[]; +template +T* Instances::instances[]; #endif // INSTANCES_MQH diff --git a/Platform/Chart/Chart.symboltf.h b/Platform/Chart/Chart.symboltf.h index 2710c4c78..9fbb59e20 100644 --- a/Platform/Chart/Chart.symboltf.h +++ b/Platform/Chart/Chart.symboltf.h @@ -32,6 +32,7 @@ // Includes. #include "../../Std.h" +#include "../../Storage/String.extern.h" /** * Represents symbol and timeframe. To be used by IndicatorBase and ChartBase classes. diff --git a/Platform/Chart3D/Frontend.h b/Platform/Chart3D/Frontend.h index 39b727d83..52a316a2e 100644 --- a/Platform/Chart3D/Frontend.h +++ b/Platform/Chart3D/Frontend.h @@ -40,7 +40,7 @@ struct DrawTextQueueItem { */ class Frontend : public Dynamic { protected: - DrawTextQueueItem draw_text_queue[]; + ARRAY(DrawTextQueueItem, draw_text_queue); public: /** diff --git a/Platform/Chart3D/IndexBuffer.h b/Platform/Chart3D/IndexBuffer.h index 2ddabdd63..e628369ab 100644 --- a/Platform/Chart3D/IndexBuffer.h +++ b/Platform/Chart3D/IndexBuffer.h @@ -49,12 +49,12 @@ class IndexBuffer : public Dynamic { /** * Creates index buffer. */ - virtual bool Create(void*& _data[]) = NULL; + virtual bool Create(VOID_DATA(_data)) = NULL; /** * Fills index buffer with indices. */ - virtual void Fill(unsigned int& _indices[]) = NULL; + virtual void Fill(ARRAY_REF(unsigned int, _indices)) = NULL; /** * Activates index buffer for rendering. diff --git a/Platform/Platform.extern.h b/Platform/Platform.extern.h index da578fe28..36ed84b64 100644 --- a/Platform/Platform.extern.h +++ b/Platform/Platform.extern.h @@ -27,8 +27,9 @@ // Includes. #include "../Exchange/Account/Account.enum.h" #include "../Storage/Data.define.h" -#include "Deal.enum.h" +#include "../Storage/DateTime.h" #include "../Storage/Object.extern.h" +#include "Deal.enum.h" #include "Order.define.h" #include "Order.enum.h" #include "Terminal.enum.h" @@ -177,4 +178,8 @@ extern bool ObjectDelete(int64 chart_id, string name); extern int ObjectFind(int64 chart_id, string name); +int GetLastError() { return _LastError; } + +void ResetLastError() { _LastError = 0; } + #endif diff --git a/Platform/Platform.h b/Platform/Platform.h index e5910add4..e7b6d9371 100644 --- a/Platform/Platform.h +++ b/Platform/Platform.h @@ -46,11 +46,11 @@ extern int Bars(CONST_REF_TO(string) _symbol, ENUM_TIMEFRAMES _tf); * Current platform's static methods. */ -#include "../Indicators/DrawIndicator.mqh" -#include "../Storage/Flags.struct.h" #include "../Indicator/IndicatorData.h" #include "../Indicator/tests/classes/IndicatorTfDummy.h" +#include "../Indicators/DrawIndicator.mqh" #include "../Std.h" +#include "../Storage/Flags.struct.h" #ifdef __MQLBUILD__ #include "../Indicators/Tick/Indi_TickMt.h" @@ -745,10 +745,6 @@ bool ObjectDelete(int64 chart_id, string name) { return false; } -int GetLastError() { return _LastError; } - -void ResetLastError() { _LastError = 0; } - int ObjectFind(int64 chart_id, string name) { Print("Not yet implemented: ", __FUNCTION__, " returns 0."); return 0; @@ -827,29 +823,29 @@ datetime StructToTime(MqlDateTime &dt_struct) { /** * Will test given indicator class with platform-default data source bindings. */ -#define TEST_INDICATOR_DEFAULT_BINDINGS_PARAMS(C, PARAMS) \ - Ref indi = new C(PARAMS); \ - \ - int OnInit() { \ - Platform::Init(); \ - Platform::AddWithDefaultBindings(indi.Ptr(), "EURUSD", PERIOD_M1); \ - bool _result = true; \ - assertTrueOrFail(indi REF_DEREF IsValid(), "Error on IsValid!"); \ - return (_result && _LastError == ERR_NO_ERROR ? INIT_SUCCEEDED : INIT_FAILED); \ - } \ - \ - void OnTick() { \ - Platform::Tick(); \ - if (Platform::IsNewHour()) { \ - IndicatorDataEntry _entry = indi REF_DEREF GetEntry(); \ +#define TEST_INDICATOR_DEFAULT_BINDINGS_PARAMS(C, PARAMS) \ + Ref indi = new C(PARAMS); \ + \ + int OnInit() { \ + Platform::Init(); \ + Platform::AddWithDefaultBindings(indi.Ptr(), "EURUSD", PERIOD_M1); \ + bool _result = true; \ + assertTrueOrFail(indi REF_DEREF IsValid(), "Error on IsValid!"); \ + return (_result && _LastError == ERR_NO_ERROR ? INIT_SUCCEEDED : INIT_FAILED); \ + } \ + \ + void OnTick() { \ + Platform::Tick(); \ + if (Platform::IsNewHour()) { \ + IndicatorDataEntry _entry = indi REF_DEREF GetEntry(); \ bool _is_ready = indi REF_DEREF Get(STRUCT_ENUM(IndicatorDataState, INDICATOR_DATA_STATE_PROP_IS_READY)); \ - bool _is_valid = _entry.IsValid(); \ - Print(indi REF_DEREF ToString(), _is_ready ? " (Ready)" : " (Not yet ready)"); \ - if (_is_ready && !_is_valid) { \ - Print(indi REF_DEREF ToString(), " (Invalid entry!)"); \ - assertTrueOrExit(_entry.IsValid(), "Invalid entry!"); \ - } \ - } \ + bool _is_valid = _entry.IsValid(); \ + Print(indi REF_DEREF ToString(), _is_ready ? " (Ready)" : " (Not yet ready)"); \ + if (_is_ready && !_is_valid) { \ + Print(indi REF_DEREF ToString(), " (Invalid entry!)"); \ + assertTrueOrExit(_entry.IsValid(), "Invalid entry!"); \ + } \ + } \ } #define TEST_INDICATOR_DEFAULT_BINDINGS(C) TEST_INDICATOR_DEFAULT_BINDINGS_PARAMS(C, ) diff --git a/Platform/Web/Web.h b/Platform/Web/Web.h index 65ee14d20..65bb3ed9f 100644 --- a/Platform/Web/Web.h +++ b/Platform/Web/Web.h @@ -29,6 +29,9 @@ #ifndef WEB_MQH #define WEB_MQH +// Includes. +#include "../../Platform/Platform.h" + struct WebRequestParams { string method; string url; @@ -37,18 +40,17 @@ struct WebRequestParams { string referer; int timeout; WebRequestParams(string _m, string _u, string _h = NULL, int _t = 500) - : method(_m), url(_u), headers(_h), timeout(_t) {}; + : method(_m), url(_u), headers(_h), timeout(_t){}; WebRequestParams(string _m, string _u, string _c, string _r = NULL, int _t = 500) - : method(_m), url(_u), cookie(_c), referer(_r), timeout(_t) {}; - WebRequestParams(string _u, string _h = NULL, int _t = 500) - : method("GET"), url(_u), headers(_h), timeout(_t) {}; + : method(_m), url(_u), cookie(_c), referer(_r), timeout(_t){}; + WebRequestParams(string _u, string _h = NULL, int _t = 500) : method("GET"), url(_u), headers(_h), timeout(_t){}; }; struct WebRequestResult { - char data[]; - char result[]; + ARRAY(char, data); + ARRAY(char, result); int error; - int http_code; // HTTP server response code or -1 for an error. + int http_code; // HTTP server response code or -1 for an error. string headers; }; @@ -56,39 +58,30 @@ struct WebRequestResult { * Implements Web class. */ class Web { + private: + public: + /** + * Class constructor. + */ + Web() {} - private: - - public: - - /** - * Class constructor. - */ - Web() { + /** + * Web request. + * + * Note: Make sure to add URL to the list of allowed URLs in the Terminal. + */ + WebRequestResult Request(const WebRequestParams &_rp) { + ResetLastError(); + WebRequestResult _res; + if (StringLen(_rp.headers) > 0) { + _res.http_code = WebRequest(_rp.method, _rp.url, _rp.headers, _rp.timeout, _res.data, _res.result, _res.headers); + } else { + int _size = 0; // @fixme: data[] array size in bytes. + _res.http_code = WebRequest(_rp.method, _rp.url, _rp.cookie, _rp.referer, _rp.timeout, _res.data, _size, + _res.result, _res.headers); } - - /** - * Web request. - * - * Note: Make sure to add URL to the list of allowed URLs in the Terminal. - */ - WebRequestResult Request(const WebRequestParams &_rp) { - ResetLastError(); - WebRequestResult _res; - if (StringLen(_rp.headers) > 0) { - _res.http_code = WebRequest( - _rp.method, _rp.url, _rp.headers, _rp.timeout, - _res.data, _res.result, _res.headers); - } - else { - int _size = 0; // @fixme: data[] array size in bytes. - _res.http_code = WebRequest( - _rp.method, _rp.url, _rp.cookie, _rp.referer, _rp.timeout, - _res.data, _size, _res.result, _res.headers); - } - _res.error = GetLastError(); - return _res; - } - + _res.error = GetLastError(); + return _res; + } }; #endif diff --git a/Platform/Web/tests/Web.test.cpp b/Platform/Web/tests/Web.test.cpp index 41a909c76..66e9901f0 100644 --- a/Platform/Web/tests/Web.test.cpp +++ b/Platform/Web/tests/Web.test.cpp @@ -24,22 +24,34 @@ * Test C++ compilation of Web class. */ +// Includes. +#include "../../../Storage/String.h" + // External functions. -extern int WebRequest(const string method, // HTTP method - const string url, // URL - const string cookie, // cookie - const string referer, // referer - int timeout, // timeout - const char &data[], // the array of the HTTP message body - int data_size, // data[] array size in bytes - char &result[], // an array containing server response data - string &result_headers // headers of server response +extern int WebRequest(const string method, // HTTP method + const string url, // URL + const string cookie, // cookie + const string referer, // referer + int timeout, // timeout + ARRAY_REF(char, data), // the array of the HTTP message body + int data_size, // data[] array size in bytes + ARRAY_REF(char, result), // an array containing server response data + string &result_headers // headers of server response ); -// Includes. -#include "../Web.h" +// External functions. +extern int WebRequest(const string method, // HTTP method + const string url, // URL + const string headers, // headers + int timeout, // timeout + ARRAY_REF(char, data), // the array of the HTTP message body + ARRAY_REF(char, result), // an array containing server response data + string &result_headers // headers of server response +); +// Includes. #include "../../Platform/Platform.h" +#include "../Web.h" int main(int argc, char **argv) { // @todo diff --git a/Serializer/SerializerBinary.h b/Serializer/SerializerBinary.h index 940e9805b..3110be9b1 100644 --- a/Serializer/SerializerBinary.h +++ b/Serializer/SerializerBinary.h @@ -48,9 +48,9 @@ class SerializerBinary { * Serializes node and its children into binary format. */ static string Stringify(SerializerNode* _node, unsigned int stringify_flags = 0, void* stringify_aux_arg = NULL) { - int size = _node.BinarySize(); + int size = _node PTR_DEREF BinarySize(); - unsigned char bytes[]; + ARRAY(unsigned char, bytes); ArrayResize(bytes, size); StringifyNode(_node, stringify_flags, stringify_aux_arg, bytes); @@ -59,10 +59,10 @@ class SerializerBinary { } static void StringifyNode(SerializerNode* _node, unsigned int stringify_flags, void* stringify_aux_arg, - unsigned char& bytes[], int offset = 0) { + ARRAY_REF(unsigned char, bytes), int offset = 0) { SerializerBinaryValue value; int i; - switch (_node.GetType()) { + switch (_node PTR_DEREF GetType()) { case SerializerNodeArray: break; case SerializerNodeObject: @@ -72,27 +72,27 @@ class SerializerBinary { break; case SerializerNodeObjectProperty: case SerializerNodeArrayItem: - switch (_node.GetValueParam().GetType()) { + switch (_node PTR_DEREF GetValueParam().GetType()) { case SerializerNodeParamBool: - bytes[offset] = _node.GetValueParam()._integral._bool; + bytes[offset] = _node PTR_DEREF GetValueParam()._integral._bool; break; case SerializerNodeParamDouble: - value.Double = _node.GetValueParam()._integral._double; + value.Double = _node PTR_DEREF GetValueParam()._integral._double; for (i = 0; i < sizeof(value.Double); ++i) { bytes[offset + i] = value.Bytes[i]; } break; case SerializerNodeParamLong: - value.Long = _node.GetValueParam()._integral._long; + value.Long = _node PTR_DEREF GetValueParam()._integral._long; for (i = 0; i < sizeof(value.Long); ++i) { bytes[offset + i] = value.Bytes[i]; } break; case SerializerNodeParamString: - for (i = 0; i < StringLen(_node.GetValueParam()._string); ++i) { - bytes[offset + i] = (unsigned char)_node.GetValueParam()._string[i]; + for (i = 0; i < StringLen(_node PTR_DEREF GetValueParam()._string); ++i) { + bytes[offset + i] = (unsigned char)_node PTR_DEREF GetValueParam()._string[i]; } - bytes[StringLen(_node.GetValueParam()._string)] = '\0'; + bytes[StringLen(_node PTR_DEREF GetValueParam()._string)] = '\0'; break; } break; diff --git a/Std.h b/Std.h index fcd91ab3a..8c841aecf 100644 --- a/Std.h +++ b/Std.h @@ -60,6 +60,7 @@ #define nullptr NULL #define REF_DEREF .Ptr(). #define int64 long +#define VOID_DATA(N) void*& N[] #else #define THIS_ATTR this-> #define THIS_PTR (this) @@ -71,6 +72,7 @@ #define MAKE_REF_FROM_PTR(TYPE, NAME, PTR) TYPE& NAME = PTR #define REF_DEREF .Ptr()-> #define int64 long long +#define VOID_DATA(N) void* N #endif // References. diff --git a/Storage/Dict/Buffer/BufferTick.h b/Storage/Dict/Buffer/BufferTick.h index 4998cd4e9..6730ff705 100644 --- a/Storage/Dict/Buffer/BufferTick.h +++ b/Storage/Dict/Buffer/BufferTick.h @@ -25,9 +25,10 @@ #define BUFFER_TICK_H // Includes. +#include "../../../Indicator/IndicatorData.enum.h" #include "../../../Platform/Chart/Chart.enum.h" #include "../../../Tick/Tick.struct.h" -#include "../../IValueStorage.h" +#include "../../ValueStorage.h" #include "BufferStruct.h" // Forward declarations. diff --git a/Storage/Singleton.h b/Storage/Singleton.h index ccc0f4b32..03ae7651e 100644 --- a/Storage/Singleton.h +++ b/Storage/Singleton.h @@ -45,6 +45,6 @@ class Singleton { }; template -C Singleton::_ref; +C Singleton::_ref; #endif // SINGLETON_H diff --git a/Storage/ValueStorage.h b/Storage/ValueStorage.h index 6eb3c4277..aff953856 100644 --- a/Storage/ValueStorage.h +++ b/Storage/ValueStorage.h @@ -65,7 +65,8 @@ enum ENUM_IPEAK { IPEAK_LOWEST, IPEAK_HIGHEST }; _cache.GetPriceBuffer(PRICE_HIGH), _cache.GetPriceBuffer(PRICE_LOW), _cache.GetPriceBuffer(PRICE_CLOSE), \ _tick_volume, _volume, _spread -#define INDICATOR_CALCULATE_GET_PARAMS_SHORT _cache.GetTotal(), _cache.GetPrevCalculated(), 0, _cache.GetPriceBuffer() +#define INDICATOR_CALCULATE_GET_PARAMS_SHORT \ + _cache PTR_DEREF GetTotal(), _cache PTR_DEREF GetPrevCalculated(), 0, PTR_TO_REF(_cache PTR_DEREF GetPriceBuffer()) #define INDICATOR_CALCULATE_POPULATE_CACHE(INDI, KEY) \ IndiBufferCache *_cache; \ diff --git a/Storage/ValueStorage.history.h b/Storage/ValueStorage.history.h index 7beb64ce7..069d67b90 100644 --- a/Storage/ValueStorage.history.h +++ b/Storage/ValueStorage.history.h @@ -34,12 +34,12 @@ #include "ValueStorage.h" // Forward declarations. -class IndicatorData; +class IndicatorBase; template class ValueStorage; #ifndef __MQL__ -extern int GetBarsFromStart(IndicatorData* _indi); +extern int GetBarsFromStart(IndicatorBase* _indi); #endif /** @@ -49,7 +49,7 @@ template class HistoryValueStorage : public ValueStorage { protected: // Indicator used as an OHLC source, e.g. IndicatorCandle. - WeakRef indi_candle; + WeakRef indi_candle; // Whether storage operates in as-series mode. bool is_series; @@ -58,7 +58,7 @@ class HistoryValueStorage : public ValueStorage { /** * Constructor. */ - HistoryValueStorage(IndicatorData* _indi_candle, bool _is_series = false) + HistoryValueStorage(IndicatorBase* _indi_candle, bool _is_series = false) : indi_candle(_indi_candle), is_series(_is_series) { if (_indi_candle == nullptr) { Print("You have to pass IndicatorCandle-compatible indicator as parameter to HistoryValueStorage!"); diff --git a/Storage/ValueStorage.indicator.h b/Storage/ValueStorage.indicator.h index 50c9d300e..29f37d7f1 100644 --- a/Storage/ValueStorage.indicator.h +++ b/Storage/ValueStorage.indicator.h @@ -49,7 +49,7 @@ class IndicatorBufferValueStorage : public HistoryValueStorage { /** * Constructor. */ - IndicatorBufferValueStorage(IndicatorData* _indi_candle, int _mode = 0, bool _is_series = false) + IndicatorBufferValueStorage(IndicatorBase* _indi_candle, int _mode = 0, bool _is_series = false) : HistoryValueStorage(_indi_candle), mode(_mode) {} /** @@ -57,7 +57,7 @@ class IndicatorBufferValueStorage : public HistoryValueStorage { */ #ifdef __MQL__ C Fetch(int _rel_shift) override { - IndicatorData* _indi = THIS_ATTR indi_candle.Ptr(); + IndicatorBase* _indi = THIS_ATTR indi_candle.Ptr(); return _indi PTR_DEREF GetValue(mode, THIS_ATTR RealShift(_rel_shift)); } #else @@ -72,7 +72,7 @@ class IndicatorBufferValueStorage : public HistoryValueStorage { #ifndef __MQL__ template C IndicatorBufferValueStorage::Fetch(int _rel_shift) { - IndicatorData* _indi = THIS_ATTR indi_candle.Ptr(); + IndicatorBase* _indi = THIS_ATTR indi_candle.Ptr(); return _indi PTR_DEREF GetValue(mode, THIS_ATTR RealShift(_rel_shift)); } #endif diff --git a/Storage/ValueStorage.price_median.h b/Storage/ValueStorage.price_median.h index db29ac942..6a05fad9d 100644 --- a/Storage/ValueStorage.price_median.h +++ b/Storage/ValueStorage.price_median.h @@ -24,10 +24,8 @@ * Median price version of ValueStorage. */ -// Forward declarations. -class IndicatorBase; - // Includes. +#include "../Indicator/IndicatorBase.h" #include "Cache/ObjectsCache.h" #include "ValueStorage.history.h" @@ -39,7 +37,7 @@ class PriceMedianValueStorage : public HistoryValueStorage { /** * Constructor. */ - PriceMedianValueStorage(IndicatorData *_indi_candle) : HistoryValueStorage(_indi_candle) {} + PriceMedianValueStorage(IndicatorBase *_indi_candle) : HistoryValueStorage(_indi_candle) {} /** * Copy constructor. diff --git a/Storage/ValueStorage.price_typical.h b/Storage/ValueStorage.price_typical.h index 7a38c19a8..3ca6300f0 100644 --- a/Storage/ValueStorage.price_typical.h +++ b/Storage/ValueStorage.price_typical.h @@ -36,7 +36,7 @@ class PriceTypicalValueStorage : public HistoryValueStorage { /** * Constructor. */ - PriceTypicalValueStorage(IndicatorData *_indi_candle) : HistoryValueStorage(_indi_candle) {} + PriceTypicalValueStorage(IndicatorBase *_indi_candle) : HistoryValueStorage(_indi_candle) {} /** * Copy constructor. diff --git a/Storage/ValueStorage.price_weighted.h b/Storage/ValueStorage.price_weighted.h index 9de66029b..e86b7cbe6 100644 --- a/Storage/ValueStorage.price_weighted.h +++ b/Storage/ValueStorage.price_weighted.h @@ -36,7 +36,7 @@ class PriceWeightedValueStorage : public HistoryValueStorage { /** * Constructor. */ - PriceWeightedValueStorage(IndicatorData *_indi_candle) : HistoryValueStorage(_indi_candle) {} + PriceWeightedValueStorage(IndicatorBase *_indi_candle) : HistoryValueStorage(_indi_candle) {} /** * Copy constructor. diff --git a/Storage/ValueStorage.spread.h b/Storage/ValueStorage.spread.h index 8f84bcd71..dfab07af5 100644 --- a/Storage/ValueStorage.spread.h +++ b/Storage/ValueStorage.spread.h @@ -36,7 +36,7 @@ class SpreadValueStorage : public HistoryValueStorage { /** * Constructor. */ - SpreadValueStorage(IndicatorData *_indi_candle) : HistoryValueStorage(_indi_candle) {} + SpreadValueStorage(IndicatorBase *_indi_candle) : HistoryValueStorage(_indi_candle) {} /** * Copy constructor. diff --git a/Storage/ValueStorage.tick_volume.h b/Storage/ValueStorage.tick_volume.h index f8061b092..6c015ca7f 100644 --- a/Storage/ValueStorage.tick_volume.h +++ b/Storage/ValueStorage.tick_volume.h @@ -36,7 +36,7 @@ class TickVolumeValueStorage : public HistoryValueStorage { /** * Constructor. */ - TickVolumeValueStorage(IndicatorData *_indi_candle) : HistoryValueStorage(_indi_candle) {} + TickVolumeValueStorage(IndicatorBase *_indi_candle) : HistoryValueStorage(_indi_candle) {} /** * Copy constructor. diff --git a/Storage/ValueStorage.time.h b/Storage/ValueStorage.time.h index 964bf5709..b8670c40b 100644 --- a/Storage/ValueStorage.time.h +++ b/Storage/ValueStorage.time.h @@ -37,7 +37,7 @@ class TimeValueStorage : public HistoryValueStorage { /** * Constructor. */ - TimeValueStorage(IndicatorData *_indi_candle) : HistoryValueStorage(_indi_candle) {} + TimeValueStorage(IndicatorBase *_indi_candle) : HistoryValueStorage(_indi_candle) {} /** * Copy constructor. diff --git a/Storage/ValueStorage.volume.h b/Storage/ValueStorage.volume.h index 396f2ce03..ee5f867b8 100644 --- a/Storage/ValueStorage.volume.h +++ b/Storage/ValueStorage.volume.h @@ -36,7 +36,7 @@ class VolumeValueStorage : public HistoryValueStorage { /** * Constructor. */ - VolumeValueStorage(IndicatorData *_indi_candle) : HistoryValueStorage(_indi_candle) {} + VolumeValueStorage(IndicatorBase *_indi_candle) : HistoryValueStorage(_indi_candle) {} /** * Copy constructor. From fb4b2278c278175ea8b7528938eb31719c2b2a3b Mon Sep 17 00:00:00 2001 From: Adrian Kierzkowski Date: Tue, 20 Jun 2023 19:35:04 +0200 Subject: [PATCH 071/109] Continuation of fixing C++ compile errors. --- Serializer/SerializerBinary.h | 14 +++++++------- Std.h | 2 ++ Storage/Array.extern.h | 10 ++++++++-- Storage/Database.h | 7 ------- Storage/Database.struct.h | 9 ++++++++- Storage/Dict/Buffer/Buffer.h | 2 +- Storage/Dict/Buffer/BufferFXT.h | 8 ++++---- Storage/String.extern.h | 25 ++++++++++++++++++++----- 8 files changed, 50 insertions(+), 27 deletions(-) diff --git a/Serializer/SerializerBinary.h b/Serializer/SerializerBinary.h index 3110be9b1..003fa6163 100644 --- a/Serializer/SerializerBinary.h +++ b/Serializer/SerializerBinary.h @@ -72,27 +72,27 @@ class SerializerBinary { break; case SerializerNodeObjectProperty: case SerializerNodeArrayItem: - switch (_node PTR_DEREF GetValueParam().GetType()) { + switch (_node PTR_DEREF GetValueParam() PTR_DEREF GetType()) { case SerializerNodeParamBool: - bytes[offset] = _node PTR_DEREF GetValueParam()._integral._bool; + bytes[offset] = _node PTR_DEREF GetValueParam() PTR_DEREF _integral._bool; break; case SerializerNodeParamDouble: - value.Double = _node PTR_DEREF GetValueParam()._integral._double; + value.Double = _node PTR_DEREF GetValueParam() PTR_DEREF _integral._double; for (i = 0; i < sizeof(value.Double); ++i) { bytes[offset + i] = value.Bytes[i]; } break; case SerializerNodeParamLong: - value.Long = _node PTR_DEREF GetValueParam()._integral._long; + value.Long = _node PTR_DEREF GetValueParam() PTR_DEREF _integral._long; for (i = 0; i < sizeof(value.Long); ++i) { bytes[offset + i] = value.Bytes[i]; } break; case SerializerNodeParamString: - for (i = 0; i < StringLen(_node PTR_DEREF GetValueParam()._string); ++i) { - bytes[offset + i] = (unsigned char)_node PTR_DEREF GetValueParam()._string[i]; + for (i = 0; i < StringLen(_node PTR_DEREF GetValueParam() PTR_DEREF _string); ++i) { + bytes[offset + i] = (unsigned char)_node PTR_DEREF GetValueParam() PTR_DEREF _string[i]; } - bytes[StringLen(_node PTR_DEREF GetValueParam()._string)] = '\0'; + bytes[StringLen(_node PTR_DEREF GetValueParam() PTR_DEREF _string)] = '\0'; break; } break; diff --git a/Std.h b/Std.h index 8c841aecf..5a0813afc 100644 --- a/Std.h +++ b/Std.h @@ -116,6 +116,7 @@ * ARRAY(, ) */ #define ARRAY(T, N) T N[] +#define FIXED_ARRAY(T, N, SIZE) T N[SIZE] #else /** @@ -143,6 +144,7 @@ * ARRAY(, ) */ #define ARRAY(T, N) ::_cpp_array N +#define FIXED_ARRAY(T, N, SIZE) T N[SIZE] #endif // typename(T) diff --git a/Storage/Array.extern.h b/Storage/Array.extern.h index 80209f126..6d546c059 100644 --- a/Storage/Array.extern.h +++ b/Storage/Array.extern.h @@ -80,13 +80,19 @@ bool ArrayReverse(ARRAY_REF(T, _array)) { } template -extern int ArrayInitialize(ARRAY_REF(T, array), char value) { +int ArrayInitialize(ARRAY_REF(T, array), char value) { + Print("Not yet implemented: ", __FUNCTION__, " returns 0."); + return 0; +} + +template +int ArrayInitialize(FIXED_ARRAY_REF(T, array, size), char value) { Print("Not yet implemented: ", __FUNCTION__, " returns 0."); return 0; } template -extern int ArraySort(ARRAY_REF(T, array)) { +int ArraySort(ARRAY_REF(T, array)) { Print("Not yet implemented: ", __FUNCTION__, " returns 0."); return 0; } diff --git a/Storage/Database.h b/Storage/Database.h index c22a17b2d..53cee9ac8 100644 --- a/Storage/Database.h +++ b/Storage/Database.h @@ -37,13 +37,6 @@ #include "../Storage/Dict/DictStruct.h" #include "Database.struct.h" -// Enums. -enum DATABASE_COLUMN_FLAGS { - DATABASE_COLUMN_FLAG_NONE = 0, - DATABASE_COLUMN_FLAG_IS_KEY = 1, - DATABASE_COLUMN_FLAG_IS_NULL = 2, -}; - class Database { private: int handle; diff --git a/Storage/Database.struct.h b/Storage/Database.struct.h index 21af84f59..a34cf232b 100644 --- a/Storage/Database.struct.h +++ b/Storage/Database.struct.h @@ -25,6 +25,13 @@ * */ +// Enums. +enum DATABASE_COLUMN_FLAGS { + DATABASE_COLUMN_FLAG_NONE = 0, + DATABASE_COLUMN_FLAG_IS_KEY = 1, + DATABASE_COLUMN_FLAG_IS_NULL = 2, +}; + // Structs. struct DatabaseTableColumnEntry { string name; @@ -77,7 +84,7 @@ struct DatabaseTableSchema { DictStruct columns; // Constructor. DatabaseTableSchema() {} - DatabaseTableSchema(DatabaseTableColumnEntry &_columns[]) { + DatabaseTableSchema(ARRAY_REF(DatabaseTableColumnEntry, _columns)) { for (int i = 0; i < ArraySize(_columns); i++) { columns.Push(_columns[i]); } diff --git a/Storage/Dict/Buffer/Buffer.h b/Storage/Dict/Buffer/Buffer.h index 6fb6e427c..61e080091 100644 --- a/Storage/Dict/Buffer/Buffer.h +++ b/Storage/Dict/Buffer/Buffer.h @@ -33,7 +33,7 @@ template class Buffer : public Dict { public: - void Buffer() {} + Buffer() {} /** * Adds new value. diff --git a/Storage/Dict/Buffer/BufferFXT.h b/Storage/Dict/Buffer/BufferFXT.h index 1a8f42803..1ef9ee21c 100644 --- a/Storage/Dict/Buffer/BufferFXT.h +++ b/Storage/Dict/Buffer/BufferFXT.h @@ -99,8 +99,8 @@ struct BufferFXTEntry { // FXT file header. struct BufferFXTHeader { - int version; // Header version: 405 - char copyright[64]; // Copyright/description. + int version; // Header version: 405 + ARRAY(char, copyright[64]; // Copyright/description. char description[128]; // Account server name. // 196 char symbol[12]; // Symbol pair. @@ -209,11 +209,11 @@ struct BufferFXTHeader { swap_long(_source PTR_DEREF GetSymbolProps().GetSwapLong()), swap_short(_source PTR_DEREF GetSymbolProps().GetSwapShort()), swap_rollover3days(3), - leverage((int)_a.GetLeverage()), + leverage((int)_a PTR_DEREF GetLeverage()), free_margin_mode(MARGIN_DONT_USE), margin_mode(MARGIN_CALC_FOREX), margin_stopout(30), // @fixme: _a.GetStopoutLevel() based on ACCOUNT_MARGIN_SO_CALL. - margin_stopout_mode(_a.GetStopoutMode()), + margin_stopout_mode(_a PTR_DEREF GetStopoutMode()), margin_initial(_source PTR_DEREF GetSymbolProps().GetMarginInit()), margin_maintenance(_source PTR_DEREF GetSymbolProps().GetMarginMaintenance()), margin_hedged(0), diff --git a/Storage/String.extern.h b/Storage/String.extern.h index e5dcc76dc..0a269553e 100644 --- a/Storage/String.extern.h +++ b/Storage/String.extern.h @@ -102,6 +102,26 @@ unsigned short StringGetCharacter(string string_value, int pos) { return string_value[pos]; } +bool StringInit(string& string_var, int new_len = 0, unsigned short character = 0) { + string_var = string(new_len, (char)character); + return true; +} + +string CharArrayToString(ARRAY_REF(unsigned char, arr), int start = 0, int count = -1, unsigned int codepage = CP_ACP) { + if (count == -1) count = (arr.size() - start); + + int _end = MathMin(count - start, arr.size()); + + string result; + StringInit(result, count); + + for (int i = 0; i < count; ++i) { + result[i] = arr[i]; + } + + return result; +} + int StringToCharArray(string text_string, ARRAY_REF(unsigned char, array), int start = 0, int count = -1, unsigned int codepage = CP_ACP) { if (count == -1) count = text_string.size(); @@ -112,11 +132,6 @@ int StringToCharArray(string text_string, ARRAY_REF(unsigned char, array), int s return array.size(); } -bool StringInit(string& string_var, int new_len = 0, unsigned short character = 0) { - string_var = string(new_len, (char)character); - return true; -} - /** * It replaces all the found substrings of a string by a set sequence of symbols. * From 143e9e6eb3cd6f528a60ea0081ae80b11b20fb25 Mon Sep 17 00:00:00 2001 From: kenorb Date: Mon, 19 Jun 2023 00:47:05 +0100 Subject: [PATCH 072/109] Moves SymbolInfo under Exchange/ --- .../workflows/test-exchange-symbolinfo.yml | 60 +++++++++++++++++++ .github/workflows/test.yml | 1 - Convert.mqh | 6 +- Exchange/Account/AccountMt.h | 2 +- Exchange/Exchange.h | 2 +- .../SymbolInfo/SymbolInfo.define.h | 0 .../SymbolInfo/SymbolInfo.enum.h | 0 .../SymbolInfo/SymbolInfo.enum.symbols.h | 0 .../SymbolInfo/SymbolInfo.extern.h | 4 +- .../SymbolInfo/SymbolInfo.h | 6 +- .../SymbolInfo/SymbolInfo.struct.h | 8 +-- .../SymbolInfo/SymbolInfo.struct.static.h | 10 ++-- Exchange/SymbolInfo/tests/Makefile | 12 ++++ Exchange/SymbolInfo/tests/SymbolInfo.test.cpp | 36 +++++++++++ .../SymbolInfo/tests/SymbolInfo.test.mq4 | 2 +- .../SymbolInfo/tests/SymbolInfo.test.mq5 | 4 +- Indicator/IndicatorData.h | 2 +- Indicator/tests/IndicatorTf.test.mq5 | 2 +- Market.mqh | 4 +- Platform/Order.h | 2 +- Platform/Order.struct.h | 2 +- Platform/Orders.h | 1 + Platform/Platform.h | 2 +- Storage/tests/Database.test.mq5 | 2 +- Tester.mqh | 2 +- Ticker.mqh | 2 +- tests/CompileTest.mq5 | 2 +- 27 files changed, 142 insertions(+), 34 deletions(-) create mode 100644 .github/workflows/test-exchange-symbolinfo.yml rename SymbolInfo.define.h => Exchange/SymbolInfo/SymbolInfo.define.h (100%) rename SymbolInfo.enum.h => Exchange/SymbolInfo/SymbolInfo.enum.h (100%) rename SymbolInfo.enum.symbols.h => Exchange/SymbolInfo/SymbolInfo.enum.symbols.h (100%) rename SymbolInfo.extern.h => Exchange/SymbolInfo/SymbolInfo.extern.h (95%) rename SymbolInfo.mqh => Exchange/SymbolInfo/SymbolInfo.h (99%) rename SymbolInfo.struct.h => Exchange/SymbolInfo/SymbolInfo.struct.h (97%) rename SymbolInfo.struct.static.h => Exchange/SymbolInfo/SymbolInfo.struct.static.h (99%) create mode 100644 Exchange/SymbolInfo/tests/Makefile create mode 100644 Exchange/SymbolInfo/tests/SymbolInfo.test.cpp rename tests/SymbolInfoTest.mq4 => Exchange/SymbolInfo/tests/SymbolInfo.test.mq4 (97%) rename tests/SymbolInfoTest.mq5 => Exchange/SymbolInfo/tests/SymbolInfo.test.mq5 (99%) diff --git a/.github/workflows/test-exchange-symbolinfo.yml b/.github/workflows/test-exchange-symbolinfo.yml new file mode 100644 index 000000000..230dfccc2 --- /dev/null +++ b/.github/workflows/test-exchange-symbolinfo.yml @@ -0,0 +1,60 @@ +--- +name: Test Exchange/SymbolInfo + +# yamllint disable-line rule:truthy +on: + pull_request: + paths: + - 'Exchange/SymbolInfo/**' + - '.github/workflows/test-exchange/symbolinfo.yml' + push: + paths: + - 'Exchange/SymbolInfo/**' + - '.github/workflows/test-exchange/symbolinfo.yml' + +jobs: + + Compile: + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + - name: Compile + uses: fx31337/mql-compile-action@master + with: + init-platform: true + path: 'Exchange/SymbolInfo/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@v3 + with: + name: files-ex4 + path: '**/*.ex4' + - name: Upload artifacts (MQL5) + uses: actions/upload-artifact@v3 + with: + name: files-ex5 + path: '**/*.ex5' + + Tests-MQL4: + defaults: + run: + shell: bash + working-directory: Exchange/SymbolInfo/tests + needs: Compile + runs-on: ubuntu-latest + strategy: + matrix: + test: + - SymbolInfo.test + steps: + - uses: actions/download-artifact@v3 + with: + name: files-ex4 + - name: Run ${{ matrix.test }} + uses: fx31337/mql-tester-action@master + with: + Script: ${{ matrix.test }} + timeout-minutes: 10 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d08552121..7897fbefd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -60,7 +60,6 @@ jobs: - StrategyTest - StrategyTest-RSI - SummaryReportTest - - SymbolInfoTest - TickerTest - TradeTest max-parallel: 4 diff --git a/Convert.mqh b/Convert.mqh index 07f02c2bd..1103756d2 100644 --- a/Convert.mqh +++ b/Convert.mqh @@ -34,9 +34,9 @@ #include "Storage/DateTime.h" #include "Math/Math.extern.h" #include "Platform/Order.enum.h" -#include "SymbolInfo.enum.h" -#include "SymbolInfo.extern.h" -#include "SymbolInfo.struct.static.h" +#include "Exchange/SymbolInfo/SymbolInfo.enum.h" +#include "Exchange/SymbolInfo/SymbolInfo.extern.h" +#include "Exchange/SymbolInfo/SymbolInfo.struct.static.h" /** * Class to provide conversion methods. diff --git a/Exchange/Account/AccountMt.h b/Exchange/Account/AccountMt.h index eb53bed17..36f7fa12f 100644 --- a/Exchange/Account/AccountMt.h +++ b/Exchange/Account/AccountMt.h @@ -36,7 +36,7 @@ class AccountMt; #include "../../Platform/Order.struct.h" #include "../../Platform/Orders.h" #include "../../Serializer/Serializer.h" -#include "../../SymbolInfo.mqh" +#include "../../Exchange/SymbolInfo/SymbolInfo.h" #include "../../Task/TaskCondition.enum.h" #include "../../Trade.struct.h" #include "Account.define.h" diff --git a/Exchange/Exchange.h b/Exchange/Exchange.h index 784416e9b..cefd5847b 100644 --- a/Exchange/Exchange.h +++ b/Exchange/Exchange.h @@ -29,7 +29,7 @@ // Includes. #include "Account/Account.h" #include "../Storage/Dict/DictObject.h" -#include "../SymbolInfo.mqh" +#include "../Exchange/SymbolInfo/SymbolInfo.h" #include "../Trade.mqh" #include "Exchange.struct.h" diff --git a/SymbolInfo.define.h b/Exchange/SymbolInfo/SymbolInfo.define.h similarity index 100% rename from SymbolInfo.define.h rename to Exchange/SymbolInfo/SymbolInfo.define.h diff --git a/SymbolInfo.enum.h b/Exchange/SymbolInfo/SymbolInfo.enum.h similarity index 100% rename from SymbolInfo.enum.h rename to Exchange/SymbolInfo/SymbolInfo.enum.h diff --git a/SymbolInfo.enum.symbols.h b/Exchange/SymbolInfo/SymbolInfo.enum.symbols.h similarity index 100% rename from SymbolInfo.enum.symbols.h rename to Exchange/SymbolInfo/SymbolInfo.enum.symbols.h diff --git a/SymbolInfo.extern.h b/Exchange/SymbolInfo/SymbolInfo.extern.h similarity index 95% rename from SymbolInfo.extern.h rename to Exchange/SymbolInfo/SymbolInfo.extern.h index d95799228..e6577ec2b 100644 --- a/SymbolInfo.extern.h +++ b/Exchange/SymbolInfo/SymbolInfo.extern.h @@ -21,9 +21,9 @@ */ // Includes. -#include "Platform/Order.enum.h" +#include "../../Platform/Order.enum.h" #include "SymbolInfo.enum.h" -#include "Tick/Tick.struct.h" +#include "../../Tick/Tick.struct.h" // Define external global functions. #ifndef __MQL__ diff --git a/SymbolInfo.mqh b/Exchange/SymbolInfo/SymbolInfo.h similarity index 99% rename from SymbolInfo.mqh rename to Exchange/SymbolInfo/SymbolInfo.h index 6e7581194..f62ed4443 100644 --- a/SymbolInfo.mqh +++ b/Exchange/SymbolInfo/SymbolInfo.h @@ -37,9 +37,9 @@ class Log; class SymbolInfo; // Includes. -#include "Log.mqh" -#include "Serializer/Serializer.h" -#include "Serializer/SerializerNode.enum.h" +#include "../../Log.mqh" +#include "../../Serializer/Serializer.h" +#include "../../Serializer/SerializerNode.enum.h" /** * Class to provide symbol information. diff --git a/SymbolInfo.struct.h b/Exchange/SymbolInfo/SymbolInfo.struct.h similarity index 97% rename from SymbolInfo.struct.h rename to Exchange/SymbolInfo/SymbolInfo.struct.h index 46c91e477..866fcd088 100644 --- a/SymbolInfo.struct.h +++ b/Exchange/SymbolInfo/SymbolInfo.struct.h @@ -31,11 +31,11 @@ #endif // Includes. -#include "Serializer/Serializable.h" -#include "Serializer/Serializer.h" -#include "Std.h" +#include "../../Serializer/Serializable.h" +#include "../../Serializer/Serializer.h" +#include "../../Std.h" #include "SymbolInfo.struct.static.h" -#include "Tick/Tick.struct.h" +#include "../../Tick/Tick.struct.h" // Defines struct to store symbol data. struct SymbolInfoEntry diff --git a/SymbolInfo.struct.static.h b/Exchange/SymbolInfo/SymbolInfo.struct.static.h similarity index 99% rename from SymbolInfo.struct.static.h rename to Exchange/SymbolInfo/SymbolInfo.struct.static.h index d6ff0c70e..2ab5f6257 100644 --- a/SymbolInfo.struct.static.h +++ b/Exchange/SymbolInfo/SymbolInfo.struct.static.h @@ -25,13 +25,13 @@ #pragma once #endif -#include "Platform/MQL5.mqh" -#include "Platform/Order.enum.h" -#include "Platform/Platform.extern.h" -#include "Std.h" +#include "../../Platform/MQL5.mqh" +#include "../../Platform/Order.enum.h" +#include "../../Platform/Platform.extern.h" +#include "../../Std.h" #include "SymbolInfo.enum.h" #include "SymbolInfo.extern.h" -#include "Tick/Tick.struct.h" +#include "../../Tick/Tick.struct.h" /** * Struct to provide symbol information. diff --git a/Exchange/SymbolInfo/tests/Makefile b/Exchange/SymbolInfo/tests/Makefile new file mode 100644 index 000000000..e792364f0 --- /dev/null +++ b/Exchange/SymbolInfo/tests/Makefile @@ -0,0 +1,12 @@ +CC := g++ # C++ compiler +CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags +SRCS := $(wildcard *.cpp) # Get all .cpp files in the current directory +OBJS := $(SRCS:.cpp=.o) # Object files corresponding to the source files + +all: $(OBJS) + +%.o: %.cpp + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -v $(OBJS) diff --git a/Exchange/SymbolInfo/tests/SymbolInfo.test.cpp b/Exchange/SymbolInfo/tests/SymbolInfo.test.cpp new file mode 100644 index 000000000..2ac8589ce --- /dev/null +++ b/Exchange/SymbolInfo/tests/SymbolInfo.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of SymbolInfo class. + */ + +// Includes. +#include "../SymbolInfo.h" +#include "../../../Platform/Platform.h" + +int main(int argc, char **argv) { + + // @todo + + return 0; +} diff --git a/tests/SymbolInfoTest.mq4 b/Exchange/SymbolInfo/tests/SymbolInfo.test.mq4 similarity index 97% rename from tests/SymbolInfoTest.mq4 rename to Exchange/SymbolInfo/tests/SymbolInfo.test.mq4 index 7ef7c4c2c..972bc282e 100644 --- a/tests/SymbolInfoTest.mq4 +++ b/Exchange/SymbolInfo/tests/SymbolInfo.test.mq4 @@ -25,4 +25,4 @@ */ // Includes. -#include "SymbolInfoTest.mq5" +#include "SymbolInfo.test.mq5" diff --git a/tests/SymbolInfoTest.mq5 b/Exchange/SymbolInfo/tests/SymbolInfo.test.mq5 similarity index 99% rename from tests/SymbolInfoTest.mq5 rename to Exchange/SymbolInfo/tests/SymbolInfo.test.mq5 index 3318f213b..55f2e2448 100644 --- a/tests/SymbolInfoTest.mq5 +++ b/Exchange/SymbolInfo/tests/SymbolInfo.test.mq5 @@ -25,8 +25,8 @@ */ // Includes. -#include "../SymbolInfo.mqh" -#include "../Test.mqh" +#include "../SymbolInfo.h" +#include "../../../Test.mqh" /** * Implements OnInit(). diff --git a/Indicator/IndicatorData.h b/Indicator/IndicatorData.h index 80a5b4881..fe415e9df 100644 --- a/Indicator/IndicatorData.h +++ b/Indicator/IndicatorData.h @@ -45,7 +45,7 @@ struct ExternInstantiateIndicatorBufferValueStorageDouble { #include "../Storage/Flags.struct.h" #include "../Storage/IValueStorage.h" #include "../Storage/ItemsHistory.h" -#include "../SymbolInfo.struct.h" +#include "../Exchange/SymbolInfo/SymbolInfo.struct.h" #include "Indicator.enum.h" #include "IndicatorBase.h" #include "IndicatorData.enum.h" diff --git a/Indicator/tests/IndicatorTf.test.mq5 b/Indicator/tests/IndicatorTf.test.mq5 index a136b6801..58f48f951 100644 --- a/Indicator/tests/IndicatorTf.test.mq5 +++ b/Indicator/tests/IndicatorTf.test.mq5 @@ -32,7 +32,7 @@ #include "../../Log.mqh" #include "../../Platform/Platform.h" #include "../../Storage/Dict/DictBase.h" -#include "../../SymbolInfo.mqh" +#include "../../Exchange/SymbolInfo/SymbolInfo.h" #include "../../Test.mqh" #include "../../Util.h" #include "../IndicatorTf.h" diff --git a/Market.mqh b/Market.mqh index b78fa7977..47d7a516c 100644 --- a/Market.mqh +++ b/Market.mqh @@ -28,8 +28,8 @@ #include "Market.struct.h" #include "Math/Math.h" #include "Serializer/Serializer.h" -#include "SymbolInfo.mqh" -#include "SymbolInfo.struct.static.h" +#include "Exchange/SymbolInfo/SymbolInfo.h" +#include "Exchange/SymbolInfo/SymbolInfo.struct.static.h" #include "Task/TaskCondition.enum.h" /** diff --git a/Platform/Order.h b/Platform/Order.h index ef1aa45e8..4e0f14a19 100644 --- a/Platform/Order.h +++ b/Platform/Order.h @@ -47,7 +47,7 @@ class SymbolInfo; #include "../Serializer/SerializerJson.h" #include "../Std.h" #include "../Storage/String.h" -#include "../SymbolInfo.mqh" +#include "../Exchange/SymbolInfo/SymbolInfo.h" #include "../Task/TaskAction.enum.h" /* Defines for backward compatibility. */ diff --git a/Platform/Order.struct.h b/Platform/Order.struct.h index 0b6aa9d61..be4d53b2b 100644 --- a/Platform/Order.struct.h +++ b/Platform/Order.struct.h @@ -35,7 +35,7 @@ #include "Order.enum.h" #include "Platform.extern.h" #include "../Serializer/Serializer.h" -#include "../SymbolInfo.struct.static.h" +#include "../Exchange/SymbolInfo/SymbolInfo.struct.static.h" #include "Terminal.h" #ifndef __MQL5__ diff --git a/Platform/Orders.h b/Platform/Orders.h index 93fc2ded7..6341f2002 100644 --- a/Platform/Orders.h +++ b/Platform/Orders.h @@ -25,6 +25,7 @@ class Orders; // Includes. #include "../Exchange/Account/Account.h" +#include "../Exchange/SymbolInfo/SymbolInfo.struct.static.h" #include "Chart/Chart.struct.static.h" #include "../Log.mqh" #include "../Math/Math.h" diff --git a/Platform/Platform.h b/Platform/Platform.h index 35903ea95..e5910add4 100644 --- a/Platform/Platform.h +++ b/Platform/Platform.h @@ -59,7 +59,7 @@ extern int Bars(CONST_REF_TO(string) _symbol, ENUM_TIMEFRAMES _tf); #include "../Indicators/Tick/Indi_TickProvider.h" #define PLATFORM_DEFAULT_INDICATOR_TICK Indi_TickProvider #endif -#include "../SymbolInfo.struct.static.h" +#include "../Exchange/SymbolInfo/SymbolInfo.struct.static.h" class Platform { // Whether Init() was already called. diff --git a/Storage/tests/Database.test.mq5 b/Storage/tests/Database.test.mq5 index 94d709e79..0ddda6d1d 100644 --- a/Storage/tests/Database.test.mq5 +++ b/Storage/tests/Database.test.mq5 @@ -25,7 +25,7 @@ */ // Need to be include before Database.h. -#include "../../SymbolInfo.mqh" // FOOBAR pragma: keep +#include "../../Exchange/SymbolInfo/SymbolInfo.h" // FOOBAR pragma: keep // Includes. #include "../../Test.mqh" diff --git a/Tester.mqh b/Tester.mqh index 9f4fb4ed3..0538230cf 100644 --- a/Tester.mqh +++ b/Tester.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "SymbolInfo.mqh" +#include "Exchange/SymbolInfo/SymbolInfo.h" #include "Platform/Terminal.h" /** diff --git a/Ticker.mqh b/Ticker.mqh index 53b7097d7..a1d90d55c 100644 --- a/Ticker.mqh +++ b/Ticker.mqh @@ -30,7 +30,7 @@ class Chart; // Includes. #include "Platform/Chart/Chart.h" #include "Log.mqh" -#include "SymbolInfo.mqh" +#include "Exchange/SymbolInfo/SymbolInfo.h" //#include "Market.mqh" // Define an assert macros. diff --git a/tests/CompileTest.mq5 b/tests/CompileTest.mq5 index 0fc665dbf..e00a17cbd 100644 --- a/tests/CompileTest.mq5 +++ b/tests/CompileTest.mq5 @@ -88,7 +88,7 @@ struct IndicatorParams; #include "../Strategy.mqh" #include "../Storage/String.h" #include "../SummaryReport.mqh" -#include "../SymbolInfo.mqh" +#include "../Exchange/SymbolInfo/SymbolInfo.h" #include "../Task/Task.h" #include "../Task/TaskAction.h" #include "../Task/TaskCondition.h" From e4fdf8cfcae0119a1765f87f5a640927c884644c Mon Sep 17 00:00:00 2001 From: kenorb Date: Tue, 20 Jun 2023 00:09:04 +0100 Subject: [PATCH 073/109] Moves Indi_Pivot to PriceRange/ --- .github/workflows/test-indicators-pricerange.yml | 1 + .github/workflows/test-indicators.yml | 1 - Indicators/{Indi_Pivot.mqh => PriceRange/Indi_Pivot.h} | 8 ++++---- Indicators/PriceRange/includes.h | 1 + Indicators/{ => PriceRange}/tests/Indi_Pivot.test.mq4 | 0 Indicators/{ => PriceRange}/tests/Indi_Pivot.test.mq5 | 6 +++--- Indicators/includes.h | 1 - 7 files changed, 9 insertions(+), 9 deletions(-) rename Indicators/{Indi_Pivot.mqh => PriceRange/Indi_Pivot.h} (97%) rename Indicators/{ => PriceRange}/tests/Indi_Pivot.test.mq4 (100%) rename Indicators/{ => PriceRange}/tests/Indi_Pivot.test.mq5 (92%) diff --git a/.github/workflows/test-indicators-pricerange.yml b/.github/workflows/test-indicators-pricerange.yml index d7f14cf45..1a9b1938d 100644 --- a/.github/workflows/test-indicators-pricerange.yml +++ b/.github/workflows/test-indicators-pricerange.yml @@ -52,6 +52,7 @@ jobs: test: - Indi_Bands.test - Indi_Envelopes.test + - Indi_Pivot.test - Indi_SAR.test steps: - uses: actions/download-artifact@v3 diff --git a/.github/workflows/test-indicators.yml b/.github/workflows/test-indicators.yml index 7a0ffa7dc..2d68e970f 100644 --- a/.github/workflows/test-indicators.yml +++ b/.github/workflows/test-indicators.yml @@ -86,7 +86,6 @@ jobs: - Indi_Momentum.test - Indi_OBV.test - Indi_OsMA.test - - Indi_Pivot.test - Indi_PriceChannel.test - Indi_PriceFeeder.test - Indi_PriceVolumeTrend.test diff --git a/Indicators/Indi_Pivot.mqh b/Indicators/PriceRange/Indi_Pivot.h similarity index 97% rename from Indicators/Indi_Pivot.mqh rename to Indicators/PriceRange/Indi_Pivot.h index 3a3f4e8eb..f19c7fa4a 100644 --- a/Indicators/Indi_Pivot.mqh +++ b/Indicators/PriceRange/Indi_Pivot.h @@ -21,10 +21,10 @@ */ // Includes. -#include "../Bar.struct.h" -#include "../Indicator/Indicator.struct.h" -#include "../Serializer/Serializer.h" -#include "Special/Indi_Math.mqh" +#include "../../Bar.struct.h" +#include "../../Indicator/Indicator.struct.h" +#include "../../Serializer/Serializer.h" +#include "../Special/Indi_Math.mqh" // Structs. struct IndiPivotParams : IndicatorParams { diff --git a/Indicators/PriceRange/includes.h b/Indicators/PriceRange/includes.h index 9275ab9b4..b4f73d5bc 100644 --- a/Indicators/PriceRange/includes.h +++ b/Indicators/PriceRange/includes.h @@ -28,4 +28,5 @@ // Price indicators. #include "Indi_Bands.h" #include "Indi_Envelopes.h" +#include "Indi_Pivot.h" #include "Indi_SAR.h" diff --git a/Indicators/tests/Indi_Pivot.test.mq4 b/Indicators/PriceRange/tests/Indi_Pivot.test.mq4 similarity index 100% rename from Indicators/tests/Indi_Pivot.test.mq4 rename to Indicators/PriceRange/tests/Indi_Pivot.test.mq4 diff --git a/Indicators/tests/Indi_Pivot.test.mq5 b/Indicators/PriceRange/tests/Indi_Pivot.test.mq5 similarity index 92% rename from Indicators/tests/Indi_Pivot.test.mq5 rename to Indicators/PriceRange/tests/Indi_Pivot.test.mq5 index 8aa9a0135..39c819b81 100644 --- a/Indicators/tests/Indi_Pivot.test.mq5 +++ b/Indicators/PriceRange/tests/Indi_Pivot.test.mq5 @@ -20,9 +20,9 @@ */ // Includes. -#include "../../Platform/Platform.h" -#include "../../Test.mqh" -#include "../Indi_Pivot.mqh" +#include "../../../Platform/Platform.h" +#include "../../../Test.mqh" +#include "../Indi_Pivot.h" /** * @file diff --git a/Indicators/includes.h b/Indicators/includes.h index 02c2c29e5..e7c2d0799 100644 --- a/Indicators/includes.h +++ b/Indicators/includes.h @@ -62,7 +62,6 @@ #include "Indi_Momentum.mqh" #include "Indi_OBV.mqh" #include "Indi_OsMA.mqh" -#include "Indi_Pivot.mqh" #include "Indi_PriceChannel.mqh" #include "Indi_PriceFeeder.mqh" #include "Indi_PriceVolumeTrend.mqh" From 9231484a757a45dcebe8d3d24258c1efa3ec6822 Mon Sep 17 00:00:00 2001 From: kenorb Date: Tue, 20 Jun 2023 23:50:33 +0100 Subject: [PATCH 074/109] Adds info about MACD, RSI, Stochastic and WPR --- Indicators/Oscillator/Indi_MACD.h | 5 +++ Indicators/Oscillator/Indi_RSI.h | 5 +++ Indicators/Oscillator/Indi_Stochastic.h | 5 +++ Indicators/Oscillator/Indi_WPR.h | 5 +++ Indicators/Oscillator/README.md | 46 +++++++++++++++++++++++++ 5 files changed, 66 insertions(+) diff --git a/Indicators/Oscillator/Indi_MACD.h b/Indicators/Oscillator/Indi_MACD.h index d93fc3780..27533b03c 100644 --- a/Indicators/Oscillator/Indi_MACD.h +++ b/Indicators/Oscillator/Indi_MACD.h @@ -20,6 +20,11 @@ * */ +/** + * @file + * Implements Moving Average Convergence Divergence (MACD) indicator. + */ + // Includes. #include "../../Indicator/Indicator.h" diff --git a/Indicators/Oscillator/Indi_RSI.h b/Indicators/Oscillator/Indi_RSI.h index 34650fc5a..f5495a742 100644 --- a/Indicators/Oscillator/Indi_RSI.h +++ b/Indicators/Oscillator/Indi_RSI.h @@ -20,6 +20,11 @@ * */ +/** + * @file + * Implements Relative Strength Index (RSI) indicator. + */ + // Includes. #include "../../Storage/Dict/DictStruct.h" #include "../../Indicator/Indicator.h" diff --git a/Indicators/Oscillator/Indi_Stochastic.h b/Indicators/Oscillator/Indi_Stochastic.h index 7893f4ff8..72acc0ae2 100644 --- a/Indicators/Oscillator/Indi_Stochastic.h +++ b/Indicators/Oscillator/Indi_Stochastic.h @@ -20,6 +20,11 @@ * */ +/** + * @file + * Implements Stochastic indicator. + */ + // Includes. #include "../../Indicator/Indicator.h" #include "../Price/Indi_MA.h" diff --git a/Indicators/Oscillator/Indi_WPR.h b/Indicators/Oscillator/Indi_WPR.h index 3ed9b7c9e..74cbab697 100644 --- a/Indicators/Oscillator/Indi_WPR.h +++ b/Indicators/Oscillator/Indi_WPR.h @@ -20,6 +20,11 @@ * */ +/** + * @file + * Implements Williams Percent Range (WPR) indicator. + */ + // Includes. #include "../../Indicator/Indicator.h" #include "../../Platform/Terminal.h" diff --git a/Indicators/Oscillator/README.md b/Indicators/Oscillator/README.md index f142a2b66..03d9b6762 100644 --- a/Indicators/Oscillator/README.md +++ b/Indicators/Oscillator/README.md @@ -25,3 +25,49 @@ They can be helpful in identifying potential trend reversals or determining the In summary, oscillators are a type of indicator used in technical analysis that measure price momentum and provide insights into overbought or oversold conditions. They are considered a subset of indicators due to their specific function and characteristics. + +## MACD (Moving Average Convergence Divergence) indicator + +MACD measures the relationship between two moving averages +of an asset's price. It consists of a MACD line and a signal line. +The MACD histogram represents the difference between the MACD line +and the signal line and provides insights into the momentum of the trend. + +## RSI (Relative Strength Index) indicator + +RSI compares the magnitude of recent price gains to recent price losses +to determine if an asset is overbought or oversold. +It oscillates between 0 and 100, +with values above 70 indicating overbought conditions +and values below 30 indicating oversold conditions. + +## Stochastic indicator + +The Stochastic Oscillator compares the closing price of an asset +to its price range over a specific period. +It generates values between 0 and 100, +where readings above 80 suggest overbought conditions, +and readings below 20 indicate oversold conditions. + +## WPR (Williams Percent Range) + +WPR indicator is a momentum oscillator developed by Larry Williams. +It is used to identify overbought and oversold conditions in the market +and potential trend reversals. +The WPR indicator oscillates between -100 and 0, +with readings above -20 considered overbought +and readings below -80 considered oversold. + +The WPR indicator calculates the percentage of the difference +between the current closing price and the highest high over a specified period, +relative to the difference between the highest high +and the lowest low over the same period. +The formula is then inverted and multiplied by -100 to obtain the WPR value. + +When the WPR indicator reaches or exceeds the -20 level, +it suggests that the market is overbought, +meaning the price may have risen too far too quickly, +and a reversal or correction may occur. +Conversely, when the WPR indicator falls to or below the -80 level, +it indicates oversold conditions, implying that the price may have declined +too rapidly and could potentially reverse to the upside. From 35a671489a915a7e4f917471a7cc8c0e40a63bbb Mon Sep 17 00:00:00 2001 From: Adrian Kierzkowski Date: Wed, 21 Jun 2023 18:34:01 +0200 Subject: [PATCH 075/109] Next step in fixing C++ compile errors. --- Indicator/IndicatorBase.h | 5 +++++ Indicator/IndicatorData.h | 2 +- Instances.h | 6 +++++- Socket.mqh | 10 +++++++--- Storage/Dict/Buffer/BufferFXT.h | 34 ++++++++++++++++----------------- Storage/Dict/Dict.h | 2 +- Storage/Redis.h | 24 ++++++++++++----------- Storage/Redis.struct.h | 2 +- Storage/Singleton.h | 4 ++++ Storage/String.extern.h | 11 +++++++++++ Storage/tests/Database.test.mq5 | 5 ++++- Storage/tests/Redis.test.cpp | 2 +- 12 files changed, 70 insertions(+), 37 deletions(-) diff --git a/Indicator/IndicatorBase.h b/Indicator/IndicatorBase.h index 6c7c3e214..8bc2f86f2 100644 --- a/Indicator/IndicatorBase.h +++ b/Indicator/IndicatorBase.h @@ -251,6 +251,11 @@ class IndicatorBase : public Object { */ virtual BarOHLC GetOHLC(int _rel_shift = 0) = 0; + /** + * Returns the current price value given applied price type, symbol and timeframe. + */ + virtual double GetPrice(ENUM_APPLIED_PRICE _ap, int _rel_shift = 0) = 0; + /** * Returns spread for the bar. * diff --git a/Indicator/IndicatorData.h b/Indicator/IndicatorData.h index a11c8240a..bd8d00b1e 100644 --- a/Indicator/IndicatorData.h +++ b/Indicator/IndicatorData.h @@ -1302,7 +1302,7 @@ class IndicatorData : public IndicatorBase { /** * Returns the current price value given applied price type, symbol and timeframe. */ - virtual double GetPrice(ENUM_APPLIED_PRICE _ap, int _rel_shift = 0) { + double GetPrice(ENUM_APPLIED_PRICE _ap, int _rel_shift = 0) override { return GetCandle() PTR_DEREF GetPrice(_ap, _rel_shift); } diff --git a/Instances.h b/Instances.h index 161e0609d..3392ea490 100644 --- a/Instances.h +++ b/Instances.h @@ -40,7 +40,7 @@ template class Instances { public: - static T* instances[]; + static ARRAY(T*, instances); Instances(T* _self) { Util::ArrayPush(instances, _self); } ~Instances() { @@ -49,6 +49,10 @@ class Instances { }; template +#ifdef __MQL__ +T* Instances::instances[]; +#else T* Instances::instances[]; +#endif #endif // INSTANCES_MQH diff --git a/Socket.mqh b/Socket.mqh index aa17c2ab1..136980282 100644 --- a/Socket.mqh +++ b/Socket.mqh @@ -25,6 +25,10 @@ * Implements class for socket connection. */ +// Includes. +#include "File.define.h" +#include "Std.h" + /** * Socket class. */ @@ -163,7 +167,7 @@ class Socket { * Sends string through the socket. */ bool Send(const string text) { - unsigned char _buffer[]; + ARRAY(unsigned char, _buffer); int _buffer_length = StringToCharArray(text, _buffer, 0, WHOLE_ARRAY, CP_UTF8); return Send(_buffer, _buffer_length); } @@ -171,7 +175,7 @@ class Socket { /** * Sends bytes through the socket. */ - bool Send(const unsigned char& _buffer[], unsigned int _buffer_length) { + bool Send(const ARRAY_REF(unsigned char, _buffer), unsigned int _buffer_length) { if (!EnsureConnected()) { return false; } @@ -217,7 +221,7 @@ class Socket { /** * Reads bytes from the socket. Awaits given miliseconds before giving up. */ - bool Read(unsigned char& _buffer[], unsigned int _buffer_max_length, unsigned int _timeout_ms = 1000) { + bool Read(ARRAY_REF(unsigned char, _buffer), unsigned int _buffer_max_length, unsigned int _timeout_ms = 1000) { if (!EnsureConnected()) { return false; } diff --git a/Storage/Dict/Buffer/BufferFXT.h b/Storage/Dict/Buffer/BufferFXT.h index 1ef9ee21c..6cf4461d8 100644 --- a/Storage/Dict/Buffer/BufferFXT.h +++ b/Storage/Dict/Buffer/BufferFXT.h @@ -99,19 +99,19 @@ struct BufferFXTEntry { // FXT file header. struct BufferFXTHeader { - int version; // Header version: 405 - ARRAY(char, copyright[64]; // Copyright/description. - char description[128]; // Account server name. - // 196 - char symbol[12]; // Symbol pair. - int period; // Period of data aggregation in minutes (timeframe). - int model; // Model type: 0 - every tick, 1 - control points, 2 - bar open. - int bars; // Bars - number of modeled bars in history. - int fromdate; // Modelling start date - date of the first tick. - int todate; // Modelling end date - date of the last tick. - int totalTicks; // Total ticks. Add 4 bytes to align to the next double? - double modelquality; // Modeling quality (max. 99.9). - // 240 + int version; // Header version: 405 + FIXED_ARRAY(char, copyright, 64); // Copyright/description. + FIXED_ARRAY(char, description, 128); // Account server name. + // 196 + FIXED_ARRAY(char, symbol, 12); // Symbol pair. + int period; // Period of data aggregation in minutes (timeframe). + int model; // Model type: 0 - every tick, 1 - control points, 2 - bar open. + int bars; // Bars - number of modeled bars in history. + int fromdate; // Modelling start date - date of the first tick. + int todate; // Modelling end date - date of the last tick. + int totalTicks; // Total ticks. Add 4 bytes to align to the next double? + double modelquality; // Modeling quality (max. 99.9). + // 240 // Market symbol properties. char currency[12]; // Base currency (12 bytes). Same as: StringLeft(symbol, 3) int spread; // Spread in points. Same as: MarketInfo(MODE_SPREAD) @@ -244,16 +244,16 @@ struct BufferFXTHeader { struct BufferFXTParams { AccountMt *account; - Ref source; + Ref source; // Struct constructor. - BufferFXTParams(IndicatorBase *_source, AccountMt *_account = NULL) + BufferFXTParams(IndicatorData *_source, AccountMt *_account = NULL) : account(Object::IsValid(_account) ? _account : new AccountMt), source(_source) {} BufferFXTParams(BufferFXTParams &r) { account = r.account; source = r.source; } // Struct deconstructor. - void ~BufferFXTParams() { delete account; } + ~BufferFXTParams() { delete account; } }; string ToJSON(BufferFXTEntry &_value, const bool, const unsigned int) { return _value.ToJSON(); }; @@ -269,7 +269,7 @@ class BufferFXT : public DictStruct { /** * Class constructor. */ - BufferFXT(IndicatorBase *_source) : params(_source) {} + BufferFXT(IndicatorData *_source) : params(_source) {} BufferFXT(BufferFXTParams &_params) : params(_params) {} /** diff --git a/Storage/Dict/Dict.h b/Storage/Dict/Dict.h index 3e23885e3..45f304aa1 100644 --- a/Storage/Dict/Dict.h +++ b/Storage/Dict/Dict.h @@ -223,7 +223,7 @@ class Dict : public DictBase { // If we have a slot then we can overwrite it. if (_slot != NULL) { - WriteSlot(_slot, key, value, DICT_SLOT_HAS_KEY | DICT_SLOT_IS_USED | DICT_SLOT_WAS_USED); + WriteSlot(PTR_TO_REF(_slot), key, value, DICT_SLOT_HAS_KEY | DICT_SLOT_IS_USED | DICT_SLOT_WAS_USED); // We're done, we don't have to increment number of slots used. return true; } diff --git a/Storage/Redis.h b/Storage/Redis.h index 995eabf86..852803ec0 100644 --- a/Storage/Redis.h +++ b/Storage/Redis.h @@ -42,7 +42,7 @@ typedef void (*RedisCallback)(string); class RedisQueue { protected: // Messages queue for simulation purposes. - string _queue[]; + ARRAY(string, _queue); // Current message index to be processed. Set to 0 if all messages have been popped out. int _queue_index; @@ -155,7 +155,7 @@ class Redis : public Object { string command_args = StringSubstr(command, StringLen(command_name) + 1); if (command_name == "SUBSCRIBE") { - string subscriptions[]; + ARRAY(string, subscriptions); StringSplit(command_args, ' ', subscriptions); for (int i = 0; i < ArraySize(subscriptions); ++i) { _subscriptions.Set(subscriptions[i], true); @@ -213,7 +213,7 @@ class Redis : public Object { string GetString(const string _key, string _default = NULL) { string result = Command("GET " + SerializerConversions::ValueToString(_key, true)); - if (result == NULL) return _default; + if (result == NULL_STRING) return _default; return result; } @@ -224,10 +224,10 @@ class Redis : public Object { bool Increment(const string _key, const int _value = 1) { if (_value > 0) { return Command("INCRBY " + SerializerConversions::ValueToString(_key, true) + " " + IntegerToString(_value)) != - NULL; + NULL_STRING; } else if (_value < 0) { return Command("DECRBY " + SerializerConversions::ValueToString(_key, true) + " " + IntegerToString(-_value)) != - NULL; + NULL_STRING; } // _value was 0. Nothing to do. @@ -240,10 +240,10 @@ class Redis : public Object { bool Increment(const string _key, const float _value = 1.0f) { if (_value > 0.0f) { return Command("INCRBYFLOAT " + SerializerConversions::ValueToString(_key, true) + " " + - DoubleToString(_value)) != NULL; + DoubleToString(_value)) != NULL_STRING; } else if (_value < 0.0f) { return Command("DECRBYFLOAT " + SerializerConversions::ValueToString(_key, true) + " " + - DoubleToString(_value)) != NULL; + DoubleToString(_value)) != NULL_STRING; } // _value was 0. Nothing to do. @@ -263,25 +263,27 @@ class Redis : public Object { /** * Deletes variable by given key. */ - bool Delete(const string _key) { return Command("DEL " + SerializerConversions::ValueToString(_key, true)) != NULL; } + bool Delete(const string _key) { + return Command("DEL " + SerializerConversions::ValueToString(_key, true)) != NULL_STRING; + } /** * Subscribes to string-based values on the given channels (separated by space). * * After subscribe, please use TryReadString() in the loop to retrieve values. */ - bool Subscribe(const string _channel_list) { return Command("SUBSCRIBE " + _channel_list) != NULL; } + bool Subscribe(const string _channel_list) { return Command("SUBSCRIBE " + _channel_list) != NULL_STRING; } /** * Unsubscribes from the given channels (separated by space). */ - bool Unsubscribe(const string _channel_list) { return Command("UNSUBSCRIBE " + _channel_list) != NULL; } + bool Unsubscribe(const string _channel_list) { return Command("UNSUBSCRIBE " + _channel_list) != NULL_STRING; } /** * Publishes string-based value on the given channel (channel must be previously subscribed). */ bool Publish(const string _channel, const string _value) { - return Command("PUBLISH " + _channel + " " + SerializerConversions::ValueToString(_value, true)) != NULL; + return Command("PUBLISH " + _channel + " " + SerializerConversions::ValueToString(_value, true)) != NULL_STRING; } /** diff --git a/Storage/Redis.struct.h b/Storage/Redis.struct.h index 719d6f69f..6851e84fa 100644 --- a/Storage/Redis.struct.h +++ b/Storage/Redis.struct.h @@ -58,7 +58,7 @@ struct RedisMessage { string Message; // Items of array returned from Redis. - string Items[]; + ARRAY(string, Items); /** * Adds string value into Redis message array. diff --git a/Storage/Singleton.h b/Storage/Singleton.h index 03ae7651e..6defe38f0 100644 --- a/Storage/Singleton.h +++ b/Storage/Singleton.h @@ -45,6 +45,10 @@ class Singleton { }; template +#ifdef __MQL__ +C Singleton::_ref; +#else C Singleton::_ref; +#endif #endif // SINGLETON_H diff --git a/Storage/String.extern.h b/Storage/String.extern.h index 0a269553e..26d44187f 100644 --- a/Storage/String.extern.h +++ b/Storage/String.extern.h @@ -40,6 +40,17 @@ // Define external global functions. double StringToDouble(string value) { return std::stod(value); } +string StringTrimLeft(string text) { + text.erase(text.begin(), std::find_if(text.begin(), text.end(), [](unsigned char ch) { return !std::isspace(ch); })); + return text; +} + +string StringTrimRight(string text) { + text.erase(std::find_if(text.rbegin(), text.rend(), [](unsigned char ch) { return !std::isspace(ch); }).base(), + text.end()); + return text; +} + auto StringFind(const string string_value, string match_substring, int start_pos = 0) -> int { return string_value.find(match_substring); } diff --git a/Storage/tests/Database.test.mq5 b/Storage/tests/Database.test.mq5 index 0ddda6d1d..cc77289dc 100644 --- a/Storage/tests/Database.test.mq5 +++ b/Storage/tests/Database.test.mq5 @@ -29,8 +29,11 @@ // Includes. #include "../../Test.mqh" -#include "../Database.h" +// clang-format off +// Following include order is important. #include "../Dict/Buffer/BufferStruct.h" +#include "../Database.h" +// clang-format on // Global variables. Database *db; diff --git a/Storage/tests/Redis.test.cpp b/Storage/tests/Redis.test.cpp index 5eaafae69..dc9eab2b1 100644 --- a/Storage/tests/Redis.test.cpp +++ b/Storage/tests/Redis.test.cpp @@ -27,7 +27,7 @@ // Includes. #include "../Redis.h" -#include "../Platform/Platform.h" +#include "../../Platform/Platform.h" int main(int argc, char **argv) { // @todo From e5ea52c45eeec3b988b857758c9ab44838ee4373 Mon Sep 17 00:00:00 2001 From: kenorb Date: Wed, 21 Jun 2023 21:09:31 +0100 Subject: [PATCH 076/109] Adds Indicators.test.cpp --- Indicators/tests/Indicators.test.cpp | 35 ++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Indicators/tests/Indicators.test.cpp diff --git a/Indicators/tests/Indicators.test.cpp b/Indicators/tests/Indicators.test.cpp new file mode 100644 index 000000000..2b8c62847 --- /dev/null +++ b/Indicators/tests/Indicators.test.cpp @@ -0,0 +1,35 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of all indicators. + */ + +// Includes. +#include "../../Platform/Platform.h" +#include "../includes.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} From 2d458f6602e645dd19f53a5c655f06202e6433ae Mon Sep 17 00:00:00 2001 From: kenorb Date: Wed, 21 Jun 2023 23:31:58 +0100 Subject: [PATCH 077/109] Adds Database enums and externs --- Storage/Database.enum.h | 30 +++++++++++++++++++ Storage/Database.extern.h | 63 +++++++++++++++++++++++++++++++++++++++ Storage/Database.h | 4 ++- 3 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 Storage/Database.enum.h create mode 100644 Storage/Database.extern.h diff --git a/Storage/Database.enum.h b/Storage/Database.enum.h new file mode 100644 index 000000000..dd755b9bf --- /dev/null +++ b/Storage/Database.enum.h @@ -0,0 +1,30 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + * + */ + +// @docs: https://www.mql5.com/en/docs/database/databaseopen#enum_database_open_flags +enum ENUM_DATABASE_OPEN_FLAGS { + DATABASE_OPEN_READONLY, // Read only. + DATABASE_OPEN_READWRITE, // Open for reading and writing. + DATABASE_OPEN_CREATE, // Create the file on a disk if necessary. + DATABASE_OPEN_MEMORY, // Create a database in RAM. + DATABASE_OPEN_COMMON, // The file is in the common folder of all terminals. +}; diff --git a/Storage/Database.extern.h b/Storage/Database.extern.h new file mode 100644 index 000000000..1376330ac --- /dev/null +++ b/Storage/Database.extern.h @@ -0,0 +1,63 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + * + */ + +// Includes. + +// Define external global functions. +#ifndef __MQL__ +// Closes a database. +// @docs: https://www.mql5.com/en/docs/database/databaseclose +void DatabaseClose(int database // database handle received in DatabaseOpen +); +// Executes a request to a specified database. +// @docs: https://www.mql5.com/en/docs/database/databaseexecute +extern bool DatabaseExecute(int database, // database handle received in DatabaseOpen + string sql // SQL request +); + +// Opens or creates a database in a specified file. +// @docs: https://www.mql5.com/en/docs/database/databaseopen +int DatabaseOpen(string filename, // file name + uint flags // combination of flags +); + +// Starts transaction execution. +// @docs: https://www.mql5.com/en/docs/database/databasetransactionbegin +bool DatabaseTransactionBegin(int database // database handle received in DatabaseOpen +); + +// Completes transaction execution. +// @docs: https://www.mql5.com/en/docs/database/databasetransactioncommit +extern bool DatabaseTransactionCommit(int database // database handle received in DatabaseOpen +); + +// Checks the presence of the table in a database. +// @docs: https://www.mql5.com/en/docs/database/databasetableexists +bool DatabaseTableExists(int database, // database handle received in DatabaseOpen + string table // table name +); + +// Rolls back transactions. +// @docs: https://www.mql5.com/en/docs/database/databasetransactionrollback +extern bool DatabaseTransactionRollback(int database // database handle received in DatabaseOpen +); +#endif diff --git a/Storage/Database.h b/Storage/Database.h index 53cee9ac8..ac0293a12 100644 --- a/Storage/Database.h +++ b/Storage/Database.h @@ -35,6 +35,8 @@ // Includes. #include "../Math/MatrixMini.h" #include "../Storage/Dict/DictStruct.h" +#include "Database.enum.h" +#include "Database.extern.h" #include "Database.struct.h" class Database { @@ -175,7 +177,7 @@ bool ImportData(const string _name, MatrixMini2d &data) { for (x = 0; x < data.SizeX(); ++x) { _query += data.Get(x, y) + (x < data.SizeX() - 1 ? ", " : ""); } - _query += ")" + (y < data.SizeY() - 1 ? ",\n" : ""); + _query += ")" + (string)(y < data.SizeY() - 1 ? ",\n" : ""); } #ifdef __debug__ From 1d264b44f0f1336ccde0bcc306febae8a0efc889 Mon Sep 17 00:00:00 2001 From: kenorb Date: Wed, 21 Jun 2023 23:36:26 +0100 Subject: [PATCH 078/109] SerializerBinary: Comments missing logger --- Serializer/SerializerBinary.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Serializer/SerializerBinary.h b/Serializer/SerializerBinary.h index 003fa6163..789c9adeb 100644 --- a/Serializer/SerializerBinary.h +++ b/Serializer/SerializerBinary.h @@ -115,7 +115,7 @@ class SerializerBinary { Serializer serializer(node, Unserialize); - if (logger != NULL) serializer.Logger().Link(logger); + // if (logger != NULL) serializer.Logger().Link(logger); // We don't use result. We parse data as it is. obj.Serialize(serializer); From 00e04851f9d38755519100de5de782ef007fdb91 Mon Sep 17 00:00:00 2001 From: kenorb Date: Wed, 21 Jun 2023 23:59:06 +0100 Subject: [PATCH 079/109] Indicators: Improves #ifdef condition and forward declaration syntax --- Indicators/Indi_AC.mqh | 21 ++++++++++++--------- Indicators/Indi_AD.mqh | 8 ++++++++ Indicators/Indi_ADX.mqh | 3 +++ Indicators/Indi_AO.mqh | 3 +++ Indicators/Indi_ATR.mqh | 3 +++ Indicators/Indi_BWMFI.mqh | 3 +++ Indicators/Indi_BearsPower.mqh | 3 +++ Indicators/Indi_BullsPower.mqh | 3 +++ Indicators/Indi_CCI.mqh | 3 +++ Indicators/Indi_DeMarker.mqh | 3 +++ Indicators/Indi_Force.mqh | 3 +++ Indicators/Indi_Fractals.mqh | 3 +++ Indicators/Indi_Gator.mqh | 3 +++ Indicators/Indi_Ichimoku.mqh | 3 +++ Indicators/Indi_MFI.mqh | 3 +++ Indicators/Indi_Momentum.mqh | 3 +++ Indicators/Indi_OBV.mqh | 3 +++ Indicators/Indi_OsMA.mqh | 3 +++ Indicators/Indi_RVI.mqh | 3 +++ Indicators/Indi_StdDev.mqh | 3 +++ Indicators/Oscillator/Indi_MACD.h | 2 +- Indicators/Oscillator/Indi_Stochastic.h | 3 +++ Indicators/Oscillator/Indi_WPR.h | 3 +++ Indicators/Price/Indi_MA.h | 2 +- Indicators/PriceMulti/Indi_Alligator.h | 3 +++ Indicators/PriceRange/Indi_Bands.h | 3 +++ Indicators/PriceRange/Indi_Envelopes.h | 3 +++ Indicators/PriceRange/Indi_SAR.h | 3 +++ 28 files changed, 94 insertions(+), 11 deletions(-) diff --git a/Indicators/Indi_AC.mqh b/Indicators/Indi_AC.mqh index c54961599..f323fa4f1 100644 --- a/Indicators/Indi_AC.mqh +++ b/Indicators/Indi_AC.mqh @@ -29,6 +29,17 @@ #include "../Indicator/Indicator.h" #include "../Storage/Dict/Buffer/BufferStruct.h" +#ifndef __MQL4__ +// Forward declaration. +class Indi_AC; + +// Defines global functions (for MQL4 backward compability). +double iAC(string _symbol, int _tf, int _shift) { + ResetLastError(); + return Indi_AC::iAC(_symbol, (ENUM_TIMEFRAMES)_tf, _shift); +} +#endif + // Structs. struct IndiACParams : IndicatorParams { // Struct constructor. @@ -139,16 +150,8 @@ class Indi_AC : public Indicator { if (!Objects::TryGet(_key, _ptr)) { _ptr = Objects::Set(_key, new Indi_AC()); // Assigning the same candle indicator for AC as in _indi. - _ptr.SetDataSource(_indi PTR_DEREF GetCandle()); + _ptr PTR_DEREF SetDataSource(_indi PTR_DEREF GetCandle()); } return _ptr; } }; - -#ifndef __MQL4__ -// Defines global functions (for MQL4 backward compability). -double iAC(string _symbol, int _tf, int _shift) { - ResetLastError(); - return Indi_AC::iAC(_symbol, (ENUM_TIMEFRAMES)_tf, _shift); -} -#endif diff --git a/Indicators/Indi_AD.mqh b/Indicators/Indi_AD.mqh index 30efa4106..4147ab62e 100644 --- a/Indicators/Indi_AD.mqh +++ b/Indicators/Indi_AD.mqh @@ -20,10 +20,18 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" #ifndef __MQL4__ +// Forward declaration. +class Indi_AD; + // Defines global functions (for MQL4 backward compability). double iAD(string _symbol, int _tf, int _shift) { ResetLastError(); diff --git a/Indicators/Indi_ADX.mqh b/Indicators/Indi_ADX.mqh index e2cdd7702..c904740f2 100644 --- a/Indicators/Indi_ADX.mqh +++ b/Indicators/Indi_ADX.mqh @@ -25,6 +25,9 @@ #include "Price/Indi_Price.h" #ifndef __MQL4__ +// Forward declaration. +class Indi_ADX; + // Defines global functions (for MQL4 backward compability). double iADX(string _symbol, int _tf, int _period, int _ap, int _mode, int _shift) { ResetLastError(); diff --git a/Indicators/Indi_AO.mqh b/Indicators/Indi_AO.mqh index c2d972279..bfff08ce4 100644 --- a/Indicators/Indi_AO.mqh +++ b/Indicators/Indi_AO.mqh @@ -24,6 +24,9 @@ #include "../Indicator/Indicator.h" #ifndef __MQL4__ +// Forward declaration. +class Indi_AO; + // Defines global functions (for MQL4 backward compability). double iAO(string _symbol, int _tf, int _shift) { ResetLastError(); diff --git a/Indicators/Indi_ATR.mqh b/Indicators/Indi_ATR.mqh index 55043c5b0..19113ce3f 100644 --- a/Indicators/Indi_ATR.mqh +++ b/Indicators/Indi_ATR.mqh @@ -24,6 +24,9 @@ #include "../Indicator/Indicator.h" #ifndef __MQL4__ +// Forward declaration. +class Indi_ATR; + // Defines global functions (for MQL4 backward compability). double iATR(string _symbol, int _tf, int _period, int _shift) { ResetLastError(); diff --git a/Indicators/Indi_BWMFI.mqh b/Indicators/Indi_BWMFI.mqh index ee7fb57e5..13ca86bc0 100644 --- a/Indicators/Indi_BWMFI.mqh +++ b/Indicators/Indi_BWMFI.mqh @@ -24,6 +24,9 @@ #include "../Indicator/Indicator.h" #ifndef __MQL4__ +// Forward declaration. +class Indi_BWMFI; + // Defines global functions (for MQL4 backward compability). double iBWMFI(string _symbol, int _tf, int _shift) { ResetLastError(); diff --git a/Indicators/Indi_BearsPower.mqh b/Indicators/Indi_BearsPower.mqh index 2301ac84b..6dea2d286 100644 --- a/Indicators/Indi_BearsPower.mqh +++ b/Indicators/Indi_BearsPower.mqh @@ -24,6 +24,9 @@ #include "../Indicator/Indicator.h" #ifndef __MQL4__ +// Forward declaration. +class Indi_BearsPower; + // Defines global functions (for MQL4 backward compability). double iBearsPower(string _symbol, int _tf, int _period, int _ap, int _shift) { ResetLastError(); diff --git a/Indicators/Indi_BullsPower.mqh b/Indicators/Indi_BullsPower.mqh index 0efe8c5e2..16ad2b2d6 100644 --- a/Indicators/Indi_BullsPower.mqh +++ b/Indicators/Indi_BullsPower.mqh @@ -24,6 +24,9 @@ #include "../Indicator/Indicator.h" #ifndef __MQL4__ +// Forward declaration. +class Indi_BullsPower; + // Defines global functions (for MQL4 backward compability). double iBullsPower(string _symbol, int _tf, int _period, int _ap, int _shift) { ResetLastError(); diff --git a/Indicators/Indi_CCI.mqh b/Indicators/Indi_CCI.mqh index 81901f1cb..6584925db 100644 --- a/Indicators/Indi_CCI.mqh +++ b/Indicators/Indi_CCI.mqh @@ -27,6 +27,9 @@ #include "Price/Indi_Price.h" #ifndef __MQL4__ +// Forward declaration. +class Indi_CCI; + // Defines global functions (for MQL4 backward compability). double iCCI(string _symbol, int _tf, int _period, int _ap, int _shift) { ResetLastError(); diff --git a/Indicators/Indi_DeMarker.mqh b/Indicators/Indi_DeMarker.mqh index 61ae7f172..dad279880 100644 --- a/Indicators/Indi_DeMarker.mqh +++ b/Indicators/Indi_DeMarker.mqh @@ -24,6 +24,9 @@ #include "../Indicator/Indicator.h" #ifndef __MQL4__ +// Forward declaration. +class Indi_DeMarker; + // Defines global functions (for MQL4 backward compability). double iDeMarker(string _symbol, int _tf, int _period, int _shift) { ResetLastError(); diff --git a/Indicators/Indi_Force.mqh b/Indicators/Indi_Force.mqh index 773f44c16..9c599a1d7 100644 --- a/Indicators/Indi_Force.mqh +++ b/Indicators/Indi_Force.mqh @@ -35,6 +35,9 @@ #include "../Indicator/Indicator.h" #ifndef __MQL4__ +// Forward declaration. +class Indi_Force; + // Defines global functions (for MQL4 backward compability). double iForce(string _symbol, int _tf, int _period, int _ma_method, int _ap, int _shift) { ResetLastError(); diff --git a/Indicators/Indi_Fractals.mqh b/Indicators/Indi_Fractals.mqh index ed7a2636a..4eb4a0f27 100644 --- a/Indicators/Indi_Fractals.mqh +++ b/Indicators/Indi_Fractals.mqh @@ -24,6 +24,9 @@ #include "../Indicator/Indicator.h" #ifndef __MQL4__ +// Forward declaration. +class Indi_Fractals; + // Defines global functions (for MQL4 backward compability). double iFractals(string _symbol, int _tf, int _mode, int _shift) { ResetLastError(); diff --git a/Indicators/Indi_Gator.mqh b/Indicators/Indi_Gator.mqh index 510a30ae9..a3088f23b 100644 --- a/Indicators/Indi_Gator.mqh +++ b/Indicators/Indi_Gator.mqh @@ -31,6 +31,9 @@ #include "../Indicator/Indicator.h" #ifndef __MQL4__ +// Forward declaration. +class Indi_Gator; + // Defines global functions (for MQL4 backward compability). double iGator(string _symbol, int _tf, int _jp, int _js, int _tp, int _ts, int _lp, int _ls, int _ma_method, int _ap, int _mode, int _shift) { diff --git a/Indicators/Indi_Ichimoku.mqh b/Indicators/Indi_Ichimoku.mqh index a5b790165..8541d85a6 100644 --- a/Indicators/Indi_Ichimoku.mqh +++ b/Indicators/Indi_Ichimoku.mqh @@ -24,6 +24,9 @@ #include "../Indicator/Indicator.h" #ifndef __MQL4__ +// Forward declaration. +class Indi_Ichimoku; + // Defines global functions (for MQL4 backward compability). double iIchimoku(string _symbol, int _tf, int _ts, int _ks, int _ssb, int _mode, int _shift) { ResetLastError(); diff --git a/Indicators/Indi_MFI.mqh b/Indicators/Indi_MFI.mqh index 93e712ffb..c38cf4d72 100644 --- a/Indicators/Indi_MFI.mqh +++ b/Indicators/Indi_MFI.mqh @@ -24,6 +24,9 @@ #include "../Indicator/Indicator.h" #ifndef __MQL4__ +// Forward declaration. +class Indi_MFI; + // Defines global functions (for MQL4 backward compability). double iMFI(string _symbol, int _tf, int _period, int _shift) { ResetLastError(); diff --git a/Indicators/Indi_Momentum.mqh b/Indicators/Indi_Momentum.mqh index 5b9eeca44..953d63d0f 100644 --- a/Indicators/Indi_Momentum.mqh +++ b/Indicators/Indi_Momentum.mqh @@ -34,6 +34,9 @@ #include "Indi_PriceFeeder.mqh" #ifndef __MQL4__ +// Forward declaration. +class Indi_Momentum; + // Defines global functions (for MQL4 backward compability). double iMomentum(string _symbol, int _tf, int _period, int _ap, int _shift) { ResetLastError(); diff --git a/Indicators/Indi_OBV.mqh b/Indicators/Indi_OBV.mqh index 3578134e4..b9128b1f2 100644 --- a/Indicators/Indi_OBV.mqh +++ b/Indicators/Indi_OBV.mqh @@ -24,6 +24,9 @@ #include "../Indicator/Indicator.h" #ifndef __MQL4__ +// Forward declaration. +class Indi_OBV; + // Defines global functions (for MQL4 backward compability). double iOBV(string _symbol, int _tf, int _av, int _shift) { ResetLastError(); diff --git a/Indicators/Indi_OsMA.mqh b/Indicators/Indi_OsMA.mqh index f4f85b0da..60587bda7 100644 --- a/Indicators/Indi_OsMA.mqh +++ b/Indicators/Indi_OsMA.mqh @@ -24,6 +24,9 @@ #include "../Indicator/Indicator.h" #ifndef __MQL4__ +// Forward declaration. +class Indi_OsMA; + // Defines global functions (for MQL4 backward compability). double iOsMA(string _symbol, int _tf, int _ema_fp, int _ema_sp, int _signal_period, int _ap, int _shift) { ResetLastError(); diff --git a/Indicators/Indi_RVI.mqh b/Indicators/Indi_RVI.mqh index 00f1f4ad7..07a0a5bb1 100644 --- a/Indicators/Indi_RVI.mqh +++ b/Indicators/Indi_RVI.mqh @@ -24,6 +24,9 @@ #include "../Indicator/Indicator.h" #ifndef __MQL4__ +// Forward declaration. +class Indi_RVI; + // Defines global functions (for MQL4 backward compability). double iRVI(string _symbol, int _tf, int _period, int _mode, int _shift) { ResetLastError(); diff --git a/Indicators/Indi_StdDev.mqh b/Indicators/Indi_StdDev.mqh index 3be952ed0..53078a1e4 100644 --- a/Indicators/Indi_StdDev.mqh +++ b/Indicators/Indi_StdDev.mqh @@ -34,6 +34,9 @@ #include "Price/Indi_MA.h" #ifndef __MQL4__ +// Forward declaration. +class Indi_StdDev; + // Defines global functions (for MQL4 backward compability). double iStdDev(string _symbol, int _tf, int _ma_period, int _ma_shift, int _ma_method, int _ap, int _shift) { ResetLastError(); diff --git a/Indicators/Oscillator/Indi_MACD.h b/Indicators/Oscillator/Indi_MACD.h index d93fc3780..fa192afe0 100644 --- a/Indicators/Oscillator/Indi_MACD.h +++ b/Indicators/Oscillator/Indi_MACD.h @@ -23,7 +23,7 @@ // Includes. #include "../../Indicator/Indicator.h" -#ifdef __MQL5__ +#ifndef __MQL4__ // Forward declaration. class Indi_MACD; diff --git a/Indicators/Oscillator/Indi_Stochastic.h b/Indicators/Oscillator/Indi_Stochastic.h index 7893f4ff8..156ddc379 100644 --- a/Indicators/Oscillator/Indi_Stochastic.h +++ b/Indicators/Oscillator/Indi_Stochastic.h @@ -34,6 +34,9 @@ enum ENUM_STO_PRICE { #endif #ifndef __MQL4__ +// Forward declaration. +class Indi_Stochastic; + // Defines global functions (for MQL4 backward compability). double iStochastic(string _symbol, int _tf, int _kperiod, int _dperiod, int _slowing, int _ma_method, int _pf, int _mode, int _shift) { diff --git a/Indicators/Oscillator/Indi_WPR.h b/Indicators/Oscillator/Indi_WPR.h index 3ed9b7c9e..24253b345 100644 --- a/Indicators/Oscillator/Indi_WPR.h +++ b/Indicators/Oscillator/Indi_WPR.h @@ -25,6 +25,9 @@ #include "../../Platform/Terminal.h" #ifndef __MQL4__ +// Forward declaration. +class Indi_WPR; + // Defines global functions (for MQL4 backward compability). double iWPR(string _symbol, int _tf, int _period, int _shift) { ResetLastError(); diff --git a/Indicators/Price/Indi_MA.h b/Indicators/Price/Indi_MA.h index 16dcd6f57..ad744a073 100644 --- a/Indicators/Price/Indi_MA.h +++ b/Indicators/Price/Indi_MA.h @@ -44,7 +44,7 @@ enum ENUM_MA_METHOD { }; #endif -#ifdef __MQL5__ +#ifndef __MQL4__ // Forward declaration. class Indi_MA; diff --git a/Indicators/PriceMulti/Indi_Alligator.h b/Indicators/PriceMulti/Indi_Alligator.h index 47ee1efe3..a286c5d6d 100644 --- a/Indicators/PriceMulti/Indi_Alligator.h +++ b/Indicators/PriceMulti/Indi_Alligator.h @@ -25,6 +25,9 @@ #include "../Price/Indi_MA.h" #ifndef __MQL4__ +// Forward declaration. +class Indi_Alligator; + // Defines global functions (for MQL4 backward compability). double iAlligator(string _symbol, int _tf, int _jp, int _js, int _tp, int _ts, int _lp, int _ls, int _ma_method, int _ap, int _mode, int _shift) { diff --git a/Indicators/PriceRange/Indi_Bands.h b/Indicators/PriceRange/Indi_Bands.h index 2f54bea7d..9207bcb48 100644 --- a/Indicators/PriceRange/Indi_Bands.h +++ b/Indicators/PriceRange/Indi_Bands.h @@ -31,6 +31,9 @@ #include "../Price/Indi_Price.h" #ifndef __MQL4__ +// Forward declaration. +class Indi_Bands; + // Defines global functions (for MQL4 backward compability). double iBands(string _symbol, int _tf, int _period, double _deviation, int _bands_shift, int _ap, int _mode, int _shift) { diff --git a/Indicators/PriceRange/Indi_Envelopes.h b/Indicators/PriceRange/Indi_Envelopes.h index 3ccd7eedf..a9c23ee7c 100644 --- a/Indicators/PriceRange/Indi_Envelopes.h +++ b/Indicators/PriceRange/Indi_Envelopes.h @@ -28,6 +28,9 @@ #include "../Price/Indi_Price.h" #ifndef __MQL4__ +// Forward declaration. +class Indi_Envelopes; + // Defines global functions (for MQL4 backward compability). double iEnvelopes(string _symbol, int _tf, int _period, int _ma_method, int _ma_shift, int _ap, double _deviation, int _mode, int _shift) { diff --git a/Indicators/PriceRange/Indi_SAR.h b/Indicators/PriceRange/Indi_SAR.h index c8c3bc8ce..9ff35dbc8 100644 --- a/Indicators/PriceRange/Indi_SAR.h +++ b/Indicators/PriceRange/Indi_SAR.h @@ -24,6 +24,9 @@ #include "../../Indicator/Indicator.h" #ifndef __MQL4__ +// Forward declaration. +class Indi_SAR; + // Defines global functions (for MQL4 backward compability). double iSAR(string _symbol, int _tf, double _step, double _max, int _shift) { ResetLastError(); From 4624e222dffd10c11eb6f6fedc2994b930bb258f Mon Sep 17 00:00:00 2001 From: kenorb Date: Thu, 22 Jun 2023 00:00:15 +0100 Subject: [PATCH 080/109] Indicators: Code reformats --- Indicators/Oscillator/Indi_MACD.h | 4 ++-- Indicators/Oscillator/Indi_RSI.h | 6 +++--- Indicators/Oscillator/Indi_Stochastic.h | 8 ++++---- Indicators/Oscillator/Indi_WPR.h | 4 ++-- Indicators/Price/Indi_AppliedPrice.h | 2 +- Indicators/Price/Indi_Price.h | 2 +- Indicators/PriceMulti/Indi_Alligator.h | 2 +- Indicators/PriceRange/Indi_Bands.h | 11 +++++------ Indicators/PriceRange/Indi_Envelopes.h | 7 +++---- Indicators/PriceRange/Indi_SAR.h | 2 +- Indicators/Tick/Indi_TickMt.h | 2 +- 11 files changed, 24 insertions(+), 26 deletions(-) diff --git a/Indicators/Oscillator/Indi_MACD.h b/Indicators/Oscillator/Indi_MACD.h index fa192afe0..bdf3a2992 100644 --- a/Indicators/Oscillator/Indi_MACD.h +++ b/Indicators/Oscillator/Indi_MACD.h @@ -100,11 +100,11 @@ class Indi_MACD : public Indicator { #ifdef __MQL__ #ifdef __MQL4__ return ::iMACD(_symbol, _tf, _ema_fast_period, _ema_slow_period, _signal_period, _applied_price, _mode, _shift); -#else // __MQL5__ +#else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN( ::iMACD(_symbol, _tf, _ema_fast_period, _ema_slow_period, _signal_period, _applied_price), _mode, _shift); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " diff --git a/Indicators/Oscillator/Indi_RSI.h b/Indicators/Oscillator/Indi_RSI.h index 34650fc5a..36948b52a 100644 --- a/Indicators/Oscillator/Indi_RSI.h +++ b/Indicators/Oscillator/Indi_RSI.h @@ -21,8 +21,8 @@ */ // Includes. -#include "../../Storage/Dict/DictStruct.h" #include "../../Indicator/Indicator.h" +#include "../../Storage/Dict/DictStruct.h" #include "../Price/Indi_Price.h" // Structs. @@ -113,10 +113,10 @@ class Indi_RSI : public Indicator { #ifdef __MQL__ #ifdef __MQL4__ return ::iRSI(_symbol, _tf, _period, _applied_price, _shift); -#else // __MQL5__ +#else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iRSI(_symbol, _tf, _period, _applied_price), 0, _shift); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " diff --git a/Indicators/Oscillator/Indi_Stochastic.h b/Indicators/Oscillator/Indi_Stochastic.h index 156ddc379..d8eb72b4c 100644 --- a/Indicators/Oscillator/Indi_Stochastic.h +++ b/Indicators/Oscillator/Indi_Stochastic.h @@ -28,8 +28,8 @@ // Enums. // @see: https://www.mql5.com/en/docs/constants/indicatorconstants/prices enum ENUM_STO_PRICE { - STO_LOWHIGH = 0, // Calculation is based on Low/High prices. - STO_CLOSECLOSE, // Calculation is based on Close/Close prices. + STO_LOWHIGH = 0, // Calculation is based on Low/High prices. + STO_CLOSECLOSE, // Calculation is based on Close/Close prices. }; #endif @@ -115,11 +115,11 @@ class Indi_Stochastic : public Indicator { #ifdef __MQL__ #ifdef __MQL4__ return ::iStochastic(_symbol, _tf, _kperiod, _dperiod, _slowing, _ma_method, _price_field, _mode, _shift); -#else // __MQL5__ +#else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN( ::iStochastic(_symbol, _tf, _kperiod, _dperiod, _slowing, _ma_method, _price_field), _mode, _shift); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " diff --git a/Indicators/Oscillator/Indi_WPR.h b/Indicators/Oscillator/Indi_WPR.h index 24253b345..7240eaa12 100644 --- a/Indicators/Oscillator/Indi_WPR.h +++ b/Indicators/Oscillator/Indi_WPR.h @@ -90,7 +90,7 @@ class Indi_WPR : public Indicator { #ifdef __MQL__ #ifdef __MQL4__ return ::iWPR(_symbol, _tf, _period, _shift); -#else // __MQL5__ +#else // __MQL5__ int _handle = Object::IsValid(_obj) ? _obj.Get(IndicatorDataState::INDICATOR_DATA_STATE_PROP_HANDLE) : NULL; double _res[]; if (_handle == NULL || _handle == INVALID_HANDLE) { @@ -117,7 +117,7 @@ class Indi_WPR : public Indicator { } return _res[0]; #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " diff --git a/Indicators/Price/Indi_AppliedPrice.h b/Indicators/Price/Indi_AppliedPrice.h index 9183e7bae..834ea938f 100644 --- a/Indicators/Price/Indi_AppliedPrice.h +++ b/Indicators/Price/Indi_AppliedPrice.h @@ -21,8 +21,8 @@ */ // Includes. -#include "../../Storage/Dict/Buffer/BufferStruct.h" #include "../../Indicator/Indicator.h" +#include "../../Storage/Dict/Buffer/BufferStruct.h" #include "../OHLC/Indi_OHLC.mqh" // Structs. diff --git a/Indicators/Price/Indi_Price.h b/Indicators/Price/Indi_Price.h index 9c8e87753..35db3ed59 100644 --- a/Indicators/Price/Indi_Price.h +++ b/Indicators/Price/Indi_Price.h @@ -21,9 +21,9 @@ */ // Includes. -#include "../../Storage/Dict/Buffer/BufferStruct.h" #include "../../Indicator/Indicator.h" #include "../../Platform/Platform.h" +#include "../../Storage/Dict/Buffer/BufferStruct.h" #include "../../Storage/Objects.h" // Structs. diff --git a/Indicators/PriceMulti/Indi_Alligator.h b/Indicators/PriceMulti/Indi_Alligator.h index a286c5d6d..a70b4d727 100644 --- a/Indicators/PriceMulti/Indi_Alligator.h +++ b/Indicators/PriceMulti/Indi_Alligator.h @@ -152,7 +152,7 @@ class Indi_Alligator : public Indicator { _lips_period, _lips_shift, _ma_method, _applied_price), _mode, _shift); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " diff --git a/Indicators/PriceRange/Indi_Bands.h b/Indicators/PriceRange/Indi_Bands.h index 9207bcb48..caf00ed0f 100644 --- a/Indicators/PriceRange/Indi_Bands.h +++ b/Indicators/PriceRange/Indi_Bands.h @@ -23,12 +23,12 @@ // Includes. #include "../../Indicator/Indicator.h" #include "../Indi_CCI.mqh" -#include "Indi_Envelopes.h" -#include "../Price/Indi_MA.h" #include "../Indi_Momentum.mqh" -#include "../Oscillator/Indi_RSI.h" #include "../Indi_StdDev.mqh" +#include "../Oscillator/Indi_RSI.h" +#include "../Price/Indi_MA.h" #include "../Price/Indi_Price.h" +#include "Indi_Envelopes.h" #ifndef __MQL4__ // Forward declaration. @@ -138,7 +138,7 @@ class Indi_Bands : public Indicator { INDICATOR_BUILTIN_CALL_AND_RETURN(::iBands(_symbol, _tf, _period, _bands_shift, _deviation, _applied_price), _mode, _shift); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " @@ -165,8 +165,7 @@ class Indi_Bands : public Indicator { } static double iBandsOnArray(INDICATOR_CALCULATE_PARAMS_SHORT, int _period, double _deviation, int _bands_shift, - int _mode, int _abs_shift, IndiBufferCache *_cache, - bool _recalculate = false) { + int _mode, int _abs_shift, IndiBufferCache *_cache, bool _recalculate = false) { _cache.SetPriceBuffer(_price); if (!_cache.HasBuffers()) { diff --git a/Indicators/PriceRange/Indi_Envelopes.h b/Indicators/PriceRange/Indi_Envelopes.h index a9c23ee7c..8a16962ea 100644 --- a/Indicators/PriceRange/Indi_Envelopes.h +++ b/Indicators/PriceRange/Indi_Envelopes.h @@ -23,8 +23,8 @@ // Includes. #include "../../Indicator/Indicator.h" #include "../../Storage/Singleton.h" -#include "../Price/Indi_MA.h" #include "../Indi_PriceFeeder.mqh" +#include "../Price/Indi_MA.h" #include "../Price/Indi_Price.h" #ifndef __MQL4__ @@ -145,7 +145,7 @@ class Indi_Envelopes : public Indicator { INDICATOR_BUILTIN_CALL_AND_RETURN(::iEnvelopes(_symbol, _tf, _ma_period, _ma_shift, _ma_method, _ap, _deviation), _mode, _shift); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " @@ -166,8 +166,7 @@ class Indi_Envelopes : public Indicator { } static double iEnvelopesOnArray(double &price[], int total, int ma_period, ENUM_MA_METHOD ma_method, int ma_shift, - double deviation, int mode, int shift, - IndiBufferCache *_cache = NULL) { + double deviation, int mode, int shift, IndiBufferCache *_cache = NULL) { #ifdef __MQL4__ return iEnvelopesOnArray(price, total, ma_period, ma_method, ma_shift, deviation, mode, shift); #else diff --git a/Indicators/PriceRange/Indi_SAR.h b/Indicators/PriceRange/Indi_SAR.h index 9ff35dbc8..910ed7e3d 100644 --- a/Indicators/PriceRange/Indi_SAR.h +++ b/Indicators/PriceRange/Indi_SAR.h @@ -89,7 +89,7 @@ class Indi_SAR : public Indicator { #else // __MQL5__ INDICATOR_BUILTIN_CALL_AND_RETURN(::iSAR(_symbol, _tf, _step, _max), 0, _shift); #endif -#else // Non-MQL. +#else // Non-MQL. // @todo: Use Platform class. RUNTIME_ERROR( "Not implemented. Please use an On-Indicator mode and attach " diff --git a/Indicators/Tick/Indi_TickMt.h b/Indicators/Tick/Indi_TickMt.h index 853356601..027684237 100644 --- a/Indicators/Tick/Indi_TickMt.h +++ b/Indicators/Tick/Indi_TickMt.h @@ -31,9 +31,9 @@ #endif // Includes. -#include "../../Platform/Chart/Chart.struct.static.h" #include "../../Indicator/IndicatorTick.h" #include "../../Indicator/IndicatorTick.provider.h" +#include "../../Platform/Chart/Chart.struct.static.h" // Structs. // Params for MT patform's tick-based indicator. From 92794b912fc01881b54636e4627207e2182081f7 Mon Sep 17 00:00:00 2001 From: kenorb Date: Thu, 22 Jun 2023 00:02:29 +0100 Subject: [PATCH 081/109] Makefile: Fail when make subprocess also fail --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 34cd50b8a..6425853f4 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ MAKEFILES := $(wildcard **/tests/Makefile) all: $(MAKEFILES) @for makefile in $(MAKEFILES); do \ echo "Compiling $$makefile"; \ - $(MAKE) -C $$(dirname $$makefile) CFLAGS="$(CFLAGS)" EMCC_CFLAGS="$(EMCC_CFLAGS)"; \ + $(MAKE) -C $$(dirname $$makefile) CFLAGS="$(CFLAGS)" EMCC_CFLAGS="$(EMCC_CFLAGS)" || exit $$?; \ done clean: $(MAKEFILES) From 053b6f526dc3a9d020113c15cd6722450dac1faa Mon Sep 17 00:00:00 2001 From: kenorb Date: Thu, 22 Jun 2023 00:13:39 +0100 Subject: [PATCH 082/109] Database: Code improvements and reformat --- Storage/Database.enum.h | 18 ++- Storage/Database.h | 292 +++++++++++++++++++------------------- Storage/Database.struct.h | 7 - 3 files changed, 159 insertions(+), 158 deletions(-) diff --git a/Storage/Database.enum.h b/Storage/Database.enum.h index dd755b9bf..1a6f636f3 100644 --- a/Storage/Database.enum.h +++ b/Storage/Database.enum.h @@ -20,11 +20,19 @@ * */ +// Enums. + +enum ENUM_DATABASE_COLUMN_FLAGS { + DATABASE_COLUMN_FLAG_NONE = 0, + DATABASE_COLUMN_FLAG_IS_KEY = 1, + DATABASE_COLUMN_FLAG_IS_NULL = 2, +}; + // @docs: https://www.mql5.com/en/docs/database/databaseopen#enum_database_open_flags enum ENUM_DATABASE_OPEN_FLAGS { - DATABASE_OPEN_READONLY, // Read only. - DATABASE_OPEN_READWRITE, // Open for reading and writing. - DATABASE_OPEN_CREATE, // Create the file on a disk if necessary. - DATABASE_OPEN_MEMORY, // Create a database in RAM. - DATABASE_OPEN_COMMON, // The file is in the common folder of all terminals. + DATABASE_OPEN_READONLY = 0, // Read only. + DATABASE_OPEN_READWRITE, // Open for reading and writing. + DATABASE_OPEN_CREATE, // Create the file on a disk if necessary. + DATABASE_OPEN_MEMORY, // Create a database in RAM. + DATABASE_OPEN_COMMON, // The file is in the common folder of all terminals. }; diff --git a/Storage/Database.h b/Storage/Database.h index ac0293a12..147225b63 100644 --- a/Storage/Database.h +++ b/Storage/Database.h @@ -49,211 +49,211 @@ class Database { * Class constructor. */ #ifndef __MQL4__ - Database(string _filename, unsigned int _flags = DATABASE_OPEN_CREATE){ + Database(string _filename, unsigned int _flags = DATABASE_OPEN_CREATE) #else - Database(string _filename, unsigned int _flags = 0) { + Database(string _filename, unsigned int _flags = 0) #endif + { #ifndef __MQL4__ - handle = DatabaseOpen(_filename, _flags); + handle = DatabaseOpen(_filename, _flags); #else handle = -1; SetUserError(ERR_USER_NOT_SUPPORTED); #endif -} + } -/** - * Class deconstructor. - */ -~Database() { + /** + * Class deconstructor. + */ + ~Database() { #ifndef __MQL4__ - DatabaseClose(handle); + DatabaseClose(handle); #endif -} + } -/* Table methods */ + /* Table methods */ -/** - * Checks if table exists. - */ -bool TableExists(string _name) { + /** + * Checks if table exists. + */ + bool TableExists(string _name) { #ifndef __MQL4__ - return DatabaseTableExists(handle, _name); + return DatabaseTableExists(handle, _name); #else SetUserError(ERR_USER_NOT_SUPPORTED); return false; #endif -} + } -/** - * Creates table if not yet exist. - */ -bool CreateTableIfNotExist(string _name, DatabaseTableSchema &_schema) { - if (TableExists(_name)) { - return true; + /** + * Creates table if not yet exist. + */ + bool CreateTableIfNotExist(string _name, DatabaseTableSchema &_schema) { + if (TableExists(_name)) { + return true; + } + return CreateTable(_name, _schema); } - return CreateTable(_name, _schema); -} -/** - * Creates table. - */ -bool CreateTable(string _name, DatabaseTableSchema &_schema) { - bool _result = false; + /** + * Creates table. + */ + bool CreateTable(string _name, DatabaseTableSchema &_schema) { + bool _result = false; #ifndef __MQL4__ - if (DatabaseTableExists(handle, _name)) { - // Generic error (ERR_DATABASE_ERROR). - SetUserError(5601); - return _result; - } + if (DatabaseTableExists(handle, _name)) { + // Generic error (ERR_DATABASE_ERROR). + SetUserError(5601); + return _result; + } - string query = "", subquery = ""; + string query = "", subquery = ""; - if (_schema.columns.Size() == 0) { - // SQLite does'nt allow tables without columns; - subquery = "`dummy` INTEGER"; - } else { - for (DictStructIterator iter = _schema.columns.Begin(); iter.IsValid(); ++iter) { - subquery += - StringFormat("`%s` %s %s,", iter.Value().GetName(), iter.Value().GetDatatype(), iter.Value().GetFlags()); + if (_schema.columns.Size() == 0) { + // SQLite does'nt allow tables without columns; + subquery = "`dummy` INTEGER"; + } else { + for (DictStructIterator iter = _schema.columns.Begin(); iter.IsValid(); ++iter) { + subquery += + StringFormat("`%s` %s %s,", iter.Value().GetName(), iter.Value().GetDatatype(), iter.Value().GetFlags()); + } + subquery = StringSubstr(subquery, 0, StringLen(subquery) - 1); // Removes extra comma. } - subquery = StringSubstr(subquery, 0, StringLen(subquery) - 1); // Removes extra comma. - } - query = StringFormat("CREATE TABLE `%s`(%s);", _name, subquery); + query = StringFormat("CREATE TABLE `%s`(%s);", _name, subquery); #ifdef __debug__ - Print("Database: Executing query:\n", query); + Print("Database: Executing query:\n", query); #endif - if (_result = DatabaseExecute(handle, query)) { - ResetLastError(); - SetTableSchema(_name, _schema); - } else { + if (_result = DatabaseExecute(handle, query)) { + ResetLastError(); + SetTableSchema(_name, _schema); + } else { #ifdef __debug__ - Print("Database: Query failed with error ", _LastError); - DebugBreak(); + Print("Database: Query failed with error ", _LastError); + DebugBreak(); #endif - } + } #endif - return _result; -} + return _result; + } -/** - * Drops table. - */ -bool DropTable(string _name) { - tables.Unset(_name); + /** + * Drops table. + */ + bool DropTable(string _name) { + tables.Unset(_name); #ifndef __MQL4__ - return DatabaseExecute(handle, "DROP TABLE IF EXISTS `" + _name + "`"); + return DatabaseExecute(handle, "DROP TABLE IF EXISTS `" + _name + "`"); #else return false; #endif -} + } -/* Import methods */ + /* Import methods */ -/** - * Imports data into table. First row must contain column names. Strings must be enclosed with double quotes. - */ -bool ImportData(const string _name, MatrixMini2d &data) { - if (data.SizeY() < 2 || data.SizeX() == 0) { - // No data to import or there are no columns in input data (Serialize() serialized no fields). - return true; - } - int x; - bool _result = true; - DatabaseTableSchema _schema = GetTableSchema(_name); - string _query = "", _cols = "", _vals = ""; - for (x = 0; x < data.SizeX(); ++x) { - const string key = data.Get(x, 0); - _cols += "`" + StringSubstr(key, 1, StringLen(key) - 2) + "`,"; - } - _cols = StringSubstr(_cols, 0, StringLen(_cols) - 1); // Removes extra comma. + /** + * Imports data into table. First row must contain column names. Strings must be enclosed with double quotes. + */ + bool ImportData(const string _name, MatrixMini2d &data) { + if (data.SizeY() < 2 || data.SizeX() == 0) { + // No data to import or there are no columns in input data (Serialize() serialized no fields). + return true; + } + int x; + bool _result = true; + DatabaseTableSchema _schema = GetTableSchema(_name); + string _query = "", _cols = "", _vals = ""; + for (x = 0; x < data.SizeX(); ++x) { + const string key = data.Get(x, 0); + _cols += "`" + StringSubstr(key, 1, StringLen(key) - 2) + "`,"; + } + _cols = StringSubstr(_cols, 0, StringLen(_cols) - 1); // Removes extra comma. #ifndef __MQL4__ - if (DatabaseTransactionBegin(handle)) { - _query = StringFormat("INSERT INTO `%s`(%s) VALUES\n", _name, _cols); - for (int y = 1; y < data.SizeY(); ++y) { - _query += "("; - for (x = 0; x < data.SizeX(); ++x) { - _query += data.Get(x, y) + (x < data.SizeX() - 1 ? ", " : ""); + if (DatabaseTransactionBegin(handle)) { + _query = StringFormat("INSERT INTO `%s`(%s) VALUES\n", _name, _cols); + for (int y = 1; y < data.SizeY(); ++y) { + _query += "("; + for (x = 0; x < data.SizeX(); ++x) { + _query += data.Get(x, y) + (x < data.SizeX() - 1 ? ", " : ""); + } + _query += ")" + (string)(y < data.SizeY() - 1 ? ",\n" : ""); } - _query += ")" + (string)(y < data.SizeY() - 1 ? ",\n" : ""); - } #ifdef __debug__ - Print("Database: Executing query:\n", _query); + Print("Database: Executing query:\n", _query); #endif - _result &= DatabaseExecute(handle, _query); - } - if (_result) { - DatabaseTransactionCommit(handle); - } else { - Print("Database: Query failed with error ", _LastError); - DebugBreak(); - DatabaseTransactionRollback(handle); - } + _result &= DatabaseExecute(handle, _query); + } + if (_result) { + DatabaseTransactionCommit(handle); + } else { + Print("Database: Query failed with error ", _LastError); + DebugBreak(); + DatabaseTransactionRollback(handle); + } #else return false; #endif - return _result; -} + return _result; + } #ifdef BUFFER_STRUCT_H -/** - * Imports BufferStruct records into a table. - */ -template -bool Import(const string _name, BufferStruct &_bstruct) { - bool _result = true; - DatabaseTableSchema _schema = GetTableSchema(_name); - string _query = "", _cols = "", _vals = ""; - for (DictStructIterator iter = _schema.columns.Begin(); iter.IsValid(); ++iter) { - _cols += iter.Value().name + ","; - } - _cols = StringSubstr(_cols, 0, StringLen(_cols) - 1); // Removes extra comma. + /** + * Imports BufferStruct records into a table. + */ + template + bool Import(const string _name, BufferStruct &_bstruct) { + bool _result = true; + DatabaseTableSchema _schema = GetTableSchema(_name); + string _query = "", _cols = "", _vals = ""; + for (DictStructIterator iter = _schema.columns.Begin(); iter.IsValid(); ++iter) { + _cols += iter.Value().name + ","; + } + _cols = StringSubstr(_cols, 0, StringLen(_cols) - 1); // Removes extra comma. #ifndef __MQL4__ - if (DatabaseTransactionBegin(handle)) { - for (DictStructIterator iter = _bstruct.Begin(); iter.IsValid(); ++iter) { - _query = StringFormat("INSERT INTO %s(%s) VALUES (%s)", _name, _cols, iter.Value().ToCSV()); - _result &= DatabaseExecute(handle, _query); + if (DatabaseTransactionBegin(handle)) { + for (DictStructIterator iter = _bstruct.Begin(); iter.IsValid(); ++iter) { + _query = StringFormat("INSERT INTO %s(%s) VALUES (%s)", _name, _cols, iter.Value().ToCSV()); + _result &= DatabaseExecute(handle, _query); + } + } + if (_result) { + DatabaseTransactionCommit(handle); + } else { + DatabaseTransactionRollback(handle); } - } - if (_result) { - DatabaseTransactionCommit(handle); - } else { - DatabaseTransactionRollback(handle); - } #else - return false; + return false; #endif - return _result; -} + return _result; + } #endif -/* Getters */ + /* Getters */ -/** - * Gets database handle. - */ -int GetHandle() { return handle; } + /** + * Gets database handle. + */ + int GetHandle() { return handle; } -/** - * Gets table schema. - */ -DatabaseTableSchema GetTableSchema(string _name) { return tables.GetByKey(_name); } + /** + * Gets table schema. + */ + DatabaseTableSchema GetTableSchema(string _name) { return tables.GetByKey(_name); } -/** - * Checks if table schema exists. - */ -bool SchemaExists(string _name) { return tables.KeyExists(_name); } + /** + * Checks if table schema exists. + */ + bool SchemaExists(string _name) { return tables.KeyExists(_name); } -/* Setters */ + /* Setters */ -/** - * Sets table schema. - */ -bool SetTableSchema(string _name, DatabaseTableSchema &_schema) { return tables.Set(_name, _schema); } -} -; + /** + * Sets table schema. + */ + bool SetTableSchema(string _name, DatabaseTableSchema &_schema) { return tables.Set(_name, _schema); } +}; #endif // DATABASE_H diff --git a/Storage/Database.struct.h b/Storage/Database.struct.h index a34cf232b..46f623778 100644 --- a/Storage/Database.struct.h +++ b/Storage/Database.struct.h @@ -25,13 +25,6 @@ * */ -// Enums. -enum DATABASE_COLUMN_FLAGS { - DATABASE_COLUMN_FLAG_NONE = 0, - DATABASE_COLUMN_FLAG_IS_KEY = 1, - DATABASE_COLUMN_FLAG_IS_NULL = 2, -}; - // Structs. struct DatabaseTableColumnEntry { string name; From caffc979561257523d26adb5008b4630fd92d20b Mon Sep 17 00:00:00 2001 From: kenorb Date: Thu, 22 Jun 2023 00:33:08 +0100 Subject: [PATCH 083/109] Adds CPP tests for EA, Log, Refs, Strategy and Trade --- tests/EA.test.cpp | 35 +++++++++++++++++++++++++++++++++++ tests/Log.test.cpp | 35 +++++++++++++++++++++++++++++++++++ tests/Refs.test.cpp | 35 +++++++++++++++++++++++++++++++++++ tests/Strategy.test.cpp | 35 +++++++++++++++++++++++++++++++++++ tests/Trade.test.cpp | 35 +++++++++++++++++++++++++++++++++++ 5 files changed, 175 insertions(+) create mode 100644 tests/EA.test.cpp create mode 100644 tests/Log.test.cpp create mode 100644 tests/Refs.test.cpp create mode 100644 tests/Strategy.test.cpp create mode 100644 tests/Trade.test.cpp diff --git a/tests/EA.test.cpp b/tests/EA.test.cpp new file mode 100644 index 000000000..5a93ec93c --- /dev/null +++ b/tests/EA.test.cpp @@ -0,0 +1,35 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of EA class. + */ + +// Includes. +#include "../EA.mqh" +#include "../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/tests/Log.test.cpp b/tests/Log.test.cpp new file mode 100644 index 000000000..23112c803 --- /dev/null +++ b/tests/Log.test.cpp @@ -0,0 +1,35 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Log class. + */ + +// Includes. +#include "../Log.mqh" +#include "../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/tests/Refs.test.cpp b/tests/Refs.test.cpp new file mode 100644 index 000000000..2f78a63b1 --- /dev/null +++ b/tests/Refs.test.cpp @@ -0,0 +1,35 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Refs class. + */ + +// Includes. +#include "../Refs.mqh" +#include "../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/tests/Strategy.test.cpp b/tests/Strategy.test.cpp new file mode 100644 index 000000000..30f554008 --- /dev/null +++ b/tests/Strategy.test.cpp @@ -0,0 +1,35 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Strategy class. + */ + +// Includes. +#include "../Strategy.mqh" +#include "../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/tests/Trade.test.cpp b/tests/Trade.test.cpp new file mode 100644 index 000000000..60970ff19 --- /dev/null +++ b/tests/Trade.test.cpp @@ -0,0 +1,35 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Trade class. + */ + +// Includes. +#include "../Trade.mqh" +#include "../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} From 9bcb7ab19109fd632685900e06d7deb0f8cb3156 Mon Sep 17 00:00:00 2001 From: kenorb Date: Thu, 22 Jun 2023 00:35:21 +0100 Subject: [PATCH 084/109] Adds more tests for indicators --- Indicators/tests/Indi_AC.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_AD.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_ADX.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_ADXW.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_AMA.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_AO.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_ASI.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_ATR.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_BWMFI.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_BWZT.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_BearsPower.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_BullsPower.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_CCI.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_CHO.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_CHV.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_ColorBars.test.cpp | 36 +++++++++++++++++++ .../tests/Indi_ColorCandlesDaily.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_ColorLine.test.cpp | 36 +++++++++++++++++++ .../tests/Indi_CustomMovingAverage.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_DEMA.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_DeMarker.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_Demo.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_DetrendedPrice.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_Drawer.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_Force.test.cpp | 36 +++++++++++++++++++ .../tests/Indi_FractalAdaptiveMA.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_Fractals.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_Gator.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_HeikenAshi.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_Ichimoku.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_Killzones.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_MFI.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_MassIndex.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_Momentum.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_OBV.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_OHLC.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_OsMA.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_Pattern.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_Price.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_PriceChannel.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_PriceFeeder.test.cpp | 36 +++++++++++++++++++ .../tests/Indi_PriceVolumeTrend.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_RS.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_RVI.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_RateOfChange.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_StdDev.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_TEMA.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_TRIX.test.cpp | 36 +++++++++++++++++++ .../tests/Indi_UltimateOscillator.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_VIDYA.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_VROC.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_Volumes.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_WilliamsAD.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_ZigZag.test.cpp | 36 +++++++++++++++++++ Indicators/tests/Indi_ZigZagColor.test.cpp | 36 +++++++++++++++++++ 55 files changed, 1980 insertions(+) create mode 100644 Indicators/tests/Indi_AC.test.cpp create mode 100644 Indicators/tests/Indi_AD.test.cpp create mode 100644 Indicators/tests/Indi_ADX.test.cpp create mode 100644 Indicators/tests/Indi_ADXW.test.cpp create mode 100644 Indicators/tests/Indi_AMA.test.cpp create mode 100644 Indicators/tests/Indi_AO.test.cpp create mode 100644 Indicators/tests/Indi_ASI.test.cpp create mode 100644 Indicators/tests/Indi_ATR.test.cpp create mode 100644 Indicators/tests/Indi_BWMFI.test.cpp create mode 100644 Indicators/tests/Indi_BWZT.test.cpp create mode 100644 Indicators/tests/Indi_BearsPower.test.cpp create mode 100644 Indicators/tests/Indi_BullsPower.test.cpp create mode 100644 Indicators/tests/Indi_CCI.test.cpp create mode 100644 Indicators/tests/Indi_CHO.test.cpp create mode 100644 Indicators/tests/Indi_CHV.test.cpp create mode 100644 Indicators/tests/Indi_ColorBars.test.cpp create mode 100644 Indicators/tests/Indi_ColorCandlesDaily.test.cpp create mode 100644 Indicators/tests/Indi_ColorLine.test.cpp create mode 100644 Indicators/tests/Indi_CustomMovingAverage.test.cpp create mode 100644 Indicators/tests/Indi_DEMA.test.cpp create mode 100644 Indicators/tests/Indi_DeMarker.test.cpp create mode 100644 Indicators/tests/Indi_Demo.test.cpp create mode 100644 Indicators/tests/Indi_DetrendedPrice.test.cpp create mode 100644 Indicators/tests/Indi_Drawer.test.cpp create mode 100644 Indicators/tests/Indi_Force.test.cpp create mode 100644 Indicators/tests/Indi_FractalAdaptiveMA.test.cpp create mode 100644 Indicators/tests/Indi_Fractals.test.cpp create mode 100644 Indicators/tests/Indi_Gator.test.cpp create mode 100644 Indicators/tests/Indi_HeikenAshi.test.cpp create mode 100644 Indicators/tests/Indi_Ichimoku.test.cpp create mode 100644 Indicators/tests/Indi_Killzones.test.cpp create mode 100644 Indicators/tests/Indi_MFI.test.cpp create mode 100644 Indicators/tests/Indi_MassIndex.test.cpp create mode 100644 Indicators/tests/Indi_Momentum.test.cpp create mode 100644 Indicators/tests/Indi_OBV.test.cpp create mode 100644 Indicators/tests/Indi_OHLC.test.cpp create mode 100644 Indicators/tests/Indi_OsMA.test.cpp create mode 100644 Indicators/tests/Indi_Pattern.test.cpp create mode 100644 Indicators/tests/Indi_Price.test.cpp create mode 100644 Indicators/tests/Indi_PriceChannel.test.cpp create mode 100644 Indicators/tests/Indi_PriceFeeder.test.cpp create mode 100644 Indicators/tests/Indi_PriceVolumeTrend.test.cpp create mode 100644 Indicators/tests/Indi_RS.test.cpp create mode 100644 Indicators/tests/Indi_RVI.test.cpp create mode 100644 Indicators/tests/Indi_RateOfChange.test.cpp create mode 100644 Indicators/tests/Indi_StdDev.test.cpp create mode 100644 Indicators/tests/Indi_TEMA.test.cpp create mode 100644 Indicators/tests/Indi_TRIX.test.cpp create mode 100644 Indicators/tests/Indi_UltimateOscillator.test.cpp create mode 100644 Indicators/tests/Indi_VIDYA.test.cpp create mode 100644 Indicators/tests/Indi_VROC.test.cpp create mode 100644 Indicators/tests/Indi_Volumes.test.cpp create mode 100644 Indicators/tests/Indi_WilliamsAD.test.cpp create mode 100644 Indicators/tests/Indi_ZigZag.test.cpp create mode 100644 Indicators/tests/Indi_ZigZagColor.test.cpp diff --git a/Indicators/tests/Indi_AC.test.cpp b/Indicators/tests/Indi_AC.test.cpp new file mode 100644 index 000000000..cb31dbd00 --- /dev/null +++ b/Indicators/tests/Indi_AC.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_AC class. + */ + +// Includes. +#include "../Indi_AC.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_AD.test.cpp b/Indicators/tests/Indi_AD.test.cpp new file mode 100644 index 000000000..e7f113dca --- /dev/null +++ b/Indicators/tests/Indi_AD.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_AD class. + */ + +// Includes. +#include "../Indi_AD.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_ADX.test.cpp b/Indicators/tests/Indi_ADX.test.cpp new file mode 100644 index 000000000..7f79f5bff --- /dev/null +++ b/Indicators/tests/Indi_ADX.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_ADX class. + */ + +// Includes. +#include "../Indi_ADX.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_ADXW.test.cpp b/Indicators/tests/Indi_ADXW.test.cpp new file mode 100644 index 000000000..6adc1c09a --- /dev/null +++ b/Indicators/tests/Indi_ADXW.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_ADXW class. + */ + +// Includes. +#include "../Indi_ADXW.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_AMA.test.cpp b/Indicators/tests/Indi_AMA.test.cpp new file mode 100644 index 000000000..69e2a89c3 --- /dev/null +++ b/Indicators/tests/Indi_AMA.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_AMA class. + */ + +// Includes. +#include "../Indi_AMA.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_AO.test.cpp b/Indicators/tests/Indi_AO.test.cpp new file mode 100644 index 000000000..d2c78c25e --- /dev/null +++ b/Indicators/tests/Indi_AO.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_AO class. + */ + +// Includes. +#include "../Indi_AO.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_ASI.test.cpp b/Indicators/tests/Indi_ASI.test.cpp new file mode 100644 index 000000000..77ce2b19b --- /dev/null +++ b/Indicators/tests/Indi_ASI.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_ASI class. + */ + +// Includes. +#include "../Indi_ASI.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_ATR.test.cpp b/Indicators/tests/Indi_ATR.test.cpp new file mode 100644 index 000000000..7c1e7872a --- /dev/null +++ b/Indicators/tests/Indi_ATR.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_ATR class. + */ + +// Includes. +#include "../Indi_ATR.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_BWMFI.test.cpp b/Indicators/tests/Indi_BWMFI.test.cpp new file mode 100644 index 000000000..6591cc05d --- /dev/null +++ b/Indicators/tests/Indi_BWMFI.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_BWMFI class. + */ + +// Includes. +#include "../Indi_BWMFI.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_BWZT.test.cpp b/Indicators/tests/Indi_BWZT.test.cpp new file mode 100644 index 000000000..3c389116e --- /dev/null +++ b/Indicators/tests/Indi_BWZT.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_BWZT class. + */ + +// Includes. +#include "../Indi_BWZT.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_BearsPower.test.cpp b/Indicators/tests/Indi_BearsPower.test.cpp new file mode 100644 index 000000000..a2247a51f --- /dev/null +++ b/Indicators/tests/Indi_BearsPower.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_BearsPower class. + */ + +// Includes. +#include "../Indi_BearsPower.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_BullsPower.test.cpp b/Indicators/tests/Indi_BullsPower.test.cpp new file mode 100644 index 000000000..dd4a059e0 --- /dev/null +++ b/Indicators/tests/Indi_BullsPower.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_BullsPower class. + */ + +// Includes. +#include "../Indi_BullsPower.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_CCI.test.cpp b/Indicators/tests/Indi_CCI.test.cpp new file mode 100644 index 000000000..1221be0f7 --- /dev/null +++ b/Indicators/tests/Indi_CCI.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_CCI class. + */ + +// Includes. +#include "../Indi_CCI.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_CHO.test.cpp b/Indicators/tests/Indi_CHO.test.cpp new file mode 100644 index 000000000..40bbd0702 --- /dev/null +++ b/Indicators/tests/Indi_CHO.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_CHO class. + */ + +// Includes. +#include "../Indi_CHO.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_CHV.test.cpp b/Indicators/tests/Indi_CHV.test.cpp new file mode 100644 index 000000000..df51642ce --- /dev/null +++ b/Indicators/tests/Indi_CHV.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_CHV class. + */ + +// Includes. +#include "../Indi_CHV.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_ColorBars.test.cpp b/Indicators/tests/Indi_ColorBars.test.cpp new file mode 100644 index 000000000..9b0692069 --- /dev/null +++ b/Indicators/tests/Indi_ColorBars.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_ColorBars class. + */ + +// Includes. +#include "../Indi_ColorBars.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_ColorCandlesDaily.test.cpp b/Indicators/tests/Indi_ColorCandlesDaily.test.cpp new file mode 100644 index 000000000..f1bd10a00 --- /dev/null +++ b/Indicators/tests/Indi_ColorCandlesDaily.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_ColorCandlesDaily class. + */ + +// Includes. +#include "../Indi_ColorCandlesDaily.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_ColorLine.test.cpp b/Indicators/tests/Indi_ColorLine.test.cpp new file mode 100644 index 000000000..701f35998 --- /dev/null +++ b/Indicators/tests/Indi_ColorLine.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_ColorLine class. + */ + +// Includes. +#include "../Indi_ColorLine.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_CustomMovingAverage.test.cpp b/Indicators/tests/Indi_CustomMovingAverage.test.cpp new file mode 100644 index 000000000..2e122de71 --- /dev/null +++ b/Indicators/tests/Indi_CustomMovingAverage.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_CustomMovingAverage class. + */ + +// Includes. +#include "../Indi_CustomMovingAverage.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_DEMA.test.cpp b/Indicators/tests/Indi_DEMA.test.cpp new file mode 100644 index 000000000..48118f6af --- /dev/null +++ b/Indicators/tests/Indi_DEMA.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_DEMA class. + */ + +// Includes. +#include "../Indi_DEMA.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_DeMarker.test.cpp b/Indicators/tests/Indi_DeMarker.test.cpp new file mode 100644 index 000000000..3193ef17a --- /dev/null +++ b/Indicators/tests/Indi_DeMarker.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_DeMarker class. + */ + +// Includes. +#include "../Indi_DeMarker.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_Demo.test.cpp b/Indicators/tests/Indi_Demo.test.cpp new file mode 100644 index 000000000..e4bbfc8b7 --- /dev/null +++ b/Indicators/tests/Indi_Demo.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_Demo class. + */ + +// Includes. +#include "../Indi_Demo.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_DetrendedPrice.test.cpp b/Indicators/tests/Indi_DetrendedPrice.test.cpp new file mode 100644 index 000000000..a59478d75 --- /dev/null +++ b/Indicators/tests/Indi_DetrendedPrice.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_DetrendedPrice class. + */ + +// Includes. +#include "../Indi_DetrendedPrice.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_Drawer.test.cpp b/Indicators/tests/Indi_Drawer.test.cpp new file mode 100644 index 000000000..37f1fb554 --- /dev/null +++ b/Indicators/tests/Indi_Drawer.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_Drawer class. + */ + +// Includes. +#include "../Indi_Drawer.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_Force.test.cpp b/Indicators/tests/Indi_Force.test.cpp new file mode 100644 index 000000000..0e9bd8d4c --- /dev/null +++ b/Indicators/tests/Indi_Force.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_Force class. + */ + +// Includes. +#include "../Indi_Force.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_FractalAdaptiveMA.test.cpp b/Indicators/tests/Indi_FractalAdaptiveMA.test.cpp new file mode 100644 index 000000000..669cb9da9 --- /dev/null +++ b/Indicators/tests/Indi_FractalAdaptiveMA.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_FractalAdaptiveMA class. + */ + +// Includes. +#include "../Indi_FractalAdaptiveMA.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_Fractals.test.cpp b/Indicators/tests/Indi_Fractals.test.cpp new file mode 100644 index 000000000..50d6950cb --- /dev/null +++ b/Indicators/tests/Indi_Fractals.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_Fractals class. + */ + +// Includes. +#include "../Indi_Fractals.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_Gator.test.cpp b/Indicators/tests/Indi_Gator.test.cpp new file mode 100644 index 000000000..f4be095c1 --- /dev/null +++ b/Indicators/tests/Indi_Gator.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_Gator class. + */ + +// Includes. +#include "../Indi_Gator.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_HeikenAshi.test.cpp b/Indicators/tests/Indi_HeikenAshi.test.cpp new file mode 100644 index 000000000..326731b08 --- /dev/null +++ b/Indicators/tests/Indi_HeikenAshi.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_HeikenAshi class. + */ + +// Includes. +#include "../Indi_HeikenAshi.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_Ichimoku.test.cpp b/Indicators/tests/Indi_Ichimoku.test.cpp new file mode 100644 index 000000000..60955e6af --- /dev/null +++ b/Indicators/tests/Indi_Ichimoku.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_Ichimoku class. + */ + +// Includes. +#include "../Indi_Ichimoku.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_Killzones.test.cpp b/Indicators/tests/Indi_Killzones.test.cpp new file mode 100644 index 000000000..68be7807f --- /dev/null +++ b/Indicators/tests/Indi_Killzones.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_Killzones class. + */ + +// Includes. +#include "../Indi_Killzones.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_MFI.test.cpp b/Indicators/tests/Indi_MFI.test.cpp new file mode 100644 index 000000000..b185f1b84 --- /dev/null +++ b/Indicators/tests/Indi_MFI.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_MFI class. + */ + +// Includes. +#include "../Indi_MFI.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_MassIndex.test.cpp b/Indicators/tests/Indi_MassIndex.test.cpp new file mode 100644 index 000000000..2cce413c3 --- /dev/null +++ b/Indicators/tests/Indi_MassIndex.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_MassIndex class. + */ + +// Includes. +#include "../Indi_MassIndex.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_Momentum.test.cpp b/Indicators/tests/Indi_Momentum.test.cpp new file mode 100644 index 000000000..aa8dfee33 --- /dev/null +++ b/Indicators/tests/Indi_Momentum.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_Momentum class. + */ + +// Includes. +#include "../Indi_Momentum.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_OBV.test.cpp b/Indicators/tests/Indi_OBV.test.cpp new file mode 100644 index 000000000..c968c61d2 --- /dev/null +++ b/Indicators/tests/Indi_OBV.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_OBV class. + */ + +// Includes. +#include "../Indi_OBV.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_OHLC.test.cpp b/Indicators/tests/Indi_OHLC.test.cpp new file mode 100644 index 000000000..ba42aef26 --- /dev/null +++ b/Indicators/tests/Indi_OHLC.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_OHLC class. + */ + +// Includes. +#include "../Indi_OHLC.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_OsMA.test.cpp b/Indicators/tests/Indi_OsMA.test.cpp new file mode 100644 index 000000000..81bef59ba --- /dev/null +++ b/Indicators/tests/Indi_OsMA.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_OsMA class. + */ + +// Includes. +#include "../Indi_OsMA.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_Pattern.test.cpp b/Indicators/tests/Indi_Pattern.test.cpp new file mode 100644 index 000000000..1828b7ae0 --- /dev/null +++ b/Indicators/tests/Indi_Pattern.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_Pattern class. + */ + +// Includes. +#include "../Indi_Pattern.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_Price.test.cpp b/Indicators/tests/Indi_Price.test.cpp new file mode 100644 index 000000000..c0cd11094 --- /dev/null +++ b/Indicators/tests/Indi_Price.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_Price class. + */ + +// Includes. +#include "../Indi_Price.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_PriceChannel.test.cpp b/Indicators/tests/Indi_PriceChannel.test.cpp new file mode 100644 index 000000000..a4ceb1884 --- /dev/null +++ b/Indicators/tests/Indi_PriceChannel.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_PriceChannel class. + */ + +// Includes. +#include "../Indi_PriceChannel.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_PriceFeeder.test.cpp b/Indicators/tests/Indi_PriceFeeder.test.cpp new file mode 100644 index 000000000..fb28a6dd1 --- /dev/null +++ b/Indicators/tests/Indi_PriceFeeder.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_PriceFeeder class. + */ + +// Includes. +#include "../Indi_PriceFeeder.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_PriceVolumeTrend.test.cpp b/Indicators/tests/Indi_PriceVolumeTrend.test.cpp new file mode 100644 index 000000000..1280eac1b --- /dev/null +++ b/Indicators/tests/Indi_PriceVolumeTrend.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_PriceVolumeTrend class. + */ + +// Includes. +#include "../Indi_PriceVolumeTrend.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_RS.test.cpp b/Indicators/tests/Indi_RS.test.cpp new file mode 100644 index 000000000..d81e396e1 --- /dev/null +++ b/Indicators/tests/Indi_RS.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_RS class. + */ + +// Includes. +#include "../Indi_RS.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_RVI.test.cpp b/Indicators/tests/Indi_RVI.test.cpp new file mode 100644 index 000000000..9f15b1838 --- /dev/null +++ b/Indicators/tests/Indi_RVI.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_RVI class. + */ + +// Includes. +#include "../Indi_RVI.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_RateOfChange.test.cpp b/Indicators/tests/Indi_RateOfChange.test.cpp new file mode 100644 index 000000000..1bbec0188 --- /dev/null +++ b/Indicators/tests/Indi_RateOfChange.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_RateOfChange class. + */ + +// Includes. +#include "../Indi_RateOfChange.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_StdDev.test.cpp b/Indicators/tests/Indi_StdDev.test.cpp new file mode 100644 index 000000000..8df779140 --- /dev/null +++ b/Indicators/tests/Indi_StdDev.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_StdDev class. + */ + +// Includes. +#include "../Indi_StdDev.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_TEMA.test.cpp b/Indicators/tests/Indi_TEMA.test.cpp new file mode 100644 index 000000000..9896fb162 --- /dev/null +++ b/Indicators/tests/Indi_TEMA.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_TEMA class. + */ + +// Includes. +#include "../Indi_TEMA.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_TRIX.test.cpp b/Indicators/tests/Indi_TRIX.test.cpp new file mode 100644 index 000000000..c8694d834 --- /dev/null +++ b/Indicators/tests/Indi_TRIX.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_TRIX class. + */ + +// Includes. +#include "../Indi_TRIX.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_UltimateOscillator.test.cpp b/Indicators/tests/Indi_UltimateOscillator.test.cpp new file mode 100644 index 000000000..4bbe6e77c --- /dev/null +++ b/Indicators/tests/Indi_UltimateOscillator.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_UltimateOscillator class. + */ + +// Includes. +#include "../Indi_UltimateOscillator.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_VIDYA.test.cpp b/Indicators/tests/Indi_VIDYA.test.cpp new file mode 100644 index 000000000..8a5820691 --- /dev/null +++ b/Indicators/tests/Indi_VIDYA.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_VIDYA class. + */ + +// Includes. +#include "../Indi_VIDYA.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_VROC.test.cpp b/Indicators/tests/Indi_VROC.test.cpp new file mode 100644 index 000000000..8f983e407 --- /dev/null +++ b/Indicators/tests/Indi_VROC.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_VROC class. + */ + +// Includes. +#include "../Indi_VROC.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_Volumes.test.cpp b/Indicators/tests/Indi_Volumes.test.cpp new file mode 100644 index 000000000..1c91cc7a4 --- /dev/null +++ b/Indicators/tests/Indi_Volumes.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_Volumes class. + */ + +// Includes. +#include "../Indi_Volumes.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_WilliamsAD.test.cpp b/Indicators/tests/Indi_WilliamsAD.test.cpp new file mode 100644 index 000000000..0b014600a --- /dev/null +++ b/Indicators/tests/Indi_WilliamsAD.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_WilliamsAD class. + */ + +// Includes. +#include "../Indi_WilliamsAD.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_ZigZag.test.cpp b/Indicators/tests/Indi_ZigZag.test.cpp new file mode 100644 index 000000000..1e78a2a62 --- /dev/null +++ b/Indicators/tests/Indi_ZigZag.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_ZigZag class. + */ + +// Includes. +#include "../Indi_ZigZag.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/tests/Indi_ZigZagColor.test.cpp b/Indicators/tests/Indi_ZigZagColor.test.cpp new file mode 100644 index 000000000..8a8f46ff6 --- /dev/null +++ b/Indicators/tests/Indi_ZigZagColor.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_ZigZagColor class. + */ + +// Includes. +#include "../Indi_ZigZagColor.mqh" + +#include "../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} From b22c2a44b8d1f5ac19fa380c59921de5268cc219 Mon Sep 17 00:00:00 2001 From: kenorb Date: Thu, 22 Jun 2023 00:44:59 +0100 Subject: [PATCH 085/109] Makefile: Improves syntax --- Makefile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 6425853f4..d8c1fdb97 100644 --- a/Makefile +++ b/Makefile @@ -5,13 +5,14 @@ MAKEFILES := $(wildcard **/tests/Makefile) .PHONY: all all: $(MAKEFILES) - @for makefile in $(MAKEFILES); do \ - echo "Compiling $$makefile"; \ - $(MAKE) -C $$(dirname $$makefile) CFLAGS="$(CFLAGS)" EMCC_CFLAGS="$(EMCC_CFLAGS)" || exit $$?; \ - done + @ret=0; \ + for makefile in $(MAKEFILES); do \ + $(MAKE) -C $$(dirname $$makefile) CFLAGS="$(CFLAGS)" EMCC_CFLAGS="$(EMCC_CFLAGS)" || { ret=$$?; }; \ + done; \ + exit $$ret clean: $(MAKEFILES) @for makefile in $(MAKEFILES); do \ - echo "Compiling $$makefile"; \ + echo "Cleaning $$makefile"; \ $(MAKE) -C $$(dirname $$makefile) clean; \ done From 2ca9366b07f00817dc5020b3d33336f72bcc3a7c Mon Sep 17 00:00:00 2001 From: kenorb Date: Thu, 22 Jun 2023 00:55:21 +0100 Subject: [PATCH 086/109] Adds more tests for indicators --- Indicators/Bitwise/tests/Indi_Candle.test.cpp | 36 +++++++++++++++++++ .../Bitwise/tests/Indi_Pattern.test.cpp | 36 +++++++++++++++++++ .../Oscillator/tests/Indi_Stochastic.test.cpp | 36 +++++++++++++++++++ Indicators/Oscillator/tests/Indi_WPR.test.cpp | 36 +++++++++++++++++++ .../Price/tests/Indi_AppliedPrice.test.cpp | 36 +++++++++++++++++++ Indicators/Price/tests/Indi_MA.test.cpp | 36 +++++++++++++++++++ .../PriceMulti/tests/Indi_Alligator.test.cpp | 36 +++++++++++++++++++ .../PriceRange/tests/Indi_Bands.test.cpp | 36 +++++++++++++++++++ .../PriceRange/tests/Indi_Envelopes.test.cpp | 36 +++++++++++++++++++ .../PriceRange/tests/Indi_Pivot.test.cpp | 35 ++++++++++++++++++ .../PriceRange/tests/Indi_PriceRange.test.cpp | 35 ++++++++++++++++++ Indicators/PriceRange/tests/Indi_SAR.test.cpp | 36 +++++++++++++++++++ Indicators/Special/tests/Indi_Custom.test.cpp | 36 +++++++++++++++++++ Indicators/Tick/tests/Indi_TickMt.test.cpp | 36 +++++++++++++++++++ 14 files changed, 502 insertions(+) create mode 100644 Indicators/Bitwise/tests/Indi_Candle.test.cpp create mode 100644 Indicators/Bitwise/tests/Indi_Pattern.test.cpp create mode 100644 Indicators/Oscillator/tests/Indi_Stochastic.test.cpp create mode 100644 Indicators/Oscillator/tests/Indi_WPR.test.cpp create mode 100644 Indicators/Price/tests/Indi_AppliedPrice.test.cpp create mode 100644 Indicators/Price/tests/Indi_MA.test.cpp create mode 100644 Indicators/PriceMulti/tests/Indi_Alligator.test.cpp create mode 100644 Indicators/PriceRange/tests/Indi_Bands.test.cpp create mode 100644 Indicators/PriceRange/tests/Indi_Envelopes.test.cpp create mode 100644 Indicators/PriceRange/tests/Indi_Pivot.test.cpp create mode 100644 Indicators/PriceRange/tests/Indi_PriceRange.test.cpp create mode 100644 Indicators/PriceRange/tests/Indi_SAR.test.cpp create mode 100644 Indicators/Special/tests/Indi_Custom.test.cpp create mode 100644 Indicators/Tick/tests/Indi_TickMt.test.cpp diff --git a/Indicators/Bitwise/tests/Indi_Candle.test.cpp b/Indicators/Bitwise/tests/Indi_Candle.test.cpp new file mode 100644 index 000000000..edc1a920a --- /dev/null +++ b/Indicators/Bitwise/tests/Indi_Candle.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_Candle indicator class. + */ + +// Includes. +#include "../Indi_Candle.mqh" + +#include "../../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/Bitwise/tests/Indi_Pattern.test.cpp b/Indicators/Bitwise/tests/Indi_Pattern.test.cpp new file mode 100644 index 000000000..dce78be8a --- /dev/null +++ b/Indicators/Bitwise/tests/Indi_Pattern.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_Pattern indicator class. + */ + +// Includes. +#include "../Indi_Pattern.mqh" + +#include "../../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/Oscillator/tests/Indi_Stochastic.test.cpp b/Indicators/Oscillator/tests/Indi_Stochastic.test.cpp new file mode 100644 index 000000000..d38039d0d --- /dev/null +++ b/Indicators/Oscillator/tests/Indi_Stochastic.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_Stochastic class. + */ + +// Includes. +#include "../Indi_Stochastic.h" + +#include "../../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/Oscillator/tests/Indi_WPR.test.cpp b/Indicators/Oscillator/tests/Indi_WPR.test.cpp new file mode 100644 index 000000000..bc9bdff13 --- /dev/null +++ b/Indicators/Oscillator/tests/Indi_WPR.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_WPR class. + */ + +// Includes. +#include "../Indi_WPR.h" + +#include "../../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/Price/tests/Indi_AppliedPrice.test.cpp b/Indicators/Price/tests/Indi_AppliedPrice.test.cpp new file mode 100644 index 000000000..b918fd4d5 --- /dev/null +++ b/Indicators/Price/tests/Indi_AppliedPrice.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_AppliedPrice class. + */ + +// Includes. +#include "../Indi_AppliedPrice.h" + +#include "../../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/Price/tests/Indi_MA.test.cpp b/Indicators/Price/tests/Indi_MA.test.cpp new file mode 100644 index 000000000..4d4c45d9e --- /dev/null +++ b/Indicators/Price/tests/Indi_MA.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_MA class. + */ + +// Includes. +#include "../Indi_MA.h" + +#include "../../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/PriceMulti/tests/Indi_Alligator.test.cpp b/Indicators/PriceMulti/tests/Indi_Alligator.test.cpp new file mode 100644 index 000000000..f966ae735 --- /dev/null +++ b/Indicators/PriceMulti/tests/Indi_Alligator.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_Alligator class. + */ + +// Includes. +#include "../Indi_Alligator.h" + +#include "../../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/PriceRange/tests/Indi_Bands.test.cpp b/Indicators/PriceRange/tests/Indi_Bands.test.cpp new file mode 100644 index 000000000..266225f20 --- /dev/null +++ b/Indicators/PriceRange/tests/Indi_Bands.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_Bands class. + */ + +// Includes. +#include "../Indi_Bands.h" + +#include "../../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/PriceRange/tests/Indi_Envelopes.test.cpp b/Indicators/PriceRange/tests/Indi_Envelopes.test.cpp new file mode 100644 index 000000000..244ffaea8 --- /dev/null +++ b/Indicators/PriceRange/tests/Indi_Envelopes.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_Envelopes class. + */ + +// Includes. +#include "../Indi_Envelopes.h" + +#include "../../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/PriceRange/tests/Indi_Pivot.test.cpp b/Indicators/PriceRange/tests/Indi_Pivot.test.cpp new file mode 100644 index 000000000..407445ee1 --- /dev/null +++ b/Indicators/PriceRange/tests/Indi_Pivot.test.cpp @@ -0,0 +1,35 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_Pivot class. + */ + +// Includes. +#include "../Indi_Pivot.h" +#include "../../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/PriceRange/tests/Indi_PriceRange.test.cpp b/Indicators/PriceRange/tests/Indi_PriceRange.test.cpp new file mode 100644 index 000000000..d6c820fed --- /dev/null +++ b/Indicators/PriceRange/tests/Indi_PriceRange.test.cpp @@ -0,0 +1,35 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of all price range classes. + */ + +// Includes. +#include "../../../Platform/Platform.h" +#include "../includes.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/PriceRange/tests/Indi_SAR.test.cpp b/Indicators/PriceRange/tests/Indi_SAR.test.cpp new file mode 100644 index 000000000..af7b0a987 --- /dev/null +++ b/Indicators/PriceRange/tests/Indi_SAR.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_SAR class. + */ + +// Includes. +#include "../Indi_SAR.h" + +#include "../../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/Special/tests/Indi_Custom.test.cpp b/Indicators/Special/tests/Indi_Custom.test.cpp new file mode 100644 index 000000000..26e5bf6b5 --- /dev/null +++ b/Indicators/Special/tests/Indi_Custom.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_Custom indicator class. + */ + +// Includes. +#include "../Indi_Custom.mqh" + +#include "../../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/Tick/tests/Indi_TickMt.test.cpp b/Indicators/Tick/tests/Indi_TickMt.test.cpp new file mode 100644 index 000000000..78cb8b856 --- /dev/null +++ b/Indicators/Tick/tests/Indi_TickMt.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_TickMt indicator class. + */ + +// Includes. +#include "../Indi_TickMt.h" + +#include "../../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} From 1fe4be43eab8855cb50613b16dad633d404ee68e Mon Sep 17 00:00:00 2001 From: Adrian Kierzkowski Date: Thu, 22 Jun 2023 17:32:50 +0200 Subject: [PATCH 087/109] Another step in fixing C++ compile errors. --- Storage/Database.enum.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Storage/Database.enum.h b/Storage/Database.enum.h index 1a6f636f3..926d67ed9 100644 --- a/Storage/Database.enum.h +++ b/Storage/Database.enum.h @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Enums. enum ENUM_DATABASE_COLUMN_FLAGS { @@ -28,6 +33,8 @@ enum ENUM_DATABASE_COLUMN_FLAGS { DATABASE_COLUMN_FLAG_IS_NULL = 2, }; +#ifndef __MQL5__ + // @docs: https://www.mql5.com/en/docs/database/databaseopen#enum_database_open_flags enum ENUM_DATABASE_OPEN_FLAGS { DATABASE_OPEN_READONLY = 0, // Read only. @@ -36,3 +43,5 @@ enum ENUM_DATABASE_OPEN_FLAGS { DATABASE_OPEN_MEMORY, // Create a database in RAM. DATABASE_OPEN_COMMON, // The file is in the common folder of all terminals. }; + +#endif From ba9afe30fc4492851efa684375c1739418a1df6b Mon Sep 17 00:00:00 2001 From: Adrian Kierzkowski Date: Thu, 22 Jun 2023 20:31:05 +0200 Subject: [PATCH 088/109] A little step forward in fixing C++ compile errors. --- Indicators/Bitwise/Indi_Candle.mqh | 10 ++--- Indicators/Bitwise/Indi_Pattern.mqh | 12 +++--- Indicators/Special/Indi_Math.mqh | 14 +++---- Pattern.struct.h | 61 +++++++++++++++++------------ 4 files changed, 54 insertions(+), 43 deletions(-) diff --git a/Indicators/Bitwise/Indi_Candle.mqh b/Indicators/Bitwise/Indi_Candle.mqh index 27d6e3233..154129dcd 100644 --- a/Indicators/Bitwise/Indi_Candle.mqh +++ b/Indicators/Bitwise/Indi_Candle.mqh @@ -105,7 +105,7 @@ class Indi_Candle : public Indicator { // must have at least 4 buffers and define OHLC in the first 4 buffers. // Indi_Price is an example of such indicator. if (!indi_src.IsSet()) { - GetLogger().Error( + GetLogger() PTR_DEREF Error( "In order use custom indicator as a source, you need to select one using SetIndicatorData() method, " "which is a part of CandleParams structure.", "Indi_Candle"); @@ -117,10 +117,10 @@ class Indi_Candle : public Indicator { break; } - _ohlcs[0].open = GetDataSource().GetValue(PRICE_OPEN, ToRelShift(_abs_shift)); - _ohlcs[0].high = GetDataSource().GetValue(PRICE_HIGH, ToRelShift(_abs_shift)); - _ohlcs[0].low = GetDataSource().GetValue(PRICE_LOW, ToRelShift(_abs_shift)); - _ohlcs[0].close = GetDataSource().GetValue(PRICE_CLOSE, ToRelShift(_abs_shift)); + _ohlcs[0].open = GetDataSource() PTR_DEREF GetValue(PRICE_OPEN, ToRelShift(_abs_shift)); + _ohlcs[0].high = GetDataSource() PTR_DEREF GetValue(PRICE_HIGH, ToRelShift(_abs_shift)); + _ohlcs[0].low = GetDataSource() PTR_DEREF GetValue(PRICE_LOW, ToRelShift(_abs_shift)); + _ohlcs[0].close = GetDataSource() PTR_DEREF GetValue(PRICE_CLOSE, ToRelShift(_abs_shift)); break; default: SetUserError(ERR_INVALID_PARAMETER); diff --git a/Indicators/Bitwise/Indi_Pattern.mqh b/Indicators/Bitwise/Indi_Pattern.mqh index 7fa156adb..2b1f5ccd1 100644 --- a/Indicators/Bitwise/Indi_Pattern.mqh +++ b/Indicators/Bitwise/Indi_Pattern.mqh @@ -90,7 +90,7 @@ class Indi_Pattern : public Indicator { INDI_REQUIRE_SHIFT_OR_RETURN(GetCandle(), ToRelShift(_abs_shift) + _max_modes, WRONG_VALUE); - BarOHLC _ohlcs[8]; + FIXED_ARRAY(BarOHLC, _ohlcs, 8); switch (Get(STRUCT_ENUM(IndicatorDataParams, IDATA_PARAM_IDSTYPE))) { case IDATA_BUILTIN: @@ -108,7 +108,7 @@ class Indi_Pattern : public Indicator { // must have at least 4 buffers and define OHLC in the first 4 buffers. // Indi_Price is an example of such indicator. if (!indi_src.IsSet()) { - GetLogger().Error( + GetLogger() PTR_DEREF Error( "In order use custom indicator as a source, you need to select one using SetIndicatorData() method, " "which is a part of PatternParams structure.", "Indi_Pattern"); @@ -121,10 +121,10 @@ class Indi_Pattern : public Indicator { } for (i = 0; i < _max_modes; ++i) { - _ohlcs[i].open = GetDataSource().GetValue(PRICE_OPEN, ToRelShift(_abs_shift) + i); - _ohlcs[i].high = GetDataSource().GetValue(PRICE_HIGH, ToRelShift(_abs_shift) + i); - _ohlcs[i].low = GetDataSource().GetValue(PRICE_LOW, ToRelShift(_abs_shift) + i); - _ohlcs[i].close = GetDataSource().GetValue(PRICE_CLOSE, ToRelShift(_abs_shift) + i); + _ohlcs[i].open = GetDataSource() PTR_DEREF GetValue(PRICE_OPEN, ToRelShift(_abs_shift) + i); + _ohlcs[i].high = GetDataSource() PTR_DEREF GetValue(PRICE_HIGH, ToRelShift(_abs_shift) + i); + _ohlcs[i].low = GetDataSource() PTR_DEREF GetValue(PRICE_LOW, ToRelShift(_abs_shift) + i); + _ohlcs[i].close = GetDataSource() PTR_DEREF GetValue(PRICE_CLOSE, ToRelShift(_abs_shift) + i); if (!_ohlcs[i].IsValid()) { // Return empty entry on invalid candles. return WRONG_VALUE; diff --git a/Indicators/Special/Indi_Math.mqh b/Indicators/Special/Indi_Math.mqh index 4c622c46b..0df25f3be 100644 --- a/Indicators/Special/Indi_Math.mqh +++ b/Indicators/Special/Indi_Math.mqh @@ -119,7 +119,7 @@ class Indi_Math : public Indicator { switch (Get(STRUCT_ENUM(IndicatorDataParams, IDATA_PARAM_IDSTYPE))) { case IDATA_INDICATOR: if (!indi_src.IsSet()) { - GetLogger().Error( + GetLogger() PTR_DEREF Error( "In order use custom indicator as a source, you need to select one using SetIndicatorData() method, " "which is a part of IndiMathParams structure.", "Indi_Math"); @@ -133,12 +133,12 @@ class Indi_Math : public Indicator { case MATH_OP_MODE_BUILTIN: _value = Indi_Math::iMathOnIndicator(GetDataSource(), GetSymbol(), GetTf(), /*[*/ GetOpBuiltIn(), GetMode1(), GetMode2(), GetShift1(), - GetShift2() /*]*/, 0, ToRelShift(_abs_shift), &this); + GetShift2() /*]*/, 0, ToRelShift(_abs_shift), THIS_PTR); break; case MATH_OP_MODE_CUSTOM_FUNCTION: _value = Indi_Math::iMathOnIndicator(GetDataSource(), GetSymbol(), GetTf(), /*[*/ GetOpFunction(), GetMode1(), GetMode2(), GetShift1(), - GetShift2() /*]*/, 0, ToRelShift(_abs_shift), &this); + GetShift2() /*]*/, 0, ToRelShift(_abs_shift), THIS_PTR); break; } break; @@ -153,8 +153,8 @@ class Indi_Math : public Indicator { unsigned int _mode_1, unsigned int _mode_2, unsigned int _shift_1, unsigned int _shift_2, unsigned int _mode, int _shift, Indi_Math *_obj) { INDI_REQUIRE_SHIFT_OR_RETURN_EMPTY(_indi, MathMax(_shift_1, _shift_2)); - double _val_1 = _indi.GetValue(_mode_1, _shift_1); - double _val_2 = _indi.GetValue(_mode_2, _shift_2); + double _val_1 = _indi PTR_DEREF GetValue(_mode_1, _shift_1); + double _val_2 = _indi PTR_DEREF GetValue(_mode_2, _shift_2); return Math::Op(op, _val_1, _val_2); } @@ -162,8 +162,8 @@ class Indi_Math : public Indicator { unsigned int _mode_1, unsigned int _mode_2, unsigned int _shift_1, unsigned int _shift_2, unsigned int _mode, int _shift, Indi_Math *_obj) { INDI_REQUIRE_SHIFT_OR_RETURN_EMPTY(_indi, MathMax(_shift_1, _shift_2)); - double _val_1 = _indi.GetValue(_mode_1, _shift_1); - double _val_2 = _indi.GetValue(_mode_2, _shift_2); + double _val_1 = _indi PTR_DEREF GetValue(_mode_1, _shift_1); + double _val_2 = _indi PTR_DEREF GetValue(_mode_2, _shift_2); return _op(_val_1, _val_2); } diff --git a/Pattern.struct.h b/Pattern.struct.h index b71c4d709..b304263cb 100644 --- a/Pattern.struct.h +++ b/Pattern.struct.h @@ -37,7 +37,7 @@ // Defines structure for bitwise pattern values. struct PatternBitwise { - unsigned int v[]; + ARRAY(unsigned int, v); // Operator methods. unsigned int operator[](const int _index) const { return v[_index]; } // Adds new value to the end of the array. @@ -52,7 +52,7 @@ struct PatternBitwise { * @return * Returns array of counts. */ - void GetBitCount(short& _depths[]) { + void GetBitCount(ARRAY_REF(short, _depths)) { int _size = sizeof(int) * 8; for (int _bi = 0; _bi < _size; _bi++) { _depths[_bi] = GetBitCount(_bi); @@ -125,7 +125,7 @@ struct PatternBitwise { * @return * Returns array of depths. */ - void GetBitDepth(short& _depths[]) { + void GetBitDepth(ARRAY_REF(short, _depths)) { int _size = sizeof(int) * 8; for (int _bi = 0; _bi < _size; _bi++) { _depths[_bi] = GetBitDepth(_bi); @@ -163,7 +163,7 @@ struct PatternCandle { int _size = sizeof(int) * 8; for (int i = 0; i < _size; i++) { int _value = CheckPattern(1 << i) ? 1 : 0; - _s.Pass(THIS_REF, (string)(i + 1), _value, SERIALIZER_FIELD_FLAG_DYNAMIC); + _s.Pass(THIS_REF, IntegerToString(i + 1), _value, SERIALIZER_FIELD_FLAG_DYNAMIC); } return SerializerNodeObject; } @@ -296,14 +296,14 @@ struct PatternCandle1 : PatternCandle { // Struct for calculating and storing 2-candlestick patterns. struct PatternCandle2 : PatternCandle { PatternCandle2(unsigned int _pattern = 0) : PatternCandle(_pattern) {} - PatternCandle2(const BarOHLC& _c[]) : PatternCandle(PATTERN_2CANDLE_NONE) { + PatternCandle2(CONST_ARRAY_REF(BarOHLC, _c)) : PatternCandle(PATTERN_2CANDLE_NONE) { for (int i = 0; i < sizeof(int) * 8; i++) { ENUM_PATTERN_2CANDLE _enum = (ENUM_PATTERN_2CANDLE)(1 << i); SetPattern(_enum, CheckPattern(_enum, _c)); } } // Calculation methods. - static bool CheckPattern(ENUM_PATTERN_2CANDLE _enum, const BarOHLC& _c[]) { + static bool CheckPattern(ENUM_PATTERN_2CANDLE _enum, CONST_ARRAY_REF(BarOHLC, _c)) { switch (_enum) { case PATTERN_2CANDLE_BEARS: // Two bear candles. @@ -405,14 +405,14 @@ struct PatternCandle2 : PatternCandle { // Struct for calculating and storing 3-candlestick patterns. struct PatternCandle3 : PatternCandle { PatternCandle3(unsigned int _pattern = 0) : PatternCandle(_pattern) {} - PatternCandle3(const BarOHLC& _c[]) : PatternCandle(PATTERN_3CANDLE_NONE) { + PatternCandle3(CONST_ARRAY_REF(BarOHLC, _c)) : PatternCandle(PATTERN_3CANDLE_NONE) { for (int i = 0; i < sizeof(int) * 8; i++) { ENUM_PATTERN_3CANDLE _enum = (ENUM_PATTERN_3CANDLE)(1 << i); SetPattern(_enum, CheckPattern(_enum, _c)); } } // Calculation methods. - static bool CheckPattern(ENUM_PATTERN_3CANDLE _enum, const BarOHLC& _c[]) { + static bool CheckPattern(ENUM_PATTERN_3CANDLE _enum, CONST_ARRAY_REF(BarOHLC, _c)) { switch (_enum) { case PATTERN_3CANDLE_BEARS: // Three bear candles. @@ -521,14 +521,14 @@ struct PatternCandle3 : PatternCandle { // Struct for calculating and storing 4-candlestick patterns. struct PatternCandle4 : PatternCandle { PatternCandle4(unsigned int _pattern = 0) : PatternCandle(_pattern) {} - PatternCandle4(const BarOHLC& _c[]) : PatternCandle(PATTERN_4CANDLE_NONE) { + PatternCandle4(CONST_ARRAY_REF(BarOHLC, _c)) : PatternCandle(PATTERN_4CANDLE_NONE) { for (int i = 0; i < sizeof(int) * 8; i++) { ENUM_PATTERN_4CANDLE _enum = (ENUM_PATTERN_4CANDLE)(1 << i); SetPattern(_enum, CheckPattern(_enum, _c)); } } // Calculation methods. - static bool CheckPattern(ENUM_PATTERN_4CANDLE _enum, const BarOHLC& _c[]) { + static bool CheckPattern(ENUM_PATTERN_4CANDLE _enum, CONST_ARRAY_REF(BarOHLC, _c)) { PatternCandle3 _c3(_c); switch (_enum) { case PATTERN_4CANDLE_BEARS: @@ -539,7 +539,7 @@ struct PatternCandle4 : PatternCandle { return /* Bear 0 cont. */ _c[0].open > _c[0].close && /* Bear 0 is low */ _c[0].low < _c[3].low && - /* Bear 0 body is large */ _c3.CheckPattern(PATTERN_3CANDLE_BODY0_GT_SUM) && + /* Bear 0 body is large */ _c3.CheckPattern(PATTERN_3CANDLE_BODY0_GT_SUM, _c) && /* Bull 1 */ _c[1].open < _c[1].close && /* Bull 2 */ _c[2].open < _c[2].close && /* Bear 3 */ _c[3].open > _c[3].close && @@ -575,7 +575,7 @@ struct PatternCandle4 : PatternCandle { return /* Bull 0 cont. */ _c[0].open < _c[0].close && /* Bull 0 is high */ _c[0].high > _c[3].high && - /* Bull 0 body is large */ _c3.CheckPattern(PATTERN_3CANDLE_BODY0_GT_SUM) && + /* Bull 0 body is large */ _c3.CheckPattern(PATTERN_3CANDLE_BODY0_GT_SUM, _c) && /* Bear 1 */ _c[1].open > _c[1].close && /* Bear 2 */ _c[2].open > _c[2].close && /* Bull 3 */ _c[3].open < _c[3].close && @@ -687,14 +687,14 @@ struct PatternCandle4 : PatternCandle { // Struct for calculating and storing 4-candlestick patterns. struct PatternCandle5 : PatternCandle { PatternCandle5(unsigned int _pattern = 0) : PatternCandle(_pattern) {} - PatternCandle5(const BarOHLC& _c[]) : PatternCandle(PATTERN_5CANDLE_NONE) { + PatternCandle5(CONST_ARRAY_REF(BarOHLC, _c)) : PatternCandle(PATTERN_5CANDLE_NONE) { for (int i = 0; i < sizeof(int) * 8; i++) { ENUM_PATTERN_5CANDLE _enum = (ENUM_PATTERN_5CANDLE)(1 << i); SetPattern(_enum, CheckPattern(_enum, _c)); } } // Calculation methods. - static bool CheckPattern(ENUM_PATTERN_5CANDLE _enum, const BarOHLC& _c[]) { + static bool CheckPattern(ENUM_PATTERN_5CANDLE _enum, CONST_ARRAY_REF(BarOHLC, _c)) { switch (_enum) { case PATTERN_5CANDLE_BODY0_DIFF_PEAK: // Diff of the last two bodies is at a peak. @@ -838,14 +838,14 @@ struct PatternCandle5 : PatternCandle { // Struct for calculating and storing 4-candlestick patterns. struct PatternCandle6 : PatternCandle { PatternCandle6(unsigned int _pattern = 0) : PatternCandle(_pattern) {} - PatternCandle6(const BarOHLC& _c[]) : PatternCandle(PATTERN_6CANDLE_NONE) { + PatternCandle6(CONST_ARRAY_REF(BarOHLC, _c)) : PatternCandle(PATTERN_6CANDLE_NONE) { for (int i = 0; i < sizeof(int) * 8; i++) { ENUM_PATTERN_6CANDLE _enum = (ENUM_PATTERN_6CANDLE)(1 << i); SetPattern(_enum, CheckPattern(_enum, _c)); } } // Calculation methods. - static bool CheckPattern(ENUM_PATTERN_6CANDLE _enum, const BarOHLC& _c[]) { + static bool CheckPattern(ENUM_PATTERN_6CANDLE _enum, CONST_ARRAY_REF(BarOHLC, _c)) { switch (_enum) { case PATTERN_6CANDLE_NONE: return false; @@ -857,14 +857,14 @@ struct PatternCandle6 : PatternCandle { // Struct for calculating and storing 4-candlestick patterns. struct PatternCandle7 : PatternCandle { PatternCandle7(unsigned int _pattern = 0) : PatternCandle(_pattern) {} - PatternCandle7(const BarOHLC& _c[]) : PatternCandle(PATTERN_7CANDLE_NONE) { + PatternCandle7(CONST_ARRAY_REF(BarOHLC, _c)) : PatternCandle(PATTERN_7CANDLE_NONE) { for (int i = 0; i < sizeof(int) * 8; i++) { ENUM_PATTERN_7CANDLE _enum = (ENUM_PATTERN_7CANDLE)(1 << i); SetPattern(_enum, CheckPattern(_enum, _c)); } } // Calculation methods. - static bool CheckPattern(ENUM_PATTERN_7CANDLE _enum, const BarOHLC& _c[]) { + static bool CheckPattern(ENUM_PATTERN_7CANDLE _enum, CONST_ARRAY_REF(BarOHLC, _c)) { switch (_enum) { case PATTERN_7CANDLE_NONE: return false; @@ -876,14 +876,14 @@ struct PatternCandle7 : PatternCandle { // Struct for calculating and storing 4-candlestick patterns. struct PatternCandle8 : PatternCandle { PatternCandle8(unsigned int _pattern = 0) : PatternCandle(_pattern) {} - PatternCandle8(const BarOHLC& _c[]) : PatternCandle(PATTERN_8CANDLE_NONE) { + PatternCandle8(CONST_ARRAY_REF(BarOHLC, _c)) : PatternCandle(PATTERN_8CANDLE_NONE) { for (int i = 0; i < sizeof(int) * 8; i++) { ENUM_PATTERN_8CANDLE _enum = (ENUM_PATTERN_8CANDLE)(1 << i); SetPattern(_enum, CheckPattern(_enum, _c)); } } // Calculation methods. - static bool CheckPattern(ENUM_PATTERN_8CANDLE _enum, const BarOHLC& _c[]) { + static bool CheckPattern(ENUM_PATTERN_8CANDLE _enum, CONST_ARRAY_REF(BarOHLC, _c)) { switch (_enum) { case PATTERN_8CANDLE_NONE: return false; @@ -895,14 +895,14 @@ struct PatternCandle8 : PatternCandle { // Struct for calculating and storing 4-candlestick patterns. struct PatternCandle9 : PatternCandle { PatternCandle9(unsigned int _pattern = 0) : PatternCandle(_pattern) {} - PatternCandle9(const BarOHLC& _c[]) : PatternCandle(PATTERN_9CANDLE_NONE) { + PatternCandle9(CONST_ARRAY_REF(BarOHLC, _c)) : PatternCandle(PATTERN_9CANDLE_NONE) { for (int i = 0; i < sizeof(int) * 8; i++) { ENUM_PATTERN_9CANDLE _enum = (ENUM_PATTERN_9CANDLE)(1 << i); SetPattern(_enum, CheckPattern(_enum, _c)); } } // Calculation methods. - static bool CheckPattern(ENUM_PATTERN_9CANDLE _enum, const BarOHLC& _c[]) { + static bool CheckPattern(ENUM_PATTERN_9CANDLE _enum, CONST_ARRAY_REF(BarOHLC, _c)) { switch (_enum) { case PATTERN_9CANDLE_NONE: return false; @@ -914,14 +914,14 @@ struct PatternCandle9 : PatternCandle { // Struct for calculating and storing 4-candlestick patterns. struct PatternCandle10 : PatternCandle { PatternCandle10(unsigned int _pattern = 0) : PatternCandle(_pattern) {} - PatternCandle10(const BarOHLC& _c[]) : PatternCandle(PATTERN_10CANDLE_NONE) { + PatternCandle10(CONST_ARRAY_REF(BarOHLC, _c)) : PatternCandle(PATTERN_10CANDLE_NONE) { for (int i = 0; i < sizeof(int) * 8; i++) { ENUM_PATTERN_10CANDLE _enum = (ENUM_PATTERN_10CANDLE)(1 << i); SetPattern(_enum, CheckPattern(_enum, _c)); } } // Calculation methods. - static bool CheckPattern(ENUM_PATTERN_10CANDLE _enum, const BarOHLC& _c[]) { + static bool CheckPattern(ENUM_PATTERN_10CANDLE _enum, CONST_ARRAY_REF(BarOHLC, _c)) { switch (_enum) { case PATTERN_10CANDLE_NONE: return false; @@ -954,7 +954,18 @@ struct PatternEntry { pattern8(0), pattern9(0), pattern10(0) {} - PatternEntry(BarOHLC& _c[]) + PatternEntry(ARRAY_REF(BarOHLC, _c)) + : pattern1(_c[0]), + pattern2(_c), + pattern3(_c), + pattern4(_c), + pattern5(_c), + pattern6(_c), + pattern7(_c), + pattern8(_c), + pattern9(_c), + pattern10(_c) {} + PatternEntry(ARRAY_REF(BarOHLC, _c)) : pattern1(_c[0]), pattern2(_c), pattern3(_c), From fd5e6dbe4ddd4119ec72be2da50b758fbb5d25b6 Mon Sep 17 00:00:00 2001 From: kenorb Date: Thu, 22 Jun 2023 23:29:11 +0100 Subject: [PATCH 089/109] Moves global functions at the end for C++ compatibility --- Indicators/DrawIndicator.mqh | 4 +-- Indicators/Indi_AC.mqh | 25 ++++++++---------- Indicators/Indi_AD.mqh | 25 ++++++++---------- Indicators/Indi_ADX.mqh | 21 +++++++-------- Indicators/Indi_AO.mqh | 19 ++++++-------- Indicators/Indi_ATR.mqh | 19 ++++++-------- Indicators/Indi_BWMFI.mqh | 19 ++++++-------- Indicators/Indi_BearsPower.mqh | 19 ++++++-------- Indicators/Indi_BullsPower.mqh | 19 ++++++-------- Indicators/Indi_CCI.mqh | 27 +++++++++---------- Indicators/Indi_DeMarker.mqh | 19 ++++++-------- Indicators/Indi_Force.mqh | 21 +++++++-------- Indicators/Indi_Fractals.mqh | 19 ++++++-------- Indicators/Indi_Gator.mqh | 23 +++++++--------- Indicators/Indi_Ichimoku.mqh | 19 ++++++-------- Indicators/Indi_MFI.mqh | 19 ++++++-------- Indicators/Indi_Momentum.mqh | 19 ++++++-------- Indicators/Indi_OBV.mqh | 19 ++++++-------- Indicators/Indi_OsMA.mqh | 21 +++++++-------- Indicators/Indi_RVI.mqh | 19 ++++++-------- Indicators/Indi_StdDev.mqh | 29 +++++++++----------- Indicators/Oscillator/Indi_MACD.h | 21 +++++++-------- Indicators/Oscillator/Indi_Stochastic.h | 23 +++++++--------- Indicators/Oscillator/Indi_WPR.h | 19 ++++++-------- Indicators/Price/Indi_MA.h | 32 +++++++++++----------- Indicators/PriceMulti/Indi_Alligator.h | 25 ++++++++---------- Indicators/PriceRange/Indi_Bands.h | 23 +++++++--------- Indicators/PriceRange/Indi_Envelopes.h | 35 +++++++++++-------------- Indicators/PriceRange/Indi_SAR.h | 19 ++++++-------- 29 files changed, 268 insertions(+), 353 deletions(-) diff --git a/Indicators/DrawIndicator.mqh b/Indicators/DrawIndicator.mqh index a34e8b708..7293b5cdc 100644 --- a/Indicators/DrawIndicator.mqh +++ b/Indicators/DrawIndicator.mqh @@ -33,9 +33,7 @@ #include "../Platform/Plot.h" #include "../Storage/Dict/DictObject.h" #include "../Storage/Object.h" - -// Forward declaration. -class IndicatorBase; +#include "../Indicator/IndicatorBase.h" class DrawPoint { public: diff --git a/Indicators/Indi_AC.mqh b/Indicators/Indi_AC.mqh index f323fa4f1..0cd7efe82 100644 --- a/Indicators/Indi_AC.mqh +++ b/Indicators/Indi_AC.mqh @@ -20,24 +20,13 @@ * */ -#ifndef __MQL__ -// Allows the preprocessor to include a header file when it is needed. -#pragma once -#endif - // Includes. #include "../Indicator/Indicator.h" #include "../Storage/Dict/Buffer/BufferStruct.h" -#ifndef __MQL4__ -// Forward declaration. -class Indi_AC; - -// Defines global functions (for MQL4 backward compability). -double iAC(string _symbol, int _tf, int _shift) { - ResetLastError(); - return Indi_AC::iAC(_symbol, (ENUM_TIMEFRAMES)_tf, _shift); -} +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once #endif // Structs. @@ -155,3 +144,11 @@ class Indi_AC : public Indicator { return _ptr; } }; + +#ifndef __MQL4__ +// Defines global functions (for MQL4 backward compability). +double iAC(string _symbol, int _tf, int _shift) { + ResetLastError(); + return Indi_AC::iAC(_symbol, (ENUM_TIMEFRAMES)_tf, _shift); +} +#endif diff --git a/Indicators/Indi_AD.mqh b/Indicators/Indi_AD.mqh index 4147ab62e..e4bb3ee92 100644 --- a/Indicators/Indi_AD.mqh +++ b/Indicators/Indi_AD.mqh @@ -20,23 +20,12 @@ * */ -#ifndef __MQL__ -// Allows the preprocessor to include a header file when it is needed. -#pragma once -#endif - // Includes. #include "../Indicator/Indicator.h" -#ifndef __MQL4__ -// Forward declaration. -class Indi_AD; - -// Defines global functions (for MQL4 backward compability). -double iAD(string _symbol, int _tf, int _shift) { - ResetLastError(); - return Indi_AD::iAD(_symbol, (ENUM_TIMEFRAMES)_tf, _shift); -} +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once #endif // Structs. @@ -128,3 +117,11 @@ class Indi_AD : public Indicator { return _value; } }; + +#ifndef __MQL4__ +// Defines global functions (for MQL4 backward compability). +double iAD(string _symbol, int _tf, int _shift) { + ResetLastError(); + return Indi_AD::iAD(_symbol, (ENUM_TIMEFRAMES)_tf, _shift); +} +#endif diff --git a/Indicators/Indi_ADX.mqh b/Indicators/Indi_ADX.mqh index c904740f2..2d0a81e4a 100644 --- a/Indicators/Indi_ADX.mqh +++ b/Indicators/Indi_ADX.mqh @@ -24,18 +24,6 @@ #include "../Indicator/Indicator.h" #include "Price/Indi_Price.h" -#ifndef __MQL4__ -// Forward declaration. -class Indi_ADX; - -// Defines global functions (for MQL4 backward compability). -double iADX(string _symbol, int _tf, int _period, int _ap, int _mode, int _shift) { - ResetLastError(); - return Indi_ADX::iADX(_symbol, (ENUM_TIMEFRAMES)_tf, _period, (ENUM_APPLIED_PRICE)_ap, (ENUM_INDI_ADX_LINE)_mode, - _shift); -} -#endif - // Structs. struct IndiADXParams : IndicatorParams { unsigned int period; @@ -179,3 +167,12 @@ class Indi_ADX : public Indicator { iparams.applied_price = _applied_price; } }; + +#ifndef __MQL4__ +// Defines global functions (for MQL4 backward compability). +double iADX(string _symbol, int _tf, int _period, int _ap, int _mode, int _shift) { + ResetLastError(); + return Indi_ADX::iADX(_symbol, (ENUM_TIMEFRAMES)_tf, _period, (ENUM_APPLIED_PRICE)_ap, (ENUM_INDI_ADX_LINE)_mode, + _shift); +} +#endif diff --git a/Indicators/Indi_AO.mqh b/Indicators/Indi_AO.mqh index bfff08ce4..ecc2be6dc 100644 --- a/Indicators/Indi_AO.mqh +++ b/Indicators/Indi_AO.mqh @@ -23,17 +23,6 @@ // Includes. #include "../Indicator/Indicator.h" -#ifndef __MQL4__ -// Forward declaration. -class Indi_AO; - -// Defines global functions (for MQL4 backward compability). -double iAO(string _symbol, int _tf, int _shift) { - ResetLastError(); - return Indi_AO::iAO(_symbol, (ENUM_TIMEFRAMES)_tf, _shift); -} -#endif - // Structs. struct IndiAOParams : IndicatorParams { // Struct constructor. @@ -153,3 +142,11 @@ class Indi_AO : public Indicator { */ bool IsValidEntry(IndicatorDataEntry &_entry) override { return _entry.values[0].Get() != EMPTY_VALUE; } }; + +#ifndef __MQL4__ +// Defines global functions (for MQL4 backward compability). +double iAO(string _symbol, int _tf, int _shift) { + ResetLastError(); + return Indi_AO::iAO(_symbol, (ENUM_TIMEFRAMES)_tf, _shift); +} +#endif diff --git a/Indicators/Indi_ATR.mqh b/Indicators/Indi_ATR.mqh index 19113ce3f..73009cc0b 100644 --- a/Indicators/Indi_ATR.mqh +++ b/Indicators/Indi_ATR.mqh @@ -23,17 +23,6 @@ // Includes. #include "../Indicator/Indicator.h" -#ifndef __MQL4__ -// Forward declaration. -class Indi_ATR; - -// Defines global functions (for MQL4 backward compability). -double iATR(string _symbol, int _tf, int _period, int _shift) { - ResetLastError(); - return Indi_ATR::iATR(_symbol, (ENUM_TIMEFRAMES)_tf, _period, _shift); -} -#endif - // Structs. struct IndiATRParams : IndicatorParams { unsigned int period; @@ -150,3 +139,11 @@ class Indi_ATR : public Indicator { iparams.period = _period; } }; + +#ifndef __MQL4__ +// Defines global functions (for MQL4 backward compability). +double iATR(string _symbol, int _tf, int _period, int _shift) { + ResetLastError(); + return Indi_ATR::iATR(_symbol, (ENUM_TIMEFRAMES)_tf, _period, _shift); +} +#endif diff --git a/Indicators/Indi_BWMFI.mqh b/Indicators/Indi_BWMFI.mqh index 13ca86bc0..2582c2eec 100644 --- a/Indicators/Indi_BWMFI.mqh +++ b/Indicators/Indi_BWMFI.mqh @@ -23,17 +23,6 @@ // Includes. #include "../Indicator/Indicator.h" -#ifndef __MQL4__ -// Forward declaration. -class Indi_BWMFI; - -// Defines global functions (for MQL4 backward compability). -double iBWMFI(string _symbol, int _tf, int _shift) { - ResetLastError(); - return Indi_BWMFI::iBWMFI(_symbol, (ENUM_TIMEFRAMES)_tf, _shift); -} -#endif - // Enumerations. // Indicator line identifiers used in BWMFI indicators. enum ENUM_BWMFI_BUFFER { BWMFI_BUFFER = 0, BWMFI_HISTCOLOR = 1, FINAL_BWMFI_BUFFER_ENTRY }; @@ -199,3 +188,11 @@ class Indi_BWMFI : public Indicator { !_entry.HasValue(DBL_MAX); } }; + +#ifndef __MQL4__ +// Defines global functions (for MQL4 backward compability). +double iBWMFI(string _symbol, int _tf, int _shift) { + ResetLastError(); + return Indi_BWMFI::iBWMFI(_symbol, (ENUM_TIMEFRAMES)_tf, _shift); +} +#endif diff --git a/Indicators/Indi_BearsPower.mqh b/Indicators/Indi_BearsPower.mqh index 6dea2d286..475ce9b97 100644 --- a/Indicators/Indi_BearsPower.mqh +++ b/Indicators/Indi_BearsPower.mqh @@ -23,17 +23,6 @@ // Includes. #include "../Indicator/Indicator.h" -#ifndef __MQL4__ -// Forward declaration. -class Indi_BearsPower; - -// Defines global functions (for MQL4 backward compability). -double iBearsPower(string _symbol, int _tf, int _period, int _ap, int _shift) { - ResetLastError(); - return Indi_BearsPower::iBearsPower(_symbol, (ENUM_TIMEFRAMES)_tf, _period, (ENUM_APPLIED_PRICE)_ap, _shift); -} -#endif - // Structs. struct IndiBearsPowerParams : IndicatorParams { unsigned int period; @@ -153,3 +142,11 @@ class Indi_BearsPower : public Indicator { iparams.applied_price = _applied_price; } }; + +#ifndef __MQL4__ +// Defines global functions (for MQL4 backward compability). +double iBearsPower(string _symbol, int _tf, int _period, int _ap, int _shift) { + ResetLastError(); + return Indi_BearsPower::iBearsPower(_symbol, (ENUM_TIMEFRAMES)_tf, _period, (ENUM_APPLIED_PRICE)_ap, _shift); +} +#endif diff --git a/Indicators/Indi_BullsPower.mqh b/Indicators/Indi_BullsPower.mqh index 16ad2b2d6..737b0bf7e 100644 --- a/Indicators/Indi_BullsPower.mqh +++ b/Indicators/Indi_BullsPower.mqh @@ -23,17 +23,6 @@ // Includes. #include "../Indicator/Indicator.h" -#ifndef __MQL4__ -// Forward declaration. -class Indi_BullsPower; - -// Defines global functions (for MQL4 backward compability). -double iBullsPower(string _symbol, int _tf, int _period, int _ap, int _shift) { - ResetLastError(); - return Indi_BullsPower::iBullsPower(_symbol, (ENUM_TIMEFRAMES)_tf, _period, (ENUM_APPLIED_PRICE)_ap, _shift); -} -#endif - // Structs. struct IndiBullsPowerParams : IndicatorParams { unsigned int period; @@ -152,3 +141,11 @@ class Indi_BullsPower : public Indicator { iparams.applied_price = _applied_price; } }; + +#ifndef __MQL4__ +// Defines global functions (for MQL4 backward compability). +double iBullsPower(string _symbol, int _tf, int _period, int _ap, int _shift) { + ResetLastError(); + return Indi_BullsPower::iBullsPower(_symbol, (ENUM_TIMEFRAMES)_tf, _period, (ENUM_APPLIED_PRICE)_ap, _shift); +} +#endif diff --git a/Indicators/Indi_CCI.mqh b/Indicators/Indi_CCI.mqh index 6584925db..fa69935b2 100644 --- a/Indicators/Indi_CCI.mqh +++ b/Indicators/Indi_CCI.mqh @@ -26,21 +26,6 @@ #include "Price/Indi_MA.h" #include "Price/Indi_Price.h" -#ifndef __MQL4__ -// Forward declaration. -class Indi_CCI; - -// Defines global functions (for MQL4 backward compability). -double iCCI(string _symbol, int _tf, int _period, int _ap, int _shift) { - ResetLastError(); - return Indi_CCI::iCCI(_symbol, (ENUM_TIMEFRAMES)_tf, _period, (ENUM_APPLIED_PRICE)_ap, _shift); -} -double iCCIOnArray(double &_arr[], int _total, int _period, int _abs_shift) { - ResetLastError(); - return Indi_CCI::iCCIOnArray(_arr, _total, _period, _abs_shift); -} -#endif - // Structs. struct IndiCCIParams : IndicatorParams { unsigned int period; @@ -232,3 +217,15 @@ class Indi_CCI : public Indicator { iparams.applied_price = _applied_price; } }; + +#ifndef __MQL4__ +// Defines global functions (for MQL4 backward compability). +double iCCI(string _symbol, int _tf, int _period, int _ap, int _shift) { + ResetLastError(); + return Indi_CCI::iCCI(_symbol, (ENUM_TIMEFRAMES)_tf, _period, (ENUM_APPLIED_PRICE)_ap, _shift); +} +double iCCIOnArray(double &_arr[], int _total, int _period, int _abs_shift) { + ResetLastError(); + return Indi_CCI::iCCIOnArray(_arr, _total, _period, _abs_shift); +} +#endif diff --git a/Indicators/Indi_DeMarker.mqh b/Indicators/Indi_DeMarker.mqh index dad279880..e3b7bb9aa 100644 --- a/Indicators/Indi_DeMarker.mqh +++ b/Indicators/Indi_DeMarker.mqh @@ -23,17 +23,6 @@ // Includes. #include "../Indicator/Indicator.h" -#ifndef __MQL4__ -// Forward declaration. -class Indi_DeMarker; - -// Defines global functions (for MQL4 backward compability). -double iDeMarker(string _symbol, int _tf, int _period, int _shift) { - ResetLastError(); - return Indi_DeMarker::iDeMarker(_symbol, (ENUM_TIMEFRAMES)_tf, _period, _shift); -} -#endif - // Structs. struct IndiDeMarkerParams : IndicatorParams { unsigned int period; @@ -132,3 +121,11 @@ class Indi_DeMarker : public Indicator { iparams.period = _period; } }; + +#ifndef __MQL4__ +// Defines global functions (for MQL4 backward compability). +double iDeMarker(string _symbol, int _tf, int _period, int _shift) { + ResetLastError(); + return Indi_DeMarker::iDeMarker(_symbol, (ENUM_TIMEFRAMES)_tf, _period, _shift); +} +#endif diff --git a/Indicators/Indi_Force.mqh b/Indicators/Indi_Force.mqh index 9c599a1d7..e04c4cf1d 100644 --- a/Indicators/Indi_Force.mqh +++ b/Indicators/Indi_Force.mqh @@ -34,18 +34,6 @@ // Includes. #include "../Indicator/Indicator.h" -#ifndef __MQL4__ -// Forward declaration. -class Indi_Force; - -// Defines global functions (for MQL4 backward compability). -double iForce(string _symbol, int _tf, int _period, int _ma_method, int _ap, int _shift) { - ResetLastError(); - return Indi_Force::iForce(_symbol, (ENUM_TIMEFRAMES)_tf, _period, (ENUM_MA_METHOD)_ma_method, (ENUM_APPLIED_PRICE)_ap, - _shift); -} -#endif - // Structs. struct IndiForceParams : IndicatorParams { unsigned int period; @@ -176,3 +164,12 @@ class Indi_Force : public Indicator { iparams.applied_price = _applied_price; } }; + +#ifndef __MQL4__ +// Defines global functions (for MQL4 backward compability). +double iForce(string _symbol, int _tf, int _period, int _ma_method, int _ap, int _shift) { + ResetLastError(); + return Indi_Force::iForce(_symbol, (ENUM_TIMEFRAMES)_tf, _period, (ENUM_MA_METHOD)_ma_method, (ENUM_APPLIED_PRICE)_ap, + _shift); +} +#endif diff --git a/Indicators/Indi_Fractals.mqh b/Indicators/Indi_Fractals.mqh index 4eb4a0f27..d9ccf5f6c 100644 --- a/Indicators/Indi_Fractals.mqh +++ b/Indicators/Indi_Fractals.mqh @@ -23,17 +23,6 @@ // Includes. #include "../Indicator/Indicator.h" -#ifndef __MQL4__ -// Forward declaration. -class Indi_Fractals; - -// Defines global functions (for MQL4 backward compability). -double iFractals(string _symbol, int _tf, int _mode, int _shift) { - ResetLastError(); - return Indi_Fractals::iFractals(_symbol, (ENUM_TIMEFRAMES)_tf, (ENUM_LO_UP_LINE)_mode, _shift); -} -#endif - // Structs. struct IndiFractalsParams : IndicatorParams { // Struct constructors. @@ -156,3 +145,11 @@ class Indi_Fractals : public Indicator { return !_entry.HasValue(_wrong_value); } }; + +#ifndef __MQL4__ +// Defines global functions (for MQL4 backward compability). +double iFractals(string _symbol, int _tf, int _mode, int _shift) { + ResetLastError(); + return Indi_Fractals::iFractals(_symbol, (ENUM_TIMEFRAMES)_tf, (ENUM_LO_UP_LINE)_mode, _shift); +} +#endif diff --git a/Indicators/Indi_Gator.mqh b/Indicators/Indi_Gator.mqh index a3088f23b..61430807c 100644 --- a/Indicators/Indi_Gator.mqh +++ b/Indicators/Indi_Gator.mqh @@ -30,19 +30,6 @@ // Includes. #include "../Indicator/Indicator.h" -#ifndef __MQL4__ -// Forward declaration. -class Indi_Gator; - -// Defines global functions (for MQL4 backward compability). -double iGator(string _symbol, int _tf, int _jp, int _js, int _tp, int _ts, int _lp, int _ls, int _ma_method, int _ap, - int _mode, int _shift) { - ResetLastError(); - return Indi_Gator::iGator(_symbol, (ENUM_TIMEFRAMES)_tf, _jp, _js, _tp, _ts, _lp, _ls, (ENUM_MA_METHOD)_ma_method, - (ENUM_APPLIED_PRICE)_ap, (ENUM_GATOR_HISTOGRAM)_mode, _shift); -} -#endif - #ifndef __MQLBUILD__ // Indicator constants. // @docs @@ -338,3 +325,13 @@ class Indi_Gator : public Indicator { iparams.applied_price = _applied_price; } }; + +#ifndef __MQL4__ +// Defines global functions (for MQL4 backward compability). +double iGator(string _symbol, int _tf, int _jp, int _js, int _tp, int _ts, int _lp, int _ls, int _ma_method, int _ap, + int _mode, int _shift) { + ResetLastError(); + return Indi_Gator::iGator(_symbol, (ENUM_TIMEFRAMES)_tf, _jp, _js, _tp, _ts, _lp, _ls, (ENUM_MA_METHOD)_ma_method, + (ENUM_APPLIED_PRICE)_ap, (ENUM_GATOR_HISTOGRAM)_mode, _shift); +} +#endif diff --git a/Indicators/Indi_Ichimoku.mqh b/Indicators/Indi_Ichimoku.mqh index 8541d85a6..fa568fad7 100644 --- a/Indicators/Indi_Ichimoku.mqh +++ b/Indicators/Indi_Ichimoku.mqh @@ -23,17 +23,6 @@ // Includes. #include "../Indicator/Indicator.h" -#ifndef __MQL4__ -// Forward declaration. -class Indi_Ichimoku; - -// Defines global functions (for MQL4 backward compability). -double iIchimoku(string _symbol, int _tf, int _ts, int _ks, int _ssb, int _mode, int _shift) { - ResetLastError(); - return Indi_Ichimoku::iIchimoku(_symbol, (ENUM_TIMEFRAMES)_tf, _ts, _ks, _ssb, _mode, _shift); -} -#endif - #ifndef __MQLBUILD__ // Indicator constants. // @docs @@ -238,3 +227,11 @@ class Indi_Ichimoku : public Indicator { iparams.senkou_span_b = _senkou_span_b; } }; + +#ifndef __MQL4__ +// Defines global functions (for MQL4 backward compability). +double iIchimoku(string _symbol, int _tf, int _ts, int _ks, int _ssb, int _mode, int _shift) { + ResetLastError(); + return Indi_Ichimoku::iIchimoku(_symbol, (ENUM_TIMEFRAMES)_tf, _ts, _ks, _ssb, _mode, _shift); +} +#endif diff --git a/Indicators/Indi_MFI.mqh b/Indicators/Indi_MFI.mqh index c38cf4d72..be35d5e77 100644 --- a/Indicators/Indi_MFI.mqh +++ b/Indicators/Indi_MFI.mqh @@ -23,17 +23,6 @@ // Includes. #include "../Indicator/Indicator.h" -#ifndef __MQL4__ -// Forward declaration. -class Indi_MFI; - -// Defines global functions (for MQL4 backward compability). -double iMFI(string _symbol, int _tf, int _period, int _shift) { - ResetLastError(); - return Indi_MFI::iMFI(_symbol, (ENUM_TIMEFRAMES)_tf, _period, _shift); -} -#endif - // Structs. struct IndiMFIParams : IndicatorParams { unsigned int ma_period; @@ -180,3 +169,11 @@ class Indi_MFI : public Indicator { iparams.applied_volume = _applied_volume; } }; + +#ifndef __MQL4__ +// Defines global functions (for MQL4 backward compability). +double iMFI(string _symbol, int _tf, int _period, int _shift) { + ResetLastError(); + return Indi_MFI::iMFI(_symbol, (ENUM_TIMEFRAMES)_tf, _period, _shift); +} +#endif diff --git a/Indicators/Indi_Momentum.mqh b/Indicators/Indi_Momentum.mqh index 953d63d0f..f10cb04be 100644 --- a/Indicators/Indi_Momentum.mqh +++ b/Indicators/Indi_Momentum.mqh @@ -33,17 +33,6 @@ #include "../Indicator/Indicator.h" #include "Indi_PriceFeeder.mqh" -#ifndef __MQL4__ -// Forward declaration. -class Indi_Momentum; - -// Defines global functions (for MQL4 backward compability). -double iMomentum(string _symbol, int _tf, int _period, int _ap, int _shift) { - ResetLastError(); - return Indi_Momentum::iMomentum(_symbol, (ENUM_TIMEFRAMES)_tf, _period, (ENUM_APPLIED_PRICE)_ap, _shift); -} -#endif - // Structs. struct IndiMomentumParams : IndicatorParams { unsigned int period; @@ -222,3 +211,11 @@ class Indi_Momentum : public Indicator { iparams.applied_price = _ap; } }; + +#ifndef __MQL4__ +// Defines global functions (for MQL4 backward compability). +double iMomentum(string _symbol, int _tf, int _period, int _ap, int _shift) { + ResetLastError(); + return Indi_Momentum::iMomentum(_symbol, (ENUM_TIMEFRAMES)_tf, _period, (ENUM_APPLIED_PRICE)_ap, _shift); +} +#endif diff --git a/Indicators/Indi_OBV.mqh b/Indicators/Indi_OBV.mqh index b9128b1f2..cd9378bf3 100644 --- a/Indicators/Indi_OBV.mqh +++ b/Indicators/Indi_OBV.mqh @@ -23,17 +23,6 @@ // Includes. #include "../Indicator/Indicator.h" -#ifndef __MQL4__ -// Forward declaration. -class Indi_OBV; - -// Defines global functions (for MQL4 backward compability). -double iOBV(string _symbol, int _tf, int _av, int _shift) { - ResetLastError(); - return Indi_OBV::iOBV(_symbol, (ENUM_TIMEFRAMES)_tf, (ENUM_APPLIED_VOLUME)_av, _shift); -} -#endif - // Structs. struct IndiOBVParams : IndicatorParams { ENUM_APPLIED_PRICE applied_price; // MT4 only. @@ -185,3 +174,11 @@ class Indi_OBV : public Indicator { iparams.applied_volume = _applied_volume; } }; + +#ifndef __MQL4__ +// Defines global functions (for MQL4 backward compability). +double iOBV(string _symbol, int _tf, int _av, int _shift) { + ResetLastError(); + return Indi_OBV::iOBV(_symbol, (ENUM_TIMEFRAMES)_tf, (ENUM_APPLIED_VOLUME)_av, _shift); +} +#endif diff --git a/Indicators/Indi_OsMA.mqh b/Indicators/Indi_OsMA.mqh index 60587bda7..697d06d7c 100644 --- a/Indicators/Indi_OsMA.mqh +++ b/Indicators/Indi_OsMA.mqh @@ -23,18 +23,6 @@ // Includes. #include "../Indicator/Indicator.h" -#ifndef __MQL4__ -// Forward declaration. -class Indi_OsMA; - -// Defines global functions (for MQL4 backward compability). -double iOsMA(string _symbol, int _tf, int _ema_fp, int _ema_sp, int _signal_period, int _ap, int _shift) { - ResetLastError(); - return Indi_OsMA::iOsMA(_symbol, (ENUM_TIMEFRAMES)_tf, _ema_fp, _ema_sp, _signal_period, (ENUM_APPLIED_PRICE)_ap, - _shift); -} -#endif - // Structs. struct IndiOsMAParams : IndicatorParams { int ema_fast_period; @@ -203,3 +191,12 @@ class Indi_OsMA : public Indicator { iparams.applied_price = _applied_price; } }; + +#ifndef __MQL4__ +// Defines global functions (for MQL4 backward compability). +double iOsMA(string _symbol, int _tf, int _ema_fp, int _ema_sp, int _signal_period, int _ap, int _shift) { + ResetLastError(); + return Indi_OsMA::iOsMA(_symbol, (ENUM_TIMEFRAMES)_tf, _ema_fp, _ema_sp, _signal_period, (ENUM_APPLIED_PRICE)_ap, + _shift); +} +#endif diff --git a/Indicators/Indi_RVI.mqh b/Indicators/Indi_RVI.mqh index 07a0a5bb1..6d5337720 100644 --- a/Indicators/Indi_RVI.mqh +++ b/Indicators/Indi_RVI.mqh @@ -23,17 +23,6 @@ // Includes. #include "../Indicator/Indicator.h" -#ifndef __MQL4__ -// Forward declaration. -class Indi_RVI; - -// Defines global functions (for MQL4 backward compability). -double iRVI(string _symbol, int _tf, int _period, int _mode, int _shift) { - ResetLastError(); - return Indi_RVI::iRVI(_symbol, (ENUM_TIMEFRAMES)_tf, _period, (ENUM_SIGNAL_LINE)_mode, _shift); -} -#endif - // Structs. struct IndiRVIParams : IndicatorParams { unsigned int period; @@ -146,3 +135,11 @@ class Indi_RVI : public Indicator { iparams.period = _period; } }; + +#ifndef __MQL4__ +// Defines global functions (for MQL4 backward compability). +double iRVI(string _symbol, int _tf, int _period, int _mode, int _shift) { + ResetLastError(); + return Indi_RVI::iRVI(_symbol, (ENUM_TIMEFRAMES)_tf, _period, (ENUM_SIGNAL_LINE)_mode, _shift); +} +#endif diff --git a/Indicators/Indi_StdDev.mqh b/Indicators/Indi_StdDev.mqh index 53078a1e4..f62d96fa8 100644 --- a/Indicators/Indi_StdDev.mqh +++ b/Indicators/Indi_StdDev.mqh @@ -33,22 +33,6 @@ #include "Indi_PriceFeeder.mqh" #include "Price/Indi_MA.h" -#ifndef __MQL4__ -// Forward declaration. -class Indi_StdDev; - -// Defines global functions (for MQL4 backward compability). -double iStdDev(string _symbol, int _tf, int _ma_period, int _ma_shift, int _ma_method, int _ap, int _shift) { - ResetLastError(); - return Indi_StdDev::iStdDev(_symbol, (ENUM_TIMEFRAMES)_tf, _ma_period, _ma_shift, (ENUM_MA_METHOD)_ma_method, - (ENUM_APPLIED_PRICE)_ap, _shift); -} -double iStdDevOnArray(double &_arr[], int _total, int _ma_period, int _ma_shift, int _ma_method, int _abs_shift) { - ResetLastError(); - return Indi_StdDev::iStdDevOnArray(_arr, _total, _ma_period, _ma_shift, (ENUM_MA_METHOD)_ma_method, _abs_shift); -} -#endif - // Structs. struct IndiStdDevParams : IndicatorParams { int ma_period; @@ -332,3 +316,16 @@ class Indi_StdDev : public Indicator { iparams.applied_price = _applied_price; } }; + +#ifndef __MQL4__ +// Defines global functions (for MQL4 backward compability). +double iStdDev(string _symbol, int _tf, int _ma_period, int _ma_shift, int _ma_method, int _ap, int _shift) { + ResetLastError(); + return Indi_StdDev::iStdDev(_symbol, (ENUM_TIMEFRAMES)_tf, _ma_period, _ma_shift, (ENUM_MA_METHOD)_ma_method, + (ENUM_APPLIED_PRICE)_ap, _shift); +} +double iStdDevOnArray(double &_arr[], int _total, int _ma_period, int _ma_shift, int _ma_method, int _abs_shift) { + ResetLastError(); + return Indi_StdDev::iStdDevOnArray(_arr, _total, _ma_period, _ma_shift, (ENUM_MA_METHOD)_ma_method, _abs_shift); +} +#endif diff --git a/Indicators/Oscillator/Indi_MACD.h b/Indicators/Oscillator/Indi_MACD.h index bdf3a2992..b50ea0736 100644 --- a/Indicators/Oscillator/Indi_MACD.h +++ b/Indicators/Oscillator/Indi_MACD.h @@ -23,18 +23,6 @@ // Includes. #include "../../Indicator/Indicator.h" -#ifndef __MQL4__ -// Forward declaration. -class Indi_MACD; - -// Defines global functions (for MQL4 backward compability). -double iMACD(string _symbol, int _tf, int _ema_fp, int _ema_sp, int _signal_period, int _ap, int _mode, int _shift) { - ResetLastError(); - return Indi_MACD::iMACD(_symbol, (ENUM_TIMEFRAMES)_tf, _ema_fp, _ema_sp, _signal_period, (ENUM_APPLIED_PRICE)_ap, - (ENUM_SIGNAL_LINE)_mode, _shift); -} -#endif - // Structs. struct IndiMACDParams : IndicatorParams { unsigned int ema_fast_period; @@ -214,3 +202,12 @@ class Indi_MACD : public Indicator { iparams.applied_price = _applied_price; } }; + +#ifndef __MQL4__ +// Defines global functions (for MQL4 backward compability). +double iMACD(string _symbol, int _tf, int _ema_fp, int _ema_sp, int _signal_period, int _ap, int _mode, int _shift) { + ResetLastError(); + return Indi_MACD::iMACD(_symbol, (ENUM_TIMEFRAMES)_tf, _ema_fp, _ema_sp, _signal_period, (ENUM_APPLIED_PRICE)_ap, + (ENUM_SIGNAL_LINE)_mode, _shift); +} +#endif diff --git a/Indicators/Oscillator/Indi_Stochastic.h b/Indicators/Oscillator/Indi_Stochastic.h index d8eb72b4c..b1e2add7f 100644 --- a/Indicators/Oscillator/Indi_Stochastic.h +++ b/Indicators/Oscillator/Indi_Stochastic.h @@ -33,19 +33,6 @@ enum ENUM_STO_PRICE { }; #endif -#ifndef __MQL4__ -// Forward declaration. -class Indi_Stochastic; - -// Defines global functions (for MQL4 backward compability). -double iStochastic(string _symbol, int _tf, int _kperiod, int _dperiod, int _slowing, int _ma_method, int _pf, - int _mode, int _shift) { - ResetLastError(); - return Indi_Stochastic::iStochastic(_symbol, (ENUM_TIMEFRAMES)_tf, _kperiod, _dperiod, _slowing, - (ENUM_MA_METHOD)_ma_method, (ENUM_STO_PRICE)_pf, _mode, _shift); -} -#endif - // Structs. struct IndiStochParams : IndicatorParams { int kperiod; @@ -222,3 +209,13 @@ class Indi_Stochastic : public Indicator { iparams.price_field = _price_field; } }; + +#ifndef __MQL4__ +// Defines global functions (for MQL4 backward compability). +double iStochastic(string _symbol, int _tf, int _kperiod, int _dperiod, int _slowing, int _ma_method, int _pf, + int _mode, int _shift) { + ResetLastError(); + return Indi_Stochastic::iStochastic(_symbol, (ENUM_TIMEFRAMES)_tf, _kperiod, _dperiod, _slowing, + (ENUM_MA_METHOD)_ma_method, (ENUM_STO_PRICE)_pf, _mode, _shift); +} +#endif diff --git a/Indicators/Oscillator/Indi_WPR.h b/Indicators/Oscillator/Indi_WPR.h index 7240eaa12..41498c5c7 100644 --- a/Indicators/Oscillator/Indi_WPR.h +++ b/Indicators/Oscillator/Indi_WPR.h @@ -24,17 +24,6 @@ #include "../../Indicator/Indicator.h" #include "../../Platform/Terminal.h" -#ifndef __MQL4__ -// Forward declaration. -class Indi_WPR; - -// Defines global functions (for MQL4 backward compability). -double iWPR(string _symbol, int _tf, int _period, int _shift) { - ResetLastError(); - return Indi_WPR::iWPR(_symbol, (ENUM_TIMEFRAMES)_tf, _period, _shift); -} -#endif - // Structs. struct IndiWPRParams : IndicatorParams { unsigned int period; @@ -162,3 +151,11 @@ class Indi_WPR : public Indicator { iparams.period = _period; } }; + +#ifndef __MQL4__ +// Defines global functions (for MQL4 backward compability). +double iWPR(string _symbol, int _tf, int _period, int _shift) { + ResetLastError(); + return Indi_WPR::iWPR(_symbol, (ENUM_TIMEFRAMES)_tf, _period, _shift); +} +#endif diff --git a/Indicators/Price/Indi_MA.h b/Indicators/Price/Indi_MA.h index ad744a073..de095993f 100644 --- a/Indicators/Price/Indi_MA.h +++ b/Indicators/Price/Indi_MA.h @@ -44,23 +44,6 @@ enum ENUM_MA_METHOD { }; #endif -#ifndef __MQL4__ -// Forward declaration. -class Indi_MA; - -// Defines global functions (for MQL4 backward compability). -double iMA(string _symbol, int _tf, int _ma_period, int _ma_shift, int _ma_method, int _ap, int _shift) { - ResetLastError(); - return Indi_MA::iMA(_symbol, (ENUM_TIMEFRAMES)_tf, _ma_period, _ma_shift, (ENUM_MA_METHOD)_ma_method, - (ENUM_APPLIED_PRICE)_ap, _shift); -} -double iMAOnArray(ARRAY_REF(double, _arr), int _total, int _period, int _ma_shift, int _ma_method, int _abs_shift, - IndiBufferCache *_cache = NULL) { - ResetLastError(); - return Indi_MA::iMAOnArray(_arr, _total, _period, _ma_shift, _ma_method, _abs_shift, _cache); -} -#endif - // Structs. struct IndiMAParams : IndicatorParams { unsigned int period; @@ -803,4 +786,19 @@ class Indi_MA : public Indicator { iparams.applied_array = _applied_price; } }; + +#ifndef __MQL4__ +// Defines global functions (for MQL4 backward compability). +double iMA(string _symbol, int _tf, int _ma_period, int _ma_shift, int _ma_method, int _ap, int _shift) { + ResetLastError(); + return Indi_MA::iMA(_symbol, (ENUM_TIMEFRAMES)_tf, _ma_period, _ma_shift, (ENUM_MA_METHOD)_ma_method, + (ENUM_APPLIED_PRICE)_ap, _shift); +} +double iMAOnArray(ARRAY_REF(double, _arr), int _total, int _period, int _ma_shift, int _ma_method, int _abs_shift, + IndiBufferCache *_cache = NULL) { + ResetLastError(); + return Indi_MA::iMAOnArray(_arr, _total, _period, _ma_shift, _ma_method, _abs_shift, _cache); +} +#endif + #endif // INDI_MA_H diff --git a/Indicators/PriceMulti/Indi_Alligator.h b/Indicators/PriceMulti/Indi_Alligator.h index a70b4d727..426cbcf70 100644 --- a/Indicators/PriceMulti/Indi_Alligator.h +++ b/Indicators/PriceMulti/Indi_Alligator.h @@ -24,20 +24,6 @@ #include "../../Indicator/Indicator.h" #include "../Price/Indi_MA.h" -#ifndef __MQL4__ -// Forward declaration. -class Indi_Alligator; - -// Defines global functions (for MQL4 backward compability). -double iAlligator(string _symbol, int _tf, int _jp, int _js, int _tp, int _ts, int _lp, int _ls, int _ma_method, - int _ap, int _mode, int _shift) { - ResetLastError(); - return Indi_Alligator::iAlligator(_symbol, (ENUM_TIMEFRAMES)_tf, _jp, _js, _tp, _ts, _lp, _ls, - (ENUM_MA_METHOD)_ma_method, (ENUM_APPLIED_PRICE)_ap, (ENUM_ALLIGATOR_LINE)_mode, - _shift); -} -#endif - #ifndef __MQLBUILD__ // Defines. // Indicator constants. @@ -308,3 +294,14 @@ class Indi_Alligator : public Indicator { iparams.applied_price = _applied_price; } }; + +#ifndef __MQL4__ +// Defines global functions (for MQL4 backward compability). +double iAlligator(string _symbol, int _tf, int _jp, int _js, int _tp, int _ts, int _lp, int _ls, int _ma_method, + int _ap, int _mode, int _shift) { + ResetLastError(); + return Indi_Alligator::iAlligator(_symbol, (ENUM_TIMEFRAMES)_tf, _jp, _js, _tp, _ts, _lp, _ls, + (ENUM_MA_METHOD)_ma_method, (ENUM_APPLIED_PRICE)_ap, (ENUM_ALLIGATOR_LINE)_mode, + _shift); +} +#endif diff --git a/Indicators/PriceRange/Indi_Bands.h b/Indicators/PriceRange/Indi_Bands.h index caf00ed0f..75965bf4a 100644 --- a/Indicators/PriceRange/Indi_Bands.h +++ b/Indicators/PriceRange/Indi_Bands.h @@ -30,19 +30,6 @@ #include "../Price/Indi_Price.h" #include "Indi_Envelopes.h" -#ifndef __MQL4__ -// Forward declaration. -class Indi_Bands; - -// Defines global functions (for MQL4 backward compability). -double iBands(string _symbol, int _tf, int _period, double _deviation, int _bands_shift, int _ap, int _mode, - int _shift) { - ResetLastError(); - return Indi_Bands::iBands(_symbol, (ENUM_TIMEFRAMES)_tf, _period, _deviation, _bands_shift, (ENUM_APPLIED_PRICE)_ap, - (ENUM_BANDS_LINE)_mode, _shift); -} -#endif - // Indicator line identifiers used in Bands. enum ENUM_BANDS_LINE { #ifdef __MQL4__ @@ -392,3 +379,13 @@ class Indi_Bands : public Indicator { iparams.applied_price = _applied_price; } }; + +#ifndef __MQL4__ +// Defines global functions (for MQL4 backward compability). +double iBands(string _symbol, int _tf, int _period, double _deviation, int _bands_shift, int _ap, int _mode, + int _shift) { + ResetLastError(); + return Indi_Bands::iBands(_symbol, (ENUM_TIMEFRAMES)_tf, _period, _deviation, _bands_shift, (ENUM_APPLIED_PRICE)_ap, + (ENUM_BANDS_LINE)_mode, _shift); +} +#endif diff --git a/Indicators/PriceRange/Indi_Envelopes.h b/Indicators/PriceRange/Indi_Envelopes.h index 8a16962ea..eb039e3e2 100644 --- a/Indicators/PriceRange/Indi_Envelopes.h +++ b/Indicators/PriceRange/Indi_Envelopes.h @@ -27,25 +27,6 @@ #include "../Price/Indi_MA.h" #include "../Price/Indi_Price.h" -#ifndef __MQL4__ -// Forward declaration. -class Indi_Envelopes; - -// Defines global functions (for MQL4 backward compability). -double iEnvelopes(string _symbol, int _tf, int _period, int _ma_method, int _ma_shift, int _ap, double _deviation, - int _mode, int _shift) { - ResetLastError(); - return Indi_Envelopes::iEnvelopes(_symbol, (ENUM_TIMEFRAMES)_tf, _period, (ENUM_MA_METHOD)_ma_method, _ma_shift, - (ENUM_APPLIED_PRICE)_ap, _deviation, _mode, _shift); -} -double iEnvelopesOnArray(double &_arr[], int _total, int _ma_period, int _ma_method, int _ma_shift, double _deviation, - int _mode, int _shift) { - ResetLastError(); - return Indi_Envelopes::iEnvelopesOnArray(_arr, _total, _ma_period, (ENUM_MA_METHOD)_ma_method, _ma_shift, _deviation, - _mode, _shift); -} -#endif - // Structs. struct IndiEnvelopesParams : IndicatorParams { int ma_period; @@ -334,3 +315,19 @@ class Indi_Envelopes : public Indicator { iparams.deviation = _deviation; } }; + +#ifndef __MQL4__ +// Defines global functions (for MQL4 backward compability). +double iEnvelopes(string _symbol, int _tf, int _period, int _ma_method, int _ma_shift, int _ap, double _deviation, + int _mode, int _shift) { + ResetLastError(); + return Indi_Envelopes::iEnvelopes(_symbol, (ENUM_TIMEFRAMES)_tf, _period, (ENUM_MA_METHOD)_ma_method, _ma_shift, + (ENUM_APPLIED_PRICE)_ap, _deviation, _mode, _shift); +} +double iEnvelopesOnArray(double &_arr[], int _total, int _ma_period, int _ma_method, int _ma_shift, double _deviation, + int _mode, int _shift) { + ResetLastError(); + return Indi_Envelopes::iEnvelopesOnArray(_arr, _total, _ma_period, (ENUM_MA_METHOD)_ma_method, _ma_shift, _deviation, + _mode, _shift); +} +#endif diff --git a/Indicators/PriceRange/Indi_SAR.h b/Indicators/PriceRange/Indi_SAR.h index 910ed7e3d..8f12916b3 100644 --- a/Indicators/PriceRange/Indi_SAR.h +++ b/Indicators/PriceRange/Indi_SAR.h @@ -23,17 +23,6 @@ // Includes. #include "../../Indicator/Indicator.h" -#ifndef __MQL4__ -// Forward declaration. -class Indi_SAR; - -// Defines global functions (for MQL4 backward compability). -double iSAR(string _symbol, int _tf, double _step, double _max, int _shift) { - ResetLastError(); - return Indi_SAR::iSAR(_symbol, (ENUM_TIMEFRAMES)_tf, _step, _max, _shift); -} -#endif - // Structs. struct IndiSARParams : IndicatorParams { double step; @@ -147,3 +136,11 @@ class Indi_SAR : public Indicator { iparams.max = _max; } }; + +#ifndef __MQL4__ +// Defines global functions (for MQL4 backward compability). +double iSAR(string _symbol, int _tf, double _step, double _max, int _shift) { + ResetLastError(); + return Indi_SAR::iSAR(_symbol, (ENUM_TIMEFRAMES)_tf, _step, _max, _shift); +} +#endif From 4a1b3d6ae555852bbd238daf6ba163b77f30e654 Mon Sep 17 00:00:00 2001 From: kenorb Date: Thu, 22 Jun 2023 23:30:04 +0100 Subject: [PATCH 090/109] Adds PriceRange/tests/Makefile --- Indicators/PriceRange/tests/Makefile | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Indicators/PriceRange/tests/Makefile diff --git a/Indicators/PriceRange/tests/Makefile b/Indicators/PriceRange/tests/Makefile new file mode 100644 index 000000000..e792364f0 --- /dev/null +++ b/Indicators/PriceRange/tests/Makefile @@ -0,0 +1,12 @@ +CC := g++ # C++ compiler +CFLAGS := -Wall -Wextra -std=c++17 -w # Compiler flags +SRCS := $(wildcard *.cpp) # Get all .cpp files in the current directory +OBJS := $(SRCS:.cpp=.o) # Object files corresponding to the source files + +all: $(OBJS) + +%.o: %.cpp + $(CC) $(CFLAGS) -c $< -o $@ + +clean: + rm -v $(OBJS) From 7d3336827661fa6e22b31f7286ee4d2bf7dcdca9 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 25 Jun 2023 15:27:41 +0100 Subject: [PATCH 091/109] Removes SymbolInfoTest from Test GHA workflow --- .github/workflows/test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d08552121..7897fbefd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -60,7 +60,6 @@ jobs: - StrategyTest - StrategyTest-RSI - SummaryReportTest - - SymbolInfoTest - TickerTest - TradeTest max-parallel: 4 From fc53da54a443164f5542377eb3d7c8144b8945ab Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 24 Jun 2023 18:13:16 +0100 Subject: [PATCH 092/109] Adds description for ASI (Accumulation Swing Index) indicator --- Indicators/Oscillator/README.md | 38 +++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/Indicators/Oscillator/README.md b/Indicators/Oscillator/README.md index 03d9b6762..626b4f62e 100644 --- a/Indicators/Oscillator/README.md +++ b/Indicators/Oscillator/README.md @@ -26,6 +26,44 @@ In summary, oscillators are a type of indicator used in technical analysis that measure price momentum and provide insights into overbought or oversold conditions. They are considered a subset of indicators due to their specific function and characteristics. +## ASI (Accumulation Swing Index) indicator + +The Accumulation Swing Index (ASI) is a technical indicator that aims to gauge +the strength and direction of a market's price movement. +It combines price action and volume to provide insights into market trends +and potential reversals. The ASI calculates a running cumulative total, +incorporating the relationship between the current close, previous close, +and recent price ranges. + +The ASI starts with an initial value, typically zero, and then factors +in price and volume data. If the current close is higher than the previous close, +the indicator adds a fraction of the current range (high minus low) +to the prior ASI value. Conversely, if the current close is lower, +a fraction of the current range is subtracted. +The fraction is determined based on the volume and price relationship. + +The ASI's cumulative total fluctuates, reflecting the strength of price movements. +Rising ASI values indicate buying pressure and potential uptrends, +while falling values suggest selling pressure and potential downtrends. +Traders often analyze the ASI for divergences from price action, +which can signal shifts in market sentiment. + +The ASI is typically plotted as a line chart. +Positive values above zero indicate accumulation or buying pressure, +while negative values below zero indicate distribution or selling pressure. +The crossover of the ASI line with zero may be considered a signal +for potential trend reversals. + +It's important to note that the ASI does not provide specific +buy or sell signals on its own. Traders commonly use it in conjunction +with other technical analysis tools and indicators +to validate trading decisions and identify potential entry or exit points. + +In summary, it is a technical indicator that combines price action +and volume to assess market strength and direction. +It calculates a running cumulative total based on the relationship +between current and previous prices, incorporating price ranges. + ## MACD (Moving Average Convergence Divergence) indicator MACD measures the relationship between two moving averages From ab107362359def6fc39e6190822d7f7f1ceee46e Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 24 Jun 2023 18:21:07 +0100 Subject: [PATCH 093/109] Adds description for AMA, AO, ATR, DEMA and MA indicators --- Indicators/Oscillator/README.md | 82 +++++++++++++++++++++ Indicators/Price/README.md | 123 ++++++++++++++++++++++++++++++++ 2 files changed, 205 insertions(+) diff --git a/Indicators/Oscillator/README.md b/Indicators/Oscillator/README.md index 626b4f62e..6ef512086 100644 --- a/Indicators/Oscillator/README.md +++ b/Indicators/Oscillator/README.md @@ -26,6 +26,49 @@ In summary, oscillators are a type of indicator used in technical analysis that measure price momentum and provide insights into overbought or oversold conditions. They are considered a subset of indicators due to their specific function and characteristics. +## AO (Awesome Oscillator) + +The Awesome Oscillator (AO) is a technical indicator designed to identify the +momentum of a market and potential trend reversals. It displays the difference +between a 34-period and a 5-period simple moving average (SMA) on a histogram. + +The calculation of the Awesome Oscillator involves subtracting the 34-period +SMA from the 5-period SMA. The resulting value is then plotted as a histogram, +with positive values indicating bullish momentum and negative values +indicating bearish momentum. + +The AO helps traders identify the strength and direction of a trend. When +the histogram bars are above the zero line, it suggests that bullish +momentum is dominant, signaling a potential uptrend. Conversely, when the +bars are below the zero line, it indicates bearish momentum, suggesting a +potential downtrend. + +The AO also provides signals for potential trend reversals. A change from +positive bars to negative bars or vice versa is considered a signal for a +potential trend reversal. Traders often look for these transitions to +generate buy or sell signals. + +Additionally, the Awesome Oscillator can be used to identify the divergence +between the indicator and price action. Divergence occurs when the +indicator's movement deviates from the price movement. Bullish divergence +occurs when the price forms lower lows while the AO forms higher lows, +suggesting a possible upward reversal. Conversely, bearish divergence +occurs when the price forms higher highs while the AO forms lower highs, +indicating a potential downward reversal. + +Traders often combine the Awesome Oscillator with other indicators or +analysis techniques to validate signals and strengthen their trading +strategies. It is a versatile tool that can be applied to various +timeframes and markets. + +In summary, the Awesome Oscillator (AO) is a technical indicator that +measures the momentum of a market and identifies potential trend reversals. +It displays the difference between a 34-period and a 5-period simple moving +average on a histogram. Positive histogram bars indicate bullish momentum, +negative bars indicate bearish momentum, and transitions can signal +potential trend reversals. The AO is often used in conjunction with other +indicators and analysis techniques to enhance trading decisions. + ## ASI (Accumulation Swing Index) indicator The Accumulation Swing Index (ASI) is a technical indicator that aims to gauge @@ -64,6 +107,45 @@ and volume to assess market strength and direction. It calculates a running cumulative total based on the relationship between current and previous prices, incorporating price ranges. +## ATR (Average True Range) + +The Average True Range (ATR) is a technical indicator used to measure and +quantify market volatility. It provides traders with information about the +average price range or volatility of an asset over a specified period. + +The ATR is calculated by taking the average of the true ranges of price +movements. The true range is the greatest of the following three values: the +difference between the current high and the current low, the absolute value of +the difference between the current high and the previous close, and the +absolute value of the difference between the current low and the previous +close. + +The ATR is typically displayed as a line chart or a histogram, indicating the +level of volatility in the market. Higher ATR values suggest greater +volatility, while lower values indicate lower volatility. + +Traders use the ATR in various ways. It helps determine the appropriate +placement of stop-loss orders by considering the average volatility of the +asset. A wider stop-loss may be used in more volatile markets to account for +larger price fluctuations, while a tighter stop-loss may be suitable for less +volatile markets. + +The ATR can also be used to identify potential trend reversals. A sudden +increase in the ATR may indicate a shift in market sentiment or the start of a +new trend. Traders may look for breakouts or changes in price behavior when the +ATR rises significantly. + +Additionally, the ATR can be used to compare volatility across different assets +or timeframes. By comparing ATR values, traders can assess which assets or +timeframes are experiencing higher or lower levels of volatility. + +In summary, the Average True Range (ATR) is a technical indicator that measures +market volatility by calculating the average price range over a specified +period. It helps traders determine stop-loss levels, identify potential trend +reversals, and compare volatility between assets or timeframes. The ATR +provides valuable insights into market conditions and assists traders in +managing risk and making informed trading decisions. + ## MACD (Moving Average Convergence Divergence) indicator MACD measures the relationship between two moving averages diff --git a/Indicators/Price/README.md b/Indicators/Price/README.md index 0a2243397..52b716d38 100644 --- a/Indicators/Price/README.md +++ b/Indicators/Price/README.md @@ -22,3 +22,126 @@ Popular examples of price indicators include: Similar to a traditional moving average, DEMA applies a double smoothing technique to provide a single price value. It aims to reduce lag and provide more responsive signals compared to standard moving averages. + +## AMA (Adaptive Moving Average) + +The Adaptive Moving Average (AMA) is a technical indicator designed to adjust +its sensitivity to market conditions. Unlike traditional moving averages that +use fixed periods, the AMA dynamically adapts to changing volatility, aiming +to provide more accurate signals. + +The AMA adjusts its smoothing factor based on market volatility. When the +market is more volatile, the indicator becomes more responsive and follows +price movements closely. Conversely, during periods of low volatility, the AMA +becomes less sensitive, reducing the impact of minor price fluctuations. + +The calculation of the AMA involves several steps. It begins with calculating +the Efficiency Ratio (ER), which measures the efficiency of price movement. +The ER compares the absolute value of the current price's change to the sum of +the absolute values of all price changes over a specified period. The ER +ranges between 0 and 1. + +Next, the Smoothing Constant (SC) is calculated by applying a formula to the +ER. The SC determines the degree of smoothing applied to the AMA. A higher SC +value results in less smoothing, making the AMA more responsive to recent +price changes. + +Finally, the AMA is computed by multiplying the current price's difference +from the previous AMA value by the SC and adding it to the previous AMA value. +This process is repeated for each subsequent data point. + +The Adaptive Moving Average aims to provide more accurate signals by adjusting +its responsiveness to prevailing market conditions. It can help traders +identify trends, support and resistance levels, and potential entry or exit +points. By adapting to changing market dynamics, the AMA attempts to minimize +false signals and enhance the effectiveness of moving average-based +strategies. + +It's worth noting that the specific formulas and parameters used in +calculating the AMA may vary based on the implementation and platform being +used. Traders should carefully review the settings and methodology of the +specific AMA indicator they intend to use. + +In summary, the Adaptive Moving Average (AMA) is a technical indicator that +dynamically adjusts its sensitivity to market conditions. It aims to provide +more accurate signals by adapting to changes in volatility. The AMA can assist +traders in identifying trends and potential entry or exit points. Its +flexibility makes it a popular choice among those seeking a moving average +that can adapt to varying market conditions. + +## DEMA (Double Exponential Moving Average) + +The Double Exponential Moving Average (DEMA) is a technical indicator that aims +to reduce lag and provide more responsive signals compared to traditional moving +averages. It accomplishes this by applying a double smoothing technique to the +price data. + +The calculation of the DEMA involves two steps. First, a regular exponential +moving average (EMA) is calculated using a specified period. The EMA calculates +the average price by assigning more weight to recent data points. + +Next, a second EMA is calculated on the previously calculated EMA values, again +using the same period. This second EMA smooths the EMA values further, resulting +in a double-smoothed average. + +The DEMA formula subtracts twice the second EMA from the first EMA to derive the +DEMA value. This calculation aims to provide a faster and more responsive moving +average line compared to traditional single-smoothed moving averages. + +The DEMA indicator attempts to identify trend reversals and generate trading +signals. When the DEMA line starts to rise, it suggests a bullish trend, while a +declining DEMA line indicates a bearish trend. Traders may look for crossovers +between the DEMA line and the price to generate buy or sell signals. + +The DEMA indicator is known for its ability to reduce lag and provide smoother +responses to price movements. However, it can also be more susceptible to false +signals during choppy or ranging market conditions. Traders often use the DEMA +in combination with other technical indicators or as part of a broader trading +strategy to confirm signals and enhance accuracy. + +In summary, the Double Exponential Moving Average (DEMA) is a technical +indicator that applies a double smoothing technique to price data. It aims to +reduce lag and provide more responsive signals compared to traditional moving +averages. The DEMA is used to identify trend reversals and generate trading +signals. Traders often use it in conjunction with other indicators and analysis +techniques to enhance their trading strategies. + +## MA (Moving Average) + +The Moving Average (MA) indicator is one of the most widely used and basic +technical analysis tools. It aims to smooth out price fluctuations and +identify trends by calculating the average price over a specified period. + +The MA indicator is calculated by adding up the closing prices of a financial +instrument over a designated number of periods and dividing the sum by the +number of periods. For example, a simple moving average (SMA) of 20 periods +would sum up the closing prices of the last 20 periods and divide the sum by 20. + +As new data points become available, the MA value is recalculated by dropping +the oldest data point and adding the most recent one. This process creates a +moving average line that trails the price action. + +The MA indicator helps traders visualize the overall direction and smooth out +short-term price fluctuations. It is commonly used to identify support and +resistance levels, as well as potential entry and exit points. When the price is +above the moving average, it suggests a bullish trend, and when the price is +below the moving average, it indicates a bearish trend. + +Different types of moving averages can be used, such as the simple moving +average (SMA) that evenly weighs all data points, or exponential moving average +(EMA) that places more weight on recent prices. Traders choose the type of +moving average based on their trading strategies and preferences. + +Crossovers between different moving averages are often analyzed to generate +trading signals. For example, a bullish signal may occur when a shorter-term +moving average crosses above a longer-term moving average, indicating a +potential upward trend reversal. Conversely, a bearish signal may occur when a +shorter-term moving average crosses below a longer-term moving average, +suggesting a potential downward trend reversal. + +In summary, the Moving Average (MA) indicator calculates the average price +over a specified period to smooth out price fluctuations and identify trends. +It is widely used to determine support and resistance levels, as well as +generate entry and exit signals. Traders often rely on moving averages in +combination with other indicators and analysis techniques to make informed +trading decisions. From ebe4d6345efe2d898a7793fb97dd51e4f22f51f9 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 24 Jun 2023 20:10:27 +0100 Subject: [PATCH 094/109] PriceRange: Adds README.md --- Indicators/PriceRange/README.md | 174 ++++++++++++++++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 Indicators/PriceRange/README.md diff --git a/Indicators/PriceRange/README.md b/Indicators/PriceRange/README.md new file mode 100644 index 000000000..a952103a4 --- /dev/null +++ b/Indicators/PriceRange/README.md @@ -0,0 +1,174 @@ +# Price Range indicators + +Price range indicators are technical analysis tools that focus on generating +price range values. They provide information about the upper and lower levels +within which prices are likely to fluctuate. These indicators are useful for +identifying potential support and resistance levels, as well as assessing the +volatility of an asset. + +Price range indicators typically use statistical calculations or mathematical +formulas to determine the range values. These values are often based on factors +such as standard deviations, moving averages, or percentage deviations from a +central price line. + +One example of a price range indicator is Bollinger Bands. Bollinger Bands +consist of a central moving average line (usually a simple moving average) and +two outer bands that are a certain number of standard deviations away from the +moving average. The width of the bands expands or contracts based on market +volatility, indicating wider price ranges during periods of high volatility and +narrower ranges during periods of low volatility. + +Envelopes are another example of a price range indicator. They are constructed +by plotting two parallel lines above and below a moving average. The distance +between the upper and lower envelope lines is typically determined by a +percentage deviation from the moving average. Envelopes provide a visual +representation of the price range around the moving average, helping traders +identify overbought and oversold conditions. + +Price range indicators are valuable for identifying potential price reversal +points, as prices often encounter resistance or support near the upper and +lower ranges. They can also help traders assess the likelihood of price +breakouts or trend reversals when the price moves beyond the established range. + +Overall, price range indicators are useful tools for understanding the +potential price levels within which an asset is expected to trade. They assist +traders in identifying support and resistance levels, assessing market +volatility, and making informed decisions about entry and exit points. + +## Bollinger Bands + +Bollinger Bands (BB) is a popular technical indicator developed by John +Bollinger. It consists of three lines plotted on a price chart: a middle band, +an upper band, and a lower band. The indicator is designed to provide +information about the volatility and potential price levels of an asset. + +The middle band is typically a simple moving average (SMA) of a specified +period, often 20 periods. The upper band is calculated by adding a certain +number of standard deviations (usually 2) to the middle band, while the lower +band is obtained by subtracting the same number of standard deviations from +the middle band. + +The width of the Bollinger Bands expands and contracts based on the +volatility of the asset. During periods of high volatility, the bands widen, +indicating larger price ranges. Conversely, during low volatility periods, +the bands contract, suggesting smaller price ranges. + +Traders use Bollinger Bands in various ways. When the price approaches or +touches the upper band, it may indicate that the asset is overbought, +suggesting a potential reversal or a pause in the upward movement. +Conversely, when the price approaches or touches the lower band, it may +suggest that the asset is oversold, signaling a potential reversal or a pause +in the downward movement. + +Another popular strategy involves looking for price breakouts beyond the +bands. A breakout above the upper band is considered a bullish signal, +suggesting a potential continuation of the upward trend. Conversely, a +breakout below the lower band is seen as a bearish signal, indicating a +potential continuation of the downward trend. + +Traders may also pay attention to the interaction between the price and the +middle band. When the price crosses above the middle band from below, it +could indicate a bullish trend, while a cross below the middle band from +above may suggest a bearish trend. + +It's important to note that Bollinger Bands are not foolproof indicators and +should be used in conjunction with other technical analysis tools or +indicators to confirm signals. Traders should also consider the overall +market context and other relevant factors before making trading decisions +based solely on Bollinger Bands. + +In summary, Bollinger Bands (BB) is a widely used technical indicator that +consists of a middle band, upper band, and lower band. The bands adapt to +market volatility and provide insights into potential overbought and oversold +levels. Traders use Bollinger Bands to identify price reversals, breakouts, +and trends, but it's essential to use them in conjunction with other tools +and analysis techniques for better accuracy. + +## Envelopes + +The Envelopes indicator is a technical analysis tool that consists of two lines +plotted above and below a central moving average line. It helps traders +identify potential overbought and oversold levels and provides insights into +possible price reversals. + +The Envelopes indicator is constructed by defining a fixed percentage deviation +from a moving average. The moving average is typically a simple moving average +(SMA) of a specified period, such as 20 periods. The upper envelope line is +calculated by adding a certain percentage (usually a fixed number of percentage +points or a fixed percentage) above the moving average, while the lower +envelope line is derived by subtracting the same percentage below the moving +average. + +The Envelopes indicator provides visual boundaries or "envelopes" around the +moving average, representing potential price levels where the asset might +encounter resistance or support. When the price approaches or touches the upper +envelope line, it suggests that the asset may be overbought, indicating a +potential reversal or a pause in the upward movement. On the other hand, when +the price approaches or touches the lower envelope line, it suggests that the +asset may be oversold, signaling a potential reversal or a pause in the +downward movement. + +Traders can use the Envelopes indicator in various ways. They may look for +price bounces or reversals when the price reaches the upper or lower envelope +lines. A bounce from the upper envelope line back toward the moving average +could indicate a potential selling opportunity, while a bounce from the lower +envelope line toward the moving average could suggest a potential buying +opportunity. + +It's important to note that the Envelopes indicator is not a standalone +indicator and is often used in conjunction with other technical analysis tools +or indicators to confirm signals. Traders may combine it with other indicators, +such as oscillators or trend-following indicators, to enhance their trading +strategies. + +In summary, the Envelopes indicator is a technical tool that uses two lines +plotted above and below a central moving average to identify potential +overbought and oversold levels. It helps traders identify possible price +reversals and can be used to find selling or buying opportunities. However, +it should be used in combination with other indicators and analysis +techniques to validate signals and make well-informed trading decisions. + +## SAR + +The Parabolic SAR (Stop and Reverse) indicator is a technical analysis tool +that helps identify potential entry and exit points in a market trend. It is +particularly useful in trending markets where it can assist traders in +determining when to enter or exit a trade. + +The indicator is represented by a series of dots that appear either above or +below the price chart. These dots indicate potential stop and reverse points +for the price trend. When the dots are below the price, it suggests an upward +trend, while dots above the price indicate a downward trend. + +The calculation of the Parabolic SAR involves two key factors: the acceleration +factor (AF) and the extreme point (EP). The acceleration factor determines the +rate at which the SAR dots move closer to the price, while the extreme point +represents the highest or lowest price reached during the current trend. + +Initially, the SAR dots are placed below the price in an upward trend and above +the price in a downward trend. As the price continues to move in the same +direction, the dots gradually move closer to the price. The acceleration factor +determines how quickly this convergence occurs. + +When the price crosses above or below the SAR dot, it indicates a potential +trend reversal. At this point, the SAR dots switch sides, appearing on the +opposite side of the price chart. This reversal signal can be used by traders +to exit existing positions and potentially enter new positions in the opposite +direction. + +Traders often use the Parabolic SAR indicator in conjunction with other +technical analysis tools or indicators to confirm signals. For example, they +may look for confirmation from oscillators, moving averages, or chart patterns +to validate the potential trend reversal suggested by the SAR dots. + +It's important to note that the Parabolic SAR is most effective in trending +markets and may produce false signals or whipsaws in ranging or sideways +markets. Therefore, it is advisable to use the indicator in conjunction with +other tools to filter out false signals and improve overall trading decisions. + +In summary, the Parabolic SAR indicator is a technical tool that helps traders +identify potential entry and exit points in a trending market. It uses a series +of dots placed above or below the price chart to indicate potential stop and +reverse points. Traders can use these signals to determine trend reversals and +make informed trading decisions, but it is recommended to use the indicator +alongside other analysis techniques for better accuracy. From 105fd8e3f98188a9ebe76d5760a95f566f4c7cf6 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sat, 24 Jun 2023 21:26:21 +0100 Subject: [PATCH 095/109] Adds Indi_Universal (GH-683) --- .github/workflows/test-indicators-special.yml | 1 + Indicator/Indicator.enum.h | 1 + Indicators/Special/Indi_Math.mqh | 2 +- Indicators/Special/Indi_Universal.h | 119 ++++++++++++++++++ Indicators/Special/includes.h | 1 + .../Special/tests/Indi_Universal.test.cpp | 36 ++++++ .../Special/tests/Indi_Universal.test.mq4 | 27 ++++ .../Special/tests/Indi_Universal.test.mq5 | 31 +++++ 8 files changed, 217 insertions(+), 1 deletion(-) create mode 100644 Indicators/Special/Indi_Universal.h create mode 100644 Indicators/Special/tests/Indi_Universal.test.cpp create mode 100644 Indicators/Special/tests/Indi_Universal.test.mq4 create mode 100644 Indicators/Special/tests/Indi_Universal.test.mq5 diff --git a/.github/workflows/test-indicators-special.yml b/.github/workflows/test-indicators-special.yml index 9c64441bc..153c605cc 100644 --- a/.github/workflows/test-indicators-special.yml +++ b/.github/workflows/test-indicators-special.yml @@ -51,6 +51,7 @@ jobs: matrix: test: - Indi_Custom.test + - Indi_Universal.test steps: - uses: actions/download-artifact@v3 with: diff --git a/Indicator/Indicator.enum.h b/Indicator/Indicator.enum.h index 891e3c024..83ebb5bcf 100644 --- a/Indicator/Indicator.enum.h +++ b/Indicator/Indicator.enum.h @@ -108,6 +108,7 @@ enum ENUM_INDICATOR_TYPE { INDI_RVI, // Relative Vigor Index INDI_SAR, // Parabolic SAR INDI_SPECIAL_MATH, // Math operations over given + INDI_SPECIAL_UNIVERSAL, // Universal INDI_STDDEV, // Standard Deviation INDI_STDDEV_ON_MA_SMA, // Standard Deviation on Moving Average in SMA mode INDI_STDDEV_ON_PRICE, // Standard Deviation (on Price) diff --git a/Indicators/Special/Indi_Math.mqh b/Indicators/Special/Indi_Math.mqh index 4c622c46b..9a9433acd 100644 --- a/Indicators/Special/Indi_Math.mqh +++ b/Indicators/Special/Indi_Math.mqh @@ -68,7 +68,7 @@ struct IndiMathParams : IndicatorParams { }; /** - * Implements the Volume Rate of Change indicator. + * Implements the Math indicator. */ class Indi_Math : public Indicator { public: diff --git a/Indicators/Special/Indi_Universal.h b/Indicators/Special/Indi_Universal.h new file mode 100644 index 000000000..ad9e44562 --- /dev/null +++ b/Indicators/Special/Indi_Universal.h @@ -0,0 +1,119 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + * + */ + +// Includes. +#include "../../Indicator/Indicator.h" +#include "../Price/Indi_Price.h" + +// Structs. +struct IndiUniversalParams : IndicatorParams { + unsigned int mode_1; + unsigned int shift_1; + + // Struct constructor. + IndiUniversalParams(unsigned int _mode_1 = 0, unsigned int _shift_1 = 0, int _shift = 0) + : IndicatorParams(INDI_SPECIAL_UNIVERSAL) { + mode_1 = _mode_1; + shift = _shift; + shift_1 = _shift_1; + }; + + IndiUniversalParams(IndiUniversalParams &_params) { THIS_REF = _params; }; +}; + +/** + * Implements the Universal indicator. + */ +class Indi_Universal : public Indicator { + protected: + /** + * Initialize. + */ + void Init() { + if (!indi_src.IsSet()) { + indi_src = new Indi_Price(); + } + } + + public: + /** + * Class constructor. + */ + Indi_Universal(IndiUniversalParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_INDICATOR, + IndicatorData *_indi_src = NULL, int _indi_src_mode = 0) + : Indicator(_p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_MIXED, _indi_src_mode), + _indi_src) { + Init(); + }; + Indi_Universal(int _shift = 0, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_INDICATOR, IndicatorData *_indi_src = NULL, + int _indi_src_mode = 0) + : Indicator(IndiUniversalParams(), + IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_MIXED, _indi_src_mode), + _indi_src) { + Init(); + }; + + /** + * Returns possible data source types. It is a bit mask of ENUM_INDI_SUITABLE_DS_TYPE. + */ + unsigned int GetSuitableDataSourceTypes() override { return INDI_SUITABLE_DS_TYPE_EXPECT_ANY; } + + /** + * Returns possible data source modes. It is a bit mask of ENUM_IDATA_SOURCE_TYPE. + */ + unsigned int GetPossibleDataModes() override { return IDATA_INDICATOR; } + + /** + * Returns the indicator's value. + */ + virtual IndicatorDataEntryValue GetEntryValue(int _mode = 0, int _abs_shift = 0) { + IndicatorDataEntryValue _value = EMPTY_VALUE; + switch (Get(STRUCT_ENUM(IndicatorDataParams, IDATA_PARAM_IDSTYPE))) { + case IDATA_INDICATOR: + if (!indi_src.IsSet()) { + logger REF_DEREF Error( + "In order use custom indicator as a source, you need to select one using SetIndicatorData() method, " + "which is a part of IndiUniversalParams structure.", + "Indi_Universal"); + Alert( + "Indi_Universal: In order use custom indicator as a source, you need to select one using " + "SetIndicatorData() " + "method, which is a part of IndiUniversalParams structure."); + SetUserError(ERR_INVALID_PARAMETER); + return _value; + } + _value = indi_src REF_DEREF GetEntryValue(_mode, _abs_shift); + break; + default: + SetUserError(ERR_INVALID_PARAMETER); + break; + } + return _value; + } + + /* Getters */ + + /** + * Whether we can and have to select mode when specifying data source. + */ + virtual bool IsDataSourceModeSelectable() { return false; } +}; diff --git a/Indicators/Special/includes.h b/Indicators/Special/includes.h index f8c2c8624..9f98f8162 100644 --- a/Indicators/Special/includes.h +++ b/Indicators/Special/includes.h @@ -28,3 +28,4 @@ // Special indicators. #include "Indi_Custom.mqh" #include "Indi_Math.mqh" +#include "Indi_Universal.h" diff --git a/Indicators/Special/tests/Indi_Universal.test.cpp b/Indicators/Special/tests/Indi_Universal.test.cpp new file mode 100644 index 000000000..ce9a1cd37 --- /dev/null +++ b/Indicators/Special/tests/Indi_Universal.test.cpp @@ -0,0 +1,36 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test C++ compilation of Indi_Universal indicator class. + */ + +// Includes. +#include "../Indi_Universal.h" + +#include "../../../Platform/Platform.h" + +int main(int argc, char **argv) { + // @todo + + return 0; +} diff --git a/Indicators/Special/tests/Indi_Universal.test.mq4 b/Indicators/Special/tests/Indi_Universal.test.mq4 new file mode 100644 index 000000000..f2f3eca94 --- /dev/null +++ b/Indicators/Special/tests/Indi_Universal.test.mq4 @@ -0,0 +1,27 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +/** + * @file + * Test functionality of Universal indicator class. + */ + +#include "Indi_Universal.test.mq5" diff --git a/Indicators/Special/tests/Indi_Universal.test.mq5 b/Indicators/Special/tests/Indi_Universal.test.mq5 new file mode 100644 index 000000000..4e0560a30 --- /dev/null +++ b/Indicators/Special/tests/Indi_Universal.test.mq5 @@ -0,0 +1,31 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + */ + +// Includes. +#include "../../../Platform/Platform.h" +#include "../../../Test.mqh" +#include "../Indi_Universal.h" + +/** + * @file + * Test functionality of Universal indicator class. + */ +TEST_INDICATOR_DEFAULT_BINDINGS(Indi_Universal); From 860893069a80027aa6ed453697e5fbce06152df7 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 25 Jun 2023 00:02:03 +0100 Subject: [PATCH 096/109] Indicators: Corrects comments --- Indicator/Indicator.enum.h | 4 ++-- Indicators/Indi_Killzones.mqh | 2 +- Indicators/Indi_Pivot.mqh | 2 +- Indicators/Indi_WilliamsAD.mqh | 2 +- Indicators/Indi_ZigZagColor.mqh | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Indicator/Indicator.enum.h b/Indicator/Indicator.enum.h index 83ebb5bcf..108324068 100644 --- a/Indicator/Indicator.enum.h +++ b/Indicator/Indicator.enum.h @@ -95,7 +95,7 @@ enum ENUM_INDICATOR_TYPE { INDI_OHLC, // OHLC (Open-High-Low-Close) INDI_OSMA, // OsMA INDI_PATTERN, // Pattern Detector - INDI_PIVOT, // Pivot Detector + INDI_PIVOT, // Pivot INDI_PRICE, // Price INDI_PRICE_CHANNEL, // Price Channel INDI_PRICE_FEEDER, // Indicator which returns prices from custom array @@ -128,7 +128,7 @@ enum ENUM_INDICATOR_TYPE { INDI_VIDYA, // Variable Index Dynamic Average INDI_VOLUMES, // Volumes INDI_VROC, // Volume Rate of Change - INDI_WILLIAMS_AD, // Larry Williams' Accumulation/Distribution + INDI_WILLIAMS_AD, // Williams' Accumulation/Distribution INDI_WPR, // Williams' Percent Range INDI_ZIGZAG, // ZigZag INDI_ZIGZAG_COLOR, // ZigZag Color diff --git a/Indicators/Indi_Killzones.mqh b/Indicators/Indi_Killzones.mqh index 462a067ca..2df696e8e 100644 --- a/Indicators/Indi_Killzones.mqh +++ b/Indicators/Indi_Killzones.mqh @@ -82,7 +82,7 @@ struct Indi_Killzones_Time : MarketTimeForex { }; /** - * Implements Pivot Detector. + * Implements Killzones indicator. */ class Indi_Killzones : public Indicator { protected: diff --git a/Indicators/Indi_Pivot.mqh b/Indicators/Indi_Pivot.mqh index 3a3f4e8eb..16945f984 100644 --- a/Indicators/Indi_Pivot.mqh +++ b/Indicators/Indi_Pivot.mqh @@ -38,7 +38,7 @@ struct IndiPivotParams : IndicatorParams { }; /** - * Implements Pivot Detector. + * Implements Pivot indicator. */ class Indi_Pivot : public Indicator { protected: diff --git a/Indicators/Indi_WilliamsAD.mqh b/Indicators/Indi_WilliamsAD.mqh index b828039aa..ff454841b 100644 --- a/Indicators/Indi_WilliamsAD.mqh +++ b/Indicators/Indi_WilliamsAD.mqh @@ -40,7 +40,7 @@ struct IndiWilliamsADParams : IndicatorParams { }; /** - * Implements the Volume Rate of Change indicator. + * Implements the Williams' AD indicator. */ class Indi_WilliamsAD : public Indicator { public: diff --git a/Indicators/Indi_ZigZagColor.mqh b/Indicators/Indi_ZigZagColor.mqh index c26a08007..509917a5e 100644 --- a/Indicators/Indi_ZigZagColor.mqh +++ b/Indicators/Indi_ZigZagColor.mqh @@ -50,7 +50,7 @@ struct IndiZigZagColorParams : IndicatorParams { }; /** - * Implements the Volume Rate of Change indicator. + * Implements the ZigZag Color indicator. */ class Indi_ZigZagColor : public Indicator { public: From 48f6b524422708c81dc903f52f121423f44f9d16 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 25 Jun 2023 15:10:27 +0100 Subject: [PATCH 097/109] Removes ColorBars indicator --- Indicators/Indi_ColorBars.mqh | 149 ----------------------- Indicators/includes.h | 1 - Indicators/tests/Indi_ColorBars.test.mq4 | 27 ---- Indicators/tests/Indi_ColorBars.test.mq5 | 31 ----- tests/IndicatorsTest.mq5 | 4 - 5 files changed, 212 deletions(-) delete mode 100644 Indicators/Indi_ColorBars.mqh delete mode 100644 Indicators/tests/Indi_ColorBars.test.mq4 delete mode 100644 Indicators/tests/Indi_ColorBars.test.mq5 diff --git a/Indicators/Indi_ColorBars.mqh b/Indicators/Indi_ColorBars.mqh deleted file mode 100644 index 6721eed7c..000000000 --- a/Indicators/Indi_ColorBars.mqh +++ /dev/null @@ -1,149 +0,0 @@ -//+------------------------------------------------------------------+ -//| EA31337 framework | -//| Copyright 2016-2023, EA31337 Ltd | -//| https://ea31337.github.io | -//+------------------------------------------------------------------+ - -/* - * 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 . - * - */ - -// Includes. -#include "../Indicator/Indicator.h" -#include "../Storage/Dict/Buffer/BufferStruct.h" -#include "../Storage/ValueStorage.all.h" - -// Structs. -struct IndiColorBarsParams : IndicatorParams { - // Struct constructor. - IndiColorBarsParams(int _shift = 0) : IndicatorParams(INDI_COLOR_BARS) { - SetCustomIndicatorName("Examples\\ColorBars"); - shift = _shift; - }; - IndiColorBarsParams(IndiColorBarsParams &_params) { THIS_REF = _params; }; -}; - -/** - * Implements Color Bars - */ -class Indi_ColorBars : public Indicator { - public: - /** - * Class constructor. - */ - Indi_ColorBars(IndiColorBarsParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, - IndicatorData *_indi_src = NULL, int _indi_src_mode = 0) - : Indicator(_p, IndicatorDataParams::GetInstance(5, TYPE_DOUBLE, _idstype, IDATA_RANGE_MIXED, _indi_src_mode), - _indi_src){}; - Indi_ColorBars(int _shift = 0, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, - int _indi_src_mode = 0) - : Indicator(IndiColorBarsParams(), - IndicatorDataParams::GetInstance(5, TYPE_DOUBLE, _idstype, IDATA_RANGE_MIXED, _indi_src_mode), - _indi_src){}; - /** - * Returns possible data source types. It is a bit mask of ENUM_INDI_SUITABLE_DS_TYPE. - */ - unsigned int GetSuitableDataSourceTypes() override { - return INDI_SUITABLE_DS_TYPE_CANDLE | INDI_SUITABLE_DS_TYPE_BASE_ONLY; - } - - /** - * Returns possible data source modes. It is a bit mask of ENUM_IDATA_SOURCE_TYPE. - */ - unsigned int GetPossibleDataModes() override { return IDATA_ONCALCULATE | IDATA_ICUSTOM | IDATA_INDICATOR; } - - /** - * OnCalculate-based version of Color Bars as there is no built-in one. - */ - static double iColorBars(IndicatorData *_indi, int _mode = 0, int _rel_shift = 0) { - INDICATOR_CALCULATE_POPULATE_PARAMS_AND_CACHE_LONG(_indi, ""); - return iColorBarsOnArray(INDICATOR_CALCULATE_POPULATED_PARAMS_LONG, _mode, _indi PTR_DEREF ToAbsShift(_rel_shift), - _cache); - } - - /** - * Calculates Color Bars on the array of values. - */ - static double iColorBarsOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _mode, int _abs_shift, - IndiBufferCache *_cache, bool _recalculate = false) { - _cache.SetPriceBuffer(_open, _high, _low, _close); - - if (!_cache.HasBuffers()) { - _cache.AddBuffer>(4 + 1); - } - - if (_recalculate) { - _cache.ResetPrevCalculated(); - } - - _cache.SetPrevCalculated(Indi_ColorBars::Calculate(INDICATOR_CALCULATE_GET_PARAMS_LONG, _cache.GetBuffer(0), - _cache.GetBuffer(1), _cache.GetBuffer(2), - _cache.GetBuffer(3), _cache.GetBuffer(4))); - - return _cache.GetTailValue(_mode, _abs_shift); - } - - /** - * OnCalculate() method for Color Bars indicator. - */ - static int Calculate(INDICATOR_CALCULATE_METHOD_PARAMS_LONG, ValueStorage &ExtOpenBuffer, - ValueStorage &ExtHighBuffer, ValueStorage &ExtLowBuffer, - ValueStorage &ExtCloseBuffer, ValueStorage &ExtColorsBuffer) { - int i = 0; - bool vol_up = true; - // Set position for beginning. - if (i < prev_calculated) i = prev_calculated - 1; - // Start calculations. - while (i < rates_total && !IsStopped()) { - ExtOpenBuffer[i] = open[i]; - ExtHighBuffer[i] = high[i]; - ExtLowBuffer[i] = low[i]; - ExtCloseBuffer[i] = close[i]; - // Determine volume change. - if (i > 0) { - if (tick_volume[i] > tick_volume[i - 1]) vol_up = true; - if (tick_volume[i] < tick_volume[i - 1]) vol_up = false; - } - ExtColorsBuffer[i] = vol_up ? 0.0 : 1.0; - i++; - } - // Return value of prev_calculated for next call. - return (rates_total); - } - - /** - * Returns the indicator's value. - */ - virtual IndicatorDataEntryValue GetEntryValue(int _mode = 0, int _abs_shift = 0) { - double _value = EMPTY_VALUE; - switch (Get(STRUCT_ENUM(IndicatorDataParams, IDATA_PARAM_IDSTYPE))) { - case IDATA_BUILTIN: - case IDATA_ONCALCULATE: - _value = Indi_ColorBars::iColorBars(THIS_PTR, _mode, ToRelShift(_abs_shift)); - break; - case IDATA_ICUSTOM: - _value = iCustom(istate.handle, GetSymbol(), GetTf(), iparams.GetCustomIndicatorName(), _mode, - ToRelShift(_abs_shift)); - break; - case IDATA_INDICATOR: - _value = Indi_ColorBars::iColorBars(THIS_PTR, _mode, ToRelShift(_abs_shift)); - break; - default: - SetUserError(ERR_INVALID_PARAMETER); - break; - } - return _value; - } -}; diff --git a/Indicators/includes.h b/Indicators/includes.h index 02c2c29e5..fd27b9c04 100644 --- a/Indicators/includes.h +++ b/Indicators/includes.h @@ -41,7 +41,6 @@ #include "Indi_CCI.mqh" #include "Indi_CHO.mqh" #include "Indi_CHV.mqh" -#include "Indi_ColorBars.mqh" #include "Indi_ColorCandlesDaily.mqh" #include "Indi_ColorLine.mqh" #include "Indi_CustomMovingAverage.mqh" diff --git a/Indicators/tests/Indi_ColorBars.test.mq4 b/Indicators/tests/Indi_ColorBars.test.mq4 deleted file mode 100644 index f752b4613..000000000 --- a/Indicators/tests/Indi_ColorBars.test.mq4 +++ /dev/null @@ -1,27 +0,0 @@ -//+------------------------------------------------------------------+ -//| EA31337 framework | -//| Copyright 2016-2023, EA31337 Ltd | -//| https://ea31337.github.io | -//+------------------------------------------------------------------+ - -/* - * 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 . - */ - -/** - * @file - * Test functionality of Indi_ColorBars indicator class. - */ - -#include "Indi_ColorBars.test.mq5" diff --git a/Indicators/tests/Indi_ColorBars.test.mq5 b/Indicators/tests/Indi_ColorBars.test.mq5 deleted file mode 100644 index cc01d47e1..000000000 --- a/Indicators/tests/Indi_ColorBars.test.mq5 +++ /dev/null @@ -1,31 +0,0 @@ -//+------------------------------------------------------------------+ -//| EA31337 framework | -//| Copyright 2016-2023, EA31337 Ltd | -//| https://ea31337.github.io | -//+------------------------------------------------------------------+ - -/* - * 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 . - */ - -// Includes. -#include "../../Platform/Platform.h" -#include "../../Test.mqh" -#include "../Indi_ColorBars.mqh" - -/** - * @file - * Test functionality of Indi_ColorBars indicator class. - */ -TEST_INDICATOR_DEFAULT_BINDINGS(Indi_ColorBars); diff --git a/tests/IndicatorsTest.mq5 b/tests/IndicatorsTest.mq5 index 92168b883..4abba8ad3 100644 --- a/tests/IndicatorsTest.mq5 +++ b/tests/IndicatorsTest.mq5 @@ -457,10 +457,6 @@ bool InitIndicators() { IndiCHVParams chv_params(); indis.Add(new Indi_CHV(chv_params)); - // Color Bars. - IndiColorBarsParams color_bars_params(); - indis.Add(new Indi_ColorBars(color_bars_params)); - // Color Candles Daily. IndiColorCandlesDailyParams color_candles_daily_params(); indis.Add(new Indi_ColorCandlesDaily(color_candles_daily_params)); From 3c4254358d955da6eacd1e5d816df7c342526d4d Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 25 Jun 2023 15:15:49 +0100 Subject: [PATCH 098/109] Removes Color Candles Daily indicator --- .github/workflows/test-indicators.yml | 2 - Indicators/Indi_ColorCandlesDaily.mqh | 158 ------------------ Indicators/includes.h | 1 - .../tests/Indi_ColorCandlesDaily.test.mq4 | 27 --- .../tests/Indi_ColorCandlesDaily.test.mq5 | 31 ---- tests/IndicatorsTest.mq5 | 4 - 6 files changed, 223 deletions(-) delete mode 100644 Indicators/Indi_ColorCandlesDaily.mqh delete mode 100644 Indicators/tests/Indi_ColorCandlesDaily.test.mq4 delete mode 100644 Indicators/tests/Indi_ColorCandlesDaily.test.mq5 diff --git a/.github/workflows/test-indicators.yml b/.github/workflows/test-indicators.yml index 7a0ffa7dc..83c05aca7 100644 --- a/.github/workflows/test-indicators.yml +++ b/.github/workflows/test-indicators.yml @@ -66,8 +66,6 @@ jobs: - Indi_CCI.test - Indi_CHO.test - Indi_CHV.test - # - Indi_ColorBars.test # @fixme - - Indi_ColorCandlesDaily.test - Indi_ColorLine.test - Indi_CustomMovingAverage.test - Indi_DeMarker.test diff --git a/Indicators/Indi_ColorCandlesDaily.mqh b/Indicators/Indi_ColorCandlesDaily.mqh deleted file mode 100644 index 9c5f2a545..000000000 --- a/Indicators/Indi_ColorCandlesDaily.mqh +++ /dev/null @@ -1,158 +0,0 @@ -//+------------------------------------------------------------------+ -//| EA31337 framework | -//| Copyright 2016-2023, EA31337 Ltd | -//| https://ea31337.github.io | -//+------------------------------------------------------------------+ - -/* - * 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 . - * - */ - -// Includes. -#include "../Indicator/Indicator.h" -#include "../Storage/Dict/Buffer/BufferStruct.h" -#include "../Storage/ValueStorage.all.h" - -// Structs. -struct IndiColorCandlesDailyParams : IndicatorParams { - // Struct constructor. - IndiColorCandlesDailyParams(int _shift = 0) : IndicatorParams(INDI_COLOR_CANDLES_DAILY) { - SetCustomIndicatorName("Examples\\ColorCandlesDaily"); - shift = _shift; - }; - IndiColorCandlesDailyParams(IndiColorCandlesDailyParams &_params) { THIS_REF = _params; }; -}; - -/** - * Implements Color Bars - */ -class Indi_ColorCandlesDaily : public Indicator { - public: - /** - * Class constructor. - */ - Indi_ColorCandlesDaily(IndiColorCandlesDailyParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, - IndicatorData *_indi_src = NULL, int _indi_src_mode = 0) - : Indicator(_p, IndicatorDataParams::GetInstance(5, TYPE_DOUBLE, _idstype, IDATA_RANGE_MIXED, _indi_src_mode), - _indi_src){}; - Indi_ColorCandlesDaily(int _shift = 0, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, - IndicatorData *_indi_src = NULL, int _indi_src_mode = 0) - : Indicator(IndiColorCandlesDailyParams(), - IndicatorDataParams::GetInstance(5, TYPE_DOUBLE, _idstype, IDATA_RANGE_MIXED, _indi_src_mode), - _indi_src){}; - /** - * Returns possible data source types. It is a bit mask of ENUM_INDI_SUITABLE_DS_TYPE. - */ - unsigned int GetSuitableDataSourceTypes() override { return INDI_SUITABLE_DS_TYPE_CUSTOM; } - - /** - * Returns possible data source modes. It is a bit mask of ENUM_IDATA_SOURCE_TYPE. - */ - unsigned int GetPossibleDataModes() override { return IDATA_ONCALCULATE | IDATA_ICUSTOM | IDATA_INDICATOR; } - - /** - * Checks whether given data source satisfies our requirements. - */ - bool OnCheckIfSuitableDataSource(IndicatorData *_ds) override { - if (Indicator::OnCheckIfSuitableDataSource(_ds)) { - return true; - } - - // Volume uses volume only. - return _ds PTR_DEREF HasSpecificAppliedPriceValueStorage(PRICE_OPEN) && - _ds PTR_DEREF HasSpecificAppliedPriceValueStorage(PRICE_HIGH) && - _ds PTR_DEREF HasSpecificAppliedPriceValueStorage(PRICE_LOW) && - _ds PTR_DEREF HasSpecificAppliedPriceValueStorage(PRICE_CLOSE); - } - - /** - * OnCalculate-based version of Color Candles Daily as there is no built-in one. - */ - static double iCCD(IndicatorData *_indi, int _mode = 0, int _rel_shift = 0) { - INDICATOR_CALCULATE_POPULATE_PARAMS_AND_CACHE_LONG(_indi, ""); - return iCCDOnArray(INDICATOR_CALCULATE_POPULATED_PARAMS_LONG, _mode, _indi PTR_DEREF ToAbsShift(_rel_shift), - _cache); - } - - /** - * Calculates Color Candles Daily on the array of values. - */ - static double iCCDOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _mode, int _abs_shift, IndiBufferCache *_cache, - bool _recalculate = false) { - _cache.SetPriceBuffer(_open, _high, _low, _close); - - if (!_cache.HasBuffers()) { - _cache.AddBuffer>(4 + 1); - } - - if (_recalculate) { - _cache.ResetPrevCalculated(); - } - - _cache.SetPrevCalculated(Indi_ColorCandlesDaily::Calculate( - INDICATOR_CALCULATE_GET_PARAMS_LONG, _cache.GetBuffer(0), _cache.GetBuffer(1), - _cache.GetBuffer(2), _cache.GetBuffer(3), _cache.GetBuffer(4))); - - return _cache.GetTailValue(_mode, _abs_shift); - } - - /** - * OnCalculate() method for Color Candles Daily indicator. - */ - static int Calculate(INDICATOR_CALCULATE_METHOD_PARAMS_LONG, ValueStorage &ExtOpenBuffer, - ValueStorage &ExtHighBuffer, ValueStorage &ExtLowBuffer, - ValueStorage &ExtCloseBuffer, ValueStorage &ExtColorsBuffer) { - color ExtColorOfDay[6] = {CLR_NONE, MediumSlateBlue, DarkGoldenrod, ForestGreen, BlueViolet, Red}; - - int pos; - MqlDateTime tstruct; - pos = prev_calculated < 1 ? 0 : prev_calculated - 1; - // Main cycle. - for (int i = pos; i < rates_total && !IsStopped(); i++) { - ExtOpenBuffer[i] = open[i]; - ExtHighBuffer[i] = high[i]; - ExtLowBuffer[i] = low[i]; - ExtCloseBuffer[i] = close[i]; - // Set color for every candle. - TimeToStruct(time[i].Get(), tstruct); - ExtColorsBuffer[i] = tstruct.day_of_week; - } - // Return value of prev_calculated for next call. - return (rates_total); - } - - /** - * Returns the indicator's value. - */ - virtual IndicatorDataEntryValue GetEntryValue(int _mode = 0, int _abs_shift = 0) { - double _value = EMPTY_VALUE; - switch (Get(STRUCT_ENUM(IndicatorDataParams, IDATA_PARAM_IDSTYPE))) { - case IDATA_BUILTIN: - case IDATA_ONCALCULATE: - _value = Indi_ColorCandlesDaily::iCCD(THIS_PTR, _mode, ToRelShift(_abs_shift)); - break; - case IDATA_ICUSTOM: - _value = iCustom(istate.handle, GetSymbol(), GetTf(), iparams.GetCustomIndicatorName(), _mode, - ToRelShift(_abs_shift)); - break; - case IDATA_INDICATOR: - _value = Indi_ColorCandlesDaily::iCCD(THIS_PTR, _mode, ToRelShift(_abs_shift)); - break; - default: - SetUserError(ERR_INVALID_PARAMETER); - } - return _value; - } -}; diff --git a/Indicators/includes.h b/Indicators/includes.h index fd27b9c04..ecff4fcd4 100644 --- a/Indicators/includes.h +++ b/Indicators/includes.h @@ -41,7 +41,6 @@ #include "Indi_CCI.mqh" #include "Indi_CHO.mqh" #include "Indi_CHV.mqh" -#include "Indi_ColorCandlesDaily.mqh" #include "Indi_ColorLine.mqh" #include "Indi_CustomMovingAverage.mqh" #include "Indi_DEMA.mqh" diff --git a/Indicators/tests/Indi_ColorCandlesDaily.test.mq4 b/Indicators/tests/Indi_ColorCandlesDaily.test.mq4 deleted file mode 100644 index e4790c792..000000000 --- a/Indicators/tests/Indi_ColorCandlesDaily.test.mq4 +++ /dev/null @@ -1,27 +0,0 @@ -//+------------------------------------------------------------------+ -//| EA31337 framework | -//| Copyright 2016-2023, EA31337 Ltd | -//| https://ea31337.github.io | -//+------------------------------------------------------------------+ - -/* - * 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 . - */ - -/** - * @file - * Test functionality of Indi_ColorCandlesDaily indicator class. - */ - -#include "Indi_ColorCandlesDaily.test.mq5" diff --git a/Indicators/tests/Indi_ColorCandlesDaily.test.mq5 b/Indicators/tests/Indi_ColorCandlesDaily.test.mq5 deleted file mode 100644 index 0fb1c846b..000000000 --- a/Indicators/tests/Indi_ColorCandlesDaily.test.mq5 +++ /dev/null @@ -1,31 +0,0 @@ -//+------------------------------------------------------------------+ -//| EA31337 framework | -//| Copyright 2016-2023, EA31337 Ltd | -//| https://ea31337.github.io | -//+------------------------------------------------------------------+ - -/* - * 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 . - */ - -// Includes. -#include "../../Platform/Platform.h" -#include "../../Test.mqh" -#include "../Indi_ColorCandlesDaily.mqh" - -/** - * @file - * Test functionality of Indi_ColorCandlesDaily indicator class. - */ -TEST_INDICATOR_DEFAULT_BINDINGS(Indi_ColorCandlesDaily); diff --git a/tests/IndicatorsTest.mq5 b/tests/IndicatorsTest.mq5 index 4abba8ad3..f39ad6cb7 100644 --- a/tests/IndicatorsTest.mq5 +++ b/tests/IndicatorsTest.mq5 @@ -457,10 +457,6 @@ bool InitIndicators() { IndiCHVParams chv_params(); indis.Add(new Indi_CHV(chv_params)); - // Color Candles Daily. - IndiColorCandlesDailyParams color_candles_daily_params(); - indis.Add(new Indi_ColorCandlesDaily(color_candles_daily_params)); - // Color Line. IndiColorLineParams color_line_params(); indis.Add(new Indi_ColorLine(color_line_params)); From 1ece85323c8657d5544759efde0484243d47fb5b Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 25 Jun 2023 15:32:15 +0100 Subject: [PATCH 099/109] Removes Color Line indicator --- .github/workflows/test-indicators.yml | 1 - Indicators/Indi_ColorLine.mqh | 241 ----------------------- Indicators/includes.h | 1 - Indicators/tests/Indi_ColorLine.test.mq4 | 27 --- Indicators/tests/Indi_ColorLine.test.mq5 | 31 --- tests/IndicatorsTest.mq5 | 4 - 6 files changed, 305 deletions(-) delete mode 100644 Indicators/Indi_ColorLine.mqh delete mode 100644 Indicators/tests/Indi_ColorLine.test.mq4 delete mode 100644 Indicators/tests/Indi_ColorLine.test.mq5 diff --git a/.github/workflows/test-indicators.yml b/.github/workflows/test-indicators.yml index 83c05aca7..923378dfa 100644 --- a/.github/workflows/test-indicators.yml +++ b/.github/workflows/test-indicators.yml @@ -66,7 +66,6 @@ jobs: - Indi_CCI.test - Indi_CHO.test - Indi_CHV.test - - Indi_ColorLine.test - Indi_CustomMovingAverage.test - Indi_DeMarker.test - Indi_Demo.test diff --git a/Indicators/Indi_ColorLine.mqh b/Indicators/Indi_ColorLine.mqh deleted file mode 100644 index e5afbe3a7..000000000 --- a/Indicators/Indi_ColorLine.mqh +++ /dev/null @@ -1,241 +0,0 @@ -//+------------------------------------------------------------------+ -//| EA31337 framework | -//| Copyright 2016-2023, EA31337 Ltd | -//| https://ea31337.github.io | -//+------------------------------------------------------------------+ - -/* - * 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 . - * - */ - -// Includes. -#include "../Indicator/Indicator.h" -#include "../Storage/Dict/Buffer/BufferStruct.h" -#include "../Storage/ValueStorage.all.h" -#include "Price/Indi_MA.h" - -// Structs. -struct IndiColorLineParams : IndicatorParams { - IndicatorData *indi_ma; - // Struct constructor. - IndiColorLineParams(int _shift = 0) : IndicatorParams(INDI_COLOR_LINE) { - indi_ma = NULL; - SetCustomIndicatorName("Examples\\ColorLine"); - shift = _shift; - }; - IndiColorLineParams(IndiColorLineParams &_params) { THIS_REF = _params; }; -}; - -/** - * Implements Color Bars - */ -class Indi_ColorLine : public Indicator { - public: - /** - * Class constructor. - */ - Indi_ColorLine(IndiColorLineParams &_p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, - IndicatorData *_indi_src = NULL, int _indi_src_mode = 0) - : Indicator(_p, IndicatorDataParams::GetInstance(2, TYPE_DOUBLE, _idstype, IDATA_RANGE_MIXED, _indi_src_mode), - _indi_src){}; - Indi_ColorLine(int _shift = 0, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData *_indi_src = NULL, - int _indi_src_mode = 0) - : Indicator(IndiColorLineParams(), - IndicatorDataParams::GetInstance(2, TYPE_DOUBLE, _idstype, IDATA_RANGE_MIXED, _indi_src_mode), - _indi_src){}; - /** - * Returns possible data source types. It is a bit mask of ENUM_INDI_SUITABLE_DS_TYPE. - * - * @fixit Should require Candle data source? - */ - unsigned int GetSuitableDataSourceTypes() override { return INDI_SUITABLE_DS_TYPE_CANDLE; } - - /** - * Returns possible data source modes. It is a bit mask of ENUM_IDATA_SOURCE_TYPE. - */ - unsigned int GetPossibleDataModes() override { return IDATA_ONCALCULATE | IDATA_ICUSTOM | IDATA_INDICATOR; } - - /** - * Checks whether given data source satisfies our requirements. - */ - bool OnCheckIfSuitableDataSource(IndicatorData *_ds) override { - if (Indicator::OnCheckIfSuitableDataSource(_ds)) { - return true; - } - - // Volume uses volume only. - return _ds PTR_DEREF HasSpecificValueStorage(INDI_DATA_VS_TYPE_VOLUME); - } - - /** - * OnCalculate-based version of Color Line as there is no built-in one. - */ - static double iColorLine(IndicatorData *_indi, int _mode = 0, int _rel_shift = 0) { - INDICATOR_CALCULATE_POPULATE_PARAMS_AND_CACHE_LONG(_indi, ""); - // Will return Indi_MA with the same candles source as _indi's. - // @fixit There should be Candle attached to MA! - Indi_MA *_indi_ma = Indi_MA::GetCached(_indi, 10, 0, MODE_EMA, PRICE_CLOSE); - return iColorLineOnArray(INDICATOR_CALCULATE_POPULATED_PARAMS_LONG, _mode, _indi PTR_DEREF ToAbsShift(_rel_shift), - _cache, _indi_ma); - } - - /** - * Calculates Color Line on the array of values. - */ - static double iColorLineOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _mode, int _abs_shift, - IndiBufferCache *_cache, IndicatorData *_indi_ma, bool _recalculate = false) { - _cache.SetPriceBuffer(_open, _high, _low, _close); - - if (!_cache.HasBuffers()) { - _cache.AddBuffer>(1 + 1); - } - - if (_recalculate) { - _cache.ResetPrevCalculated(); - } - - _cache.SetPrevCalculated(Indi_ColorLine::Calculate(INDICATOR_CALCULATE_GET_PARAMS_LONG, _cache.GetBuffer(0), - _cache.GetBuffer(1), _indi_ma)); - - return _cache.GetTailValue(_mode, _abs_shift); - } - - /** - * On-indicator version of Color Line. - */ - static double iColorLineOnIndicator(IndicatorData *_indi, int _mode, int _rel_shift, IndicatorData *_obj) { - INDICATOR_CALCULATE_POPULATE_PARAMS_AND_CACHE_LONG(_indi, ""); - Indi_MA *_indi_ma = _obj.GetDataSource(INDI_MA); - return iColorLineOnArray(INDICATOR_CALCULATE_POPULATED_PARAMS_LONG, _mode, _indi PTR_DEREF ToAbsShift(_rel_shift), - _cache, _indi_ma); - } - - /** - * Provides built-in indicators whose can be used as data source. - */ - virtual IndicatorData *FetchDataSource(ENUM_INDICATOR_TYPE _id) override { - switch (_id) { - case INDI_MA: - return iparams.indi_ma; - } - return NULL; - } - - /** - * OnCalculate() method for Color Line indicator. - */ - static int Calculate(INDICATOR_CALCULATE_METHOD_PARAMS_LONG, ValueStorage &ExtColorLineBuffer, - ValueStorage &ExtColorsBuffer, IndicatorData *ExtMAHandle) { - static int ticks = 0, modified = 0; - // Check data. - int i, calculated = BarsCalculated(ExtMAHandle); - // @added History of 100 values should be enough for MA. - if (calculated < rates_total) { - // Not all data of ExtMAHandle is calculated. - return (0); - } - // First calculation or number of bars was changed. - if (prev_calculated == 0) { - // Copy values of MA into indicator buffer ExtColorLineBuffer. - if (CopyBuffer(ExtMAHandle, 0, 0, rates_total, ExtColorLineBuffer, rates_total) <= 0) return (0); - // Now set line color for every bar. - for (i = 0; i < rates_total && !IsStopped(); i++) ExtColorsBuffer[i] = GetIndexOfColor(i); - } else { - // We can copy not all data. - int to_copy; - if (prev_calculated > rates_total || prev_calculated < 0) - to_copy = rates_total; - else { - to_copy = rates_total - prev_calculated; - if (prev_calculated > 0) to_copy++; - } - // Copy values of MA into indicator buffer ExtColorLineBuffer. - int copied = CopyBuffer(ExtMAHandle, 0, 0, rates_total, ExtColorLineBuffer, rates_total); - if (copied <= 0) return (0); - - ticks++; - if (ticks >= 5) { - // Time to change color scheme. - ticks = 0; - // Counter of color changes. - modified++; - if (modified >= 3) modified = 0; - switch (modified) { - case 0: - // First color scheme. - ExtColorLineBuffer.PlotIndexSetInteger(PLOT_LINE_COLOR, 0, Red); - ExtColorLineBuffer.PlotIndexSetInteger(PLOT_LINE_COLOR, 1, Blue); - ExtColorLineBuffer.PlotIndexSetInteger(PLOT_LINE_COLOR, 2, Green); - break; - case 1: - // Second color scheme. - ExtColorLineBuffer.PlotIndexSetInteger(PLOT_LINE_COLOR, 0, Yellow); - ExtColorLineBuffer.PlotIndexSetInteger(PLOT_LINE_COLOR, 1, Pink); - ExtColorLineBuffer.PlotIndexSetInteger(PLOT_LINE_COLOR, 2, LightSlateGray); - break; - default: - // Third color scheme. - ExtColorLineBuffer.PlotIndexSetInteger(PLOT_LINE_COLOR, 0, LightGoldenrod); - ExtColorLineBuffer.PlotIndexSetInteger(PLOT_LINE_COLOR, 1, Orchid); - ExtColorLineBuffer.PlotIndexSetInteger(PLOT_LINE_COLOR, 2, LimeGreen); - } - } else { - // Set start position. - int start = prev_calculated - 1; - // Now we set line color for every bar. - for (i = start; i < rates_total && !IsStopped(); i++) ExtColorsBuffer[i] = GetIndexOfColor(i); - } - } - // Return value of prev_calculated for next call. - return (rates_total); - } - - static int GetIndexOfColor(const int i) { - int j = i % 300; - if (j < 100) { - // First index. - return (0); - } - if (j < 200) { - // Second index. - return (1); - } - // Third index. - return (2); - } - - /** - * Returns the indicator's value. - */ - virtual IndicatorDataEntryValue GetEntryValue(int _mode = 0, int _abs_shift = 0) { - double _value = EMPTY_VALUE; - switch (Get(STRUCT_ENUM(IndicatorDataParams, IDATA_PARAM_IDSTYPE))) { - case IDATA_BUILTIN: - case IDATA_ONCALCULATE: - _value = iColorLine(THIS_PTR, _mode, ToRelShift(_abs_shift)); - break; - case IDATA_ICUSTOM: - _value = iCustom(istate.handle, GetSymbol(), GetTf(), iparams.GetCustomIndicatorName(), _mode, - ToRelShift(_abs_shift)); - break; - case IDATA_INDICATOR: - _value = iColorLine(THIS_PTR, _mode, ToRelShift(_abs_shift)); - break; - default: - SetUserError(ERR_INVALID_PARAMETER); - } - return _value; - } -}; diff --git a/Indicators/includes.h b/Indicators/includes.h index ecff4fcd4..d2a0ab967 100644 --- a/Indicators/includes.h +++ b/Indicators/includes.h @@ -41,7 +41,6 @@ #include "Indi_CCI.mqh" #include "Indi_CHO.mqh" #include "Indi_CHV.mqh" -#include "Indi_ColorLine.mqh" #include "Indi_CustomMovingAverage.mqh" #include "Indi_DEMA.mqh" #include "Indi_DeMarker.mqh" diff --git a/Indicators/tests/Indi_ColorLine.test.mq4 b/Indicators/tests/Indi_ColorLine.test.mq4 deleted file mode 100644 index c48d4d6f1..000000000 --- a/Indicators/tests/Indi_ColorLine.test.mq4 +++ /dev/null @@ -1,27 +0,0 @@ -//+------------------------------------------------------------------+ -//| EA31337 framework | -//| Copyright 2016-2023, EA31337 Ltd | -//| https://ea31337.github.io | -//+------------------------------------------------------------------+ - -/* - * 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 . - */ - -/** - * @file - * Test functionality of Indi_ColorLine indicator class. - */ - -#include "Indi_ColorLine.test.mq5" diff --git a/Indicators/tests/Indi_ColorLine.test.mq5 b/Indicators/tests/Indi_ColorLine.test.mq5 deleted file mode 100644 index 204b15a67..000000000 --- a/Indicators/tests/Indi_ColorLine.test.mq5 +++ /dev/null @@ -1,31 +0,0 @@ -//+------------------------------------------------------------------+ -//| EA31337 framework | -//| Copyright 2016-2023, EA31337 Ltd | -//| https://ea31337.github.io | -//+------------------------------------------------------------------+ - -/* - * 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 . - */ - -// Includes. -#include "../../Platform/Platform.h" -#include "../../Test.mqh" -#include "../Indi_ColorLine.mqh" - -/** - * @file - * Test functionality of Indi_ColorLine indicator class. - */ -TEST_INDICATOR_DEFAULT_BINDINGS(Indi_ColorLine); diff --git a/tests/IndicatorsTest.mq5 b/tests/IndicatorsTest.mq5 index f39ad6cb7..270da95bd 100644 --- a/tests/IndicatorsTest.mq5 +++ b/tests/IndicatorsTest.mq5 @@ -457,10 +457,6 @@ bool InitIndicators() { IndiCHVParams chv_params(); indis.Add(new Indi_CHV(chv_params)); - // Color Line. - IndiColorLineParams color_line_params(); - indis.Add(new Indi_ColorLine(color_line_params)); - // Detrended Price Oscillator. IndiDetrendedPriceParams detrended_params(); indis.Add(new Indi_DetrendedPrice(detrended_params)); From 6e2b81fdfb97df0a57953ae2984c3b885d47eb61 Mon Sep 17 00:00:00 2001 From: kenorb Date: Sun, 25 Jun 2023 15:45:47 +0100 Subject: [PATCH 100/109] Removes CustomMovingAverage indicator in favor of MA --- .github/workflows/test-indicators.yml | 1 - Indicators/Indi_CustomMovingAverage.mqh | 137 ------------------ Indicators/Price/Indi_MA.h | 12 +- Indicators/includes.h | 1 - .../tests/Indi_CustomMovingAverage.test.mq4 | 27 ---- .../tests/Indi_CustomMovingAverage.test.mq5 | 31 ---- tests/IndicatorsTest.mq5 | 4 - 7 files changed, 10 insertions(+), 203 deletions(-) delete mode 100644 Indicators/Indi_CustomMovingAverage.mqh delete mode 100644 Indicators/tests/Indi_CustomMovingAverage.test.mq4 delete mode 100644 Indicators/tests/Indi_CustomMovingAverage.test.mq5 diff --git a/.github/workflows/test-indicators.yml b/.github/workflows/test-indicators.yml index 923378dfa..b8ee9e5c1 100644 --- a/.github/workflows/test-indicators.yml +++ b/.github/workflows/test-indicators.yml @@ -66,7 +66,6 @@ jobs: - Indi_CCI.test - Indi_CHO.test - Indi_CHV.test - - Indi_CustomMovingAverage.test - Indi_DeMarker.test - Indi_Demo.test - Indi_DetrendedPrice.test diff --git a/Indicators/Indi_CustomMovingAverage.mqh b/Indicators/Indi_CustomMovingAverage.mqh deleted file mode 100644 index b0cc0fb4e..000000000 --- a/Indicators/Indi_CustomMovingAverage.mqh +++ /dev/null @@ -1,137 +0,0 @@ -//+------------------------------------------------------------------+ -//| EA31337 framework | -//| Copyright 2016-2023, EA31337 Ltd | -//| https://ea31337.github.io | -//+------------------------------------------------------------------+ - -/* - * 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 . - * - */ - -// Includes. -#include "../Indicator/Indicator.h" -#include "../Storage/Dict/Buffer/BufferStruct.h" - -// Structs. -struct IndiCustomMovingAverageParams : IndicatorParams { - unsigned int smooth_period; - unsigned int smooth_shift; - ENUM_MA_METHOD smooth_method; - // Struct constructor. - IndiCustomMovingAverageParams(int _smooth_period = 13, int _smooth_shift = 0, - ENUM_MA_METHOD _smooth_method = MODE_SMMA, int _shift = 0) - : IndicatorParams(INDI_CUSTOM_MOVING_AVG) { - if (custom_indi_name == "") { -#ifdef __MQL5__ - SetCustomIndicatorName("Examples\\Custom Moving Average"); -#else - SetCustomIndicatorName("Custom Moving Averages"); -#endif - } - shift = _shift; - smooth_method = _smooth_method; - smooth_period = _smooth_period; - smooth_shift = _smooth_shift; - }; - IndiCustomMovingAverageParams(IndiCustomMovingAverageParams& _params) { THIS_REF = _params; }; -}; - -/** - * Implements the Custom Moving Average indicator. - */ -class Indi_CustomMovingAverage : public Indicator { - public: - /** - * Class constructor. - */ - Indi_CustomMovingAverage(IndiCustomMovingAverageParams& _p, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_ICUSTOM, - IndicatorData* _indi_src = NULL, int _indi_src_mode = 0) - : Indicator(_p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_PRICE, _indi_src_mode), - _indi_src){}; - Indi_CustomMovingAverage(int _shift = 0, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_ICUSTOM, - IndicatorData* _indi_src = NULL, int _indi_src_mode = 0) - : Indicator(IndiCustomMovingAverageParams(), - IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_PRICE, _indi_src_mode), - _indi_src){}; - - /** - * Returns possible data source types. It is a bit mask of ENUM_INDI_SUITABLE_DS_TYPE. - */ - unsigned int GetSuitableDataSourceTypes() override { return INDI_SUITABLE_DS_TYPE_EXPECT_NONE; } - - /** - * Returns possible data source modes. It is a bit mask of ENUM_IDATA_SOURCE_TYPE. - */ - unsigned int GetPossibleDataModes() override { return IDATA_ICUSTOM; } - - /** - * Returns the indicator's value. - */ - virtual IndicatorDataEntryValue GetEntryValue(int _mode = 0, int _abs_shift = 0) { - double _value = EMPTY_VALUE; - switch (Get(STRUCT_ENUM(IndicatorDataParams, IDATA_PARAM_IDSTYPE))) { - case IDATA_ICUSTOM: - _value = iCustom(istate.handle, GetSymbol(), GetTf(), iparams.GetCustomIndicatorName(), /*[*/ GetSmoothPeriod(), - GetSmoothShift(), GetSmoothMethod() /*]*/, 0, ToRelShift(_abs_shift)); - break; - default: - SetUserError(ERR_INVALID_PARAMETER); - } - return _value; - } - - /* Getters */ - - /** - * Get smooth period. - */ - unsigned int GetSmoothPeriod() { return iparams.smooth_period; } - - /** - * Get smooth shift. - */ - unsigned int GetSmoothShift() { return iparams.smooth_shift; } - - /** - * Get smooth method. - */ - ENUM_MA_METHOD GetSmoothMethod() { return iparams.smooth_method; } - - /* Setters */ - - /** - * Set smooth period. - */ - void SetSmoothPeriod(unsigned int _smooth_period) { - istate.is_changed = true; - iparams.smooth_period = _smooth_period; - } - - /** - * Set smooth shift. - */ - void SetSmoothShift(unsigned int _smooth_shift) { - istate.is_changed = true; - iparams.smooth_shift = _smooth_shift; - } - - /** - * Set smooth method. - */ - void SetSmoothMethod(ENUM_MA_METHOD _smooth_method) { - istate.is_changed = true; - iparams.smooth_method = _smooth_method; - } -}; diff --git a/Indicators/Price/Indi_MA.h b/Indicators/Price/Indi_MA.h index 16dcd6f57..2c9b4ef0a 100644 --- a/Indicators/Price/Indi_MA.h +++ b/Indicators/Price/Indi_MA.h @@ -76,8 +76,14 @@ struct IndiMAParams : IndicatorParams { IndiMAParams(unsigned int _period = 13, int _ma_shift = 0, ENUM_MA_METHOD _ma_method = MODE_SMA, ENUM_APPLIED_PRICE _ap = PRICE_OPEN, int _shift = 10) : period(_period), ma_shift(_ma_shift), ma_method(_ma_method), applied_array(_ap), IndicatorParams(INDI_MA) { + if (custom_indi_name == "") { +#ifdef __MQL5__ + SetCustomIndicatorName("Examples\\Custom Moving Average"); +#else + SetCustomIndicatorName("Custom Moving Averages"); +#endif + } shift = _shift; - SetCustomIndicatorName("Examples\\Moving Average"); }; IndiMAParams(IndiMAParams &_params) { THIS_REF = _params; }; }; @@ -674,13 +680,15 @@ class Indi_MA : public Indicator { break; case IDATA_ICUSTOM: _value = iCustom(istate.handle, GetSymbol(), GetTf(), iparams.custom_indi_name, /* [ */ GetPeriod(), - GetMAShift(), GetMAMethod(), GetAppliedPrice() /* ] */, 0, ToRelShift(_abs_shift)); + GetMAShift(), GetMAMethod() /* ] */, 0, ToRelShift(_abs_shift)); break; case IDATA_INDICATOR: // Calculating MA value from specified indicator. _value = Indi_MA::iMAOnIndicator(THIS_PTR, GetDataSource(), GetSymbol(), GetTf(), GetPeriod(), GetMAShift(), GetMAMethod(), GetAppliedPrice(), ToRelShift(_abs_shift)); break; + default: + SetUserError(ERR_INVALID_PARAMETER); } return _value; diff --git a/Indicators/includes.h b/Indicators/includes.h index d2a0ab967..0026f30cd 100644 --- a/Indicators/includes.h +++ b/Indicators/includes.h @@ -41,7 +41,6 @@ #include "Indi_CCI.mqh" #include "Indi_CHO.mqh" #include "Indi_CHV.mqh" -#include "Indi_CustomMovingAverage.mqh" #include "Indi_DEMA.mqh" #include "Indi_DeMarker.mqh" #include "Indi_Demo.mqh" diff --git a/Indicators/tests/Indi_CustomMovingAverage.test.mq4 b/Indicators/tests/Indi_CustomMovingAverage.test.mq4 deleted file mode 100644 index ea53110f7..000000000 --- a/Indicators/tests/Indi_CustomMovingAverage.test.mq4 +++ /dev/null @@ -1,27 +0,0 @@ -//+------------------------------------------------------------------+ -//| EA31337 framework | -//| Copyright 2016-2023, EA31337 Ltd | -//| https://ea31337.github.io | -//+------------------------------------------------------------------+ - -/* - * 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 . - */ - -/** - * @file - * Test functionality of Indi_CustomMovingAverage indicator class. - */ - -#include "Indi_CustomMovingAverage.test.mq5" diff --git a/Indicators/tests/Indi_CustomMovingAverage.test.mq5 b/Indicators/tests/Indi_CustomMovingAverage.test.mq5 deleted file mode 100644 index 703ad75fc..000000000 --- a/Indicators/tests/Indi_CustomMovingAverage.test.mq5 +++ /dev/null @@ -1,31 +0,0 @@ -//+------------------------------------------------------------------+ -//| EA31337 framework | -//| Copyright 2016-2023, EA31337 Ltd | -//| https://ea31337.github.io | -//+------------------------------------------------------------------+ - -/* - * 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 . - */ - -// Includes. -#include "../../Platform/Platform.h" -#include "../../Test.mqh" -#include "../Indi_CustomMovingAverage.mqh" - -/** - * @file - * Test functionality of Indi_CustomMovingAverage indicator class. - */ -TEST_INDICATOR_DEFAULT_BINDINGS(Indi_CustomMovingAverage); diff --git a/tests/IndicatorsTest.mq5 b/tests/IndicatorsTest.mq5 index 270da95bd..726151b27 100644 --- a/tests/IndicatorsTest.mq5 +++ b/tests/IndicatorsTest.mq5 @@ -517,10 +517,6 @@ bool InitIndicators() { IndiZigZagColorParams zigzag_color_params(); indis.Add(new Indi_ZigZagColor(zigzag_color_params)); - // Custom Moving Average. - IndiCustomMovingAverageParams cma_params(); - indis.Add(new Indi_CustomMovingAverage(cma_params)); - // Math (specialized indicator). IndiMathParams math_params(MATH_OP_SUB, BAND_UPPER, BAND_LOWER, 0, 0); // math_params.SetPlot(clrBlue); // @fixme From 8cacb42e1029cf357f384d6790c225f304310995 Mon Sep 17 00:00:00 2001 From: Adrian Kierzkowski Date: Thu, 29 Jun 2023 19:16:36 +0200 Subject: [PATCH 101/109] WIP. Fixing C++ errors. Stuck on ValueStorage's macros. --- Indicators/Indi_ADX.mqh | 5 ++ Indicators/Indi_ADXW.mqh | 22 +++--- Indicators/Indi_CCI.mqh | 12 +-- Indicators/Indi_Momentum.mqh | 8 +- Indicators/Indi_PriceFeeder.mqh | 18 +++-- Indicators/Indi_StdDev.mqh | 22 +++--- Indicators/Price/Indi_AppliedPrice.h | 4 +- Indicators/Price/Indi_MA.h | 24 +++--- Indicators/Price/Indi_Price.h | 5 ++ Indicators/PriceRange/Indi_Bands.h | 35 +++++---- Indicators/PriceRange/Indi_Envelopes.h | 25 +++--- Indicators/PriceRange/Indi_Pivot.h | 8 +- Indicators/Special/Indi_Custom.mqh | 4 +- Math/Math.extern.h | 4 + Pattern.struct.h | 56 +++++++++++++- Platform/Order.struct.h | 6 +- Std.h | 16 +++- Storage/Array.extern.h | 4 +- Storage/Cache/IndiBufferCache.h | 19 +++-- Storage/Cache/ObjectsCache.h | 8 +- Storage/ValueStorage.h | 103 +++++++++++++++++++------ Storage/ValueStorage.native.h | 4 +- Storage/ValueStorage.spread.h | 5 ++ Storage/ValueStorage.tick_volume.h | 5 ++ Storage/ValueStorage.time.h | 5 ++ Storage/ValueStorage.volume.h | 5 ++ 26 files changed, 303 insertions(+), 129 deletions(-) diff --git a/Indicators/Indi_ADX.mqh b/Indicators/Indi_ADX.mqh index 2d0a81e4a..4c5ddf08f 100644 --- a/Indicators/Indi_ADX.mqh +++ b/Indicators/Indi_ADX.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" #include "Price/Indi_Price.h" diff --git a/Indicators/Indi_ADXW.mqh b/Indicators/Indi_ADXW.mqh index 5f37980dc..01ca8329c 100644 --- a/Indicators/Indi_ADXW.mqh +++ b/Indicators/Indi_ADXW.mqh @@ -132,25 +132,27 @@ class Indi_ADXW : public Indicator { */ static double iADXWilderOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _period, int _mode, int _abs_shift, IndiBufferCache *_cache, bool _recalculate = false) { - _cache.SetPriceBuffer(_open, _high, _low, _close); + _cache PTR_DEREF SetPriceBuffer(_open, _high, _low, _close); - if (!_cache.HasBuffers()) { - _cache.AddBuffer>(3 + 7); + if (!_cache PTR_DEREF HasBuffers()) { + _cache PTR_DEREF AddBuffer>(3 + 7); } if (_recalculate) { - _cache.ResetPrevCalculated(); + _cache PTR_DEREF ResetPrevCalculated(); } - _cache.SetPrevCalculated(Indi_ADXW::Calculate( - INDICATOR_CALCULATE_GET_PARAMS_LONG, _cache.GetBuffer(0), _cache.GetBuffer(1), - _cache.GetBuffer(2), _cache.GetBuffer(3), _cache.GetBuffer(4), - _cache.GetBuffer(5), _cache.GetBuffer(6), _cache.GetBuffer(7), - _cache.GetBuffer(8), _cache.GetBuffer(9), _period)); + _cache PTR_DEREF SetPrevCalculated( + Indi_ADXW::Calculate(INDICATOR_CALCULATE_GET_PARAMS_LONG, _cache PTR_DEREF GetBuffer(0), + _cache PTR_DEREF GetBuffer(1), _cache PTR_DEREF GetBuffer(2), + _cache PTR_DEREF GetBuffer(3), _cache PTR_DEREF GetBuffer(4), + _cache PTR_DEREF GetBuffer(5), _cache PTR_DEREF GetBuffer(6), + _cache PTR_DEREF GetBuffer(7), _cache PTR_DEREF GetBuffer(8), + _cache PTR_DEREF GetBuffer(9), _period)); // Returns value from the first calculation buffer. // Returns first value for as-series array or last value for non-as-series array. - return _cache.GetTailValue(_mode, _abs_shift); + return _cache PTR_DEREF GetTailValue(_mode, _abs_shift); } /** diff --git a/Indicators/Indi_CCI.mqh b/Indicators/Indi_CCI.mqh index fa69935b2..418a229f4 100644 --- a/Indicators/Indi_CCI.mqh +++ b/Indicators/Indi_CCI.mqh @@ -98,10 +98,10 @@ class Indi_CCI : public Indicator { int _mode, int _shift = 0) { INDI_REQUIRE_BARS_OR_RETURN_EMPTY(_indi, _period); - _indi.ValidateDataSourceMode(_mode); + _indi PTR_DEREF ValidateDataSourceMode(_mode); - double _indi_value_buffer[]; - IndicatorDataEntry _entry(_indi.GetModeCount()); + ARRAY(double, _indi_value_buffer); + IndicatorDataEntry _entry(_indi PTR_DEREF GetModeCount()); ArrayResize(_indi_value_buffer, _period); @@ -136,12 +136,12 @@ class Indi_CCI : public Indicator { /** * CCI on array. */ - static double iCCIOnArray(double &array[], int total, int period, int shift) { + static double iCCIOnArray(CONST_ARRAY_REF(double, array), int total, int period, int shift) { #ifdef __MQL4__ return ::iCCIOnArray(array, total, period, shift); #else Indi_PriceFeeder indi_price_feeder(array); - return iCCIOnIndicator(&indi_price_feeder, NULL, NULL, period, /*unused*/ PRICE_OPEN, shift); + return iCCIOnIndicator(&indi_price_feeder, NULL, PERIOD_CURRENT, period, /*unused*/ PRICE_OPEN, shift); #endif } @@ -224,7 +224,7 @@ double iCCI(string _symbol, int _tf, int _period, int _ap, int _shift) { ResetLastError(); return Indi_CCI::iCCI(_symbol, (ENUM_TIMEFRAMES)_tf, _period, (ENUM_APPLIED_PRICE)_ap, _shift); } -double iCCIOnArray(double &_arr[], int _total, int _period, int _abs_shift) { +double iCCIOnArray(CONST_ARRAY_REF(double, _arr), int _total, int _period, int _abs_shift) { ResetLastError(); return Indi_CCI::iCCIOnArray(_arr, _total, _period, _abs_shift); } diff --git a/Indicators/Indi_Momentum.mqh b/Indicators/Indi_Momentum.mqh index f10cb04be..d23b4b57d 100644 --- a/Indicators/Indi_Momentum.mqh +++ b/Indicators/Indi_Momentum.mqh @@ -106,8 +106,8 @@ class Indi_Momentum : public Indicator { int _mode, int _shift = 0) { INDI_REQUIRE_BARS_OR_RETURN_EMPTY(_indi, _period); - double _indi_value_buffer[]; - IndicatorDataEntry _entry(_indi.GetModeCount()); + ARRAY(double, _indi_value_buffer); + IndicatorDataEntry _entry(_indi PTR_DEREF GetModeCount()); ArrayResize(_indi_value_buffer, _period); @@ -122,12 +122,12 @@ class Indi_Momentum : public Indicator { return momentum; } - static double iMomentumOnArray(double &array[], int total, int period, int shift) { + static double iMomentumOnArray(CONST_ARRAY_REF(double, array), int total, int period, int shift) { #ifdef __MQL4__ return ::iMomentumOnArray(array, total, period, shift); #else Indi_PriceFeeder indi_price_feeder(array); - return iMomentumOnIndicator(&indi_price_feeder, NULL, NULL, period, /*unused*/ PRICE_OPEN, shift); + return iMomentumOnIndicator(&indi_price_feeder, NULL, PERIOD_CURRENT, period, /*unused*/ PRICE_OPEN, shift); #endif } diff --git a/Indicators/Indi_PriceFeeder.mqh b/Indicators/Indi_PriceFeeder.mqh index aa6f683b0..481f8654c 100644 --- a/Indicators/Indi_PriceFeeder.mqh +++ b/Indicators/Indi_PriceFeeder.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" #include "../Storage/Dict/Buffer/BufferStruct.h" @@ -27,7 +32,7 @@ // Structs. struct IndiPriceFeederParams : IndicatorParams { ENUM_APPLIED_PRICE applied_price; - double price_data[]; + ARRAY(double, price_data); /** * Struct constructor. @@ -39,7 +44,7 @@ struct IndiPriceFeederParams : IndicatorParams { * * @todo Use more modes (full OHCL). */ - IndiPriceFeederParams(const double& _price_data[], int _total = 0) : IndicatorParams(INDI_PRICE_FEEDER) { + IndiPriceFeederParams(CONST_ARRAY_REF(double, _price_data), int _total = 0) : IndicatorParams(INDI_PRICE_FEEDER) { ArrayCopy(price_data, _price_data, 0, 0, _total == 0 ? WHOLE_ARRAY : _total); }; IndiPriceFeederParams(IndiPriceFeederParams& _params) { THIS_REF = _params; }; @@ -57,8 +62,9 @@ class Indi_PriceFeeder : public Indicator { IndicatorData* _indi_src = NULL, int _indi_src_mode = 0) : Indicator(_p, IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_PRICE, _indi_src_mode), _indi_src){}; - Indi_PriceFeeder(const double& _price_data[], int _total = 0, ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, - IndicatorData* _indi_src = NULL, int _indi_src_mode = 0) + Indi_PriceFeeder(CONST_ARRAY_REF(double, _price_data), int _total = 0, + ENUM_IDATA_SOURCE_TYPE _idstype = IDATA_BUILTIN, IndicatorData* _indi_src = NULL, + int _indi_src_mode = 0) : Indicator(IndiPriceFeederParams(), IndicatorDataParams::GetInstance(1, TYPE_DOUBLE, _idstype, IDATA_RANGE_PRICE, _indi_src_mode), _indi_src) {} @@ -78,7 +84,9 @@ class Indi_PriceFeeder : public Indicator { */ unsigned int GetPossibleDataModes() override { return IDATA_BUILTIN; } - void SetPrices(const double& _price_data[], int _total = 0) { iparams = IndiPriceFeederParams(_price_data, _total); } + void SetPrices(CONST_ARRAY_REF(double, _price_data), int _total = 0) { + iparams = IndiPriceFeederParams(_price_data, _total); + } /** * Checks whether indicator has a valid value for a given shift. diff --git a/Indicators/Indi_StdDev.mqh b/Indicators/Indi_StdDev.mqh index f62d96fa8..5ba32d176 100644 --- a/Indicators/Indi_StdDev.mqh +++ b/Indicators/Indi_StdDev.mqh @@ -115,7 +115,7 @@ class Indi_StdDev : public Indicator { Indi_StdDev *_obj = NULL) { INDI_REQUIRE_BARS_OR_RETURN_EMPTY(_source, _ma_period + _ma_shift + _shift) - double _indi_value_buffer[]; + ARRAY(double, _indi_value_buffer); double _std_dev; int i; @@ -137,16 +137,17 @@ class Indi_StdDev : public Indicator { return _std_dev; } - static double iStdDevOnArray(const double &price[], double MAprice, int period) { + static double iStdDevOnArray(CONST_ARRAY_REF(double, price), double MAprice, int period) { double std_dev = 0; int i; - for (i = 0; i < period; ++i) std_dev += MathPow(price[i] - MAprice, 2); + for (i = 0; i < period; ++i) std_dev += MathPow(price[i] - MAprice, (double)2); return MathSqrt(std_dev / period); } - static double iStdDevOnArray(double &array[], int total, int ma_period, int ma_shift, int ma_method, int shift) { + static double iStdDevOnArray(ARRAY_REF(double, array), int total, int ma_period, int ma_shift, + ENUM_MA_METHOD ma_method, int shift) { #ifdef __MQL4__ return ::iStdDevOnArray(array, total, ma_period, ma_shift, ma_method, shift); #endif @@ -189,17 +190,17 @@ class Indi_StdDev : public Indicator { /** * Standard Deviation On Array is just a normal standard deviation over MA with a selected method. */ - static double iStdDevOnArray(const double &price[], int period, ENUM_MA_METHOD ma_method = MODE_SMA) { + static double iStdDevOnArray(CONST_ARRAY_REF(double, price), int period, ENUM_MA_METHOD ma_method = MODE_SMA) { string _key = "Indi_PriceFeeder"; Indi_PriceFeeder *_indi_price_feeder; if (!ObjectsCache::TryGet(_key, _indi_price_feeder)) { - IndiPriceFeederParams _params(); - IndicatorData *_indi_pf = new Indi_PriceFeeder(_params); + IndiPriceFeederParams _params; + Indi_PriceFeeder *_indi_pf = new Indi_PriceFeeder(_params); _indi_price_feeder = ObjectsCache::Set(_key, _indi_pf); } // Filling reused price feeder. - _indi_price_feeder.SetPrices(price); + _indi_price_feeder PTR_DEREF SetPrices(price); IndiMAParams ma_params(period, 0, ma_method, PRICE_OPEN); @@ -214,7 +215,7 @@ class Indi_StdDev : public Indicator { return _result; */ - Print(__FUNCTION__ + " must be refactored!"); + Print(string(__FUNCTION__) + " must be refactored!"); DebugBreak(); return 0; } @@ -324,7 +325,8 @@ double iStdDev(string _symbol, int _tf, int _ma_period, int _ma_shift, int _ma_m return Indi_StdDev::iStdDev(_symbol, (ENUM_TIMEFRAMES)_tf, _ma_period, _ma_shift, (ENUM_MA_METHOD)_ma_method, (ENUM_APPLIED_PRICE)_ap, _shift); } -double iStdDevOnArray(double &_arr[], int _total, int _ma_period, int _ma_shift, int _ma_method, int _abs_shift) { +double iStdDevOnArray(ARRAY_REF(double, _arr), int _total, int _ma_period, int _ma_shift, int _ma_method, + int _abs_shift) { ResetLastError(); return Indi_StdDev::iStdDevOnArray(_arr, _total, _ma_period, _ma_shift, (ENUM_MA_METHOD)_ma_method, _abs_shift); } diff --git a/Indicators/Price/Indi_AppliedPrice.h b/Indicators/Price/Indi_AppliedPrice.h index 834ea938f..df5249d28 100644 --- a/Indicators/Price/Indi_AppliedPrice.h +++ b/Indicators/Price/Indi_AppliedPrice.h @@ -79,8 +79,8 @@ class Indi_AppliedPrice : public Indicator { unsigned int GetPossibleDataModes() override { return IDATA_INDICATOR; } static double iAppliedPriceOnIndicator(IndicatorData *_indi, ENUM_APPLIED_PRICE _applied_price, int _shift = 0) { - double _ohlc[4]; - _indi[_shift].GetArray(_ohlc, 4); + ARRAY(double, _ohlc); + PTR_TO_REF(_indi)[_shift].GetArray(_ohlc, 4); return BarOHLC::GetAppliedPrice(_applied_price, _ohlc[0], _ohlc[1], _ohlc[2], _ohlc[3]); } diff --git a/Indicators/Price/Indi_MA.h b/Indicators/Price/Indi_MA.h index de095993f..9a41ecf8a 100644 --- a/Indicators/Price/Indi_MA.h +++ b/Indicators/Price/Indi_MA.h @@ -149,8 +149,8 @@ class Indi_MA : public Indicator { /** * Calculates MA on the array of values. Cache is optional. */ - static double iMAOnArray(ARRAY_REF(double, price), int total, int ma_period, int ma_shift, int ma_method, int shift, - IndiBufferCache *cache = NULL) { + static double iMAOnArray(ARRAY_REF(double, price), int total, int ma_period, int ma_shift, ENUM_MA_METHOD ma_method, + int shift, IndiBufferCache *cache = NULL) { #ifdef __MQL4__ return ::iMAOnArray(price, total, ma_period, ma_shift, ma_method, shift); #else @@ -166,8 +166,9 @@ class Indi_MA : public Indicator { /** * Calculates MA on the array of values. */ - static double iMAOnArray(ValueStorage &price, int total, int ma_period, int ma_shift, int ma_method, - int shift, IndiBufferCache *_cache = NULL, bool recalculate = false) { + static double iMAOnArray(ValueStorage &price, int total, int ma_period, int ma_shift, + ENUM_MA_METHOD ma_method, int shift, IndiBufferCache *_cache = NULL, + bool recalculate = false) { if (_cache != NULL) { _cache PTR_DEREF SetPriceBuffer(price); @@ -179,9 +180,8 @@ class Indi_MA : public Indicator { _cache PTR_DEREF ResetPrevCalculated(); } - _cache PTR_DEREF SetPrevCalculated(Indi_MA::Calculate(INDICATOR_CALCULATE_GET_PARAMS_SHORT, - PTR_TO_REF(_cache PTR_DEREF GetBuffer(0)), - ma_method, ma_period)); + _cache PTR_DEREF SetPrevCalculated(Indi_MA::Calculate( + INDICATOR_CALCULATE_GET_PARAMS_SHORT, _cache PTR_DEREF GetBuffer(0), ma_method, ma_period)); // Returns value from the first calculation buffer. // Returns first value for as-series array or last value for non-as-series array. @@ -789,13 +789,13 @@ class Indi_MA : public Indicator { #ifndef __MQL4__ // Defines global functions (for MQL4 backward compability). -double iMA(string _symbol, int _tf, int _ma_period, int _ma_shift, int _ma_method, int _ap, int _shift) { +double iMA(string _symbol, int _tf, int _ma_period, int _ma_shift, ENUM_MA_METHOD _ma_method, int _ap, int _shift) { ResetLastError(); - return Indi_MA::iMA(_symbol, (ENUM_TIMEFRAMES)_tf, _ma_period, _ma_shift, (ENUM_MA_METHOD)_ma_method, - (ENUM_APPLIED_PRICE)_ap, _shift); + return Indi_MA::iMA(_symbol, (ENUM_TIMEFRAMES)_tf, _ma_period, _ma_shift, _ma_method, (ENUM_APPLIED_PRICE)_ap, + _shift); } -double iMAOnArray(ARRAY_REF(double, _arr), int _total, int _period, int _ma_shift, int _ma_method, int _abs_shift, - IndiBufferCache *_cache = NULL) { +double iMAOnArray(ARRAY_REF(double, _arr), int _total, int _period, int _ma_shift, ENUM_MA_METHOD _ma_method, + int _abs_shift, IndiBufferCache *_cache = NULL) { ResetLastError(); return Indi_MA::iMAOnArray(_arr, _total, _period, _ma_shift, _ma_method, _abs_shift, _cache); } diff --git a/Indicators/Price/Indi_Price.h b/Indicators/Price/Indi_Price.h index 35db3ed59..0e2c1d67f 100644 --- a/Indicators/Price/Indi_Price.h +++ b/Indicators/Price/Indi_Price.h @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../../Indicator/Indicator.h" #include "../../Platform/Platform.h" diff --git a/Indicators/PriceRange/Indi_Bands.h b/Indicators/PriceRange/Indi_Bands.h index 75965bf4a..6b9612347 100644 --- a/Indicators/PriceRange/Indi_Bands.h +++ b/Indicators/PriceRange/Indi_Bands.h @@ -153,21 +153,22 @@ class Indi_Bands : public Indicator { static double iBandsOnArray(INDICATOR_CALCULATE_PARAMS_SHORT, int _period, double _deviation, int _bands_shift, int _mode, int _abs_shift, IndiBufferCache *_cache, bool _recalculate = false) { - _cache.SetPriceBuffer(_price); + _cache PTR_DEREF SetPriceBuffer(_price); - if (!_cache.HasBuffers()) { - _cache.AddBuffer>(4); + if (!_cache PTR_DEREF HasBuffers()) { + _cache PTR_DEREF AddBuffer>(4); } if (_recalculate) { - _cache.ResetPrevCalculated(); + _cache PTR_DEREF ResetPrevCalculated(); } - _cache.SetPrevCalculated(Indi_Bands::Calculate(INDICATOR_CALCULATE_GET_PARAMS_SHORT, _cache.GetBuffer(0), - _cache.GetBuffer(1), _cache.GetBuffer(2), - _cache.GetBuffer(3), _period, _bands_shift, _deviation)); + _cache PTR_DEREF SetPrevCalculated( + Indi_Bands::Calculate(INDICATOR_CALCULATE_GET_PARAMS_SHORT, _cache PTR_DEREF GetBuffer(0), + _cache PTR_DEREF GetBuffer(1), _cache PTR_DEREF GetBuffer(2), + _cache PTR_DEREF GetBuffer(3), _period, _bands_shift, _deviation)); - return _cache.GetTailValue(_mode, _abs_shift); + return _cache PTR_DEREF GetTailValue(_mode, _abs_shift); } /** @@ -293,30 +294,30 @@ class Indi_Bands : public Indicator { virtual IndicatorData *FetchDataSource(ENUM_INDICATOR_TYPE _id) { IndicatorData *_result = NULL; if (_id == INDI_BANDS) { - IndiBandsParams bands_params(); - _result = Indi_Bands(bands_params); + IndiBandsParams bands_params; + _result = new Indi_Bands(bands_params); } else if (_id == INDI_CCI) { - IndiCCIParams cci_params(); + IndiCCIParams cci_params; _result = new Indi_CCI(cci_params); } else if (_id == INDI_ENVELOPES) { - IndiEnvelopesParams env_params(); + IndiEnvelopesParams env_params; _result = new Indi_Envelopes(env_params); } else if (_id == INDI_MOMENTUM) { - IndiMomentumParams mom_params(); + IndiMomentumParams mom_params; _result = new Indi_Momentum(mom_params); } else if (_id == INDI_MA) { - IndiMAParams ma_params(); + IndiMAParams ma_params; _result = new Indi_MA(ma_params); } else if (_id == INDI_RSI) { - IndiRSIParams _rsi_params(); + IndiRSIParams _rsi_params; _result = new Indi_RSI(_rsi_params); } else if (_id == INDI_STDDEV) { - IndiStdDevParams stddev_params(); + IndiStdDevParams stddev_params; _result = new Indi_StdDev(stddev_params); } if (_result != nullptr) { - _result.SetDataSource(GetCandle()); + _result PTR_DEREF SetDataSource(GetCandle()); return _result; } diff --git a/Indicators/PriceRange/Indi_Envelopes.h b/Indicators/PriceRange/Indi_Envelopes.h index eb039e3e2..197fce0aa 100644 --- a/Indicators/PriceRange/Indi_Envelopes.h +++ b/Indicators/PriceRange/Indi_Envelopes.h @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../../Indicator/Indicator.h" #include "../../Storage/Singleton.h" @@ -142,18 +147,19 @@ class Indi_Envelopes : public Indicator { int _mode, // (MT4 _mode): 0 - MODE_MAIN, 1 - MODE_UPPER, 2 - MODE_LOWER; (MT5 // _mode): 0 - UPPER_LINE, 1 - LOWER_LINE int _shift = 0) { - return iEnvelopesOnArray(_source.GetSpecificAppliedPriceValueStorage(_ap, _target), 0, _ma_period, _ma_method, - _ma_shift, _deviation, _mode, _shift, _target PTR_DEREF GetCache()); + return iEnvelopesOnArray(_source PTR_DEREF GetSpecificAppliedPriceValueStorage(_ap, _target), 0, _ma_period, + _ma_method, _ma_shift, _deviation, _mode, _shift, _target PTR_DEREF GetCache()); } - static double iEnvelopesOnArray(double &price[], int total, int ma_period, ENUM_MA_METHOD ma_method, int ma_shift, - double deviation, int mode, int shift, IndiBufferCache *_cache = NULL) { + static double iEnvelopesOnArray(CONST_ARRAY_REF(double, price), int total, int ma_period, ENUM_MA_METHOD ma_method, + int ma_shift, double deviation, int mode, int shift, + IndiBufferCache *_cache = NULL) { #ifdef __MQL4__ return iEnvelopesOnArray(price, total, ma_period, ma_method, ma_shift, deviation, mode, shift); #else // We're reusing the same native array for each consecutive calculation. NativeValueStorage *_price = Singleton >::Get(); - _price.SetData(price); + _price PTR_DEREF SetData(price); return iEnvelopesOnArray(_price, total, ma_period, ma_method, ma_shift, deviation, mode, shift); #endif @@ -167,13 +173,14 @@ class Indi_Envelopes : public Indicator { return DBL_MIN; } - double _indi_value_buffer[]; + ARRAY(double, _indi_value_buffer); double _result; ArrayResize(_indi_value_buffer, _ma_period); // MA will use sub-cache of the given one. - _result = Indi_MA::iMAOnArray(_price, 0, _ma_period, _ma_shift, _ma_method, _shift, _cache.GetSubCache(0)); + _result = Indi_MA::iMAOnArray(PTR_TO_REF(_price), 0, _ma_period, _ma_shift, _ma_method, _shift, + _cache PTR_DEREF GetSubCache(0)); switch (_mode) { case LINE_UPPER: @@ -324,8 +331,8 @@ double iEnvelopes(string _symbol, int _tf, int _period, int _ma_method, int _ma_ return Indi_Envelopes::iEnvelopes(_symbol, (ENUM_TIMEFRAMES)_tf, _period, (ENUM_MA_METHOD)_ma_method, _ma_shift, (ENUM_APPLIED_PRICE)_ap, _deviation, _mode, _shift); } -double iEnvelopesOnArray(double &_arr[], int _total, int _ma_period, int _ma_method, int _ma_shift, double _deviation, - int _mode, int _shift) { +double iEnvelopesOnArray(CONST_ARRAY_REF(double, _arr), int _total, int _ma_period, int _ma_method, int _ma_shift, + double _deviation, int _mode, int _shift) { ResetLastError(); return Indi_Envelopes::iEnvelopesOnArray(_arr, _total, _ma_period, (ENUM_MA_METHOD)_ma_method, _ma_shift, _deviation, _mode, _shift); diff --git a/Indicators/PriceRange/Indi_Pivot.h b/Indicators/PriceRange/Indi_Pivot.h index f19c7fa4a..427fd5382 100644 --- a/Indicators/PriceRange/Indi_Pivot.h +++ b/Indicators/PriceRange/Indi_Pivot.h @@ -157,10 +157,10 @@ class Indi_Pivot : public Indicator { // must have at least 4 buffers and define OHLC in the first 4 buffers. // Indi_Price is an example of such indicator. if (HasDataSource()) { - _ohlc.open = GetDataSource().GetValue(PRICE_OPEN, _shift); - _ohlc.high = GetDataSource().GetValue(PRICE_HIGH, _shift); - _ohlc.low = GetDataSource().GetValue(PRICE_LOW, _shift); - _ohlc.close = GetDataSource().GetValue(PRICE_CLOSE, _shift); + _ohlc.open = GetDataSource() PTR_DEREF GetValue(PRICE_OPEN, _shift); + _ohlc.high = GetDataSource() PTR_DEREF GetValue(PRICE_HIGH, _shift); + _ohlc.low = GetDataSource() PTR_DEREF GetValue(PRICE_LOW, _shift); + _ohlc.close = GetDataSource() PTR_DEREF GetValue(PRICE_CLOSE, _shift); } break; default: diff --git a/Indicators/Special/Indi_Custom.mqh b/Indicators/Special/Indi_Custom.mqh index c12f5390a..4d8984f44 100644 --- a/Indicators/Special/Indi_Custom.mqh +++ b/Indicators/Special/Indi_Custom.mqh @@ -40,7 +40,7 @@ // Defines struct to store indicator parameter values. struct IndiCustomParams : public IndicatorParams { - DataParamEntry iargs[]; + ARRAY(DataParamEntry, iargs); // Struct constructors. IndiCustomParams(string _filepath = INDI_CUSTOM_PATH, int _shift = 0) : IndicatorParams(INDI_CUSTOM) { custom_indi_name = _filepath; @@ -61,7 +61,7 @@ struct IndiCustomParams : public IndicatorParams { } iargs[_index + 1] = _entry; } - void SetParams(DataParamEntry &_entries[]) { + void SetParams(CONST_ARRAY_REF(DataParamEntry, _entries)) { for (int i = 0; i < ArraySize(_entries); i++) { iargs[i] = _entries[i]; } diff --git a/Math/Math.extern.h b/Math/Math.extern.h index cfe6d3b32..da468d94e 100644 --- a/Math/Math.extern.h +++ b/Math/Math.extern.h @@ -44,6 +44,10 @@ T MathPow(T base, T exponent) { return std::pow(base, exponent); } template +T MathSqrt(T value) { + return std::sqrt(value); +} +template T round(T value) { return std::round(value); } diff --git a/Pattern.struct.h b/Pattern.struct.h index b304263cb..97c756d28 100644 --- a/Pattern.struct.h +++ b/Pattern.struct.h @@ -302,6 +302,12 @@ struct PatternCandle2 : PatternCandle { SetPattern(_enum, CheckPattern(_enum, _c)); } } + PatternCandle2(CONST_FIXED_ARRAY_REF(BarOHLC, _c, 8)) : PatternCandle(PATTERN_2CANDLE_NONE) { + for (int i = 0; i < sizeof(int) * 8; i++) { + ENUM_PATTERN_2CANDLE _enum = (ENUM_PATTERN_2CANDLE)(1 << i); + SetPattern(_enum, CheckPattern(_enum, _c)); + } + } // Calculation methods. static bool CheckPattern(ENUM_PATTERN_2CANDLE _enum, CONST_ARRAY_REF(BarOHLC, _c)) { switch (_enum) { @@ -411,6 +417,12 @@ struct PatternCandle3 : PatternCandle { SetPattern(_enum, CheckPattern(_enum, _c)); } } + PatternCandle3(CONST_FIXED_ARRAY_REF(BarOHLC, _c, 8)) : PatternCandle(PATTERN_3CANDLE_NONE) { + for (int i = 0; i < sizeof(int) * 8; i++) { + ENUM_PATTERN_3CANDLE _enum = (ENUM_PATTERN_3CANDLE)(1 << i); + SetPattern(_enum, CheckPattern(_enum, _c)); + } + } // Calculation methods. static bool CheckPattern(ENUM_PATTERN_3CANDLE _enum, CONST_ARRAY_REF(BarOHLC, _c)) { switch (_enum) { @@ -527,6 +539,12 @@ struct PatternCandle4 : PatternCandle { SetPattern(_enum, CheckPattern(_enum, _c)); } } + PatternCandle4(CONST_FIXED_ARRAY_REF(BarOHLC, _c, 8)) : PatternCandle(PATTERN_4CANDLE_NONE) { + for (int i = 0; i < sizeof(int) * 8; i++) { + ENUM_PATTERN_4CANDLE _enum = (ENUM_PATTERN_4CANDLE)(1 << i); + SetPattern(_enum, CheckPattern(_enum, _c)); + } + } // Calculation methods. static bool CheckPattern(ENUM_PATTERN_4CANDLE _enum, CONST_ARRAY_REF(BarOHLC, _c)) { PatternCandle3 _c3(_c); @@ -693,6 +711,12 @@ struct PatternCandle5 : PatternCandle { SetPattern(_enum, CheckPattern(_enum, _c)); } } + PatternCandle5(CONST_FIXED_ARRAY_REF(BarOHLC, _c, 8)) : PatternCandle(PATTERN_5CANDLE_NONE) { + for (int i = 0; i < sizeof(int) * 8; i++) { + ENUM_PATTERN_5CANDLE _enum = (ENUM_PATTERN_5CANDLE)(1 << i); + SetPattern(_enum, CheckPattern(_enum, _c)); + } + } // Calculation methods. static bool CheckPattern(ENUM_PATTERN_5CANDLE _enum, CONST_ARRAY_REF(BarOHLC, _c)) { switch (_enum) { @@ -844,6 +868,12 @@ struct PatternCandle6 : PatternCandle { SetPattern(_enum, CheckPattern(_enum, _c)); } } + PatternCandle6(CONST_FIXED_ARRAY_REF(BarOHLC, _c, 8)) : PatternCandle(PATTERN_6CANDLE_NONE) { + for (int i = 0; i < sizeof(int) * 8; i++) { + ENUM_PATTERN_6CANDLE _enum = (ENUM_PATTERN_6CANDLE)(1 << i); + SetPattern(_enum, CheckPattern(_enum, _c)); + } + } // Calculation methods. static bool CheckPattern(ENUM_PATTERN_6CANDLE _enum, CONST_ARRAY_REF(BarOHLC, _c)) { switch (_enum) { @@ -863,6 +893,12 @@ struct PatternCandle7 : PatternCandle { SetPattern(_enum, CheckPattern(_enum, _c)); } } + PatternCandle7(CONST_FIXED_ARRAY_REF(BarOHLC, _c, 8)) : PatternCandle(PATTERN_7CANDLE_NONE) { + for (int i = 0; i < sizeof(int) * 8; i++) { + ENUM_PATTERN_7CANDLE _enum = (ENUM_PATTERN_7CANDLE)(1 << i); + SetPattern(_enum, CheckPattern(_enum, _c)); + } + } // Calculation methods. static bool CheckPattern(ENUM_PATTERN_7CANDLE _enum, CONST_ARRAY_REF(BarOHLC, _c)) { switch (_enum) { @@ -882,6 +918,12 @@ struct PatternCandle8 : PatternCandle { SetPattern(_enum, CheckPattern(_enum, _c)); } } + PatternCandle8(CONST_FIXED_ARRAY_REF(BarOHLC, _c, 8)) : PatternCandle(PATTERN_8CANDLE_NONE) { + for (int i = 0; i < sizeof(int) * 8; i++) { + ENUM_PATTERN_8CANDLE _enum = (ENUM_PATTERN_8CANDLE)(1 << i); + SetPattern(_enum, CheckPattern(_enum, _c)); + } + } // Calculation methods. static bool CheckPattern(ENUM_PATTERN_8CANDLE _enum, CONST_ARRAY_REF(BarOHLC, _c)) { switch (_enum) { @@ -901,6 +943,12 @@ struct PatternCandle9 : PatternCandle { SetPattern(_enum, CheckPattern(_enum, _c)); } } + PatternCandle9(CONST_FIXED_ARRAY_REF(BarOHLC, _c, 8)) : PatternCandle(PATTERN_9CANDLE_NONE) { + for (int i = 0; i < sizeof(int) * 8; i++) { + ENUM_PATTERN_9CANDLE _enum = (ENUM_PATTERN_9CANDLE)(1 << i); + SetPattern(_enum, CheckPattern(_enum, _c)); + } + } // Calculation methods. static bool CheckPattern(ENUM_PATTERN_9CANDLE _enum, CONST_ARRAY_REF(BarOHLC, _c)) { switch (_enum) { @@ -920,6 +968,12 @@ struct PatternCandle10 : PatternCandle { SetPattern(_enum, CheckPattern(_enum, _c)); } } + PatternCandle10(CONST_FIXED_ARRAY_REF(BarOHLC, _c, 8)) : PatternCandle(PATTERN_10CANDLE_NONE) { + for (int i = 0; i < sizeof(int) * 8; i++) { + ENUM_PATTERN_10CANDLE _enum = (ENUM_PATTERN_10CANDLE)(1 << i); + SetPattern(_enum, CheckPattern(_enum, _c)); + } + } // Calculation methods. static bool CheckPattern(ENUM_PATTERN_10CANDLE _enum, CONST_ARRAY_REF(BarOHLC, _c)) { switch (_enum) { @@ -965,7 +1019,7 @@ struct PatternEntry { pattern8(_c), pattern9(_c), pattern10(_c) {} - PatternEntry(ARRAY_REF(BarOHLC, _c)) + PatternEntry(FIXED_ARRAY_REF(BarOHLC, _c, 8)) : pattern1(_c[0]), pattern2(_c), pattern3(_c), diff --git a/Platform/Order.struct.h b/Platform/Order.struct.h index be4d53b2b..a1773c1bb 100644 --- a/Platform/Order.struct.h +++ b/Platform/Order.struct.h @@ -31,11 +31,11 @@ #endif // Includes. +#include "../Exchange/SymbolInfo/SymbolInfo.struct.static.h" +#include "../Serializer/Serializer.h" #include "../Storage/Data.struct.h" #include "Order.enum.h" #include "Platform.extern.h" -#include "../Serializer/Serializer.h" -#include "../Exchange/SymbolInfo/SymbolInfo.struct.static.h" #include "Terminal.h" #ifndef __MQL5__ @@ -130,7 +130,7 @@ struct OrderParams { bool _result = true; int _size = ArraySize(_cond_close); if (_size <= _index) { - _result &= ArrayResize(_cond_close, _size + 1); + _result &= ArrayResize(_cond_close, _size + 1) == _size + 1; } return _result; } diff --git a/Std.h b/Std.h index 5a0813afc..181592c58 100644 --- a/Std.h +++ b/Std.h @@ -56,6 +56,7 @@ #define PTR_ATTRIB(O, A) O.A #define PTR_ATTRIB2(O, A, B) O.A.B #define PTR_TO_REF(PTR) PTR +#define REF_TO_PTR(PTR) PTR #define MAKE_REF_FROM_PTR(TYPE, NAME, PTR) TYPE* NAME = PTR #define nullptr NULL #define REF_DEREF .Ptr(). @@ -69,6 +70,7 @@ #define PTR_ATTRIB(O, A) O->A #define PTR_ATTRIB2(O, A, B) O->A->B #define PTR_TO_REF(PTR) (*PTR) +#define REF_TO_PTR(PTR) (&PTR) #define MAKE_REF_FROM_PTR(TYPE, NAME, PTR) TYPE& NAME = PTR #define REF_DEREF .Ptr()-> #define int64 long long @@ -95,7 +97,10 @@ /** * Reference to object. */ -#define CONST_REF_TO(T) const T + +#define REF_TO(T) T* +#define CONST_REF_TO(T) const REF_TO(T) +#define REF_CAST(T) (T*) /** * Reference to the array. @@ -118,11 +123,15 @@ #define ARRAY(T, N) T N[] #define FIXED_ARRAY(T, N, SIZE) T N[SIZE] +#define CONST_FIXED_ARRAY_REF(T, N, S) const FIXED_ARRAY_REF(T, N, S) + #else /** * Reference to object. */ -#define CONST_REF_TO(T) const T& +#define REF_TO(T) T& +#define CONST_REF_TO(T) const REF_TO(T) +#define REF_CAST(T) (T&) /** @@ -136,6 +145,7 @@ #define FIXED_ARRAY_REF(T, N, S) T(&N)[S] #define CONST_ARRAY_REF(T, N) const _cpp_array& N +#define CONST_FIXED_ARRAY_REF(T, N, S) const FIXED_ARRAY_REF(T, N, S) /** * Array definition. @@ -169,7 +179,7 @@ class _cpp_array { _cpp_array() {} template - _cpp_array(const T REF(_arr)[size]) { + _cpp_array(CONST_FIXED_ARRAY_REF(T, _arr, size)) { for (const auto& _item : _arr) m_data.push_back(_item); } diff --git a/Storage/Array.extern.h b/Storage/Array.extern.h index 6d546c059..976004818 100644 --- a/Storage/Array.extern.h +++ b/Storage/Array.extern.h @@ -34,7 +34,7 @@ int ArraySize(const ARRAY_REF(T, _array)) { } template -constexpr int ArraySize(const T REF(_array)[size]) { +constexpr int ArraySize(CONST_FIXED_ARRAY_REF(T, _array, size)) { return size; } @@ -51,7 +51,7 @@ bool ArraySetAsSeries(ARRAY_REF(T, _array), bool _flag) { } template -bool ArrayGetAsSeries(ARRAY_REF(T, _array)) { +bool ArrayGetAsSeries(CONST_ARRAY_REF(T, _array)) { return _array.getIsSeries(); } diff --git a/Storage/Cache/IndiBufferCache.h b/Storage/Cache/IndiBufferCache.h index 99831d74c..09cad345a 100644 --- a/Storage/Cache/IndiBufferCache.h +++ b/Storage/Cache/IndiBufferCache.h @@ -102,7 +102,9 @@ class IndiBufferCache : public Dynamic { /** * Returns size of the current price buffer. */ - int GetTotal() { return price_buffer != NULL ? ArraySize(price_buffer) : ArraySize(price_open_buffer); } + int GetTotal() { + return price_buffer != NULL ? ArraySize(PTR_TO_REF(price_buffer)) : ArraySize(PTR_TO_REF(price_open_buffer)); + } /** * Returns number of already calculated prices (bars). @@ -154,19 +156,20 @@ class IndiBufferCache : public Dynamic { * Returns given calculation buffer. */ template - ValueStorage *GetBuffer(int _index) { - return (ValueStorage *)buffers[_index]; + REF_TO(ValueStorage) + GetBuffer(int _index) { + return PTR_TO_REF((ValueStorage *)buffers[_index]); } /** * Returns main price buffer. */ - ValueStorage *GetPriceBuffer() { return price_buffer; } + REF_TO(ValueStorage) GetPriceBuffer() { return PTR_TO_REF(price_buffer); } /** * Returns given price buffer. */ - ValueStorage *GetPriceBuffer(ENUM_APPLIED_PRICE _applied_price) { + REF_TO(ValueStorage) GetPriceBuffer(ENUM_APPLIED_PRICE _applied_price) { switch (_applied_price) { case PRICE_OPEN: return price_open_buffer; @@ -242,9 +245,9 @@ class IndiBufferCache : public Dynamic { */ template D GetTailValue(int _buffer_index, int _shift) { - ValueStorage *_buff = GetBuffer(_buffer_index); - int _index = _buff PTR_DEREF IsSeries() ? _shift : (ArraySize(_buff) - _shift - 1); - return _buff[_index] PTR_DEREF Get(); + ValueStorage *_buff = REF_TO_PTR(GetBuffer(_buffer_index)); + int _index = _buff PTR_DEREF IsSeries() ? _shift : (ArraySize(PTR_TO_REF(_buff)) - _shift - 1); + return PTR_TO_REF(_buff)[_index].Get(); } /** diff --git a/Storage/Cache/ObjectsCache.h b/Storage/Cache/ObjectsCache.h index 05f1ce2eb..dc43c872a 100644 --- a/Storage/Cache/ObjectsCache.h +++ b/Storage/Cache/ObjectsCache.h @@ -64,12 +64,12 @@ class ObjectsCache { * Tries to retrieve pointer to object for a given key. Returns true if object did exist. */ static bool TryGet(string& key, C*& out_ptr) { - int position; - if (!GetObjects().KeyExists(key, position)) { + unsigned int position; + if (!GetObjects() PTR_DEREF KeyExists(key, position)) { out_ptr = NULL; return false; } else { - out_ptr = GetObjects().GetByPos(position); + out_ptr = GetObjects() PTR_DEREF GetByPos(position); return true; } } @@ -78,7 +78,7 @@ class ObjectsCache { * Stores object pointer with a given key. */ static C* Set(string& key, C* ptr) { - GetObjects().Set(key, ptr); + GetObjects() PTR_DEREF Set(key, ptr); return ptr; } }; diff --git a/Storage/ValueStorage.h b/Storage/ValueStorage.h index aff953856..ab43f81e5 100644 --- a/Storage/ValueStorage.h +++ b/Storage/ValueStorage.h @@ -60,13 +60,14 @@ enum ENUM_IPEAK { IPEAK_LOWEST, IPEAK_HIGHEST }; #define INDICATOR_CALCULATE_METHOD_PARAMS_SHORT \ const int rates_total, const int prev_calculated, const int begin, ValueStorage &price -#define INDICATOR_CALCULATE_GET_PARAMS_LONG \ - _cache.GetTotal(), _cache.GetPrevCalculated(), _time, _cache.GetPriceBuffer(PRICE_OPEN), \ - _cache.GetPriceBuffer(PRICE_HIGH), _cache.GetPriceBuffer(PRICE_LOW), _cache.GetPriceBuffer(PRICE_CLOSE), \ - _tick_volume, _volume, _spread +#define INDICATOR_CALCULATE_GET_PARAMS_LONG \ + _cache PTR_DEREF GetTotal(), _cache PTR_DEREF GetPrevCalculated(), _time, \ + _cache PTR_DEREF GetPriceBuffer(PRICE_OPEN), _cache PTR_DEREF GetPriceBuffer(PRICE_HIGH), \ + _cache PTR_DEREF GetPriceBuffer(PRICE_LOW), _cache PTR_DEREF GetPriceBuffer(PRICE_CLOSE), _tick_volume, _volume, \ + _spread #define INDICATOR_CALCULATE_GET_PARAMS_SHORT \ - _cache PTR_DEREF GetTotal(), _cache PTR_DEREF GetPrevCalculated(), 0, PTR_TO_REF(_cache PTR_DEREF GetPriceBuffer()) + _cache PTR_DEREF GetTotal(), _cache PTR_DEREF GetPrevCalculated(), 0, _cache PTR_DEREF GetPriceBuffer() #define INDICATOR_CALCULATE_POPULATE_CACHE(INDI, KEY) \ IndiBufferCache *_cache; \ @@ -82,9 +83,9 @@ enum ENUM_IPEAK { IPEAK_LOWEST, IPEAK_HIGHEST }; * (the one that doesn't exist in the hierarchy). */ #define INDICATOR_CALCULATE_POPULATE_PARAMS_AND_CACHE_SHORT(INDI, APPLIED_PRICE, KEY) \ - ValueStorage *_price; \ + ValueStorage *_price_ptr; \ if (INDI PTR_DEREF GetSuitableDataSource() PTR_DEREF HasSpecificAppliedPriceValueStorage(APPLIED_PRICE, INDI)) { \ - _price = \ + _price_ptr = \ INDI PTR_DEREF GetSuitableDataSource() PTR_DEREF GetSpecificAppliedPriceValueStorage(APPLIED_PRICE, INDI); \ } else { \ Print("Source indicator ", INDI PTR_DEREF GetFullName(), \ @@ -94,26 +95,32 @@ enum ENUM_IPEAK { IPEAK_LOWEST, IPEAK_HIGHEST }; ", AP overriden: ", EnumToString(INDI PTR_DEREF GetDataSourceAppliedType())); \ DebugBreak(); \ } \ + REF_TO(ValueStorage) _price = PTR_TO_REF(_price_ptr); \ INDICATOR_CALCULATE_POPULATE_CACHE(INDI, KEY) -#define INDICATOR_CALCULATE_POPULATE_PARAMS_AND_CACHE_LONG(INDI, KEY) \ - IndicatorData *_suitable_ds = INDI PTR_DEREF GetSuitableDataSource(); \ - ValueStorage *_time = \ - (ValueStorage *)_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_TIME); \ - ValueStorage *_tick_volume = \ - (ValueStorage *)_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_TICK_VOLUME); \ - ValueStorage *_volume = \ - (ValueStorage *)_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_VOLUME); \ - ValueStorage *_spread = \ - (ValueStorage *)_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_SPREAD); \ - ValueStorage *_price_open = \ - (ValueStorage *)_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_OPEN); \ - ValueStorage *_price_high = \ - (ValueStorage *)_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_HIGH); \ - ValueStorage *_price_low = \ - (ValueStorage *)_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_LOW); \ - ValueStorage *_price_close = \ - (ValueStorage *)_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_CLOSE); \ +#define INDICATOR_CALCULATE_POPULATE_PARAMS_AND_CACHE_LONG(INDI, KEY) \ + IndicatorData *_suitable_ds = INDI PTR_DEREF GetSuitableDataSource(); \ + ValueStorage &_time = \ + (ValueStorage &)(_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_TIME)); \ + REF_TO(ValueStorage) \ + _tick_volume = \ + REF_CAST(ValueStorage)(_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_TICK_VOLUME)); \ + REF_TO(ValueStorage) \ + _volume = REF_CAST(ValueStorage)(_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_VOLUME)); \ + REF_TO(ValueStorage) \ + _spread = REF_CAST(ValueStorage)(_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_SPREAD)); \ + REF_TO(ValueStorage) \ + _price_open = \ + REF_CAST(ValueStorage)(_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_OPEN)); \ + REF_TO(ValueStorage) \ + _price_high = \ + REF_CAST(ValueStorage)(_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_HIGH)); \ + REF_TO(ValueStorage) \ + _price_low = \ + REF_CAST(ValueStorage)(_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_LOW)); \ + REF_TO(ValueStorage) \ + _price_close = \ + REF_CAST(ValueStorage)(_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_CLOSE)); \ INDICATOR_CALCULATE_POPULATE_CACHE(INDI, KEY) #define INDICATOR_CALCULATE_POPULATED_PARAMS_LONG \ @@ -254,6 +261,52 @@ int ArrayCopy(ARRAY_REF(D, _target), ValueStorage &_source, int _dst_start = return _num_copied; } +/** + * Array-Array wrapper for ArrayCopy. + * @note It's a copy-past of the above ArrayCopy. + */ +template +int ArrayCopy(ARRAY_REF(C, _target), CONST_ARRAY_REF(C, _source), int _dst_start = 0, int _src_start = 0, + int count = WHOLE_ARRAY) { + if (count == WHOLE_ARRAY) { + count = ArraySize(_source); + } + + if (ArrayGetAsSeries(_target)) { + if ((ArraySize(_target) == 0 && _dst_start != 0) || + (ArraySize(_target) != 0 && ArraySize(_target) < _dst_start + count)) { + // The receiving array is declared as AS_SERIES, and it is of insufficient size. + SetUserError(ERR_SMALL_ASSERIES_ARRAY); + ArrayResize(_target, 0); + return 0; + } + } + + count = MathMin(count, ArraySize(_source) - _src_start); + + int _dst_required_size = _dst_start + count; + + if (ArraySize(_target) < _dst_required_size) { + ArrayResize(_target, _dst_required_size, 32); + } + + int _num_copied, t, s; + + for (_num_copied = 0, t = _dst_start, s = _src_start; _num_copied < count; ++_num_copied, ++t, ++s) { + if (s >= ArraySize(_source)) { + // No more data to copy. + break; + } + + bool _reverse = ArrayGetAsSeries(_target) != ArrayGetAsSeries(_source); + + int _source_idx = _reverse ? (ArraySize(_source) - s - 1 + _src_start) : s; + + _target[t] = _source[_source_idx]; + } + + return _num_copied; +} /** * iLowest() version working on ValueStorage. diff --git a/Storage/ValueStorage.native.h b/Storage/ValueStorage.native.h index 95f8e351c..048d82fcb 100644 --- a/Storage/ValueStorage.native.h +++ b/Storage/ValueStorage.native.h @@ -33,7 +33,7 @@ template class NativeValueStorage : public ValueStorage { // Dynamic native array. - C _values[]; + ARRAY(C, _values); public: /** @@ -49,7 +49,7 @@ class NativeValueStorage : public ValueStorage { /** * Initializes array with given one. */ - void SetData(ARRAY_REF(C, _arr)) { ArrayCopy(_values, _arr); } + void SetData(CONST_ARRAY_REF(C, _arr)) { ArrayCopy(_values, _arr); } /** * Initializes storage with given value. diff --git a/Storage/ValueStorage.spread.h b/Storage/ValueStorage.spread.h index dfab07af5..4b18fe614 100644 --- a/Storage/ValueStorage.spread.h +++ b/Storage/ValueStorage.spread.h @@ -24,6 +24,11 @@ * Spread getter version of ValueStorage. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "Cache/ObjectsCache.h" #include "ValueStorage.history.h" diff --git a/Storage/ValueStorage.tick_volume.h b/Storage/ValueStorage.tick_volume.h index 6c015ca7f..61e9845e4 100644 --- a/Storage/ValueStorage.tick_volume.h +++ b/Storage/ValueStorage.tick_volume.h @@ -24,6 +24,11 @@ * Tick volume getter version of ValueStorage. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "Cache/ObjectsCache.h" #include "ValueStorage.history.h" diff --git a/Storage/ValueStorage.time.h b/Storage/ValueStorage.time.h index b8670c40b..7756953fa 100644 --- a/Storage/ValueStorage.time.h +++ b/Storage/ValueStorage.time.h @@ -24,6 +24,11 @@ * Time getter version of ValueStorage. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Util.h" #include "Cache/ObjectsCache.h" diff --git a/Storage/ValueStorage.volume.h b/Storage/ValueStorage.volume.h index ee5f867b8..dc3d07690 100644 --- a/Storage/ValueStorage.volume.h +++ b/Storage/ValueStorage.volume.h @@ -24,6 +24,11 @@ * Volume getter version of ValueStorage. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "Cache/ObjectsCache.h" #include "ValueStorage.history.h" From 1296e80f97bf692ffb917e12a4f6f6b6a1a353ce Mon Sep 17 00:00:00 2001 From: Adrian Kierzkowski Date: Fri, 30 Jun 2023 20:13:52 +0200 Subject: [PATCH 102/109] WIP. Fixing C++ errors. Closer to the end. --- Indicators/Indi_AMA.mqh | 17 +++++---- Indicators/Indi_AO.mqh | 7 +++- Indicators/Indi_ASI.mqh | 17 +++++---- Indicators/Indi_ATR.mqh | 7 +++- Indicators/Indi_BWZT.mqh | 26 +++++++------ Indicators/Indi_CHO.mqh | 17 +++++---- Indicators/Indi_CHV.mqh | 17 +++++---- Indicators/Indi_ColorBars.mqh | 17 +++++---- Indicators/Indi_ColorCandlesDaily.mqh | 17 +++++---- Indicators/Indi_ColorLine.mqh | 17 +++++---- Indicators/Indi_CustomMovingAverage.mqh | 6 +++ Indicators/Indi_DEMA.mqh | 16 ++++---- Indicators/Indi_DetrendedPrice.mqh | 17 +++++---- Indicators/Indi_Drawer.mqh | 6 +-- Indicators/Indi_Force.mqh | 1 + Indicators/Indi_FractalAdaptiveMA.mqh | 14 +++---- Indicators/Indi_HeikenAshi.mqh | 17 +++++---- Indicators/Indi_MassIndex.mqh | 17 +++++---- Indicators/Indi_PriceChannel.mqh | 16 ++++---- Indicators/Indi_PriceVolumeTrend.mqh | 14 +++---- Indicators/Indi_RateOfChange.mqh | 14 +++---- Indicators/Indi_TEMA.mqh | 17 +++++---- Indicators/Indi_TRIX.mqh | 17 +++++---- Indicators/Indi_UltimateOscillator.mqh | 19 +++++----- Indicators/Indi_VIDYA.mqh | 15 ++++---- Indicators/Indi_VROC.mqh | 14 +++---- Indicators/Indi_Volumes.mqh | 15 ++++---- Indicators/Indi_WilliamsAD.mqh | 14 +++---- Indicators/Indi_ZigZag.mqh | 16 ++++---- Indicators/Indi_ZigZagColor.mqh | 18 ++++----- Math/Math.extern.h | 8 ++++ Platform/Platform.h | 38 +++++++++++++++++++ Platform/Terminal.define.h | 1 + Std.h | 4 +- Storage/Cache/IndiBufferCache.h | 10 ++--- Storage/ValueStorage.applied_price.h | 5 +++ Storage/ValueStorage.h | 49 +++++++++++++------------ Storage/ValueStorage.native.h | 5 +++ 38 files changed, 329 insertions(+), 233 deletions(-) diff --git a/Indicators/Indi_AMA.mqh b/Indicators/Indi_AMA.mqh index 38e9dda16..88bc711c6 100644 --- a/Indicators/Indi_AMA.mqh +++ b/Indicators/Indi_AMA.mqh @@ -122,20 +122,21 @@ class Indi_AMA : public Indicator { static double iAMAOnArray(INDICATOR_CALCULATE_PARAMS_SHORT, int _ama_period, int _fast_ema_period, int _slow_ema_period, int _ama_shift, int _mode, int _abs_shift, IndiBufferCache *_cache, bool _recalculate = false) { - _cache.SetPriceBuffer(_price); + _cache PTR_DEREF SetPriceBuffer(_price); - if (!_cache.HasBuffers()) { - _cache.AddBuffer>(1); + if (!_cache PTR_DEREF HasBuffers()) { + _cache PTR_DEREF AddBuffer>(1); } if (_recalculate) { - _cache.ResetPrevCalculated(); + _cache PTR_DEREF ResetPrevCalculated(); } - _cache.SetPrevCalculated(Indi_AMA::Calculate(INDICATOR_CALCULATE_GET_PARAMS_SHORT, _cache.GetBuffer(0), - _ama_period, _fast_ema_period, _slow_ema_period, _ama_shift)); + _cache PTR_DEREF SetPrevCalculated(Indi_AMA::Calculate(INDICATOR_CALCULATE_GET_PARAMS_SHORT, + _cache PTR_DEREF GetBuffer(0), _ama_period, + _fast_ema_period, _slow_ema_period, _ama_shift)); - return _cache.GetTailValue(_mode, _abs_shift); + return _cache PTR_DEREF GetTailValue(_mode, _abs_shift); } /** @@ -218,7 +219,7 @@ class Indi_AMA : public Indicator { // Calculate AMA. double prevAMA = ExtAMABuffer[i - 1].Get(); - ExtAMABuffer[i] = MathPow(currentSSC, 2) * (price[i] - prevAMA) + prevAMA; + ExtAMABuffer[i] = MathPow(currentSSC, 2.0) * (price[i] - prevAMA) + prevAMA; } // Return value of prev_calculated for next call. return (rates_total); diff --git a/Indicators/Indi_AO.mqh b/Indicators/Indi_AO.mqh index ecc2be6dc..b2bf9f1f6 100644 --- a/Indicators/Indi_AO.mqh +++ b/Indicators/Indi_AO.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" @@ -133,7 +138,7 @@ class Indi_AO : public Indicator { if (!Objects::TryGet(_key, _ptr)) { _ptr = Objects::Set(_key, new Indi_AO()); // Assigning the same candle indicator for AO as in _indi. - _ptr.SetDataSource(_indi PTR_DEREF GetCandle()); + _ptr PTR_DEREF SetDataSource(_indi PTR_DEREF GetCandle()); } return _ptr; } diff --git a/Indicators/Indi_ASI.mqh b/Indicators/Indi_ASI.mqh index 0919c855d..8d73f734d 100644 --- a/Indicators/Indi_ASI.mqh +++ b/Indicators/Indi_ASI.mqh @@ -22,6 +22,7 @@ // Includes. #include "../Indicator/Indicator.h" +#include "../Platform/Platform.h" #include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Storage/ValueStorage.all.h" @@ -116,20 +117,21 @@ class Indi_ASI : public Indicator { */ static double iASIOnArray(INDICATOR_CALCULATE_PARAMS_LONG, double _mpc, int _mode, int _abs_shift, IndiBufferCache *_cache, bool _recalculate = false) { - _cache.SetPriceBuffer(_open, _high, _low, _close); + _cache PTR_DEREF SetPriceBuffer(_open, _high, _low, _close); - if (!_cache.HasBuffers()) { - _cache.AddBuffer>(3); + if (!_cache PTR_DEREF HasBuffers()) { + _cache PTR_DEREF AddBuffer>(3); } if (_recalculate) { - _cache.ResetPrevCalculated(); + _cache PTR_DEREF ResetPrevCalculated(); } - _cache.SetPrevCalculated(Indi_ASI::Calculate(INDICATOR_CALCULATE_GET_PARAMS_LONG, _cache.GetBuffer(0), - _cache.GetBuffer(1), _cache.GetBuffer(2), _mpc)); + _cache PTR_DEREF SetPrevCalculated( + Indi_ASI::Calculate(INDICATOR_CALCULATE_GET_PARAMS_LONG, _cache PTR_DEREF GetBuffer(0), + _cache PTR_DEREF GetBuffer(1), _cache PTR_DEREF GetBuffer(2), _mpc)); - return _cache.GetTailValue(_mode, _abs_shift); + return _cache PTR_DEREF GetTailValue(_mode, _abs_shift); } /** @@ -143,6 +145,7 @@ class Indi_ASI : public Indicator { ExtT = 300.0; PrintFormat("Input parameter T has wrong value. Indicator will use T = %f.", ExtT); } + // Calculate ExtTpoints value. if (_Point > 1e-7) ExtTpoints = ExtT * _Point; diff --git a/Indicators/Indi_ATR.mqh b/Indicators/Indi_ATR.mqh index 73009cc0b..13dcfcd4c 100644 --- a/Indicators/Indi_ATR.mqh +++ b/Indicators/Indi_ATR.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" @@ -117,7 +122,7 @@ class Indi_ATR : public Indicator { IndiATRParams _params(_period); _ptr = Objects::Set(_key, new Indi_ATR(_params)); // Assigning the same candle indicator for ATR as in _indi. - _ptr.SetDataSource(_indi PTR_DEREF GetCandle()); + _ptr PTR_DEREF SetDataSource(_indi PTR_DEREF GetCandle()); } return _ptr; } diff --git a/Indicators/Indi_BWZT.mqh b/Indicators/Indi_BWZT.mqh index 15c5dbf8d..0b20a06cb 100644 --- a/Indicators/Indi_BWZT.mqh +++ b/Indicators/Indi_BWZT.mqh @@ -141,22 +141,23 @@ class Indi_BWZT : public Indicator { static double iBWZTOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _mode, int _abs_shift, int _data_limit, IndiBufferCache *_cache, Indi_AC *_indi_ac, Indi_AO *_indi_ao, bool _recalculate = false) { - _cache.SetPriceBuffer(_open, _high, _low, _close); + _cache PTR_DEREF SetPriceBuffer(_open, _high, _low, _close); - if (!_cache.HasBuffers()) { - _cache.AddBuffer>(4 + 1 + 2); + if (!_cache PTR_DEREF HasBuffers()) { + _cache PTR_DEREF AddBuffer>(4 + 1 + 2); } if (_recalculate) { - _cache.ResetPrevCalculated(); + _cache PTR_DEREF ResetPrevCalculated(); } - _cache.SetPrevCalculated(Indi_BWZT::Calculate( - INDICATOR_CALCULATE_GET_PARAMS_LONG, _cache.GetBuffer(0), _cache.GetBuffer(1), - _cache.GetBuffer(2), _cache.GetBuffer(3), _cache.GetBuffer(4), - _cache.GetBuffer(5), _cache.GetBuffer(6), _data_limit, _indi_ac, _indi_ao)); + _cache PTR_DEREF SetPrevCalculated(Indi_BWZT::Calculate( + INDICATOR_CALCULATE_GET_PARAMS_LONG, _cache PTR_DEREF GetBuffer(0), + _cache PTR_DEREF GetBuffer(1), _cache PTR_DEREF GetBuffer(2), + _cache PTR_DEREF GetBuffer(3), _cache PTR_DEREF GetBuffer(4), + _cache PTR_DEREF GetBuffer(5), _cache PTR_DEREF GetBuffer(6), _data_limit, _indi_ac, _indi_ao)); - return _cache.GetTailValue(_mode, _abs_shift); + return _cache PTR_DEREF GetTailValue(_mode, _abs_shift); } /** @@ -165,10 +166,11 @@ class Indi_BWZT : public Indicator { static double iBWZTOnIndicator(IndicatorData *_indi, string _symbol, ENUM_TIMEFRAMES _tf, int _mode, int _rel_shift, int _data_limit, IndicatorData *_obj) { INDI_REQUIRE_BARS_OR_RETURN_EMPTY(_indi, _data_limit); - INDICATOR_CALCULATE_POPULATE_PARAMS_AND_CACHE_LONG(_indi, Util::MakeKey("Indi_BWZT_ON_" + _indi.GetFullName())); + INDICATOR_CALCULATE_POPULATE_PARAMS_AND_CACHE_LONG(_indi, + Util::MakeKey("Indi_BWZT_ON_" + _indi PTR_DEREF GetFullName())); - Indi_AC *_indi_ac = _obj.GetDataSource(INDI_AC); - Indi_AO *_indi_ao = _obj.GetDataSource(INDI_AO); + Indi_AC *_indi_ac = (Indi_AC *)_obj PTR_DEREF GetDataSource(INDI_AC); + Indi_AO *_indi_ao = (Indi_AO *)_obj PTR_DEREF GetDataSource(INDI_AO); return iBWZTOnArray(INDICATOR_CALCULATE_POPULATED_PARAMS_LONG, _mode, _indi PTR_DEREF ToAbsShift(_rel_shift), _data_limit, _cache, _indi_ac, _indi_ao); diff --git a/Indicators/Indi_CHO.mqh b/Indicators/Indi_CHO.mqh index 6fff098c3..16d7221b7 100644 --- a/Indicators/Indi_CHO.mqh +++ b/Indicators/Indi_CHO.mqh @@ -119,21 +119,22 @@ class Indi_CHO : public Indicator { static double iChaikinOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _fast_ma_period, int _slow_ma_period, ENUM_MA_METHOD _ma_method, ENUM_APPLIED_VOLUME _av, int _mode, int _abs_shift, IndiBufferCache *_cache, bool _recalculate = false) { - _cache.SetPriceBuffer(_open, _high, _low, _close); + _cache PTR_DEREF SetPriceBuffer(_open, _high, _low, _close); - if (!_cache.HasBuffers()) { - _cache.AddBuffer>(4); + if (!_cache PTR_DEREF HasBuffers()) { + _cache PTR_DEREF AddBuffer>(4); } if (_recalculate) { - _cache.ResetPrevCalculated(); + _cache PTR_DEREF ResetPrevCalculated(); } - _cache.SetPrevCalculated(Indi_CHO::Calculate( - INDICATOR_CALCULATE_GET_PARAMS_LONG, _cache.GetBuffer(0), _cache.GetBuffer(1), - _cache.GetBuffer(2), _cache.GetBuffer(3), _fast_ma_period, _slow_ma_period, _ma_method, _av)); + _cache PTR_DEREF SetPrevCalculated( + Indi_CHO::Calculate(INDICATOR_CALCULATE_GET_PARAMS_LONG, _cache PTR_DEREF GetBuffer(0), + _cache PTR_DEREF GetBuffer(1), _cache PTR_DEREF GetBuffer(2), + _cache PTR_DEREF GetBuffer(3), _fast_ma_period, _slow_ma_period, _ma_method, _av)); - return _cache.GetTailValue(_mode, _abs_shift); + return _cache PTR_DEREF GetTailValue(_mode, _abs_shift); } /** diff --git a/Indicators/Indi_CHV.mqh b/Indicators/Indi_CHV.mqh index bfcd1847f..3119985f0 100644 --- a/Indicators/Indi_CHV.mqh +++ b/Indicators/Indi_CHV.mqh @@ -108,23 +108,24 @@ class Indi_CHV : public Indicator { static double iCHVOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _smooth_period, int _chv_period, ENUM_CHV_SMOOTH_METHOD _smooth_method, int _mode, int _abs_shift, IndiBufferCache *_cache, bool _recalculate = false) { - _cache.SetPriceBuffer(_open, _high, _low, _close); + _cache PTR_DEREF SetPriceBuffer(_open, _high, _low, _close); - if (!_cache.HasBuffers()) { - _cache.AddBuffer>(3); + if (!_cache PTR_DEREF HasBuffers()) { + _cache PTR_DEREF AddBuffer>(3); } if (_recalculate) { - _cache.ResetPrevCalculated(); + _cache PTR_DEREF ResetPrevCalculated(); } - _cache.SetPrevCalculated(Indi_CHV::Calculate(INDICATOR_CALCULATE_GET_PARAMS_LONG, _cache.GetBuffer(0), - _cache.GetBuffer(1), _cache.GetBuffer(2), - _smooth_period, _chv_period, _smooth_method)); + _cache PTR_DEREF SetPrevCalculated( + Indi_CHV::Calculate(INDICATOR_CALCULATE_GET_PARAMS_LONG, _cache PTR_DEREF GetBuffer(0), + _cache PTR_DEREF GetBuffer(1), _cache PTR_DEREF GetBuffer(2), + _smooth_period, _chv_period, _smooth_method)); // Returns value from the first calculation buffer. // Returns first value for as-series array or last value for non-as-series array. - return _cache.GetTailValue(_mode, _abs_shift); + return _cache PTR_DEREF GetTailValue(_mode, _abs_shift); } /** diff --git a/Indicators/Indi_ColorBars.mqh b/Indicators/Indi_ColorBars.mqh index 6721eed7c..8ece4900b 100644 --- a/Indicators/Indi_ColorBars.mqh +++ b/Indicators/Indi_ColorBars.mqh @@ -78,21 +78,22 @@ class Indi_ColorBars : public Indicator { */ static double iColorBarsOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _mode, int _abs_shift, IndiBufferCache *_cache, bool _recalculate = false) { - _cache.SetPriceBuffer(_open, _high, _low, _close); + _cache PTR_DEREF SetPriceBuffer(_open, _high, _low, _close); - if (!_cache.HasBuffers()) { - _cache.AddBuffer>(4 + 1); + if (!_cache PTR_DEREF HasBuffers()) { + _cache PTR_DEREF AddBuffer>(4 + 1); } if (_recalculate) { - _cache.ResetPrevCalculated(); + _cache PTR_DEREF ResetPrevCalculated(); } - _cache.SetPrevCalculated(Indi_ColorBars::Calculate(INDICATOR_CALCULATE_GET_PARAMS_LONG, _cache.GetBuffer(0), - _cache.GetBuffer(1), _cache.GetBuffer(2), - _cache.GetBuffer(3), _cache.GetBuffer(4))); + _cache PTR_DEREF SetPrevCalculated( + Indi_ColorBars::Calculate(INDICATOR_CALCULATE_GET_PARAMS_LONG, _cache PTR_DEREF GetBuffer(0), + _cache PTR_DEREF GetBuffer(1), _cache PTR_DEREF GetBuffer(2), + _cache PTR_DEREF GetBuffer(3), _cache PTR_DEREF GetBuffer(4))); - return _cache.GetTailValue(_mode, _abs_shift); + return _cache PTR_DEREF GetTailValue(_mode, _abs_shift); } /** diff --git a/Indicators/Indi_ColorCandlesDaily.mqh b/Indicators/Indi_ColorCandlesDaily.mqh index 9c5f2a545..6041fbd82 100644 --- a/Indicators/Indi_ColorCandlesDaily.mqh +++ b/Indicators/Indi_ColorCandlesDaily.mqh @@ -91,21 +91,22 @@ class Indi_ColorCandlesDaily : public Indicator { */ static double iCCDOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _mode, int _abs_shift, IndiBufferCache *_cache, bool _recalculate = false) { - _cache.SetPriceBuffer(_open, _high, _low, _close); + _cache PTR_DEREF SetPriceBuffer(_open, _high, _low, _close); - if (!_cache.HasBuffers()) { - _cache.AddBuffer>(4 + 1); + if (!_cache PTR_DEREF HasBuffers()) { + _cache PTR_DEREF AddBuffer>(4 + 1); } if (_recalculate) { - _cache.ResetPrevCalculated(); + _cache PTR_DEREF ResetPrevCalculated(); } - _cache.SetPrevCalculated(Indi_ColorCandlesDaily::Calculate( - INDICATOR_CALCULATE_GET_PARAMS_LONG, _cache.GetBuffer(0), _cache.GetBuffer(1), - _cache.GetBuffer(2), _cache.GetBuffer(3), _cache.GetBuffer(4))); + _cache PTR_DEREF SetPrevCalculated(Indi_ColorCandlesDaily::Calculate( + INDICATOR_CALCULATE_GET_PARAMS_LONG, _cache PTR_DEREF GetBuffer(0), + _cache PTR_DEREF GetBuffer(1), _cache PTR_DEREF GetBuffer(2), + _cache PTR_DEREF GetBuffer(3), _cache PTR_DEREF GetBuffer(4))); - return _cache.GetTailValue(_mode, _abs_shift); + return _cache PTR_DEREF GetTailValue(_mode, _abs_shift); } /** diff --git a/Indicators/Indi_ColorLine.mqh b/Indicators/Indi_ColorLine.mqh index e5afbe3a7..e8210a155 100644 --- a/Indicators/Indi_ColorLine.mqh +++ b/Indicators/Indi_ColorLine.mqh @@ -96,20 +96,21 @@ class Indi_ColorLine : public Indicator { */ static double iColorLineOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _mode, int _abs_shift, IndiBufferCache *_cache, IndicatorData *_indi_ma, bool _recalculate = false) { - _cache.SetPriceBuffer(_open, _high, _low, _close); + _cache PTR_DEREF SetPriceBuffer(_open, _high, _low, _close); - if (!_cache.HasBuffers()) { - _cache.AddBuffer>(1 + 1); + if (!_cache PTR_DEREF HasBuffers()) { + _cache PTR_DEREF AddBuffer>(1 + 1); } if (_recalculate) { - _cache.ResetPrevCalculated(); + _cache PTR_DEREF ResetPrevCalculated(); } - _cache.SetPrevCalculated(Indi_ColorLine::Calculate(INDICATOR_CALCULATE_GET_PARAMS_LONG, _cache.GetBuffer(0), - _cache.GetBuffer(1), _indi_ma)); + _cache PTR_DEREF SetPrevCalculated(Indi_ColorLine::Calculate(INDICATOR_CALCULATE_GET_PARAMS_LONG, + _cache PTR_DEREF GetBuffer(0), + _cache PTR_DEREF GetBuffer(1), _indi_ma)); - return _cache.GetTailValue(_mode, _abs_shift); + return _cache PTR_DEREF GetTailValue(_mode, _abs_shift); } /** @@ -117,7 +118,7 @@ class Indi_ColorLine : public Indicator { */ static double iColorLineOnIndicator(IndicatorData *_indi, int _mode, int _rel_shift, IndicatorData *_obj) { INDICATOR_CALCULATE_POPULATE_PARAMS_AND_CACHE_LONG(_indi, ""); - Indi_MA *_indi_ma = _obj.GetDataSource(INDI_MA); + Indi_MA *_indi_ma = (Indi_MA *)_obj PTR_DEREF GetDataSource(INDI_MA); return iColorLineOnArray(INDICATOR_CALCULATE_POPULATED_PARAMS_LONG, _mode, _indi PTR_DEREF ToAbsShift(_rel_shift), _cache, _indi_ma); } diff --git a/Indicators/Indi_CustomMovingAverage.mqh b/Indicators/Indi_CustomMovingAverage.mqh index b0cc0fb4e..fee017284 100644 --- a/Indicators/Indi_CustomMovingAverage.mqh +++ b/Indicators/Indi_CustomMovingAverage.mqh @@ -20,8 +20,14 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" +#include "../Indicators/Price/Indi_MA.h" #include "../Storage/Dict/Buffer/BufferStruct.h" // Structs. diff --git a/Indicators/Indi_DEMA.mqh b/Indicators/Indi_DEMA.mqh index d78d7736c..922bc7ffd 100644 --- a/Indicators/Indi_DEMA.mqh +++ b/Indicators/Indi_DEMA.mqh @@ -134,22 +134,22 @@ class Indi_DEMA : public Indicator { return 0.0f; } - _cache.SetPriceBuffer(_price); + _cache PTR_DEREF SetPriceBuffer(_price); - if (!_cache.HasBuffers()) { - _cache.AddBuffer>(3); // 3 buffers. + if (!_cache PTR_DEREF HasBuffers()) { + _cache PTR_DEREF AddBuffer>(3); // 3 buffers. } if (_recalculate) { // We don't want to continue calculations, but to recalculate previous one. - _cache.ResetPrevCalculated(); + _cache PTR_DEREF ResetPrevCalculated(); } - _cache.SetPrevCalculated(Indi_DEMA::Calculate(INDICATOR_CALCULATE_GET_PARAMS_SHORT, _cache.GetBuffer(0), - _cache.GetBuffer(1), _cache.GetBuffer(2), - _ma_period)); + _cache PTR_DEREF SetPrevCalculated( + Indi_DEMA::Calculate(INDICATOR_CALCULATE_GET_PARAMS_SHORT, _cache PTR_DEREF GetBuffer(0), + _cache PTR_DEREF GetBuffer(1), _cache PTR_DEREF GetBuffer(2), _ma_period)); - return _cache.GetTailValue(0, _ma_shift + _shift); + return _cache PTR_DEREF GetTailValue(0, _ma_shift + _shift); } /** diff --git a/Indicators/Indi_DetrendedPrice.mqh b/Indicators/Indi_DetrendedPrice.mqh index 7e23d9b49..75e57be62 100644 --- a/Indicators/Indi_DetrendedPrice.mqh +++ b/Indicators/Indi_DetrendedPrice.mqh @@ -84,7 +84,7 @@ class Indi_DetrendedPrice : public Indicator { */ static double iDPO(IndicatorData *_indi, int _period, ENUM_APPLIED_PRICE _ap, int _mode = 0, int _rel_shift = 0) { INDI_REQUIRE_BARS_OR_RETURN_EMPTY(_indi, _period + _rel_shift); - INDICATOR_CALCULATE_POPULATE_PARAMS_AND_CACHE_SHORT(_indi, _ap, Util::MakeKey(_indi.GetId())); + INDICATOR_CALCULATE_POPULATE_PARAMS_AND_CACHE_SHORT(_indi, _ap, Util::MakeKey(_indi PTR_DEREF GetId())); return iDPOOnArray(INDICATOR_CALCULATE_POPULATED_PARAMS_SHORT, _period, _ap, _mode, _indi PTR_DEREF ToAbsShift(_rel_shift), _cache); } @@ -94,20 +94,21 @@ class Indi_DetrendedPrice : public Indicator { */ static double iDPOOnArray(INDICATOR_CALCULATE_PARAMS_SHORT, int _period, ENUM_APPLIED_PRICE _ap, int _mode, int _abs_shift, IndiBufferCache *_cache, bool _recalculate = false) { - _cache.SetPriceBuffer(_price); + _cache PTR_DEREF SetPriceBuffer(_price); - if (!_cache.HasBuffers()) { - _cache.AddBuffer>(1 + 1); + if (!_cache PTR_DEREF HasBuffers()) { + _cache PTR_DEREF AddBuffer>(1 + 1); } if (_recalculate) { - _cache.ResetPrevCalculated(); + _cache PTR_DEREF ResetPrevCalculated(); } - _cache.SetPrevCalculated(Indi_DetrendedPrice::Calculate( - INDICATOR_CALCULATE_GET_PARAMS_SHORT, _cache.GetBuffer(0), _cache.GetBuffer(1), _period)); + _cache PTR_DEREF SetPrevCalculated(Indi_DetrendedPrice::Calculate(INDICATOR_CALCULATE_GET_PARAMS_SHORT, + _cache PTR_DEREF GetBuffer(0), + _cache PTR_DEREF GetBuffer(1), _period)); - return _cache.GetTailValue(_mode, _abs_shift); + return _cache PTR_DEREF GetTailValue(_mode, _abs_shift); } /** diff --git a/Indicators/Indi_Drawer.mqh b/Indicators/Indi_Drawer.mqh index 4c4b63f5b..e551fd9b7 100644 --- a/Indicators/Indi_Drawer.mqh +++ b/Indicators/Indi_Drawer.mqh @@ -83,7 +83,7 @@ class Indi_Drawer : public Indicator { */ } - virtual bool ExecuteAction(ENUM_INDICATOR_ACTION _action, DataParamEntry &_args[]) { + virtual bool ExecuteAction(ENUM_INDICATOR_ACTION _action, CONST_ARRAY_REF(DataParamEntry, _args)) { int num_args = ArraySize(_args), i; int _max_modes = Get(STRUCT_ENUM(IndicatorDataParams, IDATA_PARAM_MAX_MODES)); @@ -93,7 +93,7 @@ class Indi_Drawer : public Indicator { Set(STRUCT_ENUM(IndicatorDataParams, IDATA_PARAM_MAX_MODES), num_args - 1); if (num_args - 1 > _max_modes) { - GetLogger().Error( + GetLogger() PTR_DEREF Error( StringFormat("Too many data for buffers for action %s!", EnumToString(_action), __FUNCTION_LINE__)); return false; } @@ -187,7 +187,7 @@ class Indi_Drawer : public Indicator { /** * Performs drawing from data in array. */ - static double iDrawerOnArray(double &array[], int total, int period, int shift) { return 0; } + static double iDrawerOnArray(CONST_ARRAY_REF(double, array), int total, int period, int shift) { return 0; } /* Getters */ diff --git a/Indicators/Indi_Force.mqh b/Indicators/Indi_Force.mqh index e04c4cf1d..31b617982 100644 --- a/Indicators/Indi_Force.mqh +++ b/Indicators/Indi_Force.mqh @@ -33,6 +33,7 @@ // Includes. #include "../Indicator/Indicator.h" +#include "../Indicators/Price/Indi_MA.h" // Structs. struct IndiForceParams : IndicatorParams { diff --git a/Indicators/Indi_FractalAdaptiveMA.mqh b/Indicators/Indi_FractalAdaptiveMA.mqh index ce6682374..4d421d072 100644 --- a/Indicators/Indi_FractalAdaptiveMA.mqh +++ b/Indicators/Indi_FractalAdaptiveMA.mqh @@ -123,20 +123,20 @@ class Indi_FrAMA : public Indicator { */ static double iFrAMAOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _ma_period, int _ma_shift, ENUM_APPLIED_PRICE _ap, int _mode, int _abs_shift, IndiBufferCache *_cache, bool _recalculate = false) { - _cache.SetPriceBuffer(_open, _high, _low, _close); + _cache PTR_DEREF SetPriceBuffer(_open, _high, _low, _close); - if (!_cache.HasBuffers()) { - _cache.AddBuffer>(1); + if (!_cache PTR_DEREF HasBuffers()) { + _cache PTR_DEREF AddBuffer>(1); } if (_recalculate) { - _cache.ResetPrevCalculated(); + _cache PTR_DEREF ResetPrevCalculated(); } - _cache.SetPrevCalculated(Indi_FrAMA::Calculate(INDICATOR_CALCULATE_GET_PARAMS_LONG, _cache.GetBuffer(0), - _ma_period, _ma_shift, _ap)); + _cache PTR_DEREF SetPrevCalculated(Indi_FrAMA::Calculate( + INDICATOR_CALCULATE_GET_PARAMS_LONG, _cache PTR_DEREF GetBuffer(0), _ma_period, _ma_shift, _ap)); - return _cache.GetTailValue(_mode, _abs_shift); + return _cache PTR_DEREF GetTailValue(_mode, _abs_shift); } /** diff --git a/Indicators/Indi_HeikenAshi.mqh b/Indicators/Indi_HeikenAshi.mqh index 6fddda9d1..e1b19d96f 100644 --- a/Indicators/Indi_HeikenAshi.mqh +++ b/Indicators/Indi_HeikenAshi.mqh @@ -169,21 +169,22 @@ class Indi_HeikenAshi : public Indicator { */ static double iHeikenAshiOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _mode, int _abs_shift, IndiBufferCache *_cache, bool _recalculate = false) { - _cache.SetPriceBuffer(_open, _high, _low, _close); + _cache PTR_DEREF SetPriceBuffer(_open, _high, _low, _close); - if (!_cache.HasBuffers()) { - _cache.AddBuffer>(1 + 4); + if (!_cache PTR_DEREF HasBuffers()) { + _cache PTR_DEREF AddBuffer>(1 + 4); } if (_recalculate) { - _cache.ResetPrevCalculated(); + _cache PTR_DEREF ResetPrevCalculated(); } - _cache.SetPrevCalculated(Indi_HeikenAshi::Calculate( - INDICATOR_CALCULATE_GET_PARAMS_LONG, _cache.GetBuffer(0), _cache.GetBuffer(1), - _cache.GetBuffer(2), _cache.GetBuffer(3), _cache.GetBuffer(4))); + _cache PTR_DEREF SetPrevCalculated( + Indi_HeikenAshi::Calculate(INDICATOR_CALCULATE_GET_PARAMS_LONG, _cache PTR_DEREF GetBuffer(0), + _cache PTR_DEREF GetBuffer(1), _cache PTR_DEREF GetBuffer(2), + _cache PTR_DEREF GetBuffer(3), _cache PTR_DEREF GetBuffer(4))); - return _cache.GetTailValue(_mode, _abs_shift); + return _cache PTR_DEREF GetTailValue(_mode, _abs_shift); } /** diff --git a/Indicators/Indi_MassIndex.mqh b/Indicators/Indi_MassIndex.mqh index da802dc18..7d1013fe7 100644 --- a/Indicators/Indi_MassIndex.mqh +++ b/Indicators/Indi_MassIndex.mqh @@ -99,21 +99,22 @@ class Indi_MassIndex : public Indicator { */ static double iMIOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _period, int _second_period, int _sum_period, int _mode, int _abs_shift, IndiBufferCache *_cache, bool _recalculate = false) { - _cache.SetPriceBuffer(_open, _high, _low, _close); + _cache PTR_DEREF SetPriceBuffer(_open, _high, _low, _close); - if (!_cache.HasBuffers()) { - _cache.AddBuffer>(1 + 3); + if (!_cache PTR_DEREF HasBuffers()) { + _cache PTR_DEREF AddBuffer>(1 + 3); } if (_recalculate) { - _cache.ResetPrevCalculated(); + _cache PTR_DEREF ResetPrevCalculated(); } - _cache.SetPrevCalculated(Indi_MassIndex::Calculate( - INDICATOR_CALCULATE_GET_PARAMS_LONG, _cache.GetBuffer(0), _cache.GetBuffer(1), - _cache.GetBuffer(2), _cache.GetBuffer(3), _period, _second_period, _sum_period)); + _cache PTR_DEREF SetPrevCalculated( + Indi_MassIndex::Calculate(INDICATOR_CALCULATE_GET_PARAMS_LONG, _cache PTR_DEREF GetBuffer(0), + _cache PTR_DEREF GetBuffer(1), _cache PTR_DEREF GetBuffer(2), + _cache PTR_DEREF GetBuffer(3), _period, _second_period, _sum_period)); - return _cache.GetTailValue(_mode, _abs_shift); + return _cache PTR_DEREF GetTailValue(_mode, _abs_shift); } /** diff --git a/Indicators/Indi_PriceChannel.mqh b/Indicators/Indi_PriceChannel.mqh index c3cb344fc..bacd96f43 100644 --- a/Indicators/Indi_PriceChannel.mqh +++ b/Indicators/Indi_PriceChannel.mqh @@ -91,21 +91,21 @@ class Indi_PriceChannel : public Indicator { */ static double iPriceChannelOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _period, int _mode, int _abs_shift, IndiBufferCache *_cache, bool _recalculate = false) { - _cache.SetPriceBuffer(_open, _high, _low, _close); + _cache PTR_DEREF SetPriceBuffer(_open, _high, _low, _close); - if (!_cache.HasBuffers()) { - _cache.AddBuffer>(3); + if (!_cache PTR_DEREF HasBuffers()) { + _cache PTR_DEREF AddBuffer>(3); } if (_recalculate) { - _cache.ResetPrevCalculated(); + _cache PTR_DEREF ResetPrevCalculated(); } - _cache.SetPrevCalculated(Indi_PriceChannel::Calculate(INDICATOR_CALCULATE_GET_PARAMS_LONG, - _cache.GetBuffer(0), _cache.GetBuffer(1), - _cache.GetBuffer(2), _period)); + _cache PTR_DEREF SetPrevCalculated(Indi_PriceChannel::Calculate( + INDICATOR_CALCULATE_GET_PARAMS_LONG, _cache PTR_DEREF GetBuffer(0), + _cache PTR_DEREF GetBuffer(1), _cache PTR_DEREF GetBuffer(2), _period)); - return _cache.GetTailValue(_mode, _abs_shift); + return _cache PTR_DEREF GetTailValue(_mode, _abs_shift); } /** diff --git a/Indicators/Indi_PriceVolumeTrend.mqh b/Indicators/Indi_PriceVolumeTrend.mqh index 0e6daf990..d9a12ed71 100644 --- a/Indicators/Indi_PriceVolumeTrend.mqh +++ b/Indicators/Indi_PriceVolumeTrend.mqh @@ -86,20 +86,20 @@ class Indi_PriceVolumeTrend : public Indicator { */ static double iPVTOnArray(INDICATOR_CALCULATE_PARAMS_LONG, ENUM_APPLIED_VOLUME _av, int _mode, int _abs_shift, IndiBufferCache *_cache, bool _recalculate = false) { - _cache.SetPriceBuffer(_open, _high, _low, _close); + _cache PTR_DEREF SetPriceBuffer(_open, _high, _low, _close); - if (!_cache.HasBuffers()) { - _cache.AddBuffer>(1); + if (!_cache PTR_DEREF HasBuffers()) { + _cache PTR_DEREF AddBuffer>(1); } if (_recalculate) { - _cache.ResetPrevCalculated(); + _cache PTR_DEREF ResetPrevCalculated(); } - _cache.SetPrevCalculated( - Indi_PriceVolumeTrend::Calculate(INDICATOR_CALCULATE_GET_PARAMS_LONG, _cache.GetBuffer(0), _av)); + _cache PTR_DEREF SetPrevCalculated(Indi_PriceVolumeTrend::Calculate(INDICATOR_CALCULATE_GET_PARAMS_LONG, + _cache PTR_DEREF GetBuffer(0), _av)); - return _cache.GetTailValue(_mode, _abs_shift); + return _cache PTR_DEREF GetTailValue(_mode, _abs_shift); } /** diff --git a/Indicators/Indi_RateOfChange.mqh b/Indicators/Indi_RateOfChange.mqh index 9691edb63..fe9ebebfa 100644 --- a/Indicators/Indi_RateOfChange.mqh +++ b/Indicators/Indi_RateOfChange.mqh @@ -80,20 +80,20 @@ class Indi_RateOfChange : public Indicator { */ static double iROCOnArray(INDICATOR_CALCULATE_PARAMS_SHORT, int _period, int _mode, int _abs_shift, IndiBufferCache *_cache, bool _recalculate = false) { - _cache.SetPriceBuffer(_price); + _cache PTR_DEREF SetPriceBuffer(_price); - if (!_cache.HasBuffers()) { - _cache.AddBuffer>(1); + if (!_cache PTR_DEREF HasBuffers()) { + _cache PTR_DEREF AddBuffer>(1); } if (_recalculate) { - _cache.ResetPrevCalculated(); + _cache PTR_DEREF ResetPrevCalculated(); } - _cache.SetPrevCalculated( - Indi_RateOfChange::Calculate(INDICATOR_CALCULATE_GET_PARAMS_SHORT, _cache.GetBuffer(0), _period)); + _cache PTR_DEREF SetPrevCalculated(Indi_RateOfChange::Calculate(INDICATOR_CALCULATE_GET_PARAMS_SHORT, + _cache PTR_DEREF GetBuffer(0), _period)); - return _cache.GetTailValue(_mode, _abs_shift); + return _cache PTR_DEREF GetTailValue(_mode, _abs_shift); } /** diff --git a/Indicators/Indi_TEMA.mqh b/Indicators/Indi_TEMA.mqh index 3529aa46f..14d98a012 100644 --- a/Indicators/Indi_TEMA.mqh +++ b/Indicators/Indi_TEMA.mqh @@ -104,21 +104,22 @@ class Indi_TEMA : public Indicator { */ static double iTEMAOnArray(INDICATOR_CALCULATE_PARAMS_SHORT, int _ma_period, int _ma_shift, int _mode, int _abs_shift, IndiBufferCache *_cache, bool _recalculate = false) { - _cache.SetPriceBuffer(_price); + _cache PTR_DEREF SetPriceBuffer(_price); - if (!_cache.HasBuffers()) { - _cache.AddBuffer>(4); + if (!_cache PTR_DEREF HasBuffers()) { + _cache PTR_DEREF AddBuffer>(4); } if (_recalculate) { - _cache.ResetPrevCalculated(); + _cache PTR_DEREF ResetPrevCalculated(); } - _cache.SetPrevCalculated(Indi_TEMA::Calculate(INDICATOR_CALCULATE_GET_PARAMS_SHORT, _cache.GetBuffer(0), - _cache.GetBuffer(1), _cache.GetBuffer(2), - _cache.GetBuffer(3), _ma_period, _ma_shift)); + _cache PTR_DEREF SetPrevCalculated( + Indi_TEMA::Calculate(INDICATOR_CALCULATE_GET_PARAMS_SHORT, _cache PTR_DEREF GetBuffer(0), + _cache PTR_DEREF GetBuffer(1), _cache PTR_DEREF GetBuffer(2), + _cache PTR_DEREF GetBuffer(3), _ma_period, _ma_shift)); - return _cache.GetTailValue(_mode, _abs_shift); + return _cache PTR_DEREF GetTailValue(_mode, _abs_shift); } /** diff --git a/Indicators/Indi_TRIX.mqh b/Indicators/Indi_TRIX.mqh index 31c7cd3c4..880b5a7d9 100644 --- a/Indicators/Indi_TRIX.mqh +++ b/Indicators/Indi_TRIX.mqh @@ -102,21 +102,22 @@ class Indi_TRIX : public Indicator { */ static double iTriXOnArray(INDICATOR_CALCULATE_PARAMS_SHORT, int _ma_period, int _mode, int _abs_shift, IndiBufferCache *_cache, bool _recalculate = false) { - _cache.SetPriceBuffer(_price); + _cache PTR_DEREF SetPriceBuffer(_price); - if (!_cache.HasBuffers()) { - _cache.AddBuffer>(4); + if (!_cache PTR_DEREF HasBuffers()) { + _cache PTR_DEREF AddBuffer>(4); } if (_recalculate) { - _cache.ResetPrevCalculated(); + _cache PTR_DEREF ResetPrevCalculated(); } - _cache.SetPrevCalculated(Indi_TRIX::Calculate(INDICATOR_CALCULATE_GET_PARAMS_SHORT, _cache.GetBuffer(0), - _cache.GetBuffer(1), _cache.GetBuffer(2), - _cache.GetBuffer(3), _ma_period)); + _cache PTR_DEREF SetPrevCalculated( + Indi_TRIX::Calculate(INDICATOR_CALCULATE_GET_PARAMS_SHORT, _cache PTR_DEREF GetBuffer(0), + _cache PTR_DEREF GetBuffer(1), _cache PTR_DEREF GetBuffer(2), + _cache PTR_DEREF GetBuffer(3), _ma_period)); - return _cache.GetTailValue(_mode, _abs_shift); + return _cache PTR_DEREF GetTailValue(_mode, _abs_shift); } /** diff --git a/Indicators/Indi_UltimateOscillator.mqh b/Indicators/Indi_UltimateOscillator.mqh index 8c5bb3481..a3b31deab 100644 --- a/Indicators/Indi_UltimateOscillator.mqh +++ b/Indicators/Indi_UltimateOscillator.mqh @@ -122,22 +122,23 @@ class Indi_UltimateOscillator : public Indicator { int _fast_k, int _middle_k, int _slow_k, int _mode, int _abs_shift, IndiBufferCache *_cache, IndicatorData *_indi_atr_fast, IndicatorData *_indi_atr_middle, IndicatorData *_indi_atr_slow, bool _recalculate = false) { - _cache.SetPriceBuffer(_open, _high, _low, _close); + _cache PTR_DEREF SetPriceBuffer(_open, _high, _low, _close); - if (!_cache.HasBuffers()) { - _cache.AddBuffer>(1 + 4); + if (!_cache PTR_DEREF HasBuffers()) { + _cache PTR_DEREF AddBuffer>(1 + 4); } if (_recalculate) { - _cache.ResetPrevCalculated(); + _cache PTR_DEREF ResetPrevCalculated(); } - _cache.SetPrevCalculated(Indi_UltimateOscillator::Calculate( - INDICATOR_CALCULATE_GET_PARAMS_LONG, _cache.GetBuffer(0), _cache.GetBuffer(1), - _cache.GetBuffer(2), _cache.GetBuffer(3), _cache.GetBuffer(4), _fast_period, - _middle_period, _slow_period, _fast_k, _middle_k, _slow_k, _indi_atr_fast, _indi_atr_middle, _indi_atr_slow)); + _cache PTR_DEREF SetPrevCalculated(Indi_UltimateOscillator::Calculate( + INDICATOR_CALCULATE_GET_PARAMS_LONG, _cache PTR_DEREF GetBuffer(0), + _cache PTR_DEREF GetBuffer(1), _cache PTR_DEREF GetBuffer(2), + _cache PTR_DEREF GetBuffer(3), _cache PTR_DEREF GetBuffer(4), _fast_period, _middle_period, + _slow_period, _fast_k, _middle_k, _slow_k, _indi_atr_fast, _indi_atr_middle, _indi_atr_slow)); - return _cache.GetTailValue(_mode, _abs_shift); + return _cache PTR_DEREF GetTailValue(_mode, _abs_shift); } /** diff --git a/Indicators/Indi_VIDYA.mqh b/Indicators/Indi_VIDYA.mqh index 25238207a..e6a29adb5 100644 --- a/Indicators/Indi_VIDYA.mqh +++ b/Indicators/Indi_VIDYA.mqh @@ -107,20 +107,21 @@ class Indi_VIDYA : public Indicator { */ static double iVIDyAOnArray(INDICATOR_CALCULATE_PARAMS_SHORT, int _cmo_period, int _ema_period, int _ma_shift, int _mode, int _abs_shift, IndiBufferCache *_cache, bool _recalculate = false) { - _cache.SetPriceBuffer(_price); + _cache PTR_DEREF SetPriceBuffer(_price); - if (!_cache.HasBuffers()) { - _cache.AddBuffer>(1); + if (!_cache PTR_DEREF HasBuffers()) { + _cache PTR_DEREF AddBuffer>(1); } if (_recalculate) { - _cache.ResetPrevCalculated(); + _cache PTR_DEREF ResetPrevCalculated(); } - _cache.SetPrevCalculated(Indi_VIDYA::Calculate(INDICATOR_CALCULATE_GET_PARAMS_SHORT, _cache.GetBuffer(0), - _cmo_period, _ema_period, _ma_shift)); + _cache PTR_DEREF SetPrevCalculated(Indi_VIDYA::Calculate(INDICATOR_CALCULATE_GET_PARAMS_SHORT, + _cache PTR_DEREF GetBuffer(0), _cmo_period, + _ema_period, _ma_shift)); - return _cache.GetTailValue(_mode, _abs_shift); + return _cache PTR_DEREF GetTailValue(_mode, _abs_shift); } /** diff --git a/Indicators/Indi_VROC.mqh b/Indicators/Indi_VROC.mqh index b7e869aac..49d36f112 100644 --- a/Indicators/Indi_VROC.mqh +++ b/Indicators/Indi_VROC.mqh @@ -94,20 +94,20 @@ class Indi_VROC : public Indicator { */ static double iVROCOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _period, ENUM_APPLIED_VOLUME _av, int _mode, int _abs_shift, IndiBufferCache *_cache, bool _recalculate = false) { - _cache.SetPriceBuffer(_open, _high, _low, _close); + _cache PTR_DEREF SetPriceBuffer(_open, _high, _low, _close); - if (!_cache.HasBuffers()) { - _cache.AddBuffer>(1); + if (!_cache PTR_DEREF HasBuffers()) { + _cache PTR_DEREF AddBuffer>(1); } if (_recalculate) { - _cache.ResetPrevCalculated(); + _cache PTR_DEREF ResetPrevCalculated(); } - _cache.SetPrevCalculated( - Indi_VROC::Calculate(INDICATOR_CALCULATE_GET_PARAMS_LONG, _cache.GetBuffer(0), _period, _av)); + _cache PTR_DEREF SetPrevCalculated( + Indi_VROC::Calculate(INDICATOR_CALCULATE_GET_PARAMS_LONG, _cache PTR_DEREF GetBuffer(0), _period, _av)); - return _cache.GetTailValue(_mode, _abs_shift); + return _cache PTR_DEREF GetTailValue(_mode, _abs_shift); } /** diff --git a/Indicators/Indi_Volumes.mqh b/Indicators/Indi_Volumes.mqh index 8ae7f687f..a2a44227e 100644 --- a/Indicators/Indi_Volumes.mqh +++ b/Indicators/Indi_Volumes.mqh @@ -97,20 +97,21 @@ class Indi_Volumes : public Indicator { */ static double iVolumesOnArray(INDICATOR_CALCULATE_PARAMS_LONG, ENUM_APPLIED_VOLUME _av, int _mode, int _abs_shift, IndiBufferCache *_cache, bool _recalculate = false) { - _cache.SetPriceBuffer(_open, _high, _low, _close); + _cache PTR_DEREF SetPriceBuffer(_open, _high, _low, _close); - if (!_cache.HasBuffers()) { - _cache.AddBuffer>(1 + 1); + if (!_cache PTR_DEREF HasBuffers()) { + _cache PTR_DEREF AddBuffer>(1 + 1); } if (_recalculate) { - _cache.ResetPrevCalculated(); + _cache PTR_DEREF ResetPrevCalculated(); } - _cache.SetPrevCalculated(Indi_Volumes::Calculate(INDICATOR_CALCULATE_GET_PARAMS_LONG, _cache.GetBuffer(0), - _cache.GetBuffer(1), _av)); + _cache PTR_DEREF SetPrevCalculated(Indi_Volumes::Calculate(INDICATOR_CALCULATE_GET_PARAMS_LONG, + _cache PTR_DEREF GetBuffer(0), + _cache PTR_DEREF GetBuffer(1), _av)); - return _cache.GetTailValue(_mode, _abs_shift); + return _cache PTR_DEREF GetTailValue(_mode, _abs_shift); } /** diff --git a/Indicators/Indi_WilliamsAD.mqh b/Indicators/Indi_WilliamsAD.mqh index b828039aa..39ae47871 100644 --- a/Indicators/Indi_WilliamsAD.mqh +++ b/Indicators/Indi_WilliamsAD.mqh @@ -95,20 +95,20 @@ class Indi_WilliamsAD : public Indicator { */ static double iWADOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _mode, int _abs_shift, IndiBufferCache *_cache, bool _recalculate = false) { - _cache.SetPriceBuffer(_open, _high, _low, _close); + _cache PTR_DEREF SetPriceBuffer(_open, _high, _low, _close); - if (!_cache.HasBuffers()) { - _cache.AddBuffer>(1); + if (!_cache PTR_DEREF HasBuffers()) { + _cache PTR_DEREF AddBuffer>(1); } if (_recalculate) { - _cache.ResetPrevCalculated(); + _cache PTR_DEREF ResetPrevCalculated(); } - _cache.SetPrevCalculated( - Indi_WilliamsAD::Calculate(INDICATOR_CALCULATE_GET_PARAMS_LONG, _cache.GetBuffer(0))); + _cache PTR_DEREF SetPrevCalculated( + Indi_WilliamsAD::Calculate(INDICATOR_CALCULATE_GET_PARAMS_LONG, _cache PTR_DEREF GetBuffer(0))); - return _cache.GetTailValue(_mode, _abs_shift); + return _cache PTR_DEREF GetTailValue(_mode, _abs_shift); } /** diff --git a/Indicators/Indi_ZigZag.mqh b/Indicators/Indi_ZigZag.mqh index 38886a9ea..97efecc53 100644 --- a/Indicators/Indi_ZigZag.mqh +++ b/Indicators/Indi_ZigZag.mqh @@ -163,21 +163,21 @@ class Indi_ZigZag : public Indicator { */ static double iZigZagOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _depth, int _deviation, int _backstep, int _mode, int _abs_shift, IndiBufferCache *_cache, bool _recalculate = false) { - _cache.SetPriceBuffer(_open, _high, _low, _close); + _cache PTR_DEREF SetPriceBuffer(_open, _high, _low, _close); - if (!_cache.HasBuffers()) { - _cache.AddBuffer>(1 + 2); + if (!_cache PTR_DEREF HasBuffers()) { + _cache PTR_DEREF AddBuffer>(1 + 2); } if (_recalculate) { - _cache.ResetPrevCalculated(); + _cache PTR_DEREF ResetPrevCalculated(); } - _cache.SetPrevCalculated(Indi_ZigZag::Calculate(INDICATOR_CALCULATE_GET_PARAMS_LONG, _cache.GetBuffer(0), - _cache.GetBuffer(1), _cache.GetBuffer(2), _depth, - _deviation, _backstep)); + _cache PTR_DEREF SetPrevCalculated(Indi_ZigZag::Calculate( + INDICATOR_CALCULATE_GET_PARAMS_LONG, _cache PTR_DEREF GetBuffer(0), + _cache PTR_DEREF GetBuffer(1), _cache PTR_DEREF GetBuffer(2), _depth, _deviation, _backstep)); - return _cache.GetTailValue(_mode, _abs_shift); + return _cache PTR_DEREF GetTailValue(_mode, _abs_shift); } /** diff --git a/Indicators/Indi_ZigZagColor.mqh b/Indicators/Indi_ZigZagColor.mqh index c26a08007..5877cb0a1 100644 --- a/Indicators/Indi_ZigZagColor.mqh +++ b/Indicators/Indi_ZigZagColor.mqh @@ -110,22 +110,22 @@ class Indi_ZigZagColor : public Indicator { static double iZigZagColorOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _depth, int _deviation, int _backstep, int _mode, int _abs_shift, IndiBufferCache *_cache, bool _recalculate = false) { - _cache.SetPriceBuffer(_open, _high, _low, _close); + _cache PTR_DEREF SetPriceBuffer(_open, _high, _low, _close); - if (!_cache.HasBuffers()) { - _cache.AddBuffer>(3 + 2); + if (!_cache PTR_DEREF HasBuffers()) { + _cache PTR_DEREF AddBuffer>(3 + 2); } if (_recalculate) { - _cache.ResetPrevCalculated(); + _cache PTR_DEREF ResetPrevCalculated(); } - _cache.SetPrevCalculated(Indi_ZigZagColor::Calculate(INDICATOR_CALCULATE_GET_PARAMS_LONG, - _cache.GetBuffer(0), _cache.GetBuffer(1), - _cache.GetBuffer(2), _cache.GetBuffer(3), - _cache.GetBuffer(4), _depth, _deviation, _backstep)); + _cache PTR_DEREF SetPrevCalculated(Indi_ZigZagColor::Calculate( + INDICATOR_CALCULATE_GET_PARAMS_LONG, _cache PTR_DEREF GetBuffer(0), + _cache PTR_DEREF GetBuffer(1), _cache PTR_DEREF GetBuffer(2), + _cache PTR_DEREF GetBuffer(3), _cache PTR_DEREF GetBuffer(4), _depth, _deviation, _backstep)); - return _cache.GetTailValue(_mode, _abs_shift); + return _cache PTR_DEREF GetTailValue(_mode, _abs_shift); } /** diff --git a/Math/Math.extern.h b/Math/Math.extern.h index da468d94e..637a790c7 100644 --- a/Math/Math.extern.h +++ b/Math/Math.extern.h @@ -44,6 +44,14 @@ T MathPow(T base, T exponent) { return std::pow(base, exponent); } template +T MathLog(T value) { + return std::log(value); +} +template +T MathExp(T value) { + return std::exp(value); +} +template T MathSqrt(T value) { return std::sqrt(value); } diff --git a/Platform/Platform.h b/Platform/Platform.h index e7b6d9371..67d33153b 100644 --- a/Platform/Platform.h +++ b/Platform/Platform.h @@ -440,6 +440,38 @@ class Platform { return period; } + /** + * Returns the point size of the current symbol in the quote currency. + * @see https://docs.mql4.com/check/point + */ + static double GetPoint() { + if (symbol == PLATFORM_WRONG_SYMBOL) { + RUNTIME_ERROR( + "Retrieving _Point variable or calling Point() outside the OnTick() of the currently ticking indicator is " + "prohibited!"); + } + + Alert("Error: Platform::GetPoint() is not yet implemented! Returning 0.01."); + DebugBreak(); + return 0.01; + } + + /** + * Returns the number of decimal digits determining the accuracy of price of the current chart symbol. + * @see https://docs.mql4.com/check/digits + */ + static int GetDigits() { + if (symbol == PLATFORM_WRONG_SYMBOL) { + RUNTIME_ERROR( + "Retrieving _Digits variable or calling Digits() outside the OnTick() of the currently ticking indicator is " + "prohibited!"); + } + + Alert("Error: Platform::GetDigits() is not yet implemented! Returning 2."); + DebugBreak(); + return 2; + } + private: /** * Sets symbol of the currently ticking indicator. @@ -804,6 +836,12 @@ SymbolGetter::operator string() const { return Platform::GetSymbol(); } ENUM_TIMEFRAMES Period() { return Platform::GetPeriod(); } +double Point() { return Platform::GetPoint(); } +#define _Point (Point()) + +int Digits() { return Platform::GetDigits(); } +#define _Digits (Digits()) + datetime StructToTime(MqlDateTime &dt_struct) { tm ltm; ltm.tm_mday = dt_struct.day; diff --git a/Platform/Terminal.define.h b/Platform/Terminal.define.h index d99fb5c98..fb94241be 100644 --- a/Platform/Terminal.define.h +++ b/Platform/Terminal.define.h @@ -98,6 +98,7 @@ #define clrLightBlue 0x00ADD8E6 #define clrLightCoral 0x00F08080 #define clrLightCyan 0x00E0FFFF +#define clrLightGoldenrod 0x00EEDC82 #define clrLightGoldenrodYellow 0x00FAFAD2 #define clrLightGreen 0x0090EE90 #define clrLightGrey 0x00D3D3D3 diff --git a/Std.h b/Std.h index 181592c58..f5d05f864 100644 --- a/Std.h +++ b/Std.h @@ -69,8 +69,8 @@ #define PTR_DEREF -> #define PTR_ATTRIB(O, A) O->A #define PTR_ATTRIB2(O, A, B) O->A->B -#define PTR_TO_REF(PTR) (*PTR) -#define REF_TO_PTR(PTR) (&PTR) +#define PTR_TO_REF(PTR) (*(PTR)) +#define REF_TO_PTR(PTR) (&(PTR)) #define MAKE_REF_FROM_PTR(TYPE, NAME, PTR) TYPE& NAME = PTR #define REF_DEREF .Ptr()-> #define int64 long long diff --git a/Storage/Cache/IndiBufferCache.h b/Storage/Cache/IndiBufferCache.h index 09cad345a..6c7248796 100644 --- a/Storage/Cache/IndiBufferCache.h +++ b/Storage/Cache/IndiBufferCache.h @@ -172,17 +172,17 @@ class IndiBufferCache : public Dynamic { REF_TO(ValueStorage) GetPriceBuffer(ENUM_APPLIED_PRICE _applied_price) { switch (_applied_price) { case PRICE_OPEN: - return price_open_buffer; + return PTR_TO_REF(price_open_buffer); case PRICE_HIGH: - return price_high_buffer; + return PTR_TO_REF(price_high_buffer); case PRICE_LOW: - return price_low_buffer; + return PTR_TO_REF(price_low_buffer); case PRICE_CLOSE: - return price_close_buffer; + return PTR_TO_REF(price_close_buffer); default: RUNTIME_ERROR("Applied price not supported!"); } - return nullptr; + return PTR_TO_REF((ValueStorage *)nullptr); } /** diff --git a/Storage/ValueStorage.applied_price.h b/Storage/ValueStorage.applied_price.h index 5b513e056..f7fdb91f8 100644 --- a/Storage/ValueStorage.applied_price.h +++ b/Storage/ValueStorage.applied_price.h @@ -24,6 +24,11 @@ * Price getter version of ValueStorage. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Platform/Chart/Chart.struct.h" #include "Cache/ObjectsCache.h" diff --git a/Storage/ValueStorage.h b/Storage/ValueStorage.h index ab43f81e5..07cbbc449 100644 --- a/Storage/ValueStorage.h +++ b/Storage/ValueStorage.h @@ -98,29 +98,32 @@ enum ENUM_IPEAK { IPEAK_LOWEST, IPEAK_HIGHEST }; REF_TO(ValueStorage) _price = PTR_TO_REF(_price_ptr); \ INDICATOR_CALCULATE_POPULATE_CACHE(INDI, KEY) -#define INDICATOR_CALCULATE_POPULATE_PARAMS_AND_CACHE_LONG(INDI, KEY) \ - IndicatorData *_suitable_ds = INDI PTR_DEREF GetSuitableDataSource(); \ - ValueStorage &_time = \ - (ValueStorage &)(_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_TIME)); \ - REF_TO(ValueStorage) \ - _tick_volume = \ - REF_CAST(ValueStorage)(_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_TICK_VOLUME)); \ - REF_TO(ValueStorage) \ - _volume = REF_CAST(ValueStorage)(_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_VOLUME)); \ - REF_TO(ValueStorage) \ - _spread = REF_CAST(ValueStorage)(_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_SPREAD)); \ - REF_TO(ValueStorage) \ - _price_open = \ - REF_CAST(ValueStorage)(_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_OPEN)); \ - REF_TO(ValueStorage) \ - _price_high = \ - REF_CAST(ValueStorage)(_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_HIGH)); \ - REF_TO(ValueStorage) \ - _price_low = \ - REF_CAST(ValueStorage)(_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_LOW)); \ - REF_TO(ValueStorage) \ - _price_close = \ - REF_CAST(ValueStorage)(_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_CLOSE)); \ +#define INDICATOR_CALCULATE_POPULATE_PARAMS_AND_CACHE_LONG(INDI, KEY) \ + IndicatorData *_suitable_ds = INDI PTR_DEREF GetSuitableDataSource(); \ + REF_TO(ValueStorage) \ + _time = REF_CAST(ValueStorage) \ + PTR_TO_REF(_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_TIME)); \ + REF_TO(ValueStorage) \ + _tick_volume = REF_CAST(ValueStorage) \ + PTR_TO_REF(_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_TICK_VOLUME)); \ + REF_TO(ValueStorage) \ + _volume = REF_CAST(ValueStorage) \ + PTR_TO_REF(_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_VOLUME)); \ + REF_TO(ValueStorage) \ + _spread = REF_CAST(ValueStorage) \ + PTR_TO_REF(_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_SPREAD)); \ + REF_TO(ValueStorage) \ + _price_open = REF_CAST(ValueStorage) \ + PTR_TO_REF(_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_OPEN)); \ + REF_TO(ValueStorage) \ + _price_high = REF_CAST(ValueStorage) \ + PTR_TO_REF(_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_HIGH)); \ + REF_TO(ValueStorage) \ + _price_low = REF_CAST(ValueStorage) \ + PTR_TO_REF(_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_LOW)); \ + REF_TO(ValueStorage) \ + _price_close = REF_CAST(ValueStorage) \ + PTR_TO_REF(_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_PRICE_CLOSE)); \ INDICATOR_CALCULATE_POPULATE_CACHE(INDI, KEY) #define INDICATOR_CALCULATE_POPULATED_PARAMS_LONG \ diff --git a/Storage/ValueStorage.native.h b/Storage/ValueStorage.native.h index 048d82fcb..1ce9b13f6 100644 --- a/Storage/ValueStorage.native.h +++ b/Storage/ValueStorage.native.h @@ -24,6 +24,11 @@ * Native array version of ValueStorage. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "ValueStorage.h" From 65a4d6326fa29a052c50077c5c61a1102ab0d81e Mon Sep 17 00:00:00 2001 From: Adrian Kierzkowski Date: Mon, 3 Jul 2023 20:38:11 +0200 Subject: [PATCH 103/109] WIP. Fixing C++ errors. Closer to the end. --- Common.define.h | 4 + Common.extern.h | 4 +- Convert.basic.h | 6 +- Convert.extern.h | 2 +- EA.mqh | 18 +- Exchange/Account/Account.define.h | 5 + Exchange/Account/Account.extern.h | 5 + Exchange/Account/Account.h | 10 +- Exchange/Account/AccountBase.h | 9 +- Exchange/Account/AccountForex.h | 8 +- Exchange/Account/AccountMt.h | 16 +- Exchange/Exchange.h | 14 +- Exchange/SymbolInfo/SymbolInfo.define.h | 5 + Exchange/SymbolInfo/SymbolInfo.extern.h | 10 +- Exchange/SymbolInfo/SymbolInfo.h | 8 +- .../SymbolInfo/SymbolInfo.struct.static.h | 4 +- File.define.h | 1 + File.extern.h | 9 +- Indicator/Indicator.h | 9 +- Indicator/Indicator.struct.serialize.h | 5 + Indicator/IndicatorCandle.h | 6 - Indicator/IndicatorCandle.provider.h | 6 - Indicator/IndicatorData.h | 7 - Indicator/IndicatorData.struct.serialize.h | 5 + Indicator/IndicatorRenko.h | 6 - Indicator/IndicatorTf.h | 6 - Indicator/IndicatorTf.provider.h | 6 - Indicator/IndicatorTick.h | 6 - Indicator/IndicatorTick.provider.h | 9 +- Indicators/Bitwise/Indi_Candle.mqh | 5 + Indicators/Bitwise/Indi_Pattern.mqh | 5 + Indicators/Bitwise/includes.h | 5 + Indicators/DrawIndicator.mqh | 10 +- Indicators/Indi_AC.mqh | 8 +- Indicators/Indi_AD.mqh | 6 +- Indicators/Indi_ADXW.mqh | 5 + Indicators/Indi_AMA.mqh | 5 + Indicators/Indi_ASI.mqh | 5 + Indicators/Indi_BWMFI.mqh | 5 + Indicators/Indi_BWZT.mqh | 5 + Indicators/Indi_BearsPower.mqh | 5 + Indicators/Indi_BullsPower.mqh | 5 + Indicators/Indi_CCI.mqh | 5 + Indicators/Indi_CHO.mqh | 5 + Indicators/Indi_CHV.mqh | 5 + Indicators/Indi_ColorBars.mqh | 5 + Indicators/Indi_ColorCandlesDaily.mqh | 5 + Indicators/Indi_ColorLine.mqh | 5 + Indicators/Indi_DEMA.mqh | 8 +- Indicators/Indi_DeMarker.mqh | 5 + Indicators/Indi_Demo.mqh | 5 + Indicators/Indi_DetrendedPrice.mqh | 5 + Indicators/Indi_Drawer.mqh | 5 + Indicators/Indi_Drawer.struct.h | 5 + Indicators/Indi_Force.mqh | 5 + Indicators/Indi_FractalAdaptiveMA.mqh | 5 + Indicators/Indi_Fractals.mqh | 5 + Indicators/Indi_Gator.mqh | 6 + Indicators/Indi_HeikenAshi.mqh | 5 + Indicators/Indi_Ichimoku.mqh | 5 + Indicators/Indi_Killzones.mqh | 5 + Indicators/Indi_MFI.mqh | 5 + Indicators/Indi_MassIndex.mqh | 5 + Indicators/Indi_Momentum.mqh | 5 + Indicators/Indi_OBV.mqh | 5 + Indicators/Indi_OsMA.mqh | 5 + Indicators/Indi_PriceChannel.mqh | 8 +- Indicators/Indi_PriceVolumeTrend.mqh | 5 + Indicators/Indi_RS.mqh | 7 +- Indicators/Indi_RVI.mqh | 5 + Indicators/Indi_RateOfChange.mqh | 5 + Indicators/Indi_StdDev.mqh | 5 + Indicators/Indi_TEMA.mqh | 5 + Indicators/Indi_TRIX.mqh | 5 + Indicators/Indi_UltimateOscillator.mqh | 15 +- Indicators/Indi_VIDYA.mqh | 5 + Indicators/Indi_VROC.mqh | 5 + Indicators/Indi_Volumes.mqh | 5 + Indicators/Indi_WilliamsAD.mqh | 6 + Indicators/Indi_ZigZag.mqh | 13 +- Indicators/Indi_ZigZagColor.mqh | 7 +- Indicators/OHLC/Indi_OHLC.mqh | 5 + Indicators/OHLC/includes.h | 5 + Indicators/Oscillator/Indi_MACD.h | 5 + Indicators/Oscillator/Indi_RSI.h | 5 + Indicators/Oscillator/Indi_Stochastic.h | 5 + Indicators/Oscillator/Indi_WPR.h | 5 + Indicators/Oscillator/includes.h | 5 + Indicators/Price/Indi_AppliedPrice.h | 5 + Indicators/Price/Indi_MA.h | 9 +- Indicators/Price/includes.h | 5 + Indicators/PriceMulti/Indi_Alligator.h | 5 + Indicators/PriceMulti/includes.h | 5 + Indicators/PriceRange/Indi_Bands.h | 5 + Indicators/PriceRange/Indi_Pivot.h | 5 + Indicators/PriceRange/Indi_SAR.h | 5 + Indicators/PriceRange/includes.h | 5 + Indicators/Special/Indi_Custom.mqh | 9 +- Indicators/Special/Indi_Math.mqh | 5 + Indicators/Special/includes.h | 5 + Indicators/Tick/Indi_TickMt.h | 4 +- Indicators/Tick/includes.h | 5 + Indicators/includes.h | 5 + Log.mqh | 11 +- MD5.mqh | 7 +- Mail.mqh | 12 +- Market.struct.h | 9 +- Math/Math.extern.h | 1 + Math/Matrix.h | 9 +- Math/MatrixMini.h | 9 +- Pattern.mqh | 5 + Platform/Chart/Chart.define.h | 5 + Platform/Chart/Chart.h | 17 +- Platform/Chart/Chart.struct.serialize.h | 5 + Platform/Chart3D/Chart3D.h | 5 + Platform/Chart3D/Chart3DCandles.h | 5 + Platform/Chart3D/Chart3DType.h | 5 + Platform/Chart3D/Cube.h | 5 + Platform/Chart3D/Device.h | 5 + Platform/Chart3D/Devices/MTDX/MTDXDevice.h | 5 + .../Chart3D/Devices/MTDX/MTDXIndexBuffer.h | 5 + Platform/Chart3D/Devices/MTDX/MTDXShader.h | 5 + .../Chart3D/Devices/MTDX/MTDXVertexBuffer.h | 5 + Platform/Chart3D/Face.h | 5 + Platform/Chart3D/Frontend.h | 5 + Platform/Chart3D/Frontends/MT5Frontend.h | 5 + Platform/Chart3D/IndexBuffer.h | 5 + Platform/Chart3D/Interface.h | 5 + Platform/Chart3D/Material.h | 5 + Platform/Chart3D/Math.h | 5 + Platform/Chart3D/Mesh.h | 7 +- Platform/Chart3D/Shader.h | 5 + Platform/Chart3D/ShaderVertexLayout.struct.h | 5 + Platform/Chart3D/TSR.h | 5 + Platform/Chart3D/Vertex.h | 5 + Platform/Chart3D/VertexBuffer.h | 5 + Platform/Order.define.h | 5 + Platform/Order.h | 23 +- Platform/OrderQuery.h | 9 +- Platform/Orders.h | 9 +- Platform/Platform.extern.h | 12 + Platform/PlatformTime.h | 6 +- Platform/Plot.h | 5 + Platform/Terminal.define.h | 5 + Platform/Terminal.h | 13 +- Platform/Web/Web.h | 7 +- Profiler.mqh | 5 + Report.mqh | 59 ++-- Serializer/Serializer.define.h | 5 + Serializer/Serializer.h | 9 +- Serializer/SerializerBinary.h | 9 +- Serializer/SerializerConverter.h | 6 - Serializer/SerializerCsv.h | 13 +- Serializer/SerializerDict.h | 9 +- Serializer/SerializerJson.h | 9 +- Serializer/SerializerNode.h | 9 +- Serializer/SerializerNodeIterator.h | 9 +- Serializer/SerializerNodeParam.h | 11 +- Serializer/SerializerObject.h | 9 +- Serializer/SerializerSqlite.h | 9 +- SetFile.mqh | 281 +++++++++--------- Socket.mqh | 5 + Stats.mqh | 5 + Storage/Array.extern.h | 11 + Storage/Array.h | 22 ++ Storage/Collection.h | 8 +- Storage/Data.define.h | 5 + Storage/Database.extern.h | 7 +- Storage/Database.h | 8 +- Storage/Database.struct.h | 5 + Storage/DateTime.h | 9 +- Storage/Dict/Buffer/Buffer.h | 8 +- Storage/Dict/Buffer/BufferCandle.h | 9 +- Storage/Dict/Buffer/BufferFXT.h | 9 +- Storage/Dict/Buffer/BufferStruct.h | 9 +- Storage/Dict/Buffer/BufferTick.h | 9 +- Storage/Dict/Dict.h | 9 +- Storage/Dict/DictBase.h | 9 +- Storage/Dict/DictSlot.h | 9 +- Storage/Object.enum.h | 2 +- Storage/Object.extern.h | 1 + Storage/Object.h | 8 +- Storage/Redis.h | 6 + Storage/String.extern.h | 2 +- Storage/String.h | 8 +- Storage/ValueStorage.price_median.h | 5 + Storage/ValueStorage.price_typical.h | 5 + Storage/ValueStorage.price_weighted.h | 5 + Strategy.struct.pricestop.h | 4 +- SummaryReport.mqh | 7 +- Test.mqh | 5 + Tester.mqh | 5 + Tests.mqh | 5 + Timer.mqh | 5 + Trade/TradeSignal.h | 5 + Trade/TradeSignal.struct.h | 5 + Trade/TradeSignalManager.h | 5 + Trade/TradeSignalManager.struct.h | 5 + 198 files changed, 1109 insertions(+), 513 deletions(-) diff --git a/Common.define.h b/Common.define.h index 26767d7fb..0cdc7ff9f 100644 --- a/Common.define.h +++ b/Common.define.h @@ -24,7 +24,11 @@ * @file * Defines common defines. */ + #ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once + // Data types. #include typedef std::string string; diff --git a/Common.extern.h b/Common.extern.h index 433e1a994..3b2baddf9 100644 --- a/Common.extern.h +++ b/Common.extern.h @@ -22,13 +22,15 @@ // Define external global functions. #ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. #pragma once + #include #include #include "Platform/Chart/Chart.enum.h" -#include "Storage/DateTime.enum.h" #include "Platform/Terminal.define.h" +#include "Storage/DateTime.enum.h" void DebugBreak() { #ifdef _MSC_VER diff --git a/Convert.basic.h b/Convert.basic.h index 9dd8bc9b4..496e78bee 100644 --- a/Convert.basic.h +++ b/Convert.basic.h @@ -20,16 +20,16 @@ * */ -// Prevents processing this includes file for the second time. #ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. #pragma once #endif // Includes. -#include "Storage/Array.h" #include "Common.extern.h" -#include "Storage/DateTime.h" #include "Std.h" +#include "Storage/Array.h" +#include "Storage/DateTime.h" #include "Storage/String.h" /** diff --git a/Convert.extern.h b/Convert.extern.h index f7a2861fd..7ca60cbe8 100644 --- a/Convert.extern.h +++ b/Convert.extern.h @@ -20,8 +20,8 @@ * */ -// Prevents processing this includes file for the second time. #ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. #pragma once // Includes. diff --git a/EA.mqh b/EA.mqh index b878d774a..c7f8e7e29 100644 --- a/EA.mqh +++ b/EA.mqh @@ -25,29 +25,30 @@ * Implements Expert Advisor class for writing custom trading robots. */ -// Prevents processing this includes file for the second time. -#ifndef EA_MQH -#define EA_MQH +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif // Includes. -#include "Platform/Chart/Chart.h" -#include "Storage/Data.struct.h" -#include "Storage/Dict/Dict.h" -#include "Storage/Dict/DictObject.h" #include "EA.enum.h" #include "EA.struct.h" #include "Market.mqh" +#include "Platform/Chart/Chart.h" #include "Platform/Platform.h" +#include "Platform/Terminal.h" #include "Refs.struct.h" #include "Serializer/SerializerConverter.h" #include "Serializer/SerializerCsv.h" #include "Serializer/SerializerJson.h" #include "Serializer/SerializerSqlite.h" +#include "Storage/Data.struct.h" +#include "Storage/Dict/Dict.h" +#include "Storage/Dict/DictObject.h" #include "Strategy.mqh" #include "SummaryReport.mqh" #include "Task/TaskManager.h" #include "Task/Taskable.h" -#include "Platform/Terminal.h" #include "Trade.mqh" #include "Trade/TradeSignal.h" #include "Trade/TradeSignalManager.h" @@ -1145,4 +1146,3 @@ class EA : public Taskable { return SerializerNodeObject; } }; -#endif // EA_MQH diff --git a/Exchange/Account/Account.define.h b/Exchange/Account/Account.define.h index 165a588b4..db6b52a9d 100644 --- a/Exchange/Account/Account.define.h +++ b/Exchange/Account/Account.define.h @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Defines. #define ACC_OP_BALANCE 6 // Undocumented balance history statement entry. #define ACC_OP_CREDIT 7 // Undocumented credit history statement entry. diff --git a/Exchange/Account/Account.extern.h b/Exchange/Account/Account.extern.h index 678b1f5ed..fd498bf25 100644 --- a/Exchange/Account/Account.extern.h +++ b/Exchange/Account/Account.extern.h @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../../Storage/String.extern.h" #include "Account.enum.h" diff --git a/Exchange/Account/Account.h b/Exchange/Account/Account.h index a787c53c8..0bb89482e 100644 --- a/Exchange/Account/Account.h +++ b/Exchange/Account/Account.h @@ -20,13 +20,14 @@ * */ -// Prevents processing this includes file for the second time. -#ifndef ACCOUNT_H -#define ACCOUNT_H +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif // Includes. -#include "../../Storage/Dict/Buffer/BufferStruct.h" #include "../../Serializer/Serializer.h" +#include "../../Storage/Dict/Buffer/BufferStruct.h" #include "AccountBase.h" /** @@ -56,4 +57,3 @@ class Account : public AccountBase { */ ~Account() {} }; -#endif // ACCOUNT_H diff --git a/Exchange/Account/AccountBase.h b/Exchange/Account/AccountBase.h index f8191256c..4bbb31272 100644 --- a/Exchange/Account/AccountBase.h +++ b/Exchange/Account/AccountBase.h @@ -20,9 +20,10 @@ * */ -// Prevents processing this includes file for the second time. -#ifndef ACCOUNTBASE_H -#define ACCOUNTBASE_H +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif // Includes. #include "../../Refs.mqh" @@ -56,5 +57,3 @@ class AccountBase : public Dynamic { */ ~AccountBase() {} }; - -#endif // ACCOUNTBASE_H diff --git a/Exchange/Account/AccountForex.h b/Exchange/Account/AccountForex.h index e26810b62..28cd30ac0 100644 --- a/Exchange/Account/AccountForex.h +++ b/Exchange/Account/AccountForex.h @@ -20,9 +20,10 @@ * */ -// Prevents processing this includes file for the second time. -#ifndef ACCOUNTFOREX_H -#define ACCOUNTFOREX_H +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif // Includes. #include "../../Serializer/Serializer.h" @@ -53,4 +54,3 @@ class AccountForex : public Account { */ ~AccountForex() {} }; -#endif // ACCOUNTFOREX_H diff --git a/Exchange/Account/AccountMt.h b/Exchange/Account/AccountMt.h index 36f7fa12f..4d18afaec 100644 --- a/Exchange/Account/AccountMt.h +++ b/Exchange/Account/AccountMt.h @@ -20,23 +20,24 @@ * */ -// Prevents processing this includes file for the second time. -#ifndef ACCOUNT_MT_MQH -#define ACCOUNT_MT_MQH +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif // Forward class declaration. class AccountMt; // Includes. -#include "../../Storage/Array.h" -#include "../../Storage/Dict/Buffer/BufferStruct.h" #include "../../Convert.mqh" -#include "../../Storage/Data.struct.h" +#include "../../Exchange/SymbolInfo/SymbolInfo.h" #include "../../Indicator/Indicator.struct.h" #include "../../Platform/Order.struct.h" #include "../../Platform/Orders.h" #include "../../Serializer/Serializer.h" -#include "../../Exchange/SymbolInfo/SymbolInfo.h" +#include "../../Storage/Array.h" +#include "../../Storage/Data.struct.h" +#include "../../Storage/Dict/Buffer/BufferStruct.h" #include "../../Task/TaskCondition.enum.h" #include "../../Trade.struct.h" #include "Account.define.h" @@ -678,4 +679,3 @@ class AccountMt { */ static string AccountInfoString(ENUM_ACCOUNT_INFO_STRING _prop_id) { return ::AccountInfoString(_prop_id); } }; -#endif // ACCOUNT_MT_MQH diff --git a/Exchange/Exchange.h b/Exchange/Exchange.h index cefd5847b..609232c9a 100644 --- a/Exchange/Exchange.h +++ b/Exchange/Exchange.h @@ -20,17 +20,16 @@ * */ -/** - * Exchange class. - */ -#ifndef EXCHANGE_H -#define EXCHANGE_H +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif // Includes. -#include "Account/Account.h" -#include "../Storage/Dict/DictObject.h" #include "../Exchange/SymbolInfo/SymbolInfo.h" +#include "../Storage/Dict/DictObject.h" #include "../Trade.mqh" +#include "Account/Account.h" #include "Exchange.struct.h" class Exchange : public Dynamic { @@ -99,4 +98,3 @@ class Exchange : public Dynamic { */ void TradeRemove(string _name) { trades.Unset(_name); } }; -#endif // EXCHANGE_H diff --git a/Exchange/SymbolInfo/SymbolInfo.define.h b/Exchange/SymbolInfo/SymbolInfo.define.h index 74f19e889..a09cf157a 100644 --- a/Exchange/SymbolInfo/SymbolInfo.define.h +++ b/Exchange/SymbolInfo/SymbolInfo.define.h @@ -25,6 +25,11 @@ * SymbolInfo's defines. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + /* Defines */ #ifdef __MQL5__ diff --git a/Exchange/SymbolInfo/SymbolInfo.extern.h b/Exchange/SymbolInfo/SymbolInfo.extern.h index e6577ec2b..8446ebe7d 100644 --- a/Exchange/SymbolInfo/SymbolInfo.extern.h +++ b/Exchange/SymbolInfo/SymbolInfo.extern.h @@ -20,16 +20,18 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../../Platform/Order.enum.h" -#include "SymbolInfo.enum.h" #include "../../Tick/Tick.struct.h" +#include "SymbolInfo.enum.h" // Define external global functions. #ifndef __MQL__ -// Allows the preprocessor to include a header file when it is needed. -#pragma once - extern long SymbolInfoInteger(string name, ENUM_SYMBOL_INFO_INTEGER prop_id); extern bool SymbolInfoMarginRate(string name, ENUM_ORDER_TYPE order_type, double &initial_margin_rate, double &maintenance_margin_rate); diff --git a/Exchange/SymbolInfo/SymbolInfo.h b/Exchange/SymbolInfo/SymbolInfo.h index f62ed4443..1b8c889df 100644 --- a/Exchange/SymbolInfo/SymbolInfo.h +++ b/Exchange/SymbolInfo/SymbolInfo.h @@ -20,9 +20,10 @@ * */ -// Prevents processing this includes file for the second time. -#ifndef SYMBOLINFO_H -#define SYMBOLINFO_H +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif // Includes symbol defines, enums and structs. #include "SymbolInfo.define.h" @@ -561,4 +562,3 @@ class SymbolInfo : public Object { */ Log *GetLogger() { return GetPointer(logger); } }; -#endif // SYMBOLINFO_H diff --git a/Exchange/SymbolInfo/SymbolInfo.struct.static.h b/Exchange/SymbolInfo/SymbolInfo.struct.static.h index 2ab5f6257..84cc1f4cb 100644 --- a/Exchange/SymbolInfo/SymbolInfo.struct.static.h +++ b/Exchange/SymbolInfo/SymbolInfo.struct.static.h @@ -20,8 +20,8 @@ * */ -// Prevents processing this includes file for the second time. #ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. #pragma once #endif @@ -29,9 +29,9 @@ #include "../../Platform/Order.enum.h" #include "../../Platform/Platform.extern.h" #include "../../Std.h" +#include "../../Tick/Tick.struct.h" #include "SymbolInfo.enum.h" #include "SymbolInfo.extern.h" -#include "../../Tick/Tick.struct.h" /** * Struct to provide symbol information. diff --git a/File.define.h b/File.define.h index 491258389..4dd7e6bf7 100644 --- a/File.define.h +++ b/File.define.h @@ -21,6 +21,7 @@ */ // Defines. #ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. #pragma once // File constants to read the whole value of char, short or int type. diff --git a/File.extern.h b/File.extern.h index 1ba5dbba5..2d8c5f557 100644 --- a/File.extern.h +++ b/File.extern.h @@ -20,16 +20,19 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "File.define.h" +#include "Platform/Terminal.define.h" #include "Storage/MemoryFileSystem.h" #include "Storage/String.extern.h" -#include "Platform/Terminal.define.h" // Define external global functions. #ifndef __MQL__ -#pragma once - MemoryFileSystem _memfs; extern bool FileIsEnding(int file_handle); diff --git a/Indicator/Indicator.h b/Indicator/Indicator.h index cbc963777..b01f0c31a 100644 --- a/Indicator/Indicator.h +++ b/Indicator/Indicator.h @@ -20,9 +20,10 @@ * */ -// Ignore processing of this file if already included. -#ifndef INDICATOR_MQH -#define INDICATOR_MQH +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif // Forward class declaration. struct IndicatorParams; @@ -713,5 +714,3 @@ int IndicatorCounted(int _value = 0) { return prev_calculated; } #endif - -#endif diff --git a/Indicator/Indicator.struct.serialize.h b/Indicator/Indicator.struct.serialize.h index 0a3e2a67d..acb56a671 100644 --- a/Indicator/Indicator.struct.serialize.h +++ b/Indicator/Indicator.struct.serialize.h @@ -25,6 +25,11 @@ * Includes Indicator's struct serializers. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + #include "../Serializer/Serializer.h" #include "../Serializer/SerializerNode.enum.h" #include "Indicator.struct.h" diff --git a/Indicator/IndicatorCandle.h b/Indicator/IndicatorCandle.h index d071c57a1..3f53afd4c 100644 --- a/Indicator/IndicatorCandle.h +++ b/Indicator/IndicatorCandle.h @@ -20,10 +20,6 @@ * */ -// Ignore processing of this file if already included. -#ifndef INDICATOR_CANDLE_H -#define INDICATOR_CANDLE_H - #ifndef __MQL__ // Allows the preprocessor to include a header file when it is needed. #pragma once @@ -409,5 +405,3 @@ class IndicatorCandle : public Indicator { /* Virtual methods */ }; - -#endif diff --git a/Indicator/IndicatorCandle.provider.h b/Indicator/IndicatorCandle.provider.h index d0f12734e..17d46c3f5 100644 --- a/Indicator/IndicatorCandle.provider.h +++ b/Indicator/IndicatorCandle.provider.h @@ -20,10 +20,6 @@ * */ -// Ignore processing of this file if already included. -#ifndef INDICATOR_CANDLE_PROVIDER_H -#define INDICATOR_CANDLE_PROVIDER_H - #ifndef __MQL__ // Allows the preprocessor to include a header file when it is needed. #pragma once @@ -63,5 +59,3 @@ class ItemsHistoryCandleProvider : public ItemsHistoryItemProvider { */ string ToString() override { return "IndicatorTf candle provider on " + indi PTR_DEREF GetFullName(); } }; - -#endif // INDICATOR_TF_PROVIDER_H diff --git a/Indicator/IndicatorTick.h b/Indicator/IndicatorTick.h index 0dfdaa89c..017dfd4ac 100644 --- a/Indicator/IndicatorTick.h +++ b/Indicator/IndicatorTick.h @@ -20,10 +20,6 @@ * */ -// Ignore processing of this file if already included. -#ifndef INDICATOR_TICK_H -#define INDICATOR_TICK_H - #ifndef __MQL__ // Allows the preprocessor to include a header file when it is needed. #pragma once @@ -264,5 +260,3 @@ IndicatorDataEntry TickToEntry(long _timestamp, TickAB& _tick) { _entry.SetFlag(INDI_ENTRY_FLAG_IS_VALID, _tick.ask != 0 && _tick.bid != 0); return _entry; } - -#endif diff --git a/Indicator/IndicatorTick.provider.h b/Indicator/IndicatorTick.provider.h index 40c690d34..cb11c45eb 100644 --- a/Indicator/IndicatorTick.provider.h +++ b/Indicator/IndicatorTick.provider.h @@ -20,9 +20,10 @@ * */ -// Ignore processing of this file if already included. -#ifndef INDICATOR_TICK_PROVIDER_H -#define INDICATOR_TICK_PROVIDER_H +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif #ifndef __MQL__ // Allows the preprocessor to include a header file when it is needed. @@ -70,5 +71,3 @@ class ItemsHistoryTickProvider : public ItemsHistoryItemProvider> { */ string ToString() override { return "IndicatorTick tick provider on " + indi PTR_DEREF GetFullName(); } }; - -#endif // INDICATOR_TICK_PROVIDER_H diff --git a/Indicators/Bitwise/Indi_Candle.mqh b/Indicators/Bitwise/Indi_Candle.mqh index 154129dcd..af1400619 100644 --- a/Indicators/Bitwise/Indi_Candle.mqh +++ b/Indicators/Bitwise/Indi_Candle.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../../Bar.struct.h" #include "../../Indicator/Indicator.h" diff --git a/Indicators/Bitwise/Indi_Pattern.mqh b/Indicators/Bitwise/Indi_Pattern.mqh index 2b1f5ccd1..58b40c201 100644 --- a/Indicators/Bitwise/Indi_Pattern.mqh +++ b/Indicators/Bitwise/Indi_Pattern.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../../Bar.struct.h" #include "../../Indicator/Indicator.define.h" diff --git a/Indicators/Bitwise/includes.h b/Indicators/Bitwise/includes.h index f6bd6e906..740c61001 100644 --- a/Indicators/Bitwise/includes.h +++ b/Indicators/Bitwise/includes.h @@ -25,6 +25,11 @@ * Include file to include all bitwise indicators. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Bitwise indicators. #include "Indi_Candle.mqh" #include "Indi_Pattern.mqh" diff --git a/Indicators/DrawIndicator.mqh b/Indicators/DrawIndicator.mqh index 7293b5cdc..f64a5081e 100644 --- a/Indicators/DrawIndicator.mqh +++ b/Indicators/DrawIndicator.mqh @@ -25,15 +25,16 @@ * Group of functions intended for working with graphic objects relating to any specified chart. */ -// Ignore processing of this file if already included. -#ifndef DRAW_INDICATOR_MQH -#define DRAW_INDICATOR_MQH +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif // Includes. +#include "../Indicator/IndicatorBase.h" #include "../Platform/Plot.h" #include "../Storage/Dict/DictObject.h" #include "../Storage/Object.h" -#include "../Indicator/IndicatorBase.h" class DrawPoint { public: @@ -135,4 +136,3 @@ class DrawIndicator { } } }; -#endif // DRAW_INDICATOR_MQH diff --git a/Indicators/Indi_AC.mqh b/Indicators/Indi_AC.mqh index 0cd7efe82..19c1819f6 100644 --- a/Indicators/Indi_AC.mqh +++ b/Indicators/Indi_AC.mqh @@ -20,15 +20,15 @@ * */ -// Includes. -#include "../Indicator/Indicator.h" -#include "../Storage/Dict/Buffer/BufferStruct.h" - #ifndef __MQL__ // Allows the preprocessor to include a header file when it is needed. #pragma once #endif +// Includes. +#include "../Indicator/Indicator.h" +#include "../Storage/Dict/Buffer/BufferStruct.h" + // Structs. struct IndiACParams : IndicatorParams { // Struct constructor. diff --git a/Indicators/Indi_AD.mqh b/Indicators/Indi_AD.mqh index e4bb3ee92..3f94e8a57 100644 --- a/Indicators/Indi_AD.mqh +++ b/Indicators/Indi_AD.mqh @@ -20,14 +20,14 @@ * */ -// Includes. -#include "../Indicator/Indicator.h" - #ifndef __MQL__ // Allows the preprocessor to include a header file when it is needed. #pragma once #endif +// Includes. +#include "../Indicator/Indicator.h" + // Structs. struct IndiADParams : IndicatorParams { // Struct constructor. diff --git a/Indicators/Indi_ADXW.mqh b/Indicators/Indi_ADXW.mqh index 01ca8329c..6acef54b7 100644 --- a/Indicators/Indi_ADXW.mqh +++ b/Indicators/Indi_ADXW.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" #include "../Storage/Dict/Buffer/BufferStruct.h" diff --git a/Indicators/Indi_AMA.mqh b/Indicators/Indi_AMA.mqh index 88bc711c6..ed71fd32f 100644 --- a/Indicators/Indi_AMA.mqh +++ b/Indicators/Indi_AMA.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" #include "../Storage/Dict/Buffer/BufferStruct.h" diff --git a/Indicators/Indi_ASI.mqh b/Indicators/Indi_ASI.mqh index 8d73f734d..19e2ab77a 100644 --- a/Indicators/Indi_ASI.mqh +++ b/Indicators/Indi_ASI.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" #include "../Platform/Platform.h" diff --git a/Indicators/Indi_BWMFI.mqh b/Indicators/Indi_BWMFI.mqh index 2582c2eec..62ba99039 100644 --- a/Indicators/Indi_BWMFI.mqh +++ b/Indicators/Indi_BWMFI.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" diff --git a/Indicators/Indi_BWZT.mqh b/Indicators/Indi_BWZT.mqh index 0b20a06cb..2f40af8cb 100644 --- a/Indicators/Indi_BWZT.mqh +++ b/Indicators/Indi_BWZT.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Defines. // 38 bars (DATA_LIMIT) was originally specified by Indicators/Examples/BW-ZoneTrade.mq5 #define INDI_BWZT_DATA_LIMIT 100 diff --git a/Indicators/Indi_BearsPower.mqh b/Indicators/Indi_BearsPower.mqh index 475ce9b97..35e93d760 100644 --- a/Indicators/Indi_BearsPower.mqh +++ b/Indicators/Indi_BearsPower.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" diff --git a/Indicators/Indi_BullsPower.mqh b/Indicators/Indi_BullsPower.mqh index 737b0bf7e..511af2f0d 100644 --- a/Indicators/Indi_BullsPower.mqh +++ b/Indicators/Indi_BullsPower.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" diff --git a/Indicators/Indi_CCI.mqh b/Indicators/Indi_CCI.mqh index 418a229f4..e8c98069f 100644 --- a/Indicators/Indi_CCI.mqh +++ b/Indicators/Indi_CCI.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" #include "Indi_PriceFeeder.mqh" diff --git a/Indicators/Indi_CHO.mqh b/Indicators/Indi_CHO.mqh index 16d7221b7..35d6ec999 100644 --- a/Indicators/Indi_CHO.mqh +++ b/Indicators/Indi_CHO.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Defines. // 2 bars was originally specified by Indicators/Examples/CHO.mq5 #define INDI_CHO_MIN_BARS 2 diff --git a/Indicators/Indi_CHV.mqh b/Indicators/Indi_CHV.mqh index 3119985f0..e305e0ffa 100644 --- a/Indicators/Indi_CHV.mqh +++ b/Indicators/Indi_CHV.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" #include "../Storage/Dict/Buffer/BufferStruct.h" diff --git a/Indicators/Indi_ColorBars.mqh b/Indicators/Indi_ColorBars.mqh index 8ece4900b..49924e9e3 100644 --- a/Indicators/Indi_ColorBars.mqh +++ b/Indicators/Indi_ColorBars.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" #include "../Storage/Dict/Buffer/BufferStruct.h" diff --git a/Indicators/Indi_ColorCandlesDaily.mqh b/Indicators/Indi_ColorCandlesDaily.mqh index 6041fbd82..0b83c596f 100644 --- a/Indicators/Indi_ColorCandlesDaily.mqh +++ b/Indicators/Indi_ColorCandlesDaily.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" #include "../Storage/Dict/Buffer/BufferStruct.h" diff --git a/Indicators/Indi_ColorLine.mqh b/Indicators/Indi_ColorLine.mqh index e8210a155..99ffcbd20 100644 --- a/Indicators/Indi_ColorLine.mqh +++ b/Indicators/Indi_ColorLine.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" #include "../Storage/Dict/Buffer/BufferStruct.h" diff --git a/Indicators/Indi_DEMA.mqh b/Indicators/Indi_DEMA.mqh index 922bc7ffd..9e9961003 100644 --- a/Indicators/Indi_DEMA.mqh +++ b/Indicators/Indi_DEMA.mqh @@ -20,9 +20,10 @@ * */ -// Prevents processing this includes file for the second time. -#ifndef INDI_DEMA_MQH -#define INDI_DEMA_MQH +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif // Defines. #ifdef __MQL5__ @@ -279,4 +280,3 @@ class Indi_DEMA : public Indicator { iparams.applied_price = _applied_price; } }; -#endif // INDI_DEMA_MQH diff --git a/Indicators/Indi_DeMarker.mqh b/Indicators/Indi_DeMarker.mqh index e3b7bb9aa..974befc35 100644 --- a/Indicators/Indi_DeMarker.mqh +++ b/Indicators/Indi_DeMarker.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" diff --git a/Indicators/Indi_Demo.mqh b/Indicators/Indi_Demo.mqh index 25b747228..8fad53b13 100644 --- a/Indicators/Indi_Demo.mqh +++ b/Indicators/Indi_Demo.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" #include "../Storage/Dict/Buffer/BufferStruct.h" diff --git a/Indicators/Indi_DetrendedPrice.mqh b/Indicators/Indi_DetrendedPrice.mqh index 75e57be62..c913d3137 100644 --- a/Indicators/Indi_DetrendedPrice.mqh +++ b/Indicators/Indi_DetrendedPrice.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" #include "../Storage/Dict/Buffer/BufferStruct.h" diff --git a/Indicators/Indi_Drawer.mqh b/Indicators/Indi_Drawer.mqh index e551fd9b7..75cd23825 100644 --- a/Indicators/Indi_Drawer.mqh +++ b/Indicators/Indi_Drawer.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" #include "../Storage/Dict/DictStruct.h" diff --git a/Indicators/Indi_Drawer.struct.h b/Indicators/Indi_Drawer.struct.h index 01ed8cbf2..82359ff26 100644 --- a/Indicators/Indi_Drawer.struct.h +++ b/Indicators/Indi_Drawer.struct.h @@ -25,6 +25,11 @@ * Includes Indi_Drawer's structs. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.struct.h" #include "../Serializer/SerializerNode.enum.h" diff --git a/Indicators/Indi_Force.mqh b/Indicators/Indi_Force.mqh index 31b617982..7edf326b2 100644 --- a/Indicators/Indi_Force.mqh +++ b/Indicators/Indi_Force.mqh @@ -31,6 +31,11 @@ * 3. Trading volume. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" #include "../Indicators/Price/Indi_MA.h" diff --git a/Indicators/Indi_FractalAdaptiveMA.mqh b/Indicators/Indi_FractalAdaptiveMA.mqh index 4d421d072..b5335927a 100644 --- a/Indicators/Indi_FractalAdaptiveMA.mqh +++ b/Indicators/Indi_FractalAdaptiveMA.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" #include "../Storage/Dict/Buffer/BufferStruct.h" diff --git a/Indicators/Indi_Fractals.mqh b/Indicators/Indi_Fractals.mqh index d9ccf5f6c..0ab3f68ea 100644 --- a/Indicators/Indi_Fractals.mqh +++ b/Indicators/Indi_Fractals.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" diff --git a/Indicators/Indi_Gator.mqh b/Indicators/Indi_Gator.mqh index 61430807c..aaa179c6e 100644 --- a/Indicators/Indi_Gator.mqh +++ b/Indicators/Indi_Gator.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + /** * @file * Gator Oscillator @@ -29,6 +34,7 @@ // Includes. #include "../Indicator/Indicator.h" +#include "../Indicators/Price/Indi_MA.h" #ifndef __MQLBUILD__ // Indicator constants. diff --git a/Indicators/Indi_HeikenAshi.mqh b/Indicators/Indi_HeikenAshi.mqh index e1b19d96f..e23be6406 100644 --- a/Indicators/Indi_HeikenAshi.mqh +++ b/Indicators/Indi_HeikenAshi.mqh @@ -27,6 +27,11 @@ * Doesn't give independent signals. Is used to define volatility (trend strength). */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.all.h" diff --git a/Indicators/Indi_Ichimoku.mqh b/Indicators/Indi_Ichimoku.mqh index fa568fad7..824b1fe1d 100644 --- a/Indicators/Indi_Ichimoku.mqh +++ b/Indicators/Indi_Ichimoku.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" diff --git a/Indicators/Indi_Killzones.mqh b/Indicators/Indi_Killzones.mqh index 462a067ca..0711215ba 100644 --- a/Indicators/Indi_Killzones.mqh +++ b/Indicators/Indi_Killzones.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" #include "../Market.struct.h" diff --git a/Indicators/Indi_MFI.mqh b/Indicators/Indi_MFI.mqh index be35d5e77..f9a809bf7 100644 --- a/Indicators/Indi_MFI.mqh +++ b/Indicators/Indi_MFI.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" diff --git a/Indicators/Indi_MassIndex.mqh b/Indicators/Indi_MassIndex.mqh index 7d1013fe7..405c604f1 100644 --- a/Indicators/Indi_MassIndex.mqh +++ b/Indicators/Indi_MassIndex.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" #include "../Storage/Dict/Buffer/BufferStruct.h" diff --git a/Indicators/Indi_Momentum.mqh b/Indicators/Indi_Momentum.mqh index d23b4b57d..226510ccf 100644 --- a/Indicators/Indi_Momentum.mqh +++ b/Indicators/Indi_Momentum.mqh @@ -29,6 +29,11 @@ * In addition, it can help to identify when the price action is losing steam to prepare for a potential trend reversal. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" #include "Indi_PriceFeeder.mqh" diff --git a/Indicators/Indi_OBV.mqh b/Indicators/Indi_OBV.mqh index cd9378bf3..5de1ad59d 100644 --- a/Indicators/Indi_OBV.mqh +++ b/Indicators/Indi_OBV.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" diff --git a/Indicators/Indi_OsMA.mqh b/Indicators/Indi_OsMA.mqh index 697d06d7c..54a1c8070 100644 --- a/Indicators/Indi_OsMA.mqh +++ b/Indicators/Indi_OsMA.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" diff --git a/Indicators/Indi_PriceChannel.mqh b/Indicators/Indi_PriceChannel.mqh index bacd96f43..339470ac1 100644 --- a/Indicators/Indi_PriceChannel.mqh +++ b/Indicators/Indi_PriceChannel.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" #include "../Storage/Dict/Buffer/BufferStruct.h" @@ -73,7 +78,8 @@ class Indi_PriceChannel : public Indicator { } // PC uses high and low prices only. - return _ds PTR_DEREF HasSpecificAppliedPriceValueStorage(PRICE_HIGH | PRICE_LOW); + return _ds PTR_DEREF HasSpecificAppliedPriceValueStorage(PRICE_HIGH) && + _ds PTR_DEREF HasSpecificAppliedPriceValueStorage(PRICE_LOW); } /** diff --git a/Indicators/Indi_PriceVolumeTrend.mqh b/Indicators/Indi_PriceVolumeTrend.mqh index d9a12ed71..536afd406 100644 --- a/Indicators/Indi_PriceVolumeTrend.mqh +++ b/Indicators/Indi_PriceVolumeTrend.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Defines. // 100 bars was originally specified by Indicators/Examples/PVT.mq5 #define INDI_PVT_MIN_BARS 2 diff --git a/Indicators/Indi_RS.mqh b/Indicators/Indi_RS.mqh index c5c4f5b04..e7f50f033 100644 --- a/Indicators/Indi_RS.mqh +++ b/Indicators/Indi_RS.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" #include "../Storage/Dict/Buffer/BufferStruct.h" @@ -110,7 +115,7 @@ class Indi_RS : public Indicator { // Updating Maths' data sources to be the same as RS data source. imath.GetByKey(0) REF_DEREF SetDataSource(GetDataSource()); imath.GetByKey(1) REF_DEREF SetDataSource(GetDataSource()); - return imath[_mode].Ptr().GetEntryValue(); + return imath[_mode] REF_DEREF GetEntryValue(); break; default: SetUserError(ERR_INVALID_PARAMETER); diff --git a/Indicators/Indi_RVI.mqh b/Indicators/Indi_RVI.mqh index 6d5337720..09ed46293 100644 --- a/Indicators/Indi_RVI.mqh +++ b/Indicators/Indi_RVI.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" diff --git a/Indicators/Indi_RateOfChange.mqh b/Indicators/Indi_RateOfChange.mqh index fe9ebebfa..609d0c447 100644 --- a/Indicators/Indi_RateOfChange.mqh +++ b/Indicators/Indi_RateOfChange.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" #include "../Storage/Dict/Buffer/BufferStruct.h" diff --git a/Indicators/Indi_StdDev.mqh b/Indicators/Indi_StdDev.mqh index 5ba32d176..f588ed39e 100644 --- a/Indicators/Indi_StdDev.mqh +++ b/Indicators/Indi_StdDev.mqh @@ -27,6 +27,11 @@ * It doesn't give independent signals. Is used to define volatility (trend strength). */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" #include "../Storage/Cache/ObjectsCache.h" diff --git a/Indicators/Indi_TEMA.mqh b/Indicators/Indi_TEMA.mqh index 14d98a012..f73d64973 100644 --- a/Indicators/Indi_TEMA.mqh +++ b/Indicators/Indi_TEMA.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" #include "../Storage/Dict/Buffer/BufferStruct.h" diff --git a/Indicators/Indi_TRIX.mqh b/Indicators/Indi_TRIX.mqh index 880b5a7d9..5027de778 100644 --- a/Indicators/Indi_TRIX.mqh +++ b/Indicators/Indi_TRIX.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" #include "../Storage/Dict/Buffer/BufferStruct.h" diff --git a/Indicators/Indi_UltimateOscillator.mqh b/Indicators/Indi_UltimateOscillator.mqh index a3b31deab..cb4a47948 100644 --- a/Indicators/Indi_UltimateOscillator.mqh +++ b/Indicators/Indi_UltimateOscillator.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" #include "../Storage/Dict/Buffer/BufferStruct.h" @@ -107,9 +112,9 @@ class Indi_UltimateOscillator : public Indicator { _indi, Util::MakeKey(_fast_period, _middle_period, _slow_period, _fast_k, _middle_k, _slow_k)); // Will return Indi_ATRs with the same candles source as _indi's. - IndicatorData *_indi_atr_fast = Indi_ATR::GetCached(_indi, _fast_period); - IndicatorData *_indi_atr_middle = Indi_ATR::GetCached(_indi, _middle_period); - IndicatorData *_indi_atr_slow = Indi_ATR::GetCached(_indi, _slow_period); + Indi_ATR *_indi_atr_fast = Indi_ATR::GetCached(_indi, _fast_period); + Indi_ATR *_indi_atr_middle = Indi_ATR::GetCached(_indi, _middle_period); + Indi_ATR *_indi_atr_slow = Indi_ATR::GetCached(_indi, _slow_period); return iUOOnArray(INDICATOR_CALCULATE_POPULATED_PARAMS_LONG, _fast_period, _middle_period, _slow_period, _fast_k, _middle_k, _slow_k, _mode, _shift, _cache, _indi_atr_fast, _indi_atr_middle, _indi_atr_slow); @@ -120,8 +125,8 @@ class Indi_UltimateOscillator : public Indicator { */ static double iUOOnArray(INDICATOR_CALCULATE_PARAMS_LONG, int _fast_period, int _middle_period, int _slow_period, int _fast_k, int _middle_k, int _slow_k, int _mode, int _abs_shift, - IndiBufferCache *_cache, IndicatorData *_indi_atr_fast, - IndicatorData *_indi_atr_middle, IndicatorData *_indi_atr_slow, bool _recalculate = false) { + IndiBufferCache *_cache, Indi_ATR *_indi_atr_fast, Indi_ATR *_indi_atr_middle, + Indi_ATR *_indi_atr_slow, bool _recalculate = false) { _cache PTR_DEREF SetPriceBuffer(_open, _high, _low, _close); if (!_cache PTR_DEREF HasBuffers()) { diff --git a/Indicators/Indi_VIDYA.mqh b/Indicators/Indi_VIDYA.mqh index e6a29adb5..983878395 100644 --- a/Indicators/Indi_VIDYA.mqh +++ b/Indicators/Indi_VIDYA.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" #include "../Storage/Dict/Buffer/BufferStruct.h" diff --git a/Indicators/Indi_VROC.mqh b/Indicators/Indi_VROC.mqh index 49d36f112..9dcb9cd0f 100644 --- a/Indicators/Indi_VROC.mqh +++ b/Indicators/Indi_VROC.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/Indicator.h" #include "../Storage/Dict/Buffer/BufferStruct.h" diff --git a/Indicators/Indi_Volumes.mqh b/Indicators/Indi_Volumes.mqh index a2a44227e..2552bbe8e 100644 --- a/Indicators/Indi_Volumes.mqh +++ b/Indicators/Indi_Volumes.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Defines. // 2 bars was originally specified by Indicators/Examples/Volumes.mq5 #define INDI_VOLUMES_MIN_BARS 2 diff --git a/Indicators/Indi_WilliamsAD.mqh b/Indicators/Indi_WilliamsAD.mqh index 39ae47871..8e0e131d5 100644 --- a/Indicators/Indi_WilliamsAD.mqh +++ b/Indicators/Indi_WilliamsAD.mqh @@ -20,12 +20,18 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Defines. // 2 bars was originally specified by Indicators/Examples/W_AD.mq5 #define INDI_WAD_MIN_BARS 100 // Includes. #include "../Indicator/Indicator.h" +#include "../Platform/Platform.h" #include "../Storage/Dict/Buffer/BufferStruct.h" #include "../Storage/ValueStorage.all.h" diff --git a/Indicators/Indi_ZigZag.mqh b/Indicators/Indi_ZigZag.mqh index 97efecc53..0ecadda9e 100644 --- a/Indicators/Indi_ZigZag.mqh +++ b/Indicators/Indi_ZigZag.mqh @@ -20,12 +20,18 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Defines. // 100 bars was originally specified by Indicators/Examples/ZigZag.mq5 #define INDI_ZIGZAG_MIN_BARS 100 // Includes. #include "../Indicator/Indicator.h" +#include "../Platform/Platform.h" #include "../Platform/Terminal.h" #include "../Storage/ValueStorage.all.h" @@ -115,7 +121,8 @@ class Indi_ZigZag : public Indicator { * Returns value for ZigZag indicator. */ static double iCustomZigZag(string _symbol, ENUM_TIMEFRAMES _tf, string _name, int _depth, int _deviation, - int _backstep, ENUM_ZIGZAG_LINE _mode = 0, int _shift = 0, IndicatorData *_obj = NULL) { + int _backstep, ENUM_ZIGZAG_LINE _mode = ZIGZAG_BUFFER, int _shift = 0, + IndicatorData *_obj = NULL) { #ifdef __MQL5__ int _handle = Object::IsValid(_obj) ? _obj.Get(IndicatorDataState::INDICATOR_DATA_STATE_PROP_HANDLE) : NULL; double _res[]; @@ -150,8 +157,8 @@ class Indi_ZigZag : public Indicator { /** * Returns value for ZigZag indicator. */ - static double iZigZag(IndicatorData *_indi, int _depth, int _deviation, int _backstep, ENUM_ZIGZAG_LINE _mode = 0, - int _rel_shift = 0) { + static double iZigZag(IndicatorData *_indi, int _depth, int _deviation, int _backstep, + ENUM_ZIGZAG_LINE _mode = ZIGZAG_BUFFER, int _rel_shift = 0) { INDI_REQUIRE_BARS_OR_RETURN_EMPTY(_indi, INDI_ZIGZAG_MIN_BARS); INDICATOR_CALCULATE_POPULATE_PARAMS_AND_CACHE_LONG(_indi, Util::MakeKey(_depth, _deviation, _backstep)); return iZigZagOnArray(INDICATOR_CALCULATE_POPULATED_PARAMS_LONG, _depth, _deviation, _backstep, _mode, diff --git a/Indicators/Indi_ZigZagColor.mqh b/Indicators/Indi_ZigZagColor.mqh index 5877cb0a1..cf78ae7bf 100644 --- a/Indicators/Indi_ZigZagColor.mqh +++ b/Indicators/Indi_ZigZagColor.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Defines. // 100 bars was originally specified by Indicators/Examples/ZigzagColor.mq5 #define INDI_ZIGZAG_COLOR_MIN_BARS 100 @@ -97,7 +102,7 @@ class Indi_ZigZagColor : public Indicator { * Returns value for ZigZag Color indicator. */ static double iZigZagColor(IndicatorData *_indi, int _depth, int _deviation, int _backstep, - ENUM_ZIGZAG_LINE _mode = 0, int _rel_shift = 0) { + ENUM_ZIGZAG_LINE _mode = ZIGZAG_BUFFER, int _rel_shift = 0) { INDI_REQUIRE_BARS_OR_RETURN_EMPTY(_indi, INDI_ZIGZAG_COLOR_MIN_BARS); INDICATOR_CALCULATE_POPULATE_PARAMS_AND_CACHE_LONG(_indi, Util::MakeKey(_depth, _deviation, _backstep)); return iZigZagColorOnArray(INDICATOR_CALCULATE_POPULATED_PARAMS_LONG, _depth, _deviation, _backstep, _mode, diff --git a/Indicators/OHLC/Indi_OHLC.mqh b/Indicators/OHLC/Indi_OHLC.mqh index 0dcbddc25..0f847a0af 100644 --- a/Indicators/OHLC/Indi_OHLC.mqh +++ b/Indicators/OHLC/Indi_OHLC.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../../Indicator/Indicator.h" #include "../../Storage/Dict/Buffer/BufferStruct.h" diff --git a/Indicators/OHLC/includes.h b/Indicators/OHLC/includes.h index 2c6de4d7a..8cf89dd84 100644 --- a/Indicators/OHLC/includes.h +++ b/Indicators/OHLC/includes.h @@ -25,5 +25,10 @@ * Include file to include all OHLC indicators. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // OHLC indicators. #include "Indi_OHLC.mqh" diff --git a/Indicators/Oscillator/Indi_MACD.h b/Indicators/Oscillator/Indi_MACD.h index b50ea0736..6c35a1258 100644 --- a/Indicators/Oscillator/Indi_MACD.h +++ b/Indicators/Oscillator/Indi_MACD.h @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../../Indicator/Indicator.h" diff --git a/Indicators/Oscillator/Indi_RSI.h b/Indicators/Oscillator/Indi_RSI.h index 36948b52a..4248ffcf5 100644 --- a/Indicators/Oscillator/Indi_RSI.h +++ b/Indicators/Oscillator/Indi_RSI.h @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../../Indicator/Indicator.h" #include "../../Storage/Dict/DictStruct.h" diff --git a/Indicators/Oscillator/Indi_Stochastic.h b/Indicators/Oscillator/Indi_Stochastic.h index b1e2add7f..82cbbda3c 100644 --- a/Indicators/Oscillator/Indi_Stochastic.h +++ b/Indicators/Oscillator/Indi_Stochastic.h @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../../Indicator/Indicator.h" #include "../Price/Indi_MA.h" diff --git a/Indicators/Oscillator/Indi_WPR.h b/Indicators/Oscillator/Indi_WPR.h index 41498c5c7..9795dc5c5 100644 --- a/Indicators/Oscillator/Indi_WPR.h +++ b/Indicators/Oscillator/Indi_WPR.h @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../../Indicator/Indicator.h" #include "../../Platform/Terminal.h" diff --git a/Indicators/Oscillator/includes.h b/Indicators/Oscillator/includes.h index 0b971dd52..cb4fa953b 100644 --- a/Indicators/Oscillator/includes.h +++ b/Indicators/Oscillator/includes.h @@ -25,6 +25,11 @@ * Include file to include all oscillator indicators. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Oscillator indicators. #include "Indi_MACD.h" #include "Indi_RSI.h" diff --git a/Indicators/Price/Indi_AppliedPrice.h b/Indicators/Price/Indi_AppliedPrice.h index df5249d28..8360c9342 100644 --- a/Indicators/Price/Indi_AppliedPrice.h +++ b/Indicators/Price/Indi_AppliedPrice.h @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../../Indicator/Indicator.h" #include "../../Storage/Dict/Buffer/BufferStruct.h" diff --git a/Indicators/Price/Indi_MA.h b/Indicators/Price/Indi_MA.h index 9a41ecf8a..d772382a5 100644 --- a/Indicators/Price/Indi_MA.h +++ b/Indicators/Price/Indi_MA.h @@ -20,9 +20,10 @@ * */ -// Prevents processing this includes file for the second time. -#ifndef INDI_MA_H -#define INDI_MA_H +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif // Includes. #include "../../Indicator/Indicator.h" @@ -800,5 +801,3 @@ double iMAOnArray(ARRAY_REF(double, _arr), int _total, int _period, int _ma_shif return Indi_MA::iMAOnArray(_arr, _total, _period, _ma_shift, _ma_method, _abs_shift, _cache); } #endif - -#endif // INDI_MA_H diff --git a/Indicators/Price/includes.h b/Indicators/Price/includes.h index b24e244aa..edb2924b6 100644 --- a/Indicators/Price/includes.h +++ b/Indicators/Price/includes.h @@ -25,6 +25,11 @@ * Include file to include all price indicators. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Price indicators. #include "Indi_AppliedPrice.h" #include "Indi_MA.h" diff --git a/Indicators/PriceMulti/Indi_Alligator.h b/Indicators/PriceMulti/Indi_Alligator.h index 426cbcf70..4563f0b9c 100644 --- a/Indicators/PriceMulti/Indi_Alligator.h +++ b/Indicators/PriceMulti/Indi_Alligator.h @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../../Indicator/Indicator.h" #include "../Price/Indi_MA.h" diff --git a/Indicators/PriceMulti/includes.h b/Indicators/PriceMulti/includes.h index c8112d71a..295bcd4f4 100644 --- a/Indicators/PriceMulti/includes.h +++ b/Indicators/PriceMulti/includes.h @@ -25,5 +25,10 @@ * Include file to include all price multi indicators. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Price multi indicators. #include "Indi_Alligator.h" diff --git a/Indicators/PriceRange/Indi_Bands.h b/Indicators/PriceRange/Indi_Bands.h index 6b9612347..8553fe890 100644 --- a/Indicators/PriceRange/Indi_Bands.h +++ b/Indicators/PriceRange/Indi_Bands.h @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../../Indicator/Indicator.h" #include "../Indi_CCI.mqh" diff --git a/Indicators/PriceRange/Indi_Pivot.h b/Indicators/PriceRange/Indi_Pivot.h index 427fd5382..286c3a5f6 100644 --- a/Indicators/PriceRange/Indi_Pivot.h +++ b/Indicators/PriceRange/Indi_Pivot.h @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../../Bar.struct.h" #include "../../Indicator/Indicator.struct.h" diff --git a/Indicators/PriceRange/Indi_SAR.h b/Indicators/PriceRange/Indi_SAR.h index 8f12916b3..d3248a20b 100644 --- a/Indicators/PriceRange/Indi_SAR.h +++ b/Indicators/PriceRange/Indi_SAR.h @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../../Indicator/Indicator.h" diff --git a/Indicators/PriceRange/includes.h b/Indicators/PriceRange/includes.h index b4f73d5bc..095213f65 100644 --- a/Indicators/PriceRange/includes.h +++ b/Indicators/PriceRange/includes.h @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + /** * @file * Include file to include all price range indicators. diff --git a/Indicators/Special/Indi_Custom.mqh b/Indicators/Special/Indi_Custom.mqh index 4d8984f44..3d0175c00 100644 --- a/Indicators/Special/Indi_Custom.mqh +++ b/Indicators/Special/Indi_Custom.mqh @@ -20,9 +20,10 @@ * */ -// Prevents processing the same indicator file twice. -#ifndef INDI_CUSTOM_MQH -#define INDI_CUSTOM_MQH +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif // Defines #ifndef INDI_CUSTOM_PATH @@ -127,5 +128,3 @@ class Indi_Custom : public Indicator { return _value; } }; - -#endif // INDI_CUSTOM_MQH diff --git a/Indicators/Special/Indi_Math.mqh b/Indicators/Special/Indi_Math.mqh index 0df25f3be..830d68fff 100644 --- a/Indicators/Special/Indi_Math.mqh +++ b/Indicators/Special/Indi_Math.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../../Indicator/Indicator.h" #include "../../Math/Math.enum.h" diff --git a/Indicators/Special/includes.h b/Indicators/Special/includes.h index f8c2c8624..e1124ae15 100644 --- a/Indicators/Special/includes.h +++ b/Indicators/Special/includes.h @@ -25,6 +25,11 @@ * Include file to include all special indicators. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Special indicators. #include "Indi_Custom.mqh" #include "Indi_Math.mqh" diff --git a/Indicators/Tick/Indi_TickMt.h b/Indicators/Tick/Indi_TickMt.h index 027684237..a9ec01337 100644 --- a/Indicators/Tick/Indi_TickMt.h +++ b/Indicators/Tick/Indi_TickMt.h @@ -121,7 +121,7 @@ class Indi_TickMt : public IndicatorTick, _out_ticks)) { ArrayResize(_out_ticks, 0); - static MqlTick _tmp_ticks[]; + static ARRAY(MqlTick, _tmp_ticks); ArrayResize(_tmp_ticks, 0); // There's no history in MQL4. @@ -162,7 +162,7 @@ class Indi_TickMt : public IndicatorTick class DictStruct; // Includes. +#include "File.mqh" #include "Storage/Array.h" #include "Storage/Collection.h" #include "Storage/DateTime.h" #include "Storage/Dict/DictStruct.h" -#include "File.mqh" #include "Storage/Object.h" // Define assert macros. @@ -339,5 +340,3 @@ bool Log::AddLastError(string prefix, string suffix) { bool Log::AddLastError(string prefix, long suffix) { return Add(V_ERROR, Terminal::GetLastErrorText(), prefix, StringFormat("%d", suffix)); } - -#endif diff --git a/MD5.mqh b/MD5.mqh index 6014cd14c..265f9f5f5 100644 --- a/MD5.mqh +++ b/MD5.mqh @@ -42,9 +42,14 @@ @see: http://www.cnblogs.com/niniwzw/archive/2009/12/05/1617685.html */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. -#include "Storage/Array.h" #include "Convert.basic.h" +#include "Storage/Array.h" /** * Class to provide implementation of MD5 algorithm. diff --git a/Mail.mqh b/Mail.mqh index 80fd09022..aee989e01 100644 --- a/Mail.mqh +++ b/Mail.mqh @@ -20,15 +20,16 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. -#include "Exchange/Account/AccountMt.h" #include "Convert.mqh" +#include "Exchange/Account/AccountMt.h" #include "Platform/Order.h" -// Prevents processing this includes file for the second time. -#ifndef MAIL_MQH -#define MAIL_MQH - /** * Implements Mail class. */ @@ -136,4 +137,3 @@ class Mail { */ bool SendMailExecuteOrder() { return SendMail(GetMailSubjectExecuteOrder(), GetMailBodyExecuteOrder()); } }; -#endif diff --git a/Market.struct.h b/Market.struct.h index 361985015..76580f027 100644 --- a/Market.struct.h +++ b/Market.struct.h @@ -25,14 +25,19 @@ * Includes Market's structs. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Forward declaration. class Serializer; // Includes. -#include "Storage/DateTime.entry.h" -#include "Storage/DateTime.struct.h" #include "Serializer/SerializerNode.enum.h" #include "Std.h" +#include "Storage/DateTime.entry.h" +#include "Storage/DateTime.struct.h" // Market info. struct MarketData { diff --git a/Math/Math.extern.h b/Math/Math.extern.h index 637a790c7..9248b9253 100644 --- a/Math/Math.extern.h +++ b/Math/Math.extern.h @@ -22,6 +22,7 @@ // Define external global functions. #ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. #pragma once #include diff --git a/Math/Matrix.h b/Math/Matrix.h index 06e89cbf4..57fa065d5 100644 --- a/Math/Matrix.h +++ b/Math/Matrix.h @@ -20,9 +20,10 @@ * */ -// Prevents processing this includes file for the second time. -#ifndef MATRIX_MQH -#define MATRIX_MQH +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif #ifdef USE_MQL_MATH_STAT #ifdef __MQL5__ @@ -2262,5 +2263,3 @@ class Matrix { return _out + "]"; } }; - -#endif diff --git a/Math/MatrixMini.h b/Math/MatrixMini.h index d4371b581..134d092d2 100644 --- a/Math/MatrixMini.h +++ b/Math/MatrixMini.h @@ -20,9 +20,10 @@ * */ -// Prevents processing this includes file for the second time. -#ifndef MINIMATRIX_H -#define MINIMATRIX_H +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif // Includes. #include "../Platform/Platform.extern.h" @@ -59,5 +60,3 @@ class MatrixMini2d { int SizeY() { return size_y; } }; - -#endif // MINIMATRIX_H diff --git a/Pattern.mqh b/Pattern.mqh index 2990db07c..7cc828192 100644 --- a/Pattern.mqh +++ b/Pattern.mqh @@ -24,6 +24,11 @@ * Provides functionality for detecting candle patterns. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "Pattern.struct.h" diff --git a/Platform/Chart/Chart.define.h b/Platform/Chart/Chart.define.h index 18af886c7..f2a7afe9d 100644 --- a/Platform/Chart/Chart.define.h +++ b/Platform/Chart/Chart.define.h @@ -25,6 +25,11 @@ * Terminal's defines. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + /* Defines */ // Define type of timeframe periods using bitwise values. diff --git a/Platform/Chart/Chart.h b/Platform/Chart/Chart.h index 56a499281..50893cdc2 100644 --- a/Platform/Chart/Chart.h +++ b/Platform/Chart/Chart.h @@ -29,19 +29,20 @@ * - https://www.mql5.com/en/docs/series */ -// Prevents processing this includes file for the second time. -#ifndef CHART_H -#define CHART_H +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif // Includes. -#include "Chart.define.h" -#include "Chart.enum.h" -#include "Chart.struct.h" -#include "Chart.struct.serialize.h" #include "../../Convert.mqh" #include "../../Market.mqh" #include "../../Serializer/Serializer.h" #include "../../Task/TaskCondition.enum.h" +#include "Chart.define.h" +#include "Chart.enum.h" +#include "Chart.struct.h" +#include "Chart.struct.serialize.h" // Forward class declaration. class Chart; @@ -182,5 +183,3 @@ class Chart : public Market { void SerializeStub(int _n1 = 1, int _n2 = 1, int _n3 = 1, int _n4 = 1, int _n5 = 1) {} }; - -#endif // CHART_H diff --git a/Platform/Chart/Chart.struct.serialize.h b/Platform/Chart/Chart.struct.serialize.h index 8c2b9205b..d5079527f 100644 --- a/Platform/Chart/Chart.struct.serialize.h +++ b/Platform/Chart/Chart.struct.serialize.h @@ -25,6 +25,11 @@ * Includes Chart's struct serializers. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Forward class declaration. class Serializer; diff --git a/Platform/Chart3D/Chart3D.h b/Platform/Chart3D/Chart3D.h index d97115759..a95a9cf97 100644 --- a/Platform/Chart3D/Chart3D.h +++ b/Platform/Chart3D/Chart3D.h @@ -25,6 +25,11 @@ * 3D Chart. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + #include "../../Bar.struct.h" #include "../../Indicator/IndicatorData.h" #include "../../Indicators/Price/Indi_MA.h" diff --git a/Platform/Chart3D/Chart3DCandles.h b/Platform/Chart3D/Chart3DCandles.h index 3344b8682..ff532ecdf 100644 --- a/Platform/Chart3D/Chart3DCandles.h +++ b/Platform/Chart3D/Chart3DCandles.h @@ -25,6 +25,11 @@ * 3D chart candles renderer. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + #include "../Chart/Chart.define.h" #include "Chart3DType.h" #include "Cube.h" diff --git a/Platform/Chart3D/Chart3DType.h b/Platform/Chart3D/Chart3DType.h index 588d596f8..1a753e7ed 100644 --- a/Platform/Chart3D/Chart3DType.h +++ b/Platform/Chart3D/Chart3DType.h @@ -25,6 +25,11 @@ * 3D chart type renderer. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + #include "../../Refs.mqh" #include "Device.h" diff --git a/Platform/Chart3D/Cube.h b/Platform/Chart3D/Cube.h index 5e6b1d6e1..d3715a1bd 100644 --- a/Platform/Chart3D/Cube.h +++ b/Platform/Chart3D/Cube.h @@ -25,6 +25,11 @@ * Cube mesh. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + #include "Face.h" #include "Mesh.h" diff --git a/Platform/Chart3D/Device.h b/Platform/Chart3D/Device.h index b28c55ce8..7ac435633 100644 --- a/Platform/Chart3D/Device.h +++ b/Platform/Chart3D/Device.h @@ -25,6 +25,11 @@ * Generic graphics device. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + #include "../../Refs.mqh" #include "../../Util.h" #include "Frontend.h" diff --git a/Platform/Chart3D/Devices/MTDX/MTDXDevice.h b/Platform/Chart3D/Devices/MTDX/MTDXDevice.h index 8e0c6554f..713c7a407 100644 --- a/Platform/Chart3D/Devices/MTDX/MTDXDevice.h +++ b/Platform/Chart3D/Devices/MTDX/MTDXDevice.h @@ -25,6 +25,11 @@ * MetaTrader DX-targeted graphics device. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + #include "../../Device.h" class MTDXDevice : public Device { diff --git a/Platform/Chart3D/Devices/MTDX/MTDXIndexBuffer.h b/Platform/Chart3D/Devices/MTDX/MTDXIndexBuffer.h index 43ddbfccb..924651dbf 100644 --- a/Platform/Chart3D/Devices/MTDX/MTDXIndexBuffer.h +++ b/Platform/Chart3D/Devices/MTDX/MTDXIndexBuffer.h @@ -25,6 +25,11 @@ * MetaTrader DX-targeted graphics device's index buffer. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + #include "../../IndexBuffer.h" class MTDXIndexBuffer : public IndexBuffer { diff --git a/Platform/Chart3D/Devices/MTDX/MTDXShader.h b/Platform/Chart3D/Devices/MTDX/MTDXShader.h index ff75425a8..9fb0109b4 100644 --- a/Platform/Chart3D/Devices/MTDX/MTDXShader.h +++ b/Platform/Chart3D/Devices/MTDX/MTDXShader.h @@ -25,6 +25,11 @@ * MetaTrader DX-targeted unversal graphics shader. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + #include "../../Shader.h" class MTDXShader : public Shader { diff --git a/Platform/Chart3D/Devices/MTDX/MTDXVertexBuffer.h b/Platform/Chart3D/Devices/MTDX/MTDXVertexBuffer.h index 3a6163f4e..5af0b8405 100644 --- a/Platform/Chart3D/Devices/MTDX/MTDXVertexBuffer.h +++ b/Platform/Chart3D/Devices/MTDX/MTDXVertexBuffer.h @@ -25,6 +25,11 @@ * MetaTrader DX-targeted graphics vertex buffer. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + #include "../../VertexBuffer.h" class MTDXVertexBuffer : public VertexBuffer { diff --git a/Platform/Chart3D/Face.h b/Platform/Chart3D/Face.h index c298cfb9e..4a1bab0ee 100644 --- a/Platform/Chart3D/Face.h +++ b/Platform/Chart3D/Face.h @@ -25,6 +25,11 @@ * Generic graphics face object. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + #include "Math.h" // Face flags. diff --git a/Platform/Chart3D/Frontend.h b/Platform/Chart3D/Frontend.h index 52a316a2e..19e301b7f 100644 --- a/Platform/Chart3D/Frontend.h +++ b/Platform/Chart3D/Frontend.h @@ -25,6 +25,11 @@ * Generic graphics front-end (display buffer target). */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + #include "../../Refs.mqh" struct DrawTextQueueItem { diff --git a/Platform/Chart3D/Frontends/MT5Frontend.h b/Platform/Chart3D/Frontends/MT5Frontend.h index 7f5532550..094f16b01 100644 --- a/Platform/Chart3D/Frontends/MT5Frontend.h +++ b/Platform/Chart3D/Frontends/MT5Frontend.h @@ -25,6 +25,11 @@ * MT5 graphics front-end (display buffer target). */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + #include "../Frontend.h" /** diff --git a/Platform/Chart3D/IndexBuffer.h b/Platform/Chart3D/IndexBuffer.h index e628369ab..789aca763 100644 --- a/Platform/Chart3D/IndexBuffer.h +++ b/Platform/Chart3D/IndexBuffer.h @@ -25,6 +25,11 @@ * Generic graphics index buffer. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + #include "../../Refs.mqh" class Device; diff --git a/Platform/Chart3D/Interface.h b/Platform/Chart3D/Interface.h index 27d56457e..c833094f3 100644 --- a/Platform/Chart3D/Interface.h +++ b/Platform/Chart3D/Interface.h @@ -25,6 +25,11 @@ * Chart events. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + #include "../../Util.h" enum ENUM_INTERFACE_EVENT { diff --git a/Platform/Chart3D/Material.h b/Platform/Chart3D/Material.h index 6c084ca8c..43c5313a3 100644 --- a/Platform/Chart3D/Material.h +++ b/Platform/Chart3D/Material.h @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + #include "Math.h" /** diff --git a/Platform/Chart3D/Math.h b/Platform/Chart3D/Math.h index 8db6be380..78c283976 100644 --- a/Platform/Chart3D/Math.h +++ b/Platform/Chart3D/Math.h @@ -3,6 +3,11 @@ //| Copyright 2019,MetaQuotes Software Corp. | //| https://www.mql5.com | //+------------------------------------------------------------------+ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + #ifdef __MQL__ #property copyright "Copyright 2019,MetaQuotes Software Corp." #property link "https://www.mql5.com" diff --git a/Platform/Chart3D/Mesh.h b/Platform/Chart3D/Mesh.h index d962ab138..cf8a200d0 100644 --- a/Platform/Chart3D/Mesh.h +++ b/Platform/Chart3D/Mesh.h @@ -25,8 +25,13 @@ * Generic graphics mesh. */ -#include "../../Storage/Dict/Dict.h" +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + #include "../../Refs.mqh" +#include "../../Storage/Dict/Dict.h" #include "../../Util.h" #include "Face.h" #include "IndexBuffer.h" diff --git a/Platform/Chart3D/Shader.h b/Platform/Chart3D/Shader.h index 05e237d63..51eefccc6 100644 --- a/Platform/Chart3D/Shader.h +++ b/Platform/Chart3D/Shader.h @@ -25,6 +25,11 @@ * Generic graphics shader. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + #include "../../Refs.mqh" // Shader type. diff --git a/Platform/Chart3D/ShaderVertexLayout.struct.h b/Platform/Chart3D/ShaderVertexLayout.struct.h index f6332e9c5..026d2d8a6 100644 --- a/Platform/Chart3D/ShaderVertexLayout.struct.h +++ b/Platform/Chart3D/ShaderVertexLayout.struct.h @@ -25,6 +25,11 @@ * Defines ShaderVertexLayout structure. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Vertex layout used for Vertex Shaders. struct ShaderVertexLayout { string name; diff --git a/Platform/Chart3D/TSR.h b/Platform/Chart3D/TSR.h index e6843e449..2d487df24 100644 --- a/Platform/Chart3D/TSR.h +++ b/Platform/Chart3D/TSR.h @@ -25,6 +25,11 @@ * Translations, scale and rotation matrices. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + #include "Math.h" class TSR { diff --git a/Platform/Chart3D/Vertex.h b/Platform/Chart3D/Vertex.h index 29965fcef..65e9248b0 100644 --- a/Platform/Chart3D/Vertex.h +++ b/Platform/Chart3D/Vertex.h @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + #include "../../Refs.mqh" /** diff --git a/Platform/Chart3D/VertexBuffer.h b/Platform/Chart3D/VertexBuffer.h index 3e7567ae1..8cea3b09d 100644 --- a/Platform/Chart3D/VertexBuffer.h +++ b/Platform/Chart3D/VertexBuffer.h @@ -25,6 +25,11 @@ * Generic graphics vertex buffer. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + #include "../../Refs.mqh" class VertexBuffer : public Dynamic { diff --git a/Platform/Order.define.h b/Platform/Order.define.h index af96f14ef..f002027c3 100644 --- a/Platform/Order.define.h +++ b/Platform/Order.define.h @@ -25,6 +25,11 @@ * Includes Order's defines. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + #ifndef __MQL4__ // Mode constants. #define MODE_TRADES 0 diff --git a/Platform/Order.h b/Platform/Order.h index 4e0f14a19..d15186ff5 100644 --- a/Platform/Order.h +++ b/Platform/Order.h @@ -25,30 +25,31 @@ * Implements class for managing orders. */ -// Prevents processing this includes file for the second time. -#ifndef ORDER_MQH -#define ORDER_MQH +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif // Forward declaration. class SymbolInfo; // Includes. #include "../Convert.mqh" -#include "../Storage/Data.define.h" -#include "../Storage/Data.struct.h" -#include "Deal.enum.h" +#include "../Exchange/SymbolInfo/SymbolInfo.h" #include "../Log.mqh" -#include "Order.define.h" -#include "Order.enum.h" -#include "Order.struct.h" #include "../Serializer/Serializer.define.h" #include "../Serializer/Serializer.h" #include "../Serializer/SerializerConverter.h" #include "../Serializer/SerializerJson.h" #include "../Std.h" +#include "../Storage/Data.define.h" +#include "../Storage/Data.struct.h" #include "../Storage/String.h" -#include "../Exchange/SymbolInfo/SymbolInfo.h" #include "../Task/TaskAction.enum.h" +#include "Deal.enum.h" +#include "Order.define.h" +#include "Order.enum.h" +#include "Order.struct.h" /* Defines for backward compatibility. */ @@ -2909,5 +2910,3 @@ class Order : public SymbolInfo { ENUM_ORDER_SELECT_TYPE Order::selected_ticket_type = ORDER_SELECT_TYPE_NONE; unsigned long Order::selected_ticket_id = 0; #endif - -#endif // ORDER_MQH diff --git a/Platform/OrderQuery.h b/Platform/OrderQuery.h index 412740df1..c76f485e5 100644 --- a/Platform/OrderQuery.h +++ b/Platform/OrderQuery.h @@ -25,11 +25,16 @@ * Implements class for querying list of orders. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. -#include "../Storage/Dict/DictStruct.h" -#include "Order.h" #include "../Refs.mqh" #include "../Std.h" +#include "../Storage/Dict/DictStruct.h" +#include "Order.h" class OrderQuery : public Dynamic { protected: diff --git a/Platform/Orders.h b/Platform/Orders.h index 6341f2002..42279c9fd 100644 --- a/Platform/Orders.h +++ b/Platform/Orders.h @@ -20,18 +20,23 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Forward declarations. class Orders; // Includes. #include "../Exchange/Account/Account.h" #include "../Exchange/SymbolInfo/SymbolInfo.struct.static.h" -#include "Chart/Chart.struct.static.h" #include "../Log.mqh" #include "../Math/Math.h" +#include "../Trade.struct.h" +#include "Chart/Chart.struct.static.h" #include "Order.h" #include "Terminal.h" -#include "../Trade.struct.h" /* Defines */ diff --git a/Platform/Platform.extern.h b/Platform/Platform.extern.h index 36ed84b64..b9c93db05 100644 --- a/Platform/Platform.extern.h +++ b/Platform/Platform.extern.h @@ -25,6 +25,8 @@ #pragma once // Includes. +#include + #include "../Exchange/Account/Account.enum.h" #include "../Storage/Data.define.h" #include "../Storage/DateTime.h" @@ -32,12 +34,14 @@ #include "Deal.enum.h" #include "Order.define.h" #include "Order.enum.h" +#include "Platform.enum.h" #include "Terminal.enum.h" // Forward declarations. struct MqlTradeRequest; struct MqlTradeResult; struct MqlTradeCheckResult; +struct MqlTick; template double iCustom(string symbol, int timeframe, string name, Args... args) { @@ -182,4 +186,12 @@ int GetLastError() { return _LastError; } void ResetLastError() { _LastError = 0; } +int CopyTicks(const string symbol_name, ARRAY_REF(MqlTick, ticks_array), unsigned int flags = COPY_TICKS_ALL, + int64 from = 0, unsigned int count = 0); + +int CopyTicksRange(const string symbol_name, ARRAY_REF(MqlTick, ticks_array), unsigned int flags = COPY_TICKS_ALL, + int64 from_msc = 0, int64 to_msc = 0); + +void Sleep(int milliseconds) { std::this_thread::sleep_for(std::chrono::milliseconds(milliseconds)); } + #endif diff --git a/Platform/PlatformTime.h b/Platform/PlatformTime.h index 1588185dc..73e16008c 100644 --- a/Platform/PlatformTime.h +++ b/Platform/PlatformTime.h @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Storage/DateTime.enum.h" #include "../Storage/DateTime.struct.h" @@ -29,7 +34,6 @@ * Platform time retrieval. */ #ifndef __MQL__ -#pragma once // Includes. #include diff --git a/Platform/Plot.h b/Platform/Plot.h index 3d630769f..d2f8aa64e 100644 --- a/Platform/Plot.h +++ b/Platform/Plot.h @@ -25,6 +25,11 @@ * Group of functions intended for working with graphic objects relating to any specified chart. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Class dependencies. class Chart; class Plot; diff --git a/Platform/Terminal.define.h b/Platform/Terminal.define.h index fb94241be..475c938c5 100644 --- a/Platform/Terminal.define.h +++ b/Platform/Terminal.define.h @@ -25,6 +25,11 @@ * Terminal's defines. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + /* Defines */ // Codepages. diff --git a/Platform/Terminal.h b/Platform/Terminal.h index 1103cafc1..f720c9e00 100644 --- a/Platform/Terminal.h +++ b/Platform/Terminal.h @@ -29,18 +29,19 @@ * - https://www.mql5.com/en/docs/chart_operations */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Forward declaration. class Terminal; -// Prevents processing this includes file for the second time. -#ifndef TERMINAL_MQH -#define TERMINAL_MQH - // Includes. #include "../Convert.mqh" +#include "../Refs.mqh" #include "../Storage/Data.struct.h" #include "../Storage/Object.h" -#include "../Refs.mqh" #include "../Storage/String.h" #include "Terminal.define.h" #include "Terminal.enum.h" @@ -967,5 +968,3 @@ class Terminal : public Object { // @docs: https://docs.mql4.com/chart_operations/windowexpertname string WindowExpertName(void) { return Terminal::WindowExpertName(); } #endif - -#endif // TERMINAL_MQH diff --git a/Platform/Web/Web.h b/Platform/Web/Web.h index 65bb3ed9f..fb1e27097 100644 --- a/Platform/Web/Web.h +++ b/Platform/Web/Web.h @@ -23,12 +23,10 @@ // Properties. #ifdef __MQL__ #property strict +// Allows the preprocessor to include a header file when it is needed. +#pragma once #endif -// Prevents processing this includes file for the second time. -#ifndef WEB_MQH -#define WEB_MQH - // Includes. #include "../../Platform/Platform.h" @@ -84,4 +82,3 @@ class Web { return _res; } }; -#endif diff --git a/Profiler.mqh b/Profiler.mqh index 7f5e7710a..fed207d91 100644 --- a/Profiler.mqh +++ b/Profiler.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "Storage/Collection.h" #include "Timer.mqh" diff --git a/Report.mqh b/Report.mqh index 991cc2919..081182a5d 100644 --- a/Report.mqh +++ b/Report.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "Storage/DateTime.h" #include "Storage/String.h" @@ -28,33 +33,31 @@ * Class to provide report handling methods. */ class Report { -public: - - // Used for writing the report file. - string log[]; - - /* - * Add message into the report file. - */ - void ReportAdd(string msg) { - int last = ArraySize(log); - ArrayResize(log, last + 1); - log[last] = DateTimeStatic::TimeToStr(TimeCurrent(), TIME_DATE|TIME_SECONDS) + ": " + msg; - } - - /* - * Write report data into file. - */ - static void WriteReport(string filename, string data, bool verbose = false) { - int handle = FileOpen(filename, FILE_CSV|FILE_WRITE, '\t'); - if (handle < 1) return; - - FileWrite(handle, data); - FileClose(handle); - - if (verbose) { - String::PrintText(data); - } + public: + // Used for writing the report file. + string log[]; + + /* + * Add message into the report file. + */ + void ReportAdd(string msg) { + int last = ArraySize(log); + ArrayResize(log, last + 1); + log[last] = DateTimeStatic::TimeToStr(TimeCurrent(), TIME_DATE | TIME_SECONDS) + ": " + msg; + } + + /* + * Write report data into file. + */ + static void WriteReport(string filename, string data, bool verbose = false) { + int handle = FileOpen(filename, FILE_CSV | FILE_WRITE, '\t'); + if (handle < 1) return; + + FileWrite(handle, data); + FileClose(handle); + + if (verbose) { + String::PrintText(data); } - + } }; diff --git a/Serializer/Serializer.define.h b/Serializer/Serializer.define.h index bff8d7f1c..fc8660f72 100644 --- a/Serializer/Serializer.define.h +++ b/Serializer/Serializer.define.h @@ -25,6 +25,11 @@ * Serializer's defines. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + /* Defines */ #ifdef __MQL__ diff --git a/Serializer/Serializer.h b/Serializer/Serializer.h index 128a1c9ac..0cadf3e2c 100644 --- a/Serializer/Serializer.h +++ b/Serializer/Serializer.h @@ -20,9 +20,10 @@ * */ -// Prevents processing this includes file for the second time. -#ifndef SERIALIZER_MQH -#define SERIALIZER_MQH +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif // Includes. #include "../Convert.basic.h" @@ -474,5 +475,3 @@ class Serializer { return Struct(key); } }; - -#endif // End: SERIALIZER_MQH diff --git a/Serializer/SerializerBinary.h b/Serializer/SerializerBinary.h index 789c9adeb..e5e94e9e5 100644 --- a/Serializer/SerializerBinary.h +++ b/Serializer/SerializerBinary.h @@ -20,9 +20,10 @@ * */ -// Prevents processing this includes file for the second time. -#ifndef SERIALIZER_BINARY_MQH -#define SERIALIZER_BINARY_MQH +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif // Includes. #include "../Storage/Dict/DictBase.h" @@ -129,5 +130,3 @@ class SerializerBinary { return NULL; } }; - -#endif diff --git a/Serializer/SerializerConverter.h b/Serializer/SerializerConverter.h index 0c46435e8..c9d883c05 100644 --- a/Serializer/SerializerConverter.h +++ b/Serializer/SerializerConverter.h @@ -25,10 +25,6 @@ #pragma once #endif -// Prevents processing this includes file for the second time. -#ifndef SERIALIZER_CONVERTER_MQH -#define SERIALIZER_CONVERTER_MQH - // Forward declarations. class SerializerNode; @@ -226,5 +222,3 @@ class SerializerConverter { return SerializerConverter::FromObject(stub, _serializer_flags); } }; - -#endif diff --git a/Serializer/SerializerCsv.h b/Serializer/SerializerCsv.h index 46352f157..5b7d718c5 100644 --- a/Serializer/SerializerCsv.h +++ b/Serializer/SerializerCsv.h @@ -20,16 +20,17 @@ * */ -// Prevents processing this includes file for the second time. -#ifndef SERIALIZER_CSV_MQH -#define SERIALIZER_CSV_MQH +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif // Includes. +#include "../Math/Matrix.h" +#include "../Math/MatrixMini.h" #include "../Storage/Dict/Dict.h" #include "../Storage/Dict/DictObject.h" #include "../Storage/Dict/DictStruct.h" -#include "../Math/Matrix.h" -#include "../Math/MatrixMini.h" #include "../Storage/Object.h" #include "SerializerConverter.h" #include "SerializerNode.h" @@ -292,5 +293,3 @@ class SerializerCsv { return true; } }; - -#endif diff --git a/Serializer/SerializerDict.h b/Serializer/SerializerDict.h index 647a7ab3d..7235ffc50 100644 --- a/Serializer/SerializerDict.h +++ b/Serializer/SerializerDict.h @@ -20,9 +20,10 @@ * */ -// Prevents processing this includes file for the second time. -#ifndef SERIALIZER_DICT_MQH -#define SERIALIZER_DICT_MQH +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif // Includes. #include "SerializerNode.h" @@ -46,5 +47,3 @@ class SerializerDict { } } }; - -#endif diff --git a/Serializer/SerializerJson.h b/Serializer/SerializerJson.h index 682fbf919..0de0effbb 100644 --- a/Serializer/SerializerJson.h +++ b/Serializer/SerializerJson.h @@ -20,9 +20,10 @@ * */ -// Prevents processing this includes file for the second time. -#ifndef SERIALIZER_JSON_MQH -#define SERIALIZER_JSON_MQH +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif // Includes. #include "../Storage/Dict/DictBase.h" @@ -392,5 +393,3 @@ class SerializerJson { return NULL; } }; - -#endif diff --git a/Serializer/SerializerNode.h b/Serializer/SerializerNode.h index d4eb4cf63..6619bd216 100644 --- a/Serializer/SerializerNode.h +++ b/Serializer/SerializerNode.h @@ -20,9 +20,10 @@ * */ -// Prevents processing this includes file for the second time. -#ifndef SERIALIZER_NODE_H -#define SERIALIZER_NODE_H +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif // Includes. #include "../Math/Math.extern.h" @@ -367,5 +368,3 @@ class SerializerNode { return repr; } }; - -#endif // SERIALIZER_NODE_H diff --git a/Serializer/SerializerNodeIterator.h b/Serializer/SerializerNodeIterator.h index a20a8fb4a..9a816d349 100644 --- a/Serializer/SerializerNodeIterator.h +++ b/Serializer/SerializerNodeIterator.h @@ -20,9 +20,10 @@ * */ -// Prevents processing this includes file for the second time. -#ifndef SERIALIZER_NODE_ITERATOR_H -#define SERIALIZER_NODE_ITERATOR_H +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif #include "Serializer.h" #include "SerializerNode.h" @@ -111,5 +112,3 @@ class SerializerIterator : public SerializerNodeIterator { SerializerNodeType ParentNodeType() { return _collection PTR_DEREF GetType(); } }; - -#endif diff --git a/Serializer/SerializerNodeParam.h b/Serializer/SerializerNodeParam.h index 147be46f4..c5718a179 100644 --- a/Serializer/SerializerNodeParam.h +++ b/Serializer/SerializerNodeParam.h @@ -20,11 +20,12 @@ * */ -// Prevents processing this includes file for the second time. -#include "SerializerConversions.h" +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif -#ifndef SERIALIZER_NODE_PARAM_H -#define SERIALIZER_NODE_PARAM_H +#include "SerializerConversions.h" /** * Enumeration. @@ -333,5 +334,3 @@ SerializerNodeParam* SerializerNodeParam::FromString(string& value) { PTR_ATTRIB(param, _string) = value; return param; } - -#endif // SERIALIZER_NODE_PARAM_H diff --git a/Serializer/SerializerObject.h b/Serializer/SerializerObject.h index a1132e5c0..e42585f05 100644 --- a/Serializer/SerializerObject.h +++ b/Serializer/SerializerObject.h @@ -20,9 +20,10 @@ * */ -// Prevents processing this includes file for the second time. -#ifndef SERIALIZER_OBJECT_MQH -#define SERIALIZER_OBJECT_MQH +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif // Includes. #include "../Storage/Dict/DictBase.h" @@ -37,5 +38,3 @@ class SerializerObject { public: static string Stringify(SerializerNode* _root) { return ""; } }; - -#endif diff --git a/Serializer/SerializerSqlite.h b/Serializer/SerializerSqlite.h index 01eab37e0..291c468cb 100644 --- a/Serializer/SerializerSqlite.h +++ b/Serializer/SerializerSqlite.h @@ -20,9 +20,10 @@ * */ -// Prevents processing this includes file for the second time. -#ifndef SERIALIZER_SQL_MQH -#define SERIALIZER_SQL_MQH +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif // Includes. #include "../Storage/Database.h" @@ -91,5 +92,3 @@ class SerializerSqlite { return true; } }; - -#endif diff --git a/SetFile.mqh b/SetFile.mqh index e7d8d802d..39e32abb4 100644 --- a/SetFile.mqh +++ b/SetFile.mqh @@ -20,151 +20,140 @@ * */ -class SetFile { - struct SetFileData - { - string key; - string val; - }; - - int handle, count; - SetFileData array[]; - - public: - - bool LoadFromFile(string path) { - handle = FileOpen(path, FILE_READ|FILE_CSV|FILE_ANSI, '='); - - if (handle == INVALID_HANDLE) { - //PrintFormat("Failed to open %s file, Error code = %d", handle,GetLastError()); - FileClose(handle); - return true; - } - - if (FileSize(handle) == 0) { - //PrintFormat("Failed to open %s file, Error code = %d", handle,GetLastError()); - FileClose(handle); - return false; - } - - count = 0; - while(FileIsEnding(handle)==false) - { - ArrayResize(array,(count+1),100000); - - array[count].key = FileReadString(handle); - array[count].val = FileReadString(handle); - count++; - } - - FileClose(handle); - - return true; - } - - string GetValueString (string key) { - - for (int i = 0; i <= ArraySize(array); i++) - { - if (array[i].key == key) - { - return(array[i].val); - break; - } - } - - return(NULL); - } - - int GetValueInteger (string key) { - string value = GetValueString(key); - - if(value != NULL) { - #ifdef MQL4 - return(StrToInteger(value)); - #else - return((int) StringToInteger(value)); - #endif - } else { - return(NULL); - } - } - - double GetValueDouble (string key) { - string value = GetValueString(key); - - if(value != NULL) { - #ifdef MQL4 - return(StrToDouble(value)); - #else - return(StringToDouble(value)); - #endif - } else { - return(NULL); - } - } - - bool SetValue (string key, string value) { - - int i = 0; - for (;i <= ArraySize(array); i++) - { - if (array[i].key == key) - { - array[i].val = value; - return true; - break; - } - } - - ArrayResize(array,(i+2),100000); - - array[(i + 1)].key = key; - array[(i + 1)].val = value; - - return true; - } - - bool SetValue (string key, double value) { - - int i = 0; - for (;i <= ArraySize(array); i++) - { - if (array[i].key == key) - { - array[i].val = DoubleToString(value); - return true; - break; - } - } - - ArrayResize(array,(i+2),100000); - - array[(i + 1)].key = key; - array[(i + 1)].val = DoubleToString(value); - - return true; - } - - bool SetValue (string key, int value) { - - int i = 0; - for (;i <= ArraySize(array); i++) - { - if (array[i].key == key) - { - array[i].val = IntegerToString(value); - return true; - break; - } - } - - ArrayResize(array,(i+2),100000); - - array[(i + 1)].key = key; - array[(i + 1)].val = IntegerToString(value); - - return true; - } +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif +class SetFile { + struct SetFileData { + string key; + string val; + }; + + int handle, count; + SetFileData array[]; + + public: + bool LoadFromFile(string path) { + handle = FileOpen(path, FILE_READ | FILE_CSV | FILE_ANSI, '='); + + if (handle == INVALID_HANDLE) { + // PrintFormat("Failed to open %s file, Error code = %d", handle,GetLastError()); + FileClose(handle); + return true; + } + + if (FileSize(handle) == 0) { + // PrintFormat("Failed to open %s file, Error code = %d", handle,GetLastError()); + FileClose(handle); + return false; + } + + count = 0; + while (FileIsEnding(handle) == false) { + ArrayResize(array, (count + 1), 100000); + + array[count].key = FileReadString(handle); + array[count].val = FileReadString(handle); + count++; + } + + FileClose(handle); + + return true; + } + + string GetValueString(string key) { + for (int i = 0; i <= ArraySize(array); i++) { + if (array[i].key == key) { + return (array[i].val); + break; + } + } + + return (NULL); + } + + int GetValueInteger(string key) { + string value = GetValueString(key); + + if (value != NULL) { +#ifdef MQL4 + return (StrToInteger(value)); +#else + return ((int)StringToInteger(value)); +#endif + } else { + return (NULL); + } + } + + double GetValueDouble(string key) { + string value = GetValueString(key); + + if (value != NULL) { +#ifdef MQL4 + return (StrToDouble(value)); +#else + return (StringToDouble(value)); +#endif + } else { + return (NULL); + } + } + + bool SetValue(string key, string value) { + int i = 0; + for (; i <= ArraySize(array); i++) { + if (array[i].key == key) { + array[i].val = value; + return true; + break; + } + } + + ArrayResize(array, (i + 2), 100000); + + array[(i + 1)].key = key; + array[(i + 1)].val = value; + + return true; + } + + bool SetValue(string key, double value) { + int i = 0; + for (; i <= ArraySize(array); i++) { + if (array[i].key == key) { + array[i].val = DoubleToString(value); + return true; + break; + } + } + + ArrayResize(array, (i + 2), 100000); + + array[(i + 1)].key = key; + array[(i + 1)].val = DoubleToString(value); + + return true; + } + + bool SetValue(string key, int value) { + int i = 0; + for (; i <= ArraySize(array); i++) { + if (array[i].key == key) { + array[i].val = IntegerToString(value); + return true; + break; + } + } + + ArrayResize(array, (i + 2), 100000); + + array[(i + 1)].key = key; + array[(i + 1)].val = IntegerToString(value); + + return true; + } }; diff --git a/Socket.mqh b/Socket.mqh index 136980282..a377202b7 100644 --- a/Socket.mqh +++ b/Socket.mqh @@ -25,6 +25,11 @@ * Implements class for socket connection. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "File.define.h" #include "Std.h" diff --git a/Stats.mqh b/Stats.mqh index c3a265747..0580ae986 100644 --- a/Stats.mqh +++ b/Stats.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "Platform/Chart/Chart.h" #include "Platform/Platform.h" diff --git a/Storage/Array.extern.h b/Storage/Array.extern.h index 976004818..20cf8635e 100644 --- a/Storage/Array.extern.h +++ b/Storage/Array.extern.h @@ -22,6 +22,7 @@ // Define external global functions. #ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. #pragma once #include "../Common.extern.h" @@ -97,4 +98,14 @@ int ArraySort(ARRAY_REF(T, array)) { return 0; } +template +void ArrayFill(ARRAY_REF(X, array), int start, int count, X value) { + Array::ArrayFill(array, start, count, value); +} + +template +void ArrayFill(FIXED_ARRAY_REF(X, array, size), int start, int count, X value) { + Array::ArrayFill(array, start, count, value); +} + #endif diff --git a/Storage/Array.h b/Storage/Array.h index 5486e3ee9..392ad263a 100644 --- a/Storage/Array.h +++ b/Storage/Array.h @@ -102,6 +102,28 @@ class Array { } } + template + static void ArrayFill(ARRAY_REF(X, array), int start, int count, X value) { + start = MathMax(start, 0); + int end = MathMin(ArraySize(array), start + count); + + for (int i = start; i < end; ++i) { + array[i] = value; + } + } + +#ifdef __cplusplus + template + static void ArrayFill(FIXED_ARRAY_REF(X, array, size), int start, int count, X value) { + start = MathMax(start, 0); + int end = MathMin(size, start + count); + + for (int i = start; i < end; ++i) { + array[i] = value; + } + } +#endif + template static int ArrayCopy(ARRAY_REF(T, dst_array), const ARRAY_REF(T, src_array), const int dst_start = 0, const int src_start = 0, const int count = WHOLE_ARRAY) { diff --git a/Storage/Collection.h b/Storage/Collection.h index 98934caf2..f88820a34 100644 --- a/Storage/Collection.h +++ b/Storage/Collection.h @@ -20,9 +20,10 @@ * */ -// Prevents processing this includes file for the second time. -#ifndef COLLECTION_H -#define COLLECTION_H +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif // Includes. #include "../Storage/Object.h" @@ -209,4 +210,3 @@ class Collection { return _out; } }; -#endif // COLLECTION_H diff --git a/Storage/Data.define.h b/Storage/Data.define.h index a66e5fdd5..00a70f128 100644 --- a/Storage/Data.define.h +++ b/Storage/Data.define.h @@ -25,6 +25,11 @@ * Includes Data's defines. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + #ifndef __MQL4__ // -- #ifndef DoubleToStr diff --git a/Storage/Database.extern.h b/Storage/Database.extern.h index 1376330ac..64a6d25db 100644 --- a/Storage/Database.extern.h +++ b/Storage/Database.extern.h @@ -24,6 +24,9 @@ // Define external global functions. #ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once + // Closes a database. // @docs: https://www.mql5.com/en/docs/database/databaseclose void DatabaseClose(int database // database handle received in DatabaseOpen @@ -36,8 +39,8 @@ extern bool DatabaseExecute(int database, // database handle received in Databa // Opens or creates a database in a specified file. // @docs: https://www.mql5.com/en/docs/database/databaseopen -int DatabaseOpen(string filename, // file name - uint flags // combination of flags +int DatabaseOpen(string filename, // file name + unsigned int flags // combination of flags ); // Starts transaction execution. diff --git a/Storage/Database.h b/Storage/Database.h index 147225b63..65a96b745 100644 --- a/Storage/Database.h +++ b/Storage/Database.h @@ -28,9 +28,10 @@ * @docs https://www.mql5.com/en/docs/database */ -// Prevents processing this includes file for the second time. -#ifndef DATABASE_H -#define DATABASE_H +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif // Includes. #include "../Math/MatrixMini.h" @@ -256,4 +257,3 @@ class Database { */ bool SetTableSchema(string _name, DatabaseTableSchema &_schema) { return tables.Set(_name, _schema); } }; -#endif // DATABASE_H diff --git a/Storage/Database.struct.h b/Storage/Database.struct.h index 46f623778..e3c216401 100644 --- a/Storage/Database.struct.h +++ b/Storage/Database.struct.h @@ -25,6 +25,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Structs. struct DatabaseTableColumnEntry { string name; diff --git a/Storage/DateTime.h b/Storage/DateTime.h index c820bf37d..7372a8d48 100644 --- a/Storage/DateTime.h +++ b/Storage/DateTime.h @@ -29,9 +29,10 @@ * - https://www.mql5.com/en/docs/dateandtime */ -// Prevents processing this includes file for the second time. -#ifndef DATETIME_MQH -#define DATETIME_MQH +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif // Forward declarations. struct DataParamEntry; @@ -252,5 +253,3 @@ datetime TimeCurrent(MqlDateTime &dt_struct) { } #endif - -#endif // DATETIME_MQH diff --git a/Storage/Dict/Buffer/Buffer.h b/Storage/Dict/Buffer/Buffer.h index 61e080091..2f25b79f4 100644 --- a/Storage/Dict/Buffer/Buffer.h +++ b/Storage/Dict/Buffer/Buffer.h @@ -20,9 +20,10 @@ * */ -// Prevents processing this includes file for the second time. -#ifndef BUFFER_H -#define BUFFER_H +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif // Includes. #include "../Dict.h" @@ -108,4 +109,3 @@ class Buffer : public Dict { return (T)median; } }; -#endif // BUFFER_H diff --git a/Storage/Dict/Buffer/BufferCandle.h b/Storage/Dict/Buffer/BufferCandle.h index e616796ee..9d512c42d 100644 --- a/Storage/Dict/Buffer/BufferCandle.h +++ b/Storage/Dict/Buffer/BufferCandle.h @@ -20,9 +20,10 @@ * */ -// Prevents processing this includes file for the second time. -#ifndef BUFFER_CANDLE_H -#define BUFFER_CANDLE_H +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif // Includes. #include "../../../Candle.struct.h" @@ -62,5 +63,3 @@ class BufferCandle : public BufferStruct> { */ string ToJSON() { return SerializerConverter::FromObject(THIS_REF).ToString(); } }; - -#endif // BUFFER_CANDLE_H diff --git a/Storage/Dict/Buffer/BufferFXT.h b/Storage/Dict/Buffer/BufferFXT.h index 6cf4461d8..f4985aa31 100644 --- a/Storage/Dict/Buffer/BufferFXT.h +++ b/Storage/Dict/Buffer/BufferFXT.h @@ -19,9 +19,10 @@ * along with this program. If not, see . */ -// Prevents processing this includes file for the second time. -#ifndef BUFFER_FXT_H -#define BUFFER_FXT_H +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif // Includes. #include "../../../Exchange/Account/AccountMt.h" @@ -302,5 +303,3 @@ class BufferFXT : public DictStruct { // @see: https://docs.mql4.com/files/filewritestruct } }; - -#endif // BUFFER_FXT_H diff --git a/Storage/Dict/Buffer/BufferStruct.h b/Storage/Dict/Buffer/BufferStruct.h index ca5906759..5db539b6f 100644 --- a/Storage/Dict/Buffer/BufferStruct.h +++ b/Storage/Dict/Buffer/BufferStruct.h @@ -20,9 +20,10 @@ * */ -// Prevents processing this includes file for the second time. -#ifndef BUFFER_STRUCT_H -#define BUFFER_STRUCT_H +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif // Includes. #include "../../../Serializer/Serializer.h" @@ -116,5 +117,3 @@ class BufferStruct : public DictStruct { */ long GetMin() { return min; } }; - -#endif // BUFFER_STRUCT_H diff --git a/Storage/Dict/Buffer/BufferTick.h b/Storage/Dict/Buffer/BufferTick.h index 6730ff705..44960c3ae 100644 --- a/Storage/Dict/Buffer/BufferTick.h +++ b/Storage/Dict/Buffer/BufferTick.h @@ -20,9 +20,10 @@ * */ -// Prevents processing this includes file for the second time. -#ifndef BUFFER_TICK_H -#define BUFFER_TICK_H +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif // Includes. #include "../../../Indicator/IndicatorData.enum.h" @@ -216,5 +217,3 @@ class BufferTick : public BufferStruct> { return NULL; } }; - -#endif // BUFFER_TICK_H diff --git a/Storage/Dict/Dict.h b/Storage/Dict/Dict.h index 45f304aa1..4341a87f0 100644 --- a/Storage/Dict/Dict.h +++ b/Storage/Dict/Dict.h @@ -20,9 +20,10 @@ * */ -// Prevents processing this includes file for the second time. -#ifndef DICT_H -#define DICT_H +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif #include "../../Convert.basic.h" #include "../../Math/Matrix.h" @@ -448,5 +449,3 @@ class Dict : public DictBase { return result; } }; - -#endif diff --git a/Storage/Dict/DictBase.h b/Storage/Dict/DictBase.h index a01d14535..34e4b011b 100644 --- a/Storage/Dict/DictBase.h +++ b/Storage/Dict/DictBase.h @@ -20,9 +20,10 @@ * */ -// Prevents processing this includes file for the second time. -#ifndef DICT_BASE_H -#define DICT_BASE_H +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif // Includes. #include "../../Convert.mqh" @@ -390,5 +391,3 @@ class DictBase { */ unsigned int Hash(float x) { return (unsigned int)((unsigned long)x * 10000 % 10000); } }; - -#endif diff --git a/Storage/Dict/DictSlot.h b/Storage/Dict/DictSlot.h index 00925d3f5..b9cf1af2a 100644 --- a/Storage/Dict/DictSlot.h +++ b/Storage/Dict/DictSlot.h @@ -20,9 +20,10 @@ * */ -// Prevents processing this includes file for the second time. -#ifndef DICT_SLOT_H -#define DICT_SLOT_H +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif enum DICT_SLOT_FLAGS { DICT_SLOT_INVALID = 1, DICT_SLOT_HAS_KEY = 2, DICT_SLOT_IS_USED = 4, DICT_SLOT_WAS_USED = 8 }; @@ -60,5 +61,3 @@ class DictSlot { void RemoveFlags(unsigned char flags) { _flags &= (unsigned char)~flags; } }; - -#endif // DICT_SLOT_H diff --git a/Storage/Object.enum.h b/Storage/Object.enum.h index 021ccd22e..29d84affd 100644 --- a/Storage/Object.enum.h +++ b/Storage/Object.enum.h @@ -26,7 +26,7 @@ */ #ifndef __MQLBUILD__ - +// Allows the preprocessor to include a header file when it is needed. #pragma once // Used for checking the type of the object pointer. diff --git a/Storage/Object.extern.h b/Storage/Object.extern.h index d166ea319..3f0778bbd 100644 --- a/Storage/Object.extern.h +++ b/Storage/Object.extern.h @@ -26,6 +26,7 @@ */ #ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. #pragma once // Includes. diff --git a/Storage/Object.h b/Storage/Object.h index 85bd312f9..cf9feaf40 100644 --- a/Storage/Object.h +++ b/Storage/Object.h @@ -20,9 +20,10 @@ * */ -// Prevents processing this includes file for the second time. -#ifndef OBJECT_H -#define OBJECT_H +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif // Includes. #include "../Refs.mqh" @@ -130,4 +131,3 @@ class Object : public Dynamic { // Initialize static global variables. // Object *Object::list = { 0 }; -#endif // OBJECT_H diff --git a/Storage/Redis.h b/Storage/Redis.h index 852803ec0..81eef8ce5 100644 --- a/Storage/Redis.h +++ b/Storage/Redis.h @@ -24,6 +24,12 @@ * @file * Implements class for storing/retrieving Redis database data. */ + +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + #include "../Serializer/Serializer.h" #include "../Serializer/SerializerConversions.h" #include "../Serializer/SerializerJson.h" diff --git a/Storage/String.extern.h b/Storage/String.extern.h index 26d44187f..924c2d79c 100644 --- a/Storage/String.extern.h +++ b/Storage/String.extern.h @@ -20,8 +20,8 @@ * */ -// Prevents processing this includes file for the second time. #ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. #pragma once // Includes. diff --git a/Storage/String.h b/Storage/String.h index 73ced295d..260efa983 100644 --- a/Storage/String.h +++ b/Storage/String.h @@ -20,9 +20,10 @@ * */ -// Prevents processing this includes file for the second time. -#ifndef STRING_MQH -#define STRING_MQH +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif // Includes. #include "../Common.extern.h" @@ -119,4 +120,3 @@ class String { #endif } }; -#endif // STRING_MQH diff --git a/Storage/ValueStorage.price_median.h b/Storage/ValueStorage.price_median.h index 6a05fad9d..e58953c08 100644 --- a/Storage/ValueStorage.price_median.h +++ b/Storage/ValueStorage.price_median.h @@ -24,6 +24,11 @@ * Median price version of ValueStorage. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Indicator/IndicatorBase.h" #include "Cache/ObjectsCache.h" diff --git a/Storage/ValueStorage.price_typical.h b/Storage/ValueStorage.price_typical.h index 3ca6300f0..d063e0112 100644 --- a/Storage/ValueStorage.price_typical.h +++ b/Storage/ValueStorage.price_typical.h @@ -24,6 +24,11 @@ * Typical price version of ValueStorage. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "Cache/ObjectsCache.h" #include "ValueStorage.history.h" diff --git a/Storage/ValueStorage.price_weighted.h b/Storage/ValueStorage.price_weighted.h index e86b7cbe6..04581f325 100644 --- a/Storage/ValueStorage.price_weighted.h +++ b/Storage/ValueStorage.price_weighted.h @@ -24,6 +24,11 @@ * Weighted price version of ValueStorage. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "Cache/ObjectsCache.h" #include "ValueStorage.history.h" diff --git a/Strategy.struct.pricestop.h b/Strategy.struct.pricestop.h index 8a14b983d..240ef01b3 100644 --- a/Strategy.struct.pricestop.h +++ b/Strategy.struct.pricestop.h @@ -61,7 +61,7 @@ struct StrategyPriceStop { // IndicatorParams iparams; /* Constructors */ - void StrategyPriceStop(int _method = 0, float _ivalue = 0) : method(_method), ivalue(_ivalue) {} + StrategyPriceStop(int _method = 0, float _ivalue = 0) : method(_method), ivalue(_ivalue) {} // Main methods. // Calculate price stop value. float GetValue(int _shift = 0, int _direction = -1, float _min_trade_dist = 0.0f) { @@ -84,7 +84,7 @@ struct StrategyPriceStop { } if (CheckMethod(STRATEGY_PRICE_STOP_PRICE_PP)) { double _pp, _r1, _r2, _r3, _r4, _s1, _s2, _s3, _s4; - double _prices[4]; + FIXED_ARRAY(double, _prices, 4); _prices[0] = _ohlc0.GetClose(); _prices[1] = _direction > 0 ? _ohlc0.GetHigh() : _ohlc0.GetLow(); _prices[2] = _direction > 0 ? _ohlc1.GetHigh() : _ohlc1.GetLow(); diff --git a/SummaryReport.mqh b/SummaryReport.mqh index 84eb08feb..324eabdf0 100644 --- a/SummaryReport.mqh +++ b/SummaryReport.mqh @@ -20,8 +20,13 @@ * */ -#include "Exchange/Account/AccountMt.h" +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + #include "Convert.mqh" +#include "Exchange/Account/AccountMt.h" #include "Indicator/IndicatorData.h" #include "Platform/Order.struct.h" #include "Platform/Terminal.h" diff --git a/Test.mqh b/Test.mqh index ebb9a463d..c181fe28a 100644 --- a/Test.mqh +++ b/Test.mqh @@ -25,6 +25,11 @@ * Provides base functionality for testing purposes. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Define an assert macros. #define assertTrueOrFail(cond, msg) \ if (!(cond)) { \ diff --git a/Tester.mqh b/Tester.mqh index 0538230cf..f81a50f40 100644 --- a/Tester.mqh +++ b/Tester.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "Exchange/SymbolInfo/SymbolInfo.h" #include "Platform/Terminal.h" diff --git a/Tests.mqh b/Tests.mqh index f40cb9fec..318a1225e 100644 --- a/Tests.mqh +++ b/Tests.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "Indicator/Indicator.h" #include "Market.mqh" diff --git a/Timer.mqh b/Timer.mqh index d18ac4ebb..c15d89314 100644 --- a/Timer.mqh +++ b/Timer.mqh @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "Math/Math.h" #include "Storage/Object.h" diff --git a/Trade/TradeSignal.h b/Trade/TradeSignal.h index 16cb3d33a..73645602c 100644 --- a/Trade/TradeSignal.h +++ b/Trade/TradeSignal.h @@ -20,6 +20,11 @@ * */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "TradeSignal.struct.h" diff --git a/Trade/TradeSignal.struct.h b/Trade/TradeSignal.struct.h index b5ce076e7..92946633f 100644 --- a/Trade/TradeSignal.struct.h +++ b/Trade/TradeSignal.struct.h @@ -25,6 +25,11 @@ * Includes TradeSignal's structs. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Platform/Chart/Chart.enum.h" #include "../Serializer/SerializerConverter.h" diff --git a/Trade/TradeSignalManager.h b/Trade/TradeSignalManager.h index 7a955d55c..da966da63 100644 --- a/Trade/TradeSignalManager.h +++ b/Trade/TradeSignalManager.h @@ -25,6 +25,11 @@ * Implements TradeSignalManager class. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Includes. #include "../Storage/Dict/DictObject.h" #include "TradeSignal.h" diff --git a/Trade/TradeSignalManager.struct.h b/Trade/TradeSignalManager.struct.h index 67aa68c6b..bf3e56c08 100644 --- a/Trade/TradeSignalManager.struct.h +++ b/Trade/TradeSignalManager.struct.h @@ -25,6 +25,11 @@ * Implements TradeSignalManager's structures. */ +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + // Defines. #define TSM_PROP_FREQ STRUCT_ENUM(TradeSignalManagerParams, TSM_PARAMS_PROP_FREQ) #define TSM_PROP_LAST_CHECK STRUCT_ENUM(TradeSignalManagerParams, TSM_PARAMS_PROP_LAST_CHECK) From 27edd661d052ce2c23a908de849a2311bb426ca5 Mon Sep 17 00:00:00 2001 From: Adrian Kierzkowski Date: Tue, 4 Jul 2023 20:00:26 +0200 Subject: [PATCH 104/109] WIP. Fixing C++ errors. One step further. --- Bar.struct.h | 12 + Candle.struct.h | 20 +- Config.mqh | 8 +- Convert.basic.h | 44 +- Convert.mqh | 24 +- EA.mqh | 317 ++++++------- EA.struct.h | 3 +- Exchange/Account/AccountMt.h | 20 +- Exchange/Exchange.struct.h | 2 +- Exchange/SymbolInfo/SymbolInfo.extern.h | 2 +- Exchange/SymbolInfo/SymbolInfo.h | 6 +- Exchange/SymbolInfo/SymbolInfo.struct.h | 12 +- .../SymbolInfo/SymbolInfo.struct.static.h | 8 +- Indicator/Indicator.h | 16 +- Indicator/IndicatorBase.h | 6 +- Indicator/IndicatorCandle.h | 10 +- Indicator/IndicatorCandle.provider.h | 4 +- Indicator/IndicatorData.enum.h | 4 +- Indicator/IndicatorData.h | 28 +- Indicator/IndicatorData.struct.h | 18 +- Indicator/IndicatorRenko.h | 6 +- Indicator/IndicatorRenko.provider.h | 4 +- Indicator/IndicatorTf.provider.h | 14 +- Indicator/IndicatorTick.h | 2 +- Indicator/IndicatorTick.provider.h | 4 +- Indicator/tests/IndicatorTf.test.mq5 | 4 +- Indicator/tests/IndicatorTick.test.mq5 | 2 +- Indicators/Indi_CHO.mqh | 2 +- Indicators/Indi_PriceVolumeTrend.mqh | 2 +- Indicators/Indi_StdDev.mqh | 2 +- Indicators/Indi_VROC.mqh | 2 +- Indicators/Indi_Volumes.mqh | 2 +- Indicators/Oscillator/Indi_RSI.h | 6 +- Indicators/PriceRange/Indi_Pivot.h | 2 +- Indicators/Tick/Indi_TickMt.h | 10 +- Indicators/Tick/Indi_TickProvider.h | 2 +- Indicators/Tick/Indi_TickRandom.h | 2 +- Indicators/tests/DrawIndicator.test.mq5 | 14 +- Log.mqh | 4 +- MD5.mqh | 30 +- Market.mqh | 5 +- Math/Math.define.h | 4 +- Platform/Chart/Chart.h | 21 +- Platform/Chart/Chart.struct.h | 16 +- Platform/Chart/Chart.struct.static.h | 10 +- Platform/Chart/ChartBase.h | 14 +- Platform/Chart/ChartMt.h | 4 +- Platform/Chart3D/Interface.h | 2 +- Platform/Chart3D/Math.h | 8 +- Platform/Chart3D/Mesh.h | 8 +- Platform/MQL5.mqh | 417 +++++++++--------- Platform/Order.h | 201 ++++----- Platform/Order.struct.h | 44 +- Platform/OrderQuery.h | 14 +- Platform/Orders.h | 8 +- Platform/Platform.enum.h | 44 ++ Platform/Platform.extern.h | 27 +- Platform/Platform.h | 58 ++- Platform/Plot.h | 28 +- Platform/Terminal.h | 12 +- Platform/tests/Order.test.mq5 | 8 +- Platform/tests/OrderQuery.test.mq5 | 4 +- Profiler.mqh | 4 +- Serializer/SerializerBinary.h | 2 +- Serializer/SerializerConversions.h | 4 +- Serializer/SerializerNodeParam.h | 24 +- Stats.mqh | 18 +- Std.h | 2 + Storage/Array.h | 12 +- Storage/Collection.h | 2 +- Storage/Data.enum.h | 4 +- Storage/Data.struct.h | 26 +- Storage/Database.h | 2 +- Storage/Dict/Buffer/Buffer.h | 12 +- Storage/Dict/Buffer/BufferFXT.h | 6 +- Storage/Dict/Buffer/BufferStruct.h | 20 +- Storage/Dict/DictBase.h | 2 +- Storage/Dict/DictStruct.h | 2 +- Storage/ItemsHistory.h | 16 +- Storage/Object.h | 8 +- Storage/String.extern.h | 2 +- Storage/ValueStorage.h | 18 +- Storage/ValueStorage.spread.h | 8 +- Storage/ValueStorage.tick_volume.h | 8 +- Storage/ValueStorage.volume.h | 10 +- Strategy.mqh | 61 +-- Strategy.struct.h | 12 +- Strategy.struct.pricestop.h | 7 +- Task/Task.struct.h | 1 + Task/tests/TaskAction.test.mq5 | 8 +- Task/tests/TaskCondition.test.mq5 | 8 +- Task/tests/TaskGetter.test.mq5 | 2 +- Tick/Tick.struct.h | 18 +- Ticker.mqh | 14 +- Timer.mqh | 8 +- Trade.mqh | 79 ++-- Trade.struct.h | 8 +- Trade/TradeSignal.struct.h | 12 +- Trade/TradeSignalManager.h | 6 +- Trade/TradeSignalManager.struct.h | 6 +- tests/StrategyTest-RSI.mq5 | 20 +- tests/TickerTest.mq5 | 2 +- 102 files changed, 1114 insertions(+), 1007 deletions(-) create mode 100644 Platform/Platform.enum.h diff --git a/Bar.struct.h b/Bar.struct.h index 63d77eea9..fe55530d2 100644 --- a/Bar.struct.h +++ b/Bar.struct.h @@ -70,6 +70,18 @@ struct BarOHLC low = fmin(low, _prices[i]); } } + BarOHLC(CONST_ARRAY_REF(double, _prices, 4), datetime _time = 0) : time(_time) { + _time = _time == (datetime)0 ? TimeCurrent() : _time; + int _size = 4; + close = _prices[0]; + open = _prices[_size - 1]; + high = fmax(close, open); + low = fmin(close, open); + for (int i = 0; i < _size; i++) { + high = fmax(high, _prices[i]); + low = fmin(low, _prices[i]); + } + } // Struct methods. // Getters bool GetPivots(ENUM_PP_TYPE _type, double &_pp, double &_r1, double &_r2, double &_r3, double &_r4, double &_s1, diff --git a/Candle.struct.h b/Candle.struct.h index 596ddbb89..ec0768bb5 100644 --- a/Candle.struct.h +++ b/Candle.struct.h @@ -231,14 +231,14 @@ struct CandleOCTOHLC : CandleOHLC { int length; // Open and close timestamps of ticks that were part of this candle. - long open_timestamp_ms, close_timestamp_ms; + int64 open_timestamp_ms, close_timestamp_ms; // Number of ticks which formed the candle. Also known as volume. int volume; // Struct constructor. CandleOCTOHLC(T _open = 0, T _high = 0, T _low = 0, T _close = 0, int _start_time = -1, int _length = 0, - long _open_timestamp_ms = -1, long _close_timestamp_ms = -1, int _volume = 0) + int64 _open_timestamp_ms = -1, int64 _close_timestamp_ms = -1, int _volume = 0) : CandleOHLC(_open, _high, _low, _close), is_complete(true), start_time(_start_time), @@ -264,7 +264,7 @@ struct CandleOCTOHLC : CandleOHLC { /** * Initializes candle with a given start time, lenght in seconds, first tick's timestamp and its price. */ - void Init(int _start_time, int _length, long _timestamp_ms = -1, T _price = 0) { + void Init(int _start_time, int _length, int64 _timestamp_ms = -1, T _price = 0) { is_complete = false; start_time = _start_time; length = _length; @@ -277,7 +277,7 @@ struct CandleOCTOHLC : CandleOHLC { /** * Updates OHLC values taking into consideration tick's timestamp. */ - void Update(long _timestamp_ms, T _price) { + void Update(int64 _timestamp_ms, T _price) { if (!ContainsTimeMs(_timestamp_ms)) { Print("Error: Cannot update candle. Given time doesn't fit in candle's time-frame!"); DebugBreak(); @@ -308,12 +308,12 @@ struct CandleOCTOHLC : CandleOHLC { /** * Method used by ItemsHistory. */ - long GetTimeMs() { return (long)start_time * 1000; } + int64 GetTimeMs() { return (int64)start_time * 1000; } /** * Method used by ItemsHistory. */ - long GetLengthMs() { return (long)length * 1000; } + int64 GetLengthMs() { return (int64)length * 1000; } /** * Returns candle's start time. @@ -323,18 +323,18 @@ struct CandleOCTOHLC : CandleOHLC { /** * Returns timestamp of open price. */ - long GetOpenTimestamp() { return open_timestamp_ms / 1000; } + int64 GetOpenTimestamp() { return open_timestamp_ms / 1000; } /** * Returns timestamp of close price. */ - long GetCloseTimestamp() { return close_timestamp_ms / 1000; } + int64 GetCloseTimestamp() { return close_timestamp_ms / 1000; } /** * Whether given time fits in the candle. */ - bool ContainsTimeMs(long _time_ms) { - return _time_ms >= (long)start_time * 1000 && _time_ms < (long)(start_time + length) * 1000; + bool ContainsTimeMs(int64 _time_ms) { + return _time_ms >= (int64)start_time * 1000 && _time_ms < (int64)(start_time + length) * 1000; } // Serializers. diff --git a/Config.mqh b/Config.mqh index 8213b902e..6fafbd41f 100644 --- a/Config.mqh +++ b/Config.mqh @@ -30,10 +30,10 @@ #define CONFIG_MQH // Includes. -#include "Storage/Dict/DictStruct.h" #include "File.mqh" -#include "Storage/Object.h" #include "Serializer/Serializer.h" +#include "Storage/Dict/DictStruct.h" +#include "Storage/Object.h" enum CONFIG_FORMAT { CONFIG_FORMAT_JSON, CONFIG_FORMAT_JSON_NO_WHITESPACES, CONFIG_FORMAT_INI }; @@ -84,7 +84,7 @@ struct ConfigEntry : public MqlParam { ConfigEntry() { type = (ENUM_DATATYPE)-1; } ConfigEntry(const ConfigEntry& _r) { THIS_REF = _r; } - ConfigEntry(long _value) { + ConfigEntry(int64 _value) { type = ENUM_DATATYPE::TYPE_LONG; integer_value = _value; } @@ -198,7 +198,7 @@ class Config : public DictStruct { return Set(key, param); } - bool Set(string key, long value) { + bool Set(string key, int64 value) { ConfigEntry param = value; return Set(key, param); } diff --git a/Convert.basic.h b/Convert.basic.h index 496e78bee..b1a7d546d 100644 --- a/Convert.basic.h +++ b/Convert.basic.h @@ -40,7 +40,7 @@ class ConvertBasic { /** * Convert integer to hex. */ - static string IntToHex(long long_number) { + static string IntToHex(int64 long_number) { string result; int integer_number = (int)long_number; for (int i = 0; i < 4; i++) { @@ -88,8 +88,8 @@ class ConvertBasic { static void StringToType(string _value, unsigned int& _out) { _out = (unsigned int)StringToInteger(_value); } static void StringToType(string _value, char& _out) { _out = (char)_value[0]; } static void StringToType(string _value, unsigned char& _out) { _out = (unsigned char)_value[0]; } - static void StringToType(string _value, long& _out) { _out = StringToInteger(_value); } - static void StringToType(string _value, unsigned long& _out) { _out = StringToInteger(_value); } + static void StringToType(string _value, int64& _out) { _out = StringToInteger(_value); } + static void StringToType(string _value, uint64& _out) { _out = StringToInteger(_value); } static void StringToType(string _value, short& _out) { _out = (short)StringToInteger(_value); } static void StringToType(string _value, unsigned short& _out) { _out = (unsigned short)StringToInteger(_value); } static void StringToType(string _value, float& _out) { _out = (float)StringToDouble(_value); } @@ -116,8 +116,8 @@ class ConvertBasic { static void BoolToType(bool _value, unsigned char& _out) { _out = (unsigned char)_value; } static void BoolToType(bool _value, int& _out) { _out = (int)_value; } static void BoolToType(bool _value, unsigned int& _out) { _out = (unsigned int)_value; } - static void BoolToType(bool _value, long& _out) { _out = (long)_value; } - static void BoolToType(bool _value, unsigned long& _out) { _out = (unsigned long)_value; } + static void BoolToType(bool _value, int64& _out) { _out = (int64)_value; } + static void BoolToType(bool _value, uint64& _out) { _out = (uint64)_value; } static void BoolToType(bool _value, short& _out) { _out = (short)_value; } static void BoolToType(bool _value, unsigned short& _out) { _out = (unsigned short)_value; } static void BoolToType(bool _value, float& _out) { _out = (float)_value; } @@ -133,23 +133,23 @@ class ConvertBasic { return _out; } - static void LongToType(long _value, bool& _out) { _out = (bool)_value; } - static void LongToType(long _value, char& _out) { _out = (char)_value; } - static void LongToType(long _value, unsigned char& _out) { _out = (unsigned char)_value; } - static void LongToType(long _value, int& _out) { _out = (int)_value; } - static void LongToType(long _value, unsigned int& _out) { _out = (unsigned int)_value; } - static void LongToType(long _value, long& _out) { _out = (long)_value; } - static void LongToType(long _value, unsigned long& _out) { _out = (unsigned long)_value; } - static void LongToType(long _value, short& _out) { _out = (short)_value; } - static void LongToType(long _value, unsigned short& _out) { _out = (unsigned short)_value; } - static void LongToType(long _value, float& _out) { _out = (float)_value; } - static void LongToType(long _value, double& _out) { _out = (double)_value; } - static void LongToType(long _value, string& _out) { _out = _value ? "1" : "0"; } - static void LongToType(long _value, color& _out) { _out = 0; } - static void LongToType(long _value, datetime& _out) {} + static void LongToType(int64 _value, bool& _out) { _out = (bool)_value; } + static void LongToType(int64 _value, char& _out) { _out = (char)_value; } + static void LongToType(int64 _value, unsigned char& _out) { _out = (unsigned char)_value; } + static void LongToType(int64 _value, int& _out) { _out = (int)_value; } + static void LongToType(int64 _value, unsigned int& _out) { _out = (unsigned int)_value; } + static void LongToType(int64 _value, int64& _out) { _out = (int64)_value; } + static void LongToType(int64 _value, uint64& _out) { _out = (uint64)_value; } + static void LongToType(int64 _value, short& _out) { _out = (short)_value; } + static void LongToType(int64 _value, unsigned short& _out) { _out = (unsigned short)_value; } + static void LongToType(int64 _value, float& _out) { _out = (float)_value; } + static void LongToType(int64 _value, double& _out) { _out = (double)_value; } + static void LongToType(int64 _value, string& _out) { _out = _value ? "1" : "0"; } + static void LongToType(int64 _value, color& _out) { _out = 0; } + static void LongToType(int64 _value, datetime& _out) {} template - static X LongTo(long _value) { + static X LongTo(int64 _value) { X _out; LongToType(_value, _out); return _out; @@ -160,8 +160,8 @@ class ConvertBasic { static void DoubleToType(double _value, unsigned char& _out) { _out = (unsigned char)_value; } static void DoubleToType(double _value, int& _out) { _out = (int)_value; } static void DoubleToType(double _value, unsigned int& _out) { _out = (unsigned int)_value; } - static void DoubleToType(double _value, long& _out) { _out = (long)_value; } - static void DoubleToType(double _value, unsigned long& _out) { _out = (unsigned long)_value; } + static void DoubleToType(double _value, int64& _out) { _out = (int64)_value; } + static void DoubleToType(double _value, uint64& _out) { _out = (uint64)_value; } static void DoubleToType(double _value, short& _out) { _out = (short)_value; } static void DoubleToType(double _value, unsigned short& _out) { _out = (unsigned short)_value; } static void DoubleToType(double _value, float& _out) { _out = (float)_value; } diff --git a/Convert.mqh b/Convert.mqh index 1103756d2..86abc3ed9 100644 --- a/Convert.mqh +++ b/Convert.mqh @@ -26,17 +26,17 @@ #endif // Includes. +#include "Convert.extern.h" #include "Exchange/Account/Account.enum.h" #include "Exchange/Account/Account.extern.h" -#include "Storage/Array.h" -#include "Convert.extern.h" -#include "Storage/DateTime.extern.h" -#include "Storage/DateTime.h" -#include "Math/Math.extern.h" -#include "Platform/Order.enum.h" #include "Exchange/SymbolInfo/SymbolInfo.enum.h" #include "Exchange/SymbolInfo/SymbolInfo.extern.h" #include "Exchange/SymbolInfo/SymbolInfo.struct.static.h" +#include "Math/Math.extern.h" +#include "Platform/Order.enum.h" +#include "Storage/Array.h" +#include "Storage/DateTime.extern.h" +#include "Storage/DateTime.h" /** * Class to provide conversion methods. @@ -164,12 +164,12 @@ class Convert { /** * Convert points into pips. */ - static double PointsToPips(long pts, int digits) { return (double)(pts / PointsPerPip(digits)); } + static double PointsToPips(int64 pts, int digits) { return (double)(pts / PointsPerPip(digits)); } /** * Convert points into pips. */ - static double PointsToPips(long pts, string _symbol = NULL) { + static double PointsToPips(int64 pts, string _symbol = NULL) { return PointsToPips(pts, (unsigned int)SymbolInfoStatic::SymbolInfoInteger(_symbol, SYMBOL_DIGITS)); } @@ -177,7 +177,7 @@ class Convert { * Convert points into price value. * */ - static double PointsToValue(long pts, int mode, string _symbol = NULL) { + static double PointsToValue(int64 pts, int mode, string _symbol = NULL) { switch (mode) { case 0: // Forex. // In currencies a tick is a point. @@ -201,7 +201,7 @@ class Convert { /** * Convert points into price value. */ - static double PointsToValue(long pts, int mode, int digits) { + static double PointsToValue(int64 pts, int mode, int digits) { switch (mode) { case 0: // Forex. return PipsToValue((double)pts / PointsPerPip(digits), digits); @@ -222,8 +222,8 @@ class Convert { /** * Convert points into price value. */ - static double PointsToValue(long pts, string _symbol = NULL) { - return PointsToValue(pts, (int)SymbolInfoStatic::SymbolInfoInteger(_symbol, SYMBOL_TRADE_CALC_MODE)); + static double PointsToValue(int64 pts, string _symbol = NULL) { + return PointsToValue(pts, SymbolInfoStatic::SymbolInfoInteger(_symbol, SYMBOL_TRADE_CALC_MODE)); } /** diff --git a/EA.mqh b/EA.mqh index c7f8e7e29..a3179f174 100644 --- a/EA.mqh +++ b/EA.mqh @@ -57,7 +57,7 @@ class EA : public Taskable { protected: // Class variables. AccountMt *account; - DictStruct> strats; + DictStruct> strats; Log logger; Terminal terminal; @@ -110,7 +110,7 @@ class EA : public Taskable { // Add and process tasks. Init(); // Initialize a trade instance for the current chart and symbol. - Ref _source = Platform::FetchDefaultCandleIndicator(_Symbol, PERIOD_CURRENT); + Ref _source = Platform::FetchDefaultCandleIndicator(_Symbol, PERIOD_CURRENT); TradeParams _tparams; Trade _trade(_tparams, _source.Ptr()); trade.Set(_Symbol, _trade); @@ -174,16 +174,16 @@ class EA : public Taskable { */ TradeSignalEntry GetStrategySignalEntry(Strategy *_strat, bool _trade_allowed = true, int _shift = 0) { // float _bf = 1.0; - float _scl = _strat.Get(STRAT_PARAM_SCL); - float _sol = _strat.Get(STRAT_PARAM_SOL); - int _scfm = _strat.Get(STRAT_PARAM_SCFM); - int _scft = _strat.Get(STRAT_PARAM_SCFT); - int _scm = _strat.Get(STRAT_PARAM_SCM); - int _sob = _strat.Get(STRAT_PARAM_SOB); - int _sofm = _strat.Get(STRAT_PARAM_SOFM); - int _soft = _strat.Get(STRAT_PARAM_SOFT); - int _som = _strat.Get(STRAT_PARAM_SOM); - int _ss = _shift >= 0 ? _shift : _strat.Get(STRAT_PARAM_SHIFT); + float _scl = _strat PTR_DEREF Get(STRAT_PARAM_SCL); + float _sol = _strat PTR_DEREF Get(STRAT_PARAM_SOL); + int _scfm = _strat PTR_DEREF Get(STRAT_PARAM_SCFM); + int _scft = _strat PTR_DEREF Get(STRAT_PARAM_SCFT); + int _scm = _strat PTR_DEREF Get(STRAT_PARAM_SCM); + int _sob = _strat PTR_DEREF Get(STRAT_PARAM_SOB); + int _sofm = _strat PTR_DEREF Get(STRAT_PARAM_SOFM); + int _soft = _strat PTR_DEREF Get(STRAT_PARAM_SOFT); + int _som = _strat PTR_DEREF Get(STRAT_PARAM_SOM); + int _ss = _shift >= 0 ? _shift : _strat PTR_DEREF Get(STRAT_PARAM_SHIFT); unsigned int _signals = 0; // sparams.Get(STRAT_PARAM_WEIGHT)); if (_trade_allowed) { @@ -191,20 +191,22 @@ class EA : public Taskable { // sresult.SetBoostFactor(sparams.IsBoosted() ? SignalOpenBoost(ORDER_TYPE_BUY, _sob) : 1.0f); // sresult.SetLotSize(sparams.GetLotSizeWithFactor()); // Process open signals when trade is allowed. - _signals |= _strat.SignalOpen(ORDER_TYPE_BUY, _som, _sol, _ss) ? SIGNAL_OPEN_BUY_MAIN : 0; - _signals |= !_strat.SignalOpenFilterMethod(ORDER_TYPE_BUY, _sofm) ? SIGNAL_OPEN_BUY_FILTER : 0; - _signals |= _strat.SignalOpen(ORDER_TYPE_SELL, _som, _sol, _ss) ? SIGNAL_OPEN_SELL_MAIN : 0; - _signals |= !_strat.SignalOpenFilterMethod(ORDER_TYPE_SELL, _sofm) ? SIGNAL_OPEN_SELL_FILTER : 0; - _signals |= !_strat.SignalOpenFilterTime(_soft) ? SIGNAL_OPEN_TIME_FILTER : 0; + _signals |= _strat PTR_DEREF SignalOpen(ORDER_TYPE_BUY, _som, _sol, _ss) ? SIGNAL_OPEN_BUY_MAIN : 0; + _signals |= !_strat PTR_DEREF SignalOpenFilterMethod(ORDER_TYPE_BUY, _sofm) ? SIGNAL_OPEN_BUY_FILTER : 0; + _signals |= _strat PTR_DEREF SignalOpen(ORDER_TYPE_SELL, _som, _sol, _ss) ? SIGNAL_OPEN_SELL_MAIN : 0; + _signals |= !_strat PTR_DEREF SignalOpenFilterMethod(ORDER_TYPE_SELL, _sofm) ? SIGNAL_OPEN_SELL_FILTER : 0; + _signals |= !_strat PTR_DEREF SignalOpenFilterTime(_soft) ? SIGNAL_OPEN_TIME_FILTER : 0; } // Process close signals. - _signals |= _strat.SignalClose(ORDER_TYPE_BUY, _scm, _scl, _ss) ? SIGNAL_CLOSE_BUY_MAIN : 0; - _signals |= !_strat.SignalCloseFilter(ORDER_TYPE_BUY, _scfm) ? SIGNAL_CLOSE_BUY_FILTER : 0; - _signals |= _strat.SignalClose(ORDER_TYPE_SELL, _scm, _scl, _ss) ? SIGNAL_CLOSE_SELL_MAIN : 0; - _signals |= !_strat.SignalCloseFilter(ORDER_TYPE_SELL, _scfm) ? SIGNAL_CLOSE_SELL_FILTER : 0; - _signals |= !_strat.SignalCloseFilterTime(_scft) ? SIGNAL_CLOSE_TIME_FILTER : 0; - TradeSignalEntry _sentry(_signals, _strat.GetSource() PTR_DEREF GetTf(), _strat.Get(STRAT_PARAM_ID)); - _sentry.Set(STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_PROP_STRENGTH), _strat.SignalOpen(_sofm, _sol, _ss)); + _signals |= _strat PTR_DEREF SignalClose(ORDER_TYPE_BUY, _scm, _scl, _ss) ? SIGNAL_CLOSE_BUY_MAIN : 0; + _signals |= !_strat PTR_DEREF SignalCloseFilter(ORDER_TYPE_BUY, _scfm) ? SIGNAL_CLOSE_BUY_FILTER : 0; + _signals |= _strat PTR_DEREF SignalClose(ORDER_TYPE_SELL, _scm, _scl, _ss) ? SIGNAL_CLOSE_SELL_MAIN : 0; + _signals |= !_strat PTR_DEREF SignalCloseFilter(ORDER_TYPE_SELL, _scfm) ? SIGNAL_CLOSE_SELL_FILTER : 0; + _signals |= !_strat PTR_DEREF SignalCloseFilterTime(_scft) ? SIGNAL_CLOSE_TIME_FILTER : 0; + TradeSignalEntry _sentry(_signals, _strat PTR_DEREF GetSource() PTR_DEREF GetTf(), + _strat PTR_DEREF Get(STRAT_PARAM_ID)); + _sentry.Set(STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_PROP_STRENGTH), + _strat PTR_DEREF SignalOpen(_sofm, _sol, _ss)); _sentry.Set(STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_PROP_TIME), ::TimeGMT()); return _sentry; } @@ -229,9 +231,9 @@ class EA : public Taskable { */ template void Set(ENUM_STRATEGY_PARAM _param, T _value) { - for (DictStructIterator> iter = strats.Begin(); iter.IsValid(); ++iter) { + for (DictStructIterator> iter = strats.Begin(); iter.IsValid(); ++iter) { Strategy *_strat = iter.Value().Ptr(); - _strat.Set(_param, _value); + _strat PTR_DEREF Set(_param, _value); } } @@ -242,7 +244,7 @@ class EA : public Taskable { void Set(ENUM_TRADE_PARAM _param, T _value) { for (DictObjectIterator iter = trade.Begin(); iter.IsValid(); ++iter) { Trade *_trade = iter.Value(); - _trade.Set(_param, _value); + _trade PTR_DEREF Set(_param, _value); } } @@ -258,51 +260,53 @@ class EA : public Taskable { for (DictObjectIterator _iter = tsm.GetIterSignalsActive(); _iter.IsValid(); ++_iter) { bool _result_local = true; TradeSignal *_signal = _iter.Value(); - if (_signal.Get(STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_FLAG_PROCESSED))) { + if (_signal PTR_DEREF Get(STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_FLAG_PROCESSED))) { // Ignores already processed signals. continue; } Trade *_trade = trade.GetByKey(_Symbol); Strategy *_strat = - strats.GetByKey(_signal.Get(STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_PROP_MAGIC_ID))).Ptr(); - if (_trade.Get(TRADE_STATE_ORDERS_ACTIVE)) { - float _sig_close = _signal.GetSignalClose(); + strats.GetByKey(_signal PTR_DEREF Get(STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_PROP_MAGIC_ID))) + .Ptr(); + if (_trade PTR_DEREF Get(TRADE_STATE_ORDERS_ACTIVE)) { + float _sig_close = _signal PTR_DEREF GetSignalClose(); string _comment_close = - _strat != NULL && _sig_close != 0.0f ? _strat.GetOrderCloseComment() : __FUNCTION_LINE__; + _strat != NULL && _sig_close != 0.0f ? _strat PTR_DEREF GetOrderCloseComment() : __FUNCTION_LINE__; // Check if we should close the orders. if (_sig_close >= 0.5f) { // Close signal for buy order. - _trade.OrdersCloseViaProp2( - ORDER_MAGIC, _signal.Get(STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_PROP_MAGIC_ID)), ORDER_TYPE, - ORDER_TYPE_BUY, MATH_COND_EQ, ORDER_REASON_CLOSED_BY_SIGNAL, _comment_close); + _trade PTR_DEREF OrdersCloseViaProp2( + ORDER_MAGIC, _signal PTR_DEREF Get(STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_PROP_MAGIC_ID)), + ORDER_TYPE, ORDER_TYPE_BUY, MATH_COND_EQ, ORDER_REASON_CLOSED_BY_SIGNAL, _comment_close); // Buy orders closed. - _strat.OnOrderClose(ORDER_TYPE_BUY); + _strat PTR_DEREF OnOrderClose(ORDER_TYPE_BUY); } if (_sig_close <= -0.5f) { // Close signal for sell order. - _trade.OrdersCloseViaProp2( - ORDER_MAGIC, _signal.Get(STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_PROP_MAGIC_ID)), ORDER_TYPE, - ORDER_TYPE_SELL, MATH_COND_EQ, ORDER_REASON_CLOSED_BY_SIGNAL, _comment_close); + _trade PTR_DEREF OrdersCloseViaProp2( + ORDER_MAGIC, _signal PTR_DEREF Get(STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_PROP_MAGIC_ID)), + ORDER_TYPE, ORDER_TYPE_SELL, MATH_COND_EQ, ORDER_REASON_CLOSED_BY_SIGNAL, _comment_close); // Sell orders closed. - _strat.OnOrderClose(ORDER_TYPE_SELL); + _strat PTR_DEREF OnOrderClose(ORDER_TYPE_SELL); } } - _trade_allowed &= _trade.IsTradeAllowed(); - _trade_allowed &= !_strat.IsSuspended(); + _trade_allowed &= _trade PTR_DEREF IsTradeAllowed(); + _trade_allowed &= !_strat PTR_DEREF IsSuspended(); if (_trade_allowed) { - float _sig_open = _signal.GetSignalOpen(); + float _sig_open = _signal PTR_DEREF GetSignalOpen(); unsigned int _sig_f = eparams.Get(STRUCT_ENUM(EAParams, EA_PARAM_PROP_SIGNAL_FILTER)); - string _comment_open = _strat != NULL && _sig_open != 0.0f ? _strat.GetOrderOpenComment() : __FUNCTION_LINE__; + string _comment_open = + _strat != NULL && _sig_open != 0.0f ? _strat PTR_DEREF GetOrderOpenComment() : __FUNCTION_LINE__; // Open orders on signals. if (_sig_open >= 0.5f) { // Open signal for buy. // When H1 or H4 signal filter is enabled, do not open minute-based orders on opposite or neutral signals. if (_sig_f == 0) { // @fixme: || GetSignalOpenFiltered(_signal, _sig_f) >= 0.5f) { - _strat.Set(TRADE_PARAM_ORDER_COMMENT, _comment_open); + _strat PTR_DEREF Set(TRADE_PARAM_ORDER_COMMENT, _comment_open); // Buy order open. _result_local &= TradeRequest(ORDER_TYPE_BUY, _Symbol, _strat); if (_result_local && eparams.CheckSignalFilter(STRUCT_ENUM(EAParams, EA_PARAM_SIGNAL_FILTER_FIRST))) { - _signal.Set(STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_FLAG_PROCESSED), true); + _signal PTR_DEREF Set(STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_FLAG_PROCESSED), true); break; } } @@ -311,26 +315,27 @@ class EA : public Taskable { // Open signal for sell. // When H1 or H4 signal filter is enabled, do not open minute-based orders on opposite or neutral signals. if (_sig_f == 0) { // @fixme: || GetSignalOpenFiltered(_signal, _sig_f) <= -0.5f) { - _strat.Set(TRADE_PARAM_ORDER_COMMENT, _comment_open); + _strat PTR_DEREF Set(TRADE_PARAM_ORDER_COMMENT, _comment_open); // Sell order open. _result_local &= TradeRequest(ORDER_TYPE_SELL, _Symbol, _strat); if (_result_local && eparams.CheckSignalFilter(STRUCT_ENUM(EAParams, EA_PARAM_SIGNAL_FILTER_FIRST))) { - _signal.Set(STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_FLAG_PROCESSED), true); + _signal PTR_DEREF Set(STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_FLAG_PROCESSED), true); break; } } } if (_result_local) { - _signal.Set(STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_FLAG_PROCESSED), true); + _signal PTR_DEREF Set(STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_FLAG_PROCESSED), true); } else { _last_error = GetLastError(); if (_last_error > 0) { - logger.Warning(StringFormat("Error: %d", _last_error), __FUNCTION_LINE__, _strat.GetName()); + logger.Warning(StringFormat("Error: %d", _last_error), __FUNCTION_LINE__, _strat PTR_DEREF GetName()); ResetLastError(); } - if (_trade.Get(TRADE_STATE_MONEY_NOT_ENOUGH)) { - logger.Warning(StringFormat("Suspending strategy.", _last_error), __FUNCTION_LINE__, _strat.GetName()); - _strat.Suspended(true); + if (_trade PTR_DEREF Get(TRADE_STATE_MONEY_NOT_ENOUGH)) { + logger.Warning(StringFormat("Suspending strategy.", _last_error), __FUNCTION_LINE__, + _strat PTR_DEREF GetName()); + _strat PTR_DEREF Suspended(true); } } } @@ -355,20 +360,20 @@ class EA : public Taskable { bool _result = false; Trade *_trade = trade.GetByKey(_symbol); // Prepare a request. - MqlTradeRequest _request = _trade.GetTradeOpenRequest(_cmd); - _request.comment = _strat.GetOrderOpenComment(); - _request.magic = _strat.Get(STRAT_PARAM_ID); + MqlTradeRequest _request = _trade PTR_DEREF GetTradeOpenRequest(_cmd); + _request.comment = _strat PTR_DEREF GetOrderOpenComment(); + _request.magic = _strat PTR_DEREF Get(STRAT_PARAM_ID); _request.price = SymbolInfoStatic::GetOpenOffer(_symbol, _cmd); - _request.volume = fmax(_strat.Get(STRAT_PARAM_LS), SymbolInfoStatic::GetVolumeMin(_symbol)); + _request.volume = fmax(_strat PTR_DEREF Get(STRAT_PARAM_LS), SymbolInfoStatic::GetVolumeMin(_symbol)); // @fixit Uncomment - // _request.volume = _trade.NormalizeLots(_request.volume); + // _request.volume = _trade PTR_DEREF NormalizeLots(_request.volume); // Prepare an order parameters. OrderParams _oparams; - _strat.OnOrderOpen(_oparams); + _strat PTR_DEREF OnOrderOpen(_oparams); // Send the request. - _result = _trade.RequestSend(_request, _oparams); + _result = _trade PTR_DEREF RequestSend(_request, _oparams); return _result; } @@ -387,27 +392,28 @@ class EA : public Taskable { if (estate.IsActive()) { ProcessPeriods(); // Process all enabled strategies and retrieve their signals. - for (DictStructIterator> iter = strats.Begin(); iter.IsValid(); ++iter) { + for (DictStructIterator> iter = strats.Begin(); iter.IsValid(); ++iter) { bool _can_trade = true; Strategy *_strat = iter.Value().Ptr(); Trade *_trade = trade.GetByKey(_Symbol); - if (_strat.IsEnabled()) { + if (_strat PTR_DEREF IsEnabled()) { if (estate.Get(STRUCT_ENUM(EAState, EA_STATE_PROP_NEW_PERIODS)) >= DATETIME_MINUTE) { // Process when new periods started. - _strat.OnPeriod(estate.Get(STRUCT_ENUM(EAState, EA_STATE_PROP_NEW_PERIODS))); - _strat.ProcessTasks(); - _trade.OnPeriod(estate.Get(STRUCT_ENUM(EAState, EA_STATE_PROP_NEW_PERIODS))); + _strat PTR_DEREF OnPeriod(estate.Get(STRUCT_ENUM(EAState, EA_STATE_PROP_NEW_PERIODS))); + _strat PTR_DEREF ProcessTasks(); + _trade PTR_DEREF OnPeriod(estate.Get(STRUCT_ENUM(EAState, EA_STATE_PROP_NEW_PERIODS))); eresults.stg_processed_periods++; } - if (_strat.TickFilter(_tick)) { - _can_trade &= !_strat.IsSuspended(); - TradeSignalEntry _sentry = GetStrategySignalEntry(_strat, _can_trade, _strat.Get(STRAT_PARAM_SHIFT)); + if (_strat PTR_DEREF TickFilter(_tick)) { + _can_trade &= !_strat PTR_DEREF IsSuspended(); + TradeSignalEntry _sentry = + GetStrategySignalEntry(_strat, _can_trade, _strat PTR_DEREF Get(STRAT_PARAM_SHIFT)); if (_sentry.Get(STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_PROP_SIGNALS)) > 0) { TradeSignal _signal(_sentry); if (_signal.GetSignalClose() != _signal.GetSignalOpen()) { tsm.SignalAdd(_signal); //, _tick.time); } - StgProcessResult _strat_result = _strat.GetProcessResult(); + StgProcessResult _strat_result = _strat PTR_DEREF GetProcessResult(); eresults.last_error = fmax(eresults.last_error, _strat_result.last_error); eresults.stg_errored += (int)_strat_result.last_error > ERR_NO_ERROR; eresults.stg_processed++; @@ -415,7 +421,7 @@ class EA : public Taskable { } } } - if (tsm.GetSignalsActive().Size() > 0 && tsm.IsReady()) { + if (tsm.GetSignalsActive() PTR_DEREF Size() > 0 && tsm.IsReady()) { // Process all strategies' signals and trigger trading orders. ProcessSignals(_tick, eparams.Get(STRUCT_ENUM(EAParams, EA_PARAM_PROP_SIGNAL_FILTER))); } @@ -442,33 +448,33 @@ class EA : public Taskable { * Process data to store. */ void ProcessData() { - long _timestamp = estate.last_updated.GetEntry().GetTimestamp(); + int64 _timestamp = estate.last_updated.GetEntry().GetTimestamp(); if (eparams.CheckFlagDataStore(EA_DATA_STORE_CHART)) { ChartEntry _entry = Chart().GetEntry(); data_chart.Add(_entry, _entry.bar.ohlc.time); } if (eparams.CheckFlagDataStore(EA_DATA_STORE_INDICATOR)) { - for (DictStructIterator> iter = strats.Begin(); iter.IsValid(); ++iter) { + for (DictStructIterator> iter = strats.Begin(); iter.IsValid(); ++iter) { Strategy *_strati = iter.Value().Ptr(); - IndicatorData *_indi = _strati.GetIndicator(); + IndicatorData *_indi = _strati PTR_DEREF GetIndicator(); if (_indi != NULL) { ENUM_TIMEFRAMES _itf = _indi PTR_DEREF GetTf(); - IndicatorDataEntry _ientry = _indi.GetEntry(); + IndicatorDataEntry _ientry = _indi PTR_DEREF GetEntry(); if (!data_indi.KeyExists(_itf)) { // Create new timeframe buffer if does not exist. BufferStruct *_ide = new BufferStruct; - data_indi.Set(_itf, _ide); + data_indi.Set(_itf, PTR_TO_REF(_ide)); } // Save entry into data_indi. - data_indi[_itf].Add(_ientry); + data_indi[_itf] PTR_DEREF Add(_ientry); } } } /* if (eparams.CheckFlagDataStore(EA_DATA_STORE_STRATEGY)) { - for (DictStructIterator> iter = strats.Begin(); iter.IsValid(); ++iter) { + for (DictStructIterator> iter = strats.Begin(); iter.IsValid(); ++iter) { Strategy *_strat = iter.Value().Ptr(); - StgEntry _sentry = _strat.GetEntry(); + StgEntry _sentry = _strat PTR_DEREF GetEntry(); ENUM_TIMEFRAMES _stf = iter_tf.Key(); // @fixme if (!data_stg.KeyExists(_stf)) { // Create new timeframe buffer if does not exist. @@ -501,7 +507,7 @@ class EA : public Taskable { * Export data. */ void DataExport(unsigned short _methods) { - long _timestamp = estate.last_updated.GetEntry().GetTimestamp(); + int64 _timestamp = estate.last_updated.GetEntry().GetTimestamp(); int _serializer_flags = SERIALIZER_FLAG_SKIP_HIDDEN | SERIALIZER_FLAG_INCLUDE_DEFAULT | SERIALIZER_FLAG_INCLUDE_DYNAMIC | SERIALIZER_FLAG_REUSE_STUB | SERIALIZER_FLAG_REUSE_OBJECT; @@ -533,14 +539,14 @@ class EA : public Taskable { SerializerConverter::MakeStubObject>(_serializer_flags); /* - for (DictStructIterator> iter = strats.Begin(); iter.IsValid(); ++iter) { + for (DictStructIterator> iter = strats.Begin(); iter.IsValid(); ++iter) { ENUM_TIMEFRAMES _itf = iter_tf.Key(); // @fixme if (data_indi.KeyExists(_itf)) { BufferStruct _indi_buff = data_indi.GetByKey(_itf); SerializerConverter _obj = SerializerConverter::FromObject(_indi_buff, _serializer_flags); - for (DictStructIterator> iter = strats[_itf].Begin(); iter.IsValid(); ++iter) { + for (DictStructIterator> iter = strats[_itf].Begin(); iter.IsValid(); ++iter) { string _key_indi = "Indicator"; _key_indi += StringFormat("-%d-%d-%d", _itf, _indi_buff.GetMin(), _indi_buff.GetMax()); @@ -568,7 +574,7 @@ class EA : public Taskable { SerializerConverter _stub = SerializerConverter::MakeStubObject>(_serializer_flags); /* @fixme - for (DictStructIterator> iter = strats.Begin(); iter.IsValid(); ++iter) { + for (DictStructIterator> iter = strats.Begin(); iter.IsValid(); ++iter) { ENUM_TIMEFRAMES _stf = iter_tf.Key(); // @fixme if (data_stg.KeyExists(_stf)) { string _key_stg = StringFormat("Strategy-%d", _stf); @@ -618,7 +624,7 @@ class EA : public Taskable { } if (eparams.CheckFlagDataStore(EA_DATA_STORE_TRADE)) { string _key_trade = "Trade"; - // _key_sym += StringFormat("-%d-%d", data_trade.GetMin(), data_trade.GetMax()); + // _key_sym += StringFormat("-%d-%d", data_trade PTR_DEREF GetMin(), data_trade PTR_DEREF GetMax()); if ((_methods & EA_DATA_EXPORT_CSV) != 0) { // @todo // SerializerConverter _stub_trade = @@ -654,14 +660,11 @@ class EA : public Taskable { */ /* @fixme: Convert into TradeSignal format. float GetSignalOpenFiltered(StrategySignal &_signal, unsigned int _sf) { - float _result = _signal.GetSignalOpen(); - ENUM_TIMEFRAMES _sig_tf = _signal.Get(STRUCT_ENUM(StrategySignal, STRATEGY_SIGNAL_PROP_TF)); - if (ChartTf::TfToHours(_sig_tf) < 1 && bool(_sf & STRUCT_ENUM(EAParams, EA_PARAM_SIGNAL_FILTER_OPEN_M_IF_H))) { - _result = 0; - long _tfts[4]; - _tfts[0] = ChartStatic::iTime(_Symbol, PERIOD_H1); - _tfts[1] = ChartStatic::iTime(_Symbol, PERIOD_H4); - _tfts[2] = ChartStatic::iTime(_Symbol, PERIOD_H1, 1); + float _result = _signal PTR_DEREF GetSignalOpen(); + ENUM_TIMEFRAMES _sig_tf = _signal PTR_DEREF Get(STRUCT_ENUM(StrategySignal, + STRATEGY_SIGNAL_PROP_TF)); if (ChartTf::TfToHours(_sig_tf) < 1 && bool(_sf & STRUCT_ENUM(EAParams, + EA_PARAM_SIGNAL_FILTER_OPEN_M_IF_H))) { _result = 0; int64 _tfts[4]; _tfts[0] = ChartStatic::iTime(_Symbol, + PERIOD_H1); _tfts[1] = ChartStatic::iTime(_Symbol, PERIOD_H4); _tfts[2] = ChartStatic::iTime(_Symbol, PERIOD_H1, 1); _tfts[3] = ChartStatic::iTime(_Symbol, PERIOD_H4, 1); for (int i = 0; i < ArraySize(_tfts); i++) { DictStruct _ds = strat_signals.GetByKey(_tfts[i]); @@ -694,21 +697,21 @@ class EA : public Taskable { * Returns true if the strategy has been initialized correctly, otherwise false. */ template - bool StrategyAdd(ENUM_TIMEFRAMES _tf, long _magic_no = 0, int _type = 0) { + bool StrategyAdd(ENUM_TIMEFRAMES _tf, int64 _magic_no = 0, int _type = 0) { bool _result = true; _magic_no = _magic_no > 0 ? _magic_no : rand(); Ref _strat = ((SClass *)NULL).Init(_tf); - _strat.Ptr().Set(STRAT_PARAM_ID, _magic_no); - _strat.Ptr().Set(STRAT_PARAM_TF, _tf); - _strat.Ptr().Set(STRAT_PARAM_TYPE, _type); - _strat.Ptr().OnInit(); + _strat PTR_DEREF Ptr().Set(STRAT_PARAM_ID, _magic_no); + _strat PTR_DEREF Ptr().Set(STRAT_PARAM_TF, _tf); + _strat PTR_DEREF Ptr().Set(STRAT_PARAM_TYPE, _type); + _strat PTR_DEREF Ptr().OnInit(); if (!strats.KeyExists(_magic_no)) { _result &= strats.Set(_magic_no, _strat); } else { logger.Error("Strategy adding conflict!", __FUNCTION_LINE__); DebugBreak(); } - OnStrategyAdd(_strat.Ptr()); + OnStrategyAdd(_strat PTR_DEREF Ptr()); return _result; } @@ -729,7 +732,7 @@ class EA : public Taskable { * Returns true if all strategies has been initialized correctly, otherwise false. */ template - bool StrategyAdd(unsigned int _tfs, long _init_magic = 0, int _type = 0) { + bool StrategyAdd(unsigned int _tfs, int64 _init_magic = 0, int _type = 0) { bool _result = true; for (int _tfi = 0; _tfi < sizeof(int) * 8; ++_tfi) { if ((_tfs & (1 << _tfi)) != 0) { @@ -744,7 +747,7 @@ class EA : public Taskable { */ bool StrategyLoadTrades(Strategy *_strat) { Trade *_trade = trade.GetByKey(_Symbol); - return _trade.OrdersLoadByMagic(_strat.Get(STRAT_PARAM_ID)); + return _trade PTR_DEREF OrdersLoadByMagic(_strat PTR_DEREF Get(STRAT_PARAM_ID)); } /* Trade methods */ @@ -760,51 +763,54 @@ class EA : public Taskable { ResetLastError(); for (DictObjectIterator titer = trade.Begin(); titer.IsValid(); ++titer) { Trade *_trade = titer.Value(); - if (_trade.Get(TRADE_STATE_ORDERS_ACTIVE)) { - for (DictStructIterator> oiter = _trade.GetOrdersActive().Begin(); oiter.IsValid(); ++oiter) { + if (_trade PTR_DEREF Get(TRADE_STATE_ORDERS_ACTIVE)) { + 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(); - if (!_order.ShouldUpdate()) { + if (!_order PTR_DEREF ShouldUpdate()) { continue; } - _order.ProcessConditions(); - if (_order.IsClosed()) { - _trade.OrderMoveToHistory(_order); + _order PTR_DEREF ProcessConditions(); + if (_order PTR_DEREF IsClosed()) { + _trade PTR_DEREF OrderMoveToHistory(_order); continue; } - ENUM_ORDER_TYPE _otype = _order.Get(ORDER_TYPE); - Strategy *_strat = strats.GetByKey(_order.Get(ORDER_MAGIC)).Ptr(); - Strategy *_strat_sl = _strat.GetStratSl(); - Strategy *_strat_tp = _strat.GetStratTp(); + ENUM_ORDER_TYPE _otype = _order PTR_DEREF Get(ORDER_TYPE); + Strategy *_strat = strats.GetByKey(_order PTR_DEREF Get(ORDER_MAGIC)).Ptr(); + Strategy *_strat_sl = _strat PTR_DEREF GetStratSl(); + Strategy *_strat_tp = _strat PTR_DEREF GetStratTp(); if (_strat_sl != NULL || _strat_tp != NULL) { - float _olots = _order.Get(ORDER_VOLUME_CURRENT); - float _trisk = _trade.Get(TRADE_PARAM_RISK_MARGIN); + float _olots = _order PTR_DEREF Get(ORDER_VOLUME_CURRENT); + float _trisk = _trade PTR_DEREF Get(TRADE_PARAM_RISK_MARGIN); if (_strat_sl != NULL) { - float _psl = _strat_sl.Get(STRAT_PARAM_PSL); - float _sl_max = _trade.GetMaxSLTP(_otype, _olots, ORDER_TYPE_SL, _trisk); - int _psm = _strat_sl.Get(STRAT_PARAM_PSM); - _sl_new = _strat_sl.PriceStop(_otype, ORDER_TYPE_SL, _psm, _psl); - _sl_new = _trade.GetSaferSLTP(_sl_new, _sl_max, _otype, ORDER_TYPE_SL); - _sl_new = _trade.NormalizeSL(_sl_new, _otype); - _sl_valid = _trade.IsValidOrderSL(_sl_new, _otype, _order.Get(ORDER_SL), _psm > 0); - _sl_new = _sl_valid ? _sl_new : _order.Get(ORDER_SL); + float _psl = _strat_sl PTR_DEREF Get(STRAT_PARAM_PSL); + float _sl_max = _trade PTR_DEREF GetMaxSLTP(_otype, _olots, ORDER_TYPE_SL, _trisk); + int _psm = _strat_sl PTR_DEREF Get(STRAT_PARAM_PSM); + _sl_new = _strat_sl PTR_DEREF PriceStop(_otype, ORDER_TYPE_SL, _psm, _psl); + _sl_new = _trade PTR_DEREF GetSaferSLTP(_sl_new, _sl_max, _otype, ORDER_TYPE_SL); + _sl_new = _trade PTR_DEREF NormalizeSL(_sl_new, _otype); + _sl_valid = + _trade PTR_DEREF IsValidOrderSL(_sl_new, _otype, _order PTR_DEREF Get(ORDER_SL), _psm > 0); + _sl_new = _sl_valid ? _sl_new : _order PTR_DEREF Get(ORDER_SL); } if (_strat_tp != NULL) { - float _ppl = _strat_tp.Get(STRAT_PARAM_PPL); - float _tp_max = _trade.GetMaxSLTP(_otype, _olots, ORDER_TYPE_TP, _trisk); - int _ppm = _strat_tp.Get(STRAT_PARAM_PPM); - _tp_new = _strat_tp.PriceStop(_otype, ORDER_TYPE_TP, _ppm, _ppl); - _tp_new = _trade.GetSaferSLTP(_tp_new, _tp_max, _otype, ORDER_TYPE_TP); - _tp_new = _trade.NormalizeTP(_tp_new, _otype); - _tp_valid = _trade.IsValidOrderTP(_tp_new, _otype, _order.Get(ORDER_TP), _ppm > 0); - _tp_new = _tp_valid ? _tp_new : _order.Get(ORDER_TP); + float _ppl = _strat_tp PTR_DEREF Get(STRAT_PARAM_PPL); + float _tp_max = _trade PTR_DEREF GetMaxSLTP(_otype, _olots, ORDER_TYPE_TP, _trisk); + int _ppm = _strat_tp PTR_DEREF Get(STRAT_PARAM_PPM); + _tp_new = _strat_tp PTR_DEREF PriceStop(_otype, ORDER_TYPE_TP, _ppm, _ppl); + _tp_new = _trade PTR_DEREF GetSaferSLTP(_tp_new, _tp_max, _otype, ORDER_TYPE_TP); + _tp_new = _trade PTR_DEREF NormalizeTP(_tp_new, _otype); + _tp_valid = + _trade PTR_DEREF IsValidOrderTP(_tp_new, _otype, _order PTR_DEREF Get(ORDER_TP), _ppm > 0); + _tp_new = _tp_valid ? _tp_new : _order PTR_DEREF Get(ORDER_TP); } } if (_sl_valid || _tp_valid) { - _result &= _order.OrderModify(_sl_new, _tp_new); + _result &= _order PTR_DEREF OrderModify(_sl_new, _tp_new); if (_result) { - _order.Set(ORDER_PROP_TIME_LAST_UPDATE, TimeCurrent()); + _order PTR_DEREF Set(ORDER_PROP_TIME_LAST_UPDATE, TimeCurrent()); } } } @@ -819,12 +825,12 @@ class EA : public Taskable { * Update EA state flags. */ void UpdateStateFlags() { - estate.Set(STRUCT_ENUM(EAState, EA_STATE_FLAG_CONNECTED), GetTerminal().IsConnected()); - estate.Set(STRUCT_ENUM(EAState, EA_STATE_FLAG_LIBS_ALLOWED), GetTerminal().IsLibrariesAllowed()); - estate.Set(STRUCT_ENUM(EAState, EA_STATE_FLAG_OPTIMIZATION), GetTerminal().IsOptimization()); - estate.Set(STRUCT_ENUM(EAState, EA_STATE_FLAG_TESTING), GetTerminal().IsTesting()); - estate.Set(STRUCT_ENUM(EAState, EA_STATE_FLAG_TRADE_ALLOWED), GetTerminal().IsTradeAllowed()); - estate.Set(STRUCT_ENUM(EAState, EA_STATE_FLAG_VISUAL_MODE), GetTerminal().IsVisualMode()); + estate.Set(STRUCT_ENUM(EAState, EA_STATE_FLAG_CONNECTED), GetTerminal() PTR_DEREF IsConnected()); + estate.Set(STRUCT_ENUM(EAState, EA_STATE_FLAG_LIBS_ALLOWED), GetTerminal() PTR_DEREF IsLibrariesAllowed()); + estate.Set(STRUCT_ENUM(EAState, EA_STATE_FLAG_OPTIMIZATION), GetTerminal() PTR_DEREF IsOptimization()); + estate.Set(STRUCT_ENUM(EAState, EA_STATE_FLAG_TESTING), GetTerminal() PTR_DEREF IsTesting()); + estate.Set(STRUCT_ENUM(EAState, EA_STATE_FLAG_TRADE_ALLOWED), GetTerminal() PTR_DEREF IsTradeAllowed()); + estate.Set(STRUCT_ENUM(EAState, EA_STATE_FLAG_VISUAL_MODE), GetTerminal() PTR_DEREF IsVisualMode()); } /** @@ -851,8 +857,8 @@ class EA : public Taskable { if (eparams.CheckFlag(EA_PARAM_FLAG_LOTSIZE_AUTO)) { // Auto calculate lot size for all strategies. Trade *_trade = trade.GetByKey(_Symbol); - _result &= _trade.Run(TRADE_ACTION_CALC_LOT_SIZE); - Set(STRAT_PARAM_LS, _trade.Get(TRADE_PARAM_LOT_SIZE)); + _result &= _trade PTR_DEREF Run(TRADE_ACTION_CALC_LOT_SIZE); + Set(STRAT_PARAM_LS, _trade PTR_DEREF Get(TRADE_PARAM_LOT_SIZE)); } return _result; } @@ -889,7 +895,7 @@ class EA : public Taskable { case EA_COND_IS_ENABLED: return estate.IsEnabled(); case EA_COND_IS_NOT_CONNECTED: - estate.Set(STRUCT_ENUM(EAState, EA_STATE_FLAG_CONNECTED), GetTerminal().IsConnected()); + estate.Set(STRUCT_ENUM(EAState, EA_STATE_FLAG_CONNECTED), GetTerminal() PTR_DEREF IsConnected()); return !estate.IsConnected(); case EA_COND_ON_NEW_MINUTE: // On new minute. return (estate.Get(STRUCT_ENUM(EAState, EA_STATE_PROP_NEW_PERIODS)) & DATETIME_MINUTE) != 0; @@ -908,7 +914,7 @@ class EA : public Taskable { case EA_COND_ON_QUIT: return estate.IsOnQuit(); default: - GetLogger().Error(StringFormat("Invalid EA condition: %d!", _entry.GetId(), __FUNCTION_LINE__)); + GetLogger() PTR_DEREF Error(StringFormat("Invalid EA condition: %d!", _entry.GetId(), __FUNCTION_LINE__)); SetUserError(ERR_INVALID_PARAMETER); break; } @@ -948,10 +954,10 @@ class EA : public Taskable { // 2nd (i:1) - Strategy's argument to pass. TaskActionEntry _entry_strat = _entry; _entry_strat.ArgRemove(0); - for (DictStructIterator> iter_strat = strats.Begin(); iter_strat.IsValid(); ++iter_strat) { + for (DictStructIterator> iter_strat = strats.Begin(); iter_strat.IsValid(); ++iter_strat) { Strategy *_strat = iter_strat.Value().Ptr(); - _result &= _strat.Run(_entry_strat); + _result &= _strat PTR_DEREF Run(_entry_strat); } return _result; } @@ -961,7 +967,7 @@ class EA : public Taskable { SetUserError(ERR_INVALID_PARAMETER); return false; default: - GetLogger().Error(StringFormat("Invalid EA action: %d!", _entry.GetId(), __FUNCTION_LINE__)); + GetLogger() PTR_DEREF Error(StringFormat("Invalid EA action: %d!", _entry.GetId(), __FUNCTION_LINE__)); SetUserError(ERR_INVALID_PARAMETER); } return _result; @@ -991,9 +997,9 @@ class EA : public Taskable { */ template Strategy *GetStrategyViaProp(ENUM_STRATEGY_PARAM _prop, T _value, ENUM_MATH_CONDITION _op = MATH_COND_EQ) { - for (DictStructIterator> iter = strats.Begin(); iter.IsValid(); ++iter) { + for (DictStructIterator> iter = strats.Begin(); iter.IsValid(); ++iter) { Strategy *_strat = iter.Value().Ptr(); - if (Math::Compare(_strat.Get(_prop), _value, _op)) { + if (Math::Compare(_strat PTR_DEREF Get(_prop), _value, _op)) { return _strat; } } @@ -1010,9 +1016,10 @@ class EA : public Taskable { template Strategy *GetStrategyViaProp2(ENUM_STRATEGY_PARAM _prop1, T1 _value1, ENUM_STRATEGY_PARAM _prop2, T2 _value2, ENUM_MATH_CONDITION _op = MATH_COND_EQ) { - for (DictStructIterator> iter = strats.Begin(); iter.IsValid(); ++iter) { + for (DictStructIterator> iter = strats.Begin(); iter.IsValid(); ++iter) { Strategy *_strat = iter.Value().Ptr(); - if (Math::Compare(_strat.Get(_prop1), _value1, _op) && Math::Compare(_strat.Get(_prop2), _value2, _op)) { + if (Math::Compare(_strat PTR_DEREF Get(_prop1), _value1, _op) && + Math::Compare(_strat PTR_DEREF Get(_prop2), _value2, _op)) { return _strat; } } @@ -1032,7 +1039,7 @@ class EA : public Taskable { /** * Gets DictStruct reference to strategies. */ - DictStruct> *GetStrategies() { return GetPointer(strats); } + DictStruct> *GetStrategies() { return GetPointer(strats); } /** * Gets EA state. @@ -1054,7 +1061,7 @@ class EA : public Taskable { /** * Gets reference to strategies. */ - DictStruct> *Strategies() { return &strats; } + DictStruct> *Strategies() { return &strats; } /* Setters */ @@ -1104,9 +1111,9 @@ class EA : public Taskable { virtual void OnStrategyAdd(Strategy *_strat) { // Sets margin risk. float _margin_risk = eparams.Get(STRUCT_ENUM(EAParams, EA_PARAM_PROP_RISK_MARGIN_MAX)); - _strat.Set(TRADE_PARAM_RISK_MARGIN, _margin_risk); + _strat PTR_DEREF Set(TRADE_PARAM_RISK_MARGIN, _margin_risk); // Link a logger instance. - logger.Link(_strat.GetLogger()); + logger.Link(_strat PTR_DEREF GetLogger()); // Load existing strategy trades. StrategyLoadTrades(_strat); } @@ -1131,13 +1138,13 @@ class EA : public Taskable { SerializerNodeType Serialize(Serializer &_s) { _s.Pass(THIS_REF, "account", account, SERIALIZER_FIELD_FLAG_DYNAMIC); - for (DictStructIterator> _iter = GetStrategies().Begin(); _iter.IsValid(); ++_iter) { + for (DictStructIterator> _iter = GetStrategies() PTR_DEREF Begin(); _iter.IsValid(); ++_iter) { Strategy *_strat = _iter.Value().Ptr(); // @fixme: GH-422 - // _s.PassWriteOnly(this, "strat:" + _strat.GetName(), _strat); - string _sname = _strat.GetName(); // + "@" + Chart::TfToString(_strat.GetTf()); // @todo - string _sparams = _strat.GetParams().ToString(); - string _sresults = _strat.GetProcessResult().ToString(); + // _s.PassWriteOnly(this, "strat:" + _strat PTR_DEREF GetName(), _strat); + string _sname = _strat PTR_DEREF GetName(); // + "@" + Chart::TfToString(_strat PTR_DEREF GetTf()); // @todo + string _sparams = _strat PTR_DEREF GetParams().ToString(); + string _sresults = _strat PTR_DEREF GetProcessResult().ToString(); _s.Pass(THIS_REF, "strat:params:" + _sname, _sparams); _s.Pass(THIS_REF, "strat:results:" + _sname, _sresults); } diff --git a/EA.struct.h b/EA.struct.h index 48e260ecb..26f4ea3ff 100644 --- a/EA.struct.h +++ b/EA.struct.h @@ -31,6 +31,7 @@ #endif // Includes. +#include "Log.mqh" #include "Storage/DateTime.h" #include "Task/Task.struct.h" @@ -81,7 +82,7 @@ struct EAParams { }; // Struct special methods. - EAParams(string _name = __FILE__, ENUM_LOG_LEVEL _ll = V_INFO, unsigned long _magic = 0) + EAParams(string _name = __FILE__, ENUM_LOG_LEVEL _ll = V_INFO, uint64 _magic = 0) : author("unknown"), data_store(EA_DATA_STORE_NONE), flags(EA_PARAM_FLAG_NONE), diff --git a/Exchange/Account/AccountMt.h b/Exchange/Account/AccountMt.h index 4d18afaec..1d0baf860 100644 --- a/Exchange/Account/AccountMt.h +++ b/Exchange/Account/AccountMt.h @@ -220,14 +220,14 @@ class AccountMt { /** * Returns the current account number. */ - static long AccountNumber() { return AccountInfoInteger(ACCOUNT_LOGIN); } - long GetLogin() { return AccountNumber(); } + static int64 AccountNumber() { return AccountInfoInteger(ACCOUNT_LOGIN); } + int64 GetLogin() { return AccountNumber(); } /** * Returns leverage of the current account. */ - static long AccountLeverage() { return AccountInfoInteger(ACCOUNT_LEVERAGE); } - long GetLeverage() { return AccountLeverage(); } + static int64 AccountLeverage() { return AccountInfoInteger(ACCOUNT_LEVERAGE); } + int64 GetLeverage() { return AccountLeverage(); } /** * Returns the calculation mode for the Stop Out level. @@ -250,9 +250,9 @@ class AccountMt { * @return * Returns the limit orders (0 for unlimited). */ - static long AccountLimitOrders() { return AccountInfoInteger(ACCOUNT_LIMIT_ORDERS); } - long GetLimitOrders(unsigned int _max = 999) { - long _limit = AccountLimitOrders(); + static int64 AccountLimitOrders() { return AccountInfoInteger(ACCOUNT_LIMIT_ORDERS); } + int64 GetLimitOrders(unsigned int _max = 999) { + int64 _limit = AccountLimitOrders(); return _limit > 0 ? _limit : _max; } @@ -595,13 +595,13 @@ class AccountMt { ARRAY(DataParamEntry, _args); return AccountMt::CheckCondition(_cond, _args); } - bool CheckCondition(ENUM_ACCOUNT_CONDITION _cond, long _arg1) { + bool CheckCondition(ENUM_ACCOUNT_CONDITION _cond, int64 _arg1) { ARRAY(DataParamEntry, _args); DataParamEntry _param1 = _arg1; ArrayPushObject(_args, _param1); return AccountMt::CheckCondition(_cond, _args); } - bool CheckCondition(ENUM_ACCOUNT_CONDITION _cond, long _arg1, long _arg2) { + bool CheckCondition(ENUM_ACCOUNT_CONDITION _cond, int64 _arg1, int64 _arg2) { ARRAY(DataParamEntry, _args); DataParamEntry _param1 = _arg1; DataParamEntry _param2 = _arg2; @@ -666,7 +666,7 @@ class AccountMt { * @docs * - https://www.mql5.com/en/docs/account/accountinfointeger */ - static long AccountInfoInteger(ENUM_ACCOUNT_INFO_INTEGER _prop_id) { return ::AccountInfoInteger(_prop_id); } + static int64 AccountInfoInteger(ENUM_ACCOUNT_INFO_INTEGER _prop_id) { return ::AccountInfoInteger(_prop_id); } /** * Returns the string value of the appropriate account property. diff --git a/Exchange/Exchange.struct.h b/Exchange/Exchange.struct.h index cf73a8e0d..dcaf60dd4 100644 --- a/Exchange/Exchange.struct.h +++ b/Exchange/Exchange.struct.h @@ -38,5 +38,5 @@ struct ExchangeParams { // Constructors. ExchangeParams() {} ExchangeParams(const ExchangeParams &_eparams) {} - long id; + int64 id; }; diff --git a/Exchange/SymbolInfo/SymbolInfo.extern.h b/Exchange/SymbolInfo/SymbolInfo.extern.h index 8446ebe7d..5e1e381bd 100644 --- a/Exchange/SymbolInfo/SymbolInfo.extern.h +++ b/Exchange/SymbolInfo/SymbolInfo.extern.h @@ -32,7 +32,7 @@ // Define external global functions. #ifndef __MQL__ -extern long SymbolInfoInteger(string name, ENUM_SYMBOL_INFO_INTEGER prop_id); +extern int64 SymbolInfoInteger(string name, ENUM_SYMBOL_INFO_INTEGER prop_id); extern bool SymbolInfoMarginRate(string name, ENUM_ORDER_TYPE order_type, double &initial_margin_rate, double &maintenance_margin_rate); extern bool SymbolInfoTick(string symbol, MqlTick &tick); diff --git a/Exchange/SymbolInfo/SymbolInfo.h b/Exchange/SymbolInfo/SymbolInfo.h index 1b8c889df..2b3d5bc36 100644 --- a/Exchange/SymbolInfo/SymbolInfo.h +++ b/Exchange/SymbolInfo/SymbolInfo.h @@ -175,12 +175,12 @@ class SymbolInfo : public Object { * * @see: https://www.mql5.com/en/docs/constants/environment_state/marketinfoconstants */ - unsigned long GetVolume() { return SymbolInfoStatic::GetTick(symbol).volume; } + uint64 GetVolume() { return SymbolInfoStatic::GetTick(symbol).volume; } /** * Gets the last volume for the current price (without updating). */ - unsigned long GetLastVolume() { return last_tick.volume; } + uint64 GetLastVolume() { return last_tick.volume; } /** * Get summary volume of current session deals. @@ -358,7 +358,7 @@ class SymbolInfo : public Object { * * @see: https://book.mql4.com/appendix/limits */ - long GetTradeStopsLevel() { return SymbolInfoStatic::SymbolInfoInteger(symbol, SYMBOL_TRADE_STOPS_LEVEL); } + int64 GetTradeStopsLevel() { return SymbolInfoStatic::SymbolInfoInteger(symbol, SYMBOL_TRADE_STOPS_LEVEL); } /** * Get a contract lot size in the base currency. diff --git a/Exchange/SymbolInfo/SymbolInfo.struct.h b/Exchange/SymbolInfo/SymbolInfo.struct.h index 866fcd088..0bca2825e 100644 --- a/Exchange/SymbolInfo/SymbolInfo.struct.h +++ b/Exchange/SymbolInfo/SymbolInfo.struct.h @@ -34,8 +34,8 @@ #include "../../Serializer/Serializable.h" #include "../../Serializer/Serializer.h" #include "../../Std.h" -#include "SymbolInfo.struct.static.h" #include "../../Tick/Tick.struct.h" +#include "SymbolInfo.struct.static.h" // Defines struct to store symbol data. struct SymbolInfoEntry @@ -43,11 +43,11 @@ struct SymbolInfoEntry : public Serializable #endif { - double bid; // Current Bid price. - double ask; // Current Ask price. - double last; // Price of the last deal. - double spread; // Current spread. - unsigned long volume; // Volume for the current last price. + double bid; // Current Bid price. + double ask; // Current Ask price. + double last; // Price of the last deal. + double spread; // Current spread. + uint64 volume; // Volume for the current last price. // Constructors. SymbolInfoEntry() : bid(0), ask(0), last(0), spread(0), volume(0) {} SymbolInfoEntry(const MqlTick& _tick, const string _symbol = "") { diff --git a/Exchange/SymbolInfo/SymbolInfo.struct.static.h b/Exchange/SymbolInfo/SymbolInfo.struct.static.h index 84cc1f4cb..592062ffd 100644 --- a/Exchange/SymbolInfo/SymbolInfo.struct.static.h +++ b/Exchange/SymbolInfo/SymbolInfo.struct.static.h @@ -72,7 +72,7 @@ struct SymbolInfoStatic { * * @see: https://www.mql5.com/en/docs/constants/environment_state/marketinfoconstants */ - static unsigned long GetVolume(string _symbol) { return GetTick(_symbol).volume; } + static uint64 GetVolume(string _symbol) { return GetTick(_symbol).volume; } /** * Get summary volume of current session deals. @@ -298,7 +298,7 @@ struct SymbolInfoStatic { * * @see: https://book.mql4.com/appendix/limits */ - static long GetTradeStopsLevel(string _symbol) { + static int64 GetTradeStopsLevel(string _symbol) { return SymbolInfoStatic::SymbolInfoInteger(_symbol, SYMBOL_TRADE_STOPS_LEVEL); } @@ -481,7 +481,7 @@ struct SymbolInfoStatic { * @param ENUM_SYMBOL_INFO_INTEGER prop_id * Identifier of a property. * - * @return long + * @return int64 * Returns the value of the property. * In case of error, information can be obtained using GetLastError() function. * @@ -490,7 +490,7 @@ struct SymbolInfoStatic { * - https://www.mql5.com/en/docs/marketinformation/symbolinfointeger * */ - static long SymbolInfoInteger(string name, ENUM_SYMBOL_INFO_INTEGER prop_id) { + static int64 SymbolInfoInteger(string name, ENUM_SYMBOL_INFO_INTEGER prop_id) { return ::SymbolInfoInteger(name, prop_id); } diff --git a/Indicator/Indicator.h b/Indicator/Indicator.h index b01f0c31a..d3d22c4ab 100644 --- a/Indicator/Indicator.h +++ b/Indicator/Indicator.h @@ -477,10 +477,10 @@ class Indicator : public IndicatorData { */ virtual bool ExecuteAction(ENUM_INDICATOR_ACTION _action, ARRAY_REF(DataParamEntry, _args)) { bool _result = true; - long _arg1 = ArraySize(_args) > 0 ? DataParamEntry::ToInteger(_args[0]) : WRONG_VALUE; + int64 _arg1 = ArraySize(_args) > 0 ? DataParamEntry::ToInteger(_args[0]) : WRONG_VALUE; switch (_action) { case INDI_ACTION_CLEAR_CACHE: - _arg1 = _arg1 != 0 ? _arg1 : (long)TimeCurrent(); + _arg1 = _arg1 != 0 ? _arg1 : (int64)TimeCurrent(); Print("Action not yet implemented!"); DebugBreak(); // idata.Clear(_arg1); @@ -496,7 +496,7 @@ class Indicator : public IndicatorData { ARRAY(DataParamEntry, _args); return ExecuteAction(_action, _args); } - bool ExecuteAction(ENUM_INDICATOR_ACTION _action, long _arg1) { + bool ExecuteAction(ENUM_INDICATOR_ACTION _action, int64 _arg1) { ARRAY(DataParamEntry, _args); DataParamEntry _param1 = _arg1; ArrayPushObject(_args, _param1); @@ -555,13 +555,13 @@ class Indicator : public IndicatorData { } else { if (_entry.CheckFlags(INDI_ENTRY_FLAG_IS_UNSIGNED)) { if (_entry.CheckFlags(INDI_ENTRY_FLAG_IS_DOUBLED)) { - _result &= !_entry.HasValue(ULONG_MAX); + _result &= !_entry.HasValue(ULONG_MAX); } else { _result &= !_entry.HasValue(UINT_MAX); } } else { if (_entry.CheckFlags(INDI_ENTRY_FLAG_IS_DOUBLED)) { - _result &= !_entry.HasValue(LONG_MAX); + _result &= !_entry.HasValue(LONG_MAX); } else { _result &= !_entry.HasValue(INT_MAX); } @@ -585,7 +585,7 @@ class Indicator : public IndicatorData { */ IndicatorDataEntry GetEntry(int _rel_shift = 0) override { ResetLastError(); - long _bar_time = GetBarTime(_rel_shift); + int64 _bar_time = GetBarTime(_rel_shift); if (Get(STRUCT_ENUM(IndicatorDataParams, IDATA_PARAM_IDSTYPE)) == IDATA_BUILTIN && (GetPossibleDataModes() & IDATA_BUILTIN) == 0) { @@ -620,13 +620,13 @@ class Indicator : public IndicatorData { _entry.values[_mode] = GetValue(_mode, _rel_shift); break; case TYPE_LONG: - _entry.values[_mode] = GetValue(_mode, _rel_shift); + _entry.values[_mode] = GetValue(_mode, _rel_shift); break; case TYPE_UINT: _entry.values[_mode] = GetValue(_mode, _rel_shift); break; case TYPE_ULONG: - _entry.values[_mode] = GetValue(_mode, _rel_shift); + _entry.values[_mode] = GetValue(_mode, _rel_shift); break; case TYPE_DOUBLE: _entry.values[_mode] = GetValue(_mode, _rel_shift); diff --git a/Indicator/IndicatorBase.h b/Indicator/IndicatorBase.h index 8bc2f86f2..93988e235 100644 --- a/Indicator/IndicatorBase.h +++ b/Indicator/IndicatorBase.h @@ -261,14 +261,14 @@ class IndicatorBase : public Object { * * If local history is empty (not loaded), function returns 0. */ - virtual long GetSpread(int _shift = 0) = 0; + virtual int64 GetSpread(int _shift = 0) = 0; /** * Returns volume value for the bar. * * If local history is empty (not loaded), function returns 0. */ - virtual long GetVolume(int _shift = 0) = 0; + virtual int64 GetVolume(int _shift = 0) = 0; /** * Returns indicator value for a given shift and mode. @@ -281,7 +281,7 @@ class IndicatorBase : public Object { /* virtual bool HasValidEntry(int _index = 0) { unsigned int position; - long bar_time = GetBarTime(_index); + int64 bar_time = GetBarTime(_index); return bar_time > 0 && idata.KeyExists(bar_time, position) ? idata.GetByPos(position).IsValid() : false; } */ diff --git a/Indicator/IndicatorCandle.h b/Indicator/IndicatorCandle.h index 3f53afd4c..4e8121c02 100644 --- a/Indicator/IndicatorCandle.h +++ b/Indicator/IndicatorCandle.h @@ -224,7 +224,7 @@ class IndicatorCandle : public Indicator { * * If local history is empty (not loaded), function returns 0. */ - long GetVolume(int _shift = 0) override { + int64 GetVolume(int _shift = 0) override { CandleOCTOHLC _candle; if (history.TryGetItemByShift(_shift, _candle)) { @@ -239,14 +239,14 @@ class IndicatorCandle : public Indicator { * * If local history is empty (not loaded), function returns 0. */ - long GetSpread(int _shift = 0) override { return 0; } + int64 GetSpread(int _shift = 0) override { return 0; } /** * Returns tick volume value for the bar. * * If local history is empty (not loaded), function returns 0. */ - long GetTickVolume(int _shift = 0) override { return GetVolume(); } + int64 GetTickVolume(int _shift = 0) override { return GetVolume(); } /** * Returns the indicator's data entry. @@ -283,7 +283,7 @@ class IndicatorCandle : public Indicator { case INDI_CANDLE_MODE_SPREAD: case INDI_CANDLE_MODE_TICK_VOLUME: case INDI_CANDLE_MODE_VOLUME: - THIS_ATTR value_storages[_mode] = new IndicatorBufferValueStorage(THIS_PTR, _mode); + THIS_ATTR value_storages[_mode] = new IndicatorBufferValueStorage(THIS_PTR, _mode); break; case INDI_CANDLE_MODE_TIME: THIS_ATTR value_storages[_mode] = new IndicatorBufferValueStorage(THIS_PTR, _mode); @@ -309,7 +309,7 @@ class IndicatorCandle : public Indicator { /** * Converts candle into indicator's data entry. */ - IndicatorDataEntry CandleToEntry(long _timestamp, CandleOCTOHLC& _candle) { + IndicatorDataEntry CandleToEntry(int64 _timestamp, CandleOCTOHLC& _candle) { IndicatorDataEntry _entry(FINAL_INDI_CANDLE_MODE_ENTRY); _entry.timestamp = _timestamp; _entry.values[INDI_CANDLE_MODE_PRICE_OPEN] = _candle.open; diff --git a/Indicator/IndicatorCandle.provider.h b/Indicator/IndicatorCandle.provider.h index 17d46c3f5..d3f44b761 100644 --- a/Indicator/IndicatorCandle.provider.h +++ b/Indicator/IndicatorCandle.provider.h @@ -43,7 +43,7 @@ class ItemsHistoryCandleProvider : public ItemsHistoryItemProvider, ItemsHistoryItemProvider>>* _history, long _time_ms, + void OnTick(ItemsHistory, ItemsHistoryItemProvider>>* _history, int64 _time_ms, float _ask, float _bid) { // Should be overrided. } @@ -52,7 +52,7 @@ class ItemsHistoryCandleProvider : public ItemsHistoryItemProvider, ItemsHistoryCandleProvider>* _history, long _from_time_ms, + void GetItems(ItemsHistory, ItemsHistoryCandleProvider>* _history, int64 _from_time_ms, ENUM_ITEMS_HISTORY_DIRECTION _dir, int _num_items, ARRAY_REF(CandleOCTOHLC, _out_arr)) { // Method is called if there is a missing item (candle) in the history. We need to regenerate it. Print("Error: Retrieving items by this item provider is not implemented!"); diff --git a/Indicator/IndicatorData.enum.h b/Indicator/IndicatorData.enum.h index 2a29107e1..941f22bd6 100644 --- a/Indicator/IndicatorData.enum.h +++ b/Indicator/IndicatorData.enum.h @@ -34,11 +34,11 @@ enum INDICATOR_DATA_ENTRY_FLAGS { INDI_ENTRY_FLAG_NONE = 0 << 0, INDI_ENTRY_FLAG_IS_BITWISE = 1 << 0, - INDI_ENTRY_FLAG_IS_DOUBLED = 1 << 1, // Type is doubled in size (e.g. double or long). + INDI_ENTRY_FLAG_IS_DOUBLED = 1 << 1, // Type is doubled in size (e.g. double or int64). INDI_ENTRY_FLAG_IS_EXPIRED = 1 << 2, INDI_ENTRY_FLAG_IS_REAL = 1 << 3, // Type is real (float or double). INDI_ENTRY_FLAG_IS_PRICE = 1 << 4, - INDI_ENTRY_FLAG_IS_UNSIGNED = 1 << 5, // Type is unsigned (unsigned int or unsigned long). + INDI_ENTRY_FLAG_IS_UNSIGNED = 1 << 5, // Type is unsigned (unsigned int or uint64). INDI_ENTRY_FLAG_IS_VALID = 1 << 6, INDI_ENTRY_FLAG_INSUFFICIENT_DATA = 1 << 7, // Entry has missing value for that shift and probably won't ever have. }; diff --git a/Indicator/IndicatorData.h b/Indicator/IndicatorData.h index 7445a8d2f..5289778ee 100644 --- a/Indicator/IndicatorData.h +++ b/Indicator/IndicatorData.h @@ -57,11 +57,11 @@ class IndicatorData : public IndicatorBase { // Class variables. bool do_draw; bool indicator_builtin; - bool is_fed; // Whether calc_start_bar is already calculated. - int calc_start_bar; // Index of the first valid bar (from 0). - int flags; // Flags such as INDI_FLAG_INDEXABLE_BY_SHIFT. - int last_tick_index; // Index of the last tick. - long first_tick_time_ms; // Time of the first ask/bid tick. + bool is_fed; // Whether calc_start_bar is already calculated. + int calc_start_bar; // Index of the first valid bar (from 0). + int flags; // Flags such as INDI_FLAG_INDEXABLE_BY_SHIFT. + int last_tick_index; // Index of the last tick. + int64 first_tick_time_ms; // Time of the first ask/bid tick. void* mydata; bool last_tick_result; // Result of the last Tick() invocation. ENUM_INDI_DATA_VS_TYPE retarget_ap_av; // Value storage type to be used as applied price/volume. @@ -212,7 +212,7 @@ class IndicatorData : public IndicatorBase { * Returns time of the first ask/bid tick (time of first global OnTick()). * Time is compatible with time generated by IndicatorTick, e.g., Indi_TickMt. */ - long GetFirstTickTimeMs() { return first_tick_time_ms; } + int64 GetFirstTickTimeMs() { return first_tick_time_ms; } /** * Get full name of the indicator (with "over ..." part). @@ -260,7 +260,7 @@ class IndicatorData : public IndicatorBase { _price = (float)GetPrice(_ap, _shift); } else if (_idvrange == IDATA_RANGE_PRICE) { // When indicator values are the actual prices. - T _values[4]; + FIXED_ARRAY(T, _values, 4); if (!CopyValues(_values, 4, _shift, _mode)) { // When values aren't valid, return 0. return _price; @@ -1314,7 +1314,7 @@ class IndicatorData : public IndicatorBase { * * If local history is empty (not loaded), function returns 0. */ - long GetSpread(int _shift = 0) override { return GetCandle() PTR_DEREF GetSpread(_shift); } + int64 GetSpread(int _shift = 0) override { return GetCandle() PTR_DEREF GetSpread(_shift); } /** * Returns spread in pips. @@ -1452,7 +1452,7 @@ class IndicatorData : public IndicatorBase { * * If local history is empty (not loaded), function returns 0. */ - virtual long GetTickVolume(int _shift = 0) { return GetCandle() PTR_DEREF GetTickVolume(_shift); } + virtual int64 GetTickVolume(int _shift = 0) { return GetCandle() PTR_DEREF GetTickVolume(_shift); } /** * Removes candle from the buffer. Used mainly for testing purposes. @@ -1462,12 +1462,12 @@ class IndicatorData : public IndicatorBase { /** * Fetches historic ticks for a given time range. */ - bool FetchHistoryByTimeRange(long _from_ms, long _to_ms, ARRAY_REF(TickTAB, _out_ticks)) { return false; } + bool FetchHistoryByTimeRange(int64 _from_ms, int64 _to_ms, ARRAY_REF(TickTAB, _out_ticks)) { return false; } /** * Fetches historic ticks for a given start time and minimum number of tick to retrieve. */ - bool FetchHistoryByStartTimeAndCount(long _from_ms, ENUM_ITEMS_HISTORY_DIRECTION _dir, int _min_count, + bool FetchHistoryByStartTimeAndCount(int64 _from_ms, ENUM_ITEMS_HISTORY_DIRECTION _dir, int _min_count, ARRAY_REF(TickTAB, _out_ticks)) { // Print("FetchHistoryByStartTimeAndCount:"); // Print("- Requested _from_ms = ", _from_ms, ", _dir = ", EnumToString(_dir), ", _min_count = ", _min_count); @@ -1481,7 +1481,7 @@ class IndicatorData : public IndicatorBase { static ARRAY(TickTAB, _recv_ticks); // Time-frames for which we'll be receiving ticks. - long _recv_range_ms = 1000 * 60 * 30; // 30 min time-frames. + int64 _recv_range_ms = 1000 * 60 * 30; // 30 min time-frames. // Calculating initial time frame. if (_dir == ITEMS_HISTORY_DIRECTION_BACKWARD) { @@ -1489,7 +1489,7 @@ class IndicatorData : public IndicatorBase { _from_ms -= _recv_range_ms - 1; } // _to_ms will be at the last ms of _from_ms's timeframe. - long _to_ms = _from_ms + _recv_range_ms - 1; + int64 _to_ms = _from_ms + _recv_range_ms - 1; // Print("- Initial _from_ms = ", _from_ms, "_to_ms = ", _to_ms); @@ -1773,7 +1773,7 @@ class IndicatorData : public IndicatorBase { * * If local history is empty (not loaded), function returns 0. */ - long GetVolume(int _shift = 0) override { return GetCandle() PTR_DEREF GetVolume(_shift); } + int64 GetVolume(int _shift = 0) override { return GetCandle() PTR_DEREF GetVolume(_shift); } /** * Sends entry to listening indicators. diff --git a/Indicator/IndicatorData.struct.h b/Indicator/IndicatorData.struct.h index ab660f3f9..1c35698a6 100644 --- a/Indicator/IndicatorData.struct.h +++ b/Indicator/IndicatorData.struct.h @@ -44,7 +44,7 @@ union IndicatorDataEntryTypelessValue { double vdbl; float vflt; int vint; - long vlong; + int64 vlong; }; // Type-aware value for IndicatorDataEntry class. @@ -129,7 +129,7 @@ struct IndicatorDataEntryValue { double GetDbl() { return value.vdbl; } float GetFloat() { return value.vflt; } int GetInt() { return value.vint; } - long GetLong() { return value.vlong; } + int64 GetLong() { return value.vlong; } template void Get(T &_out) { _out = Get(); @@ -145,8 +145,8 @@ struct IndicatorDataEntryValue { void Get(float &_out) { _out = value.vflt; } void Get(int &_out) { _out = value.vint; } void Get(unsigned int &_out) { _out = (unsigned int)value.vint; } - void Get(long &_out) { _out = value.vlong; } - void Get(unsigned long &_out) { _out = (unsigned long)value.vint; } + void Get(int64 &_out) { _out = value.vlong; } + void Get(uint64 &_out) { _out = (uint64)value.vint; } // Setters. template void Set(T _value) { @@ -168,12 +168,12 @@ struct IndicatorDataEntryValue { value.vint = (int)_value; SetDataType(TYPE_UINT); } - void Set(long _value) { + void Set(int64 _value) { value.vlong = _value; SetDataType(TYPE_LONG); } - void Set(unsigned long _value) { - value.vlong = (long)_value; + void Set(uint64 _value) { + value.vlong = (int64)_value; SetDataType(TYPE_ULONG); } // Serializers. @@ -188,7 +188,7 @@ struct IndicatorDataEntryValue { /* Structure for indicator data entry. */ struct IndicatorDataEntry { - long timestamp; // Timestamp of the entry's bar. + int64 timestamp; // Timestamp of the entry's bar. unsigned short flags; // Indicator entry flags. ARRAY(IndicatorDataEntryValue, values); @@ -331,7 +331,7 @@ struct IndicatorDataEntry { int GetDayOfYear() { return DateTimeStatic::DayOfYear(timestamp); } int GetMonth() { return DateTimeStatic::Month(timestamp); } int GetYear() { return DateTimeStatic::Year(timestamp); } - long GetTime() { return timestamp; }; + int64 GetTime() { return timestamp; }; ENUM_DATATYPE GetDataType(int _mode) { return values[_mode].GetDataType(); } unsigned short GetDataTypeFlags(ENUM_DATATYPE _dt) { switch (_dt) { diff --git a/Indicator/IndicatorRenko.h b/Indicator/IndicatorRenko.h index 47d1125b7..8c8d04382 100644 --- a/Indicator/IndicatorRenko.h +++ b/Indicator/IndicatorRenko.h @@ -76,9 +76,9 @@ class IndicatorRenko : public IndicatorCandle { /** * Called when new tick was emitted from IndicatorTick-based source. */ - virtual void OnTick(ItemsHistory, ItemsHistoryRenkoCandleProvider>* _history, long _time_ms, + virtual void OnTick(ItemsHistory, ItemsHistoryRenkoCandleProvider>* _history, int64 _time_ms, float _ask, float _bid) { ++tick_index; @@ -68,7 +68,7 @@ class ItemsHistoryRenkoCandleProvider : public ItemsHistoryCandleProvider { * Retrieves given number of items starting from the given microseconds or index (inclusive). "_dir" identifies if we * want previous or next items from selected starting point. */ - void GetItems(ItemsHistory, ItemsHistoryRenkoCandleProvider>* _history, long _from_time_ms, + void GetItems(ItemsHistory, ItemsHistoryRenkoCandleProvider>* _history, int64 _from_time_ms, ENUM_ITEMS_HISTORY_DIRECTION _dir, int _num_items, ARRAY_REF(CandleOCTOHLC, _out_arr)) { // Method is called if there is a missing item (candle) in the history. We need to regenerate it. diff --git a/Indicator/IndicatorTf.provider.h b/Indicator/IndicatorTf.provider.h index 09006e6fc..86903d22c 100644 --- a/Indicator/IndicatorTf.provider.h +++ b/Indicator/IndicatorTf.provider.h @@ -49,7 +49,7 @@ class ItemsHistoryTfCandleProvider : public ItemsHistoryCandleProvider { /** * Called when new tick was emitted from IndicatorTick-based source. */ - void OnTick(ItemsHistory, ItemsHistoryTfCandleProvider>* _history, long _time_ms, float _ask, + void OnTick(ItemsHistory, ItemsHistoryTfCandleProvider>* _history, int64 _time_ms, float _ask, float _bid) { ++tick_index; @@ -106,15 +106,15 @@ class ItemsHistoryTfCandleProvider : public ItemsHistoryCandleProvider { /** * Returns start time of the candle (the place it's on the chart) for the given tick's time in milliseconds. */ - int GetCandleTimeFromTimeMs(long _time_ms, int _length_in_secs) { - return (int)((_time_ms - _time_ms % ((long)_length_in_secs * 1000)) / 1000); + int GetCandleTimeFromTimeMs(int64 _time_ms, int _length_in_secs) { + return (int)((_time_ms - _time_ms % ((int64)_length_in_secs * 1000)) / 1000); } /** * Retrieves given number of items starting from the given microseconds or index (inclusive). "_dir" identifies if we * want previous or next items from selected starting point. */ - void GetItems(ItemsHistory, ItemsHistoryTfCandleProvider>* _history, long _from_time_ms, + void GetItems(ItemsHistory, ItemsHistoryTfCandleProvider>* _history, int64 _from_time_ms, ENUM_ITEMS_HISTORY_DIRECTION _dir, int _num_items, ARRAY_REF(CandleOCTOHLC, _out_arr)) { // Method is called if there is a missing item (candle) in the history. We need to regenerate it. if (_from_time_ms != 0) { @@ -131,9 +131,9 @@ class ItemsHistoryTfCandleProvider : public ItemsHistoryCandleProvider { while (_num_items > 0) { // Calculating time from which and to which we want to retrieve ticks to form a candle. int _ticks_from_s = GetCandleTimeFromTimeMs(_from_time_ms, spc); - long _ticks_from_ms = (long)_ticks_from_s * 1000; - long _candle_length_ms = (long)spc * 1000; - long _ticks_to_ms = _ticks_from_ms + _candle_length_ms - 1; + int64 _ticks_from_ms = (int64)_ticks_from_s * 1000; + int64 _candle_length_ms = (int64)spc * 1000; + int64 _ticks_to_ms = _ticks_from_ms + _candle_length_ms - 1; if (!_indi_tick PTR_DEREF FetchHistoryByTimeRange(_ticks_from_ms, _ticks_to_ms, _ticks)) { // There is no more ticks in the history, giving up. diff --git a/Indicator/IndicatorTick.h b/Indicator/IndicatorTick.h index 017dfd4ac..ca4d2cd9b 100644 --- a/Indicator/IndicatorTick.h +++ b/Indicator/IndicatorTick.h @@ -252,7 +252,7 @@ class IndicatorTick : public Indicator { * Converts TickAB into IndicatorDataEntry. */ template -IndicatorDataEntry TickToEntry(long _timestamp, TickAB& _tick) { +IndicatorDataEntry TickToEntry(int64 _timestamp, TickAB& _tick) { IndicatorDataEntry _entry(2); _entry.timestamp = _timestamp; _entry.values[INDI_TICK_MODE_PRICE_ASK] = _tick.ask; diff --git a/Indicator/IndicatorTick.provider.h b/Indicator/IndicatorTick.provider.h index cb11c45eb..7e113a3c3 100644 --- a/Indicator/IndicatorTick.provider.h +++ b/Indicator/IndicatorTick.provider.h @@ -50,7 +50,7 @@ class ItemsHistoryTickProvider : public ItemsHistoryItemProvider> { /** * Called when new tick was emitted from IndicatorTick-based source. */ - virtual void OnTick(ItemsHistory, ItemsHistoryTickProvider>* _history, long _time_ms, float _ask, + virtual void OnTick(ItemsHistory, ItemsHistoryTickProvider>* _history, int64 _time_ms, float _ask, float _bid) { TickTAB _tick(_time_ms, _ask, _bid); _history PTR_DEREF Append(_tick); @@ -60,7 +60,7 @@ class ItemsHistoryTickProvider : public ItemsHistoryItemProvider> { * Retrieves given number of items starting from the given microseconds or index (inclusive). "_dir" identifies if we * want previous or next items from selected starting point. */ - void GetItems(ItemsHistory, ItemsHistoryTickProvider>* _history, long _from_time_ms, + void GetItems(ItemsHistory, ItemsHistoryTickProvider>* _history, int64 _from_time_ms, ENUM_ITEMS_HISTORY_DIRECTION _dir, int _num_items, ARRAY_REF(TickTAB, _out_arr)) { // Method is called if there is a missing item (tick) in the history. We need to regenerate it. indi PTR_DEREF FetchHistoryByStartTimeAndCount(_from_time_ms, _dir, _num_items, _out_arr); diff --git a/Indicator/tests/IndicatorTf.test.mq5 b/Indicator/tests/IndicatorTf.test.mq5 index 58f48f951..2c5bdce85 100644 --- a/Indicator/tests/IndicatorTf.test.mq5 +++ b/Indicator/tests/IndicatorTf.test.mq5 @@ -27,12 +27,12 @@ */ // Includes. +#include "../../Exchange/SymbolInfo/SymbolInfo.h" #include "../../Indicators/Indi_AMA.mqh" #include "../../Indicators/Tick/Indi_TickMt.h" #include "../../Log.mqh" #include "../../Platform/Platform.h" #include "../../Storage/Dict/DictBase.h" -#include "../../Exchange/SymbolInfo/SymbolInfo.h" #include "../../Test.mqh" #include "../../Util.h" #include "../IndicatorTf.h" @@ -119,7 +119,7 @@ void OnTick() { string c = DoubleToStr(iClose(_Symbol, PERIOD_CURRENT, 0), 5); string time = TimeToString(iTime(_Symbol, PERIOD_CURRENT, 0), TIME_DATE | TIME_MINUTES | TIME_SECONDS); - Util::Print("Tick: " + IntegerToString((long)iTime(indi_tf_real.Ptr().GetSymbol(), indi_tf_real.Ptr().GetTf(), 0)) + + Util::Print("Tick: " + IntegerToString((int64)iTime(indi_tf_real.Ptr().GetSymbol(), indi_tf_real.Ptr().GetTf(), 0)) + " (" + time + "), real = " + o + ", " + h + ", " + l + ", " + c); string c_o = DoubleToStr(indi_tf_real.Ptr().GetOpen(0), 5); diff --git a/Indicator/tests/IndicatorTick.test.mq5 b/Indicator/tests/IndicatorTick.test.mq5 index 5a59968f3..dddd25b2b 100644 --- a/Indicator/tests/IndicatorTick.test.mq5 +++ b/Indicator/tests/IndicatorTick.test.mq5 @@ -39,7 +39,7 @@ int OnInit() { Ref _indi_tick = new IndicatorTickDummy(_Symbol); Platform::Add(_indi_tick.Ptr()); - long _time = 1; + int64 _time = 1; for (double _price = 0.1; _price <= 2.0; _price += 0.1) { TickTAB _tick(_time++ * 1000, _price, _price); diff --git a/Indicators/Indi_CHO.mqh b/Indicators/Indi_CHO.mqh index 35d6ec999..044b572bc 100644 --- a/Indicators/Indi_CHO.mqh +++ b/Indicators/Indi_CHO.mqh @@ -189,7 +189,7 @@ class Indi_CHO : public Indicator { return (rates_total); } - static double AD(double high, double low, double close, long volume) { + static double AD(double high, double low, double close, int64 volume) { double res = 0.0; double sum = (close - low) - (high - close); if (sum != 0.0) { diff --git a/Indicators/Indi_PriceVolumeTrend.mqh b/Indicators/Indi_PriceVolumeTrend.mqh index 536afd406..989322c9e 100644 --- a/Indicators/Indi_PriceVolumeTrend.mqh +++ b/Indicators/Indi_PriceVolumeTrend.mqh @@ -138,7 +138,7 @@ class Indi_PriceVolumeTrend : public Indicator { } static void CalculatePVT(const int pos, const int rates_total, ValueStorage &close, - ValueStorage &volume, ValueStorage &ExtPVTBuffer) { + ValueStorage &volume, ValueStorage &ExtPVTBuffer) { for (int i = pos; i < rates_total && !IsStopped(); i++) { double prev_close = close[i - 1].Get(); // Calculate PVT value. diff --git a/Indicators/Indi_StdDev.mqh b/Indicators/Indi_StdDev.mqh index f588ed39e..89113cb40 100644 --- a/Indicators/Indi_StdDev.mqh +++ b/Indicators/Indi_StdDev.mqh @@ -215,7 +215,7 @@ class Indi_StdDev : public Indicator { _indi_ma.SetDataSource(_indi_price_feeder, 0); // Using first and only mode from price feeder. double _result = iStdDevOnIndicator(_indi_ma, NULL, NULL, period, 0, PRICE_OPEN, 0); // Last parameter is unused. - // We don't want to store reference to indicator too long. + // We don't want to store reference to indicator too int64. _indi_ma.SetDataSource(NULL, 0); return _result; diff --git a/Indicators/Indi_VROC.mqh b/Indicators/Indi_VROC.mqh index 9dcb9cd0f..5da0890ab 100644 --- a/Indicators/Indi_VROC.mqh +++ b/Indicators/Indi_VROC.mqh @@ -144,7 +144,7 @@ class Indi_VROC : public Indicator { return (rates_total); } - static void CalculateVROC(const int pos, const int rates_total, ValueStorage &volume, + static void CalculateVROC(const int pos, const int rates_total, ValueStorage &volume, ValueStorage &ExtVROCBuffer, int ExtPeriodVROC) { for (int i = pos; i < rates_total && !IsStopped(); i++) { double prev_volume = (double)(volume[i - (ExtPeriodVROC - 1)].Get()); diff --git a/Indicators/Indi_Volumes.mqh b/Indicators/Indi_Volumes.mqh index 2552bbe8e..2456a469e 100644 --- a/Indicators/Indi_Volumes.mqh +++ b/Indicators/Indi_Volumes.mqh @@ -143,7 +143,7 @@ class Indi_Volumes : public Indicator { return (rates_total); } - static void CalculateVolume(const int pos, const int rates_total, ValueStorage &volume, + static void CalculateVolume(const int pos, const int rates_total, ValueStorage &volume, ValueStorage &ExtVolumesBuffer, ValueStorage &ExtColorsBuffer) { ExtVolumesBuffer[0] = (double)volume[0].Get(); ExtColorsBuffer[0] = 0.0; diff --git a/Indicators/Oscillator/Indi_RSI.h b/Indicators/Oscillator/Indi_RSI.h index 4248ffcf5..2836603ae 100644 --- a/Indicators/Oscillator/Indi_RSI.h +++ b/Indicators/Oscillator/Indi_RSI.h @@ -75,7 +75,7 @@ struct RSIGainLossData { * Implements the Relative Strength Index indicator. */ class Indi_RSI : public Indicator { - DictStruct aux_data; + DictStruct aux_data; public: /** @@ -174,8 +174,8 @@ class Indi_RSI : public Indicator { ENUM_APPLIED_PRICE _ap = PRICE_CLOSE, int _shift = 0) { INDI_REQUIRE_BARS_OR_RETURN_EMPTY(_target, _period + _shift + 1); // +1 because of _bar_time_prev. - long _bar_time_curr = _source PTR_DEREF GetBarTime(_shift); - long _bar_time_prev = _source PTR_DEREF GetBarTime(_shift + 1); + int64 _bar_time_curr = _source PTR_DEREF GetBarTime(_shift); + int64 _bar_time_prev = _source PTR_DEREF GetBarTime(_shift + 1); if (fmin(_bar_time_curr, _bar_time_prev) < 0) { // Return empty value on invalid bar time. return EMPTY_VALUE; diff --git a/Indicators/PriceRange/Indi_Pivot.h b/Indicators/PriceRange/Indi_Pivot.h index 286c3a5f6..39b35f259 100644 --- a/Indicators/PriceRange/Indi_Pivot.h +++ b/Indicators/PriceRange/Indi_Pivot.h @@ -105,7 +105,7 @@ class Indi_Pivot : public Indicator { * Returns IndicatorDataEntry struct filled with indicator values. */ virtual IndicatorDataEntry GetEntry(int _rel_shift = 0) { - long _bar_time = GetCandle() PTR_DEREF GetBarTime(_rel_shift); + int64 _bar_time = GetCandle() PTR_DEREF GetBarTime(_rel_shift); IndicatorDataEntry _entry = idata.GetByKey(_bar_time); if (_bar_time > 0 && !_entry.IsValid() && !_entry.CheckFlag(INDI_ENTRY_FLAG_INSUFFICIENT_DATA)) { ResetLastError(); diff --git a/Indicators/Tick/Indi_TickMt.h b/Indicators/Tick/Indi_TickMt.h index a9ec01337..449888b2a 100644 --- a/Indicators/Tick/Indi_TickMt.h +++ b/Indicators/Tick/Indi_TickMt.h @@ -88,7 +88,7 @@ class Indi_TickMt : public IndicatorTick= 0 ? (int)_index : iparams.GetShift(); - long _bar_time; + int64 _bar_time; _bar_time = GetBarTime(_ishift); TickAB _tick = itdata.GetByKey(_bar_time); @@ -118,7 +118,7 @@ class Indi_TickMt : public IndicatorTick, _out_ticks)) { + virtual bool FetchHistoryByTimeRange(int64 _from_ms, int64 _to_ms, ARRAY_REF(TickTAB, _out_ticks)) { ArrayResize(_out_ticks, 0); static ARRAY(MqlTick, _tmp_ticks); @@ -160,7 +160,7 @@ class Indi_TickMt : public IndicatorTick _tick(_ask, _bid); IndicatorDataEntry _entry(TickToEntry(_time, _tick)); diff --git a/Indicators/Tick/Indi_TickProvider.h b/Indicators/Tick/Indi_TickProvider.h index 2fb91090c..c592eb39b 100644 --- a/Indicators/Tick/Indi_TickProvider.h +++ b/Indicators/Tick/Indi_TickProvider.h @@ -98,7 +98,7 @@ class Indi_TickProvider : public IndicatorTick, _out_ticks)) { + bool FetchHistoryByTimeRange(int64 _from_ms, int64 _to_ms, ARRAY_REF(TickTAB, _out_ticks)) { #ifdef __debug_indicator__ Print("Indi_TickProvider::FetchHistoryByTimeRange(from_ms = ", _from_ms, ", to_ms = ", _to_ms, ")"); #endif diff --git a/Indicators/Tick/Indi_TickRandom.h b/Indicators/Tick/Indi_TickRandom.h index 6e7b6097c..f90f9c012 100644 --- a/Indicators/Tick/Indi_TickRandom.h +++ b/Indicators/Tick/Indi_TickRandom.h @@ -85,7 +85,7 @@ class Indi_TickRandom : public IndicatorTick, _out_ticks)) { + bool FetchHistoryByTimeRange(int64 _from_ms, int64 _to_ms, ARRAY_REF(TickTAB, _out_ticks)) { // No history. return false; } diff --git a/Indicators/tests/DrawIndicator.test.mq5 b/Indicators/tests/DrawIndicator.test.mq5 index 8dbe43521..6ea4a4e3e 100644 --- a/Indicators/tests/DrawIndicator.test.mq5 +++ b/Indicators/tests/DrawIndicator.test.mq5 @@ -28,15 +28,15 @@ //#define __debug_verbose__ // Includes. +#include "../../Indicator/Indicator.struct.serialize.h" #include "../../Storage/Dict/DictStruct.h" +#include "../../Test.mqh" #include "../DrawIndicator.mqh" -#include "../../Indicator/Indicator.struct.serialize.h" -#include "../PriceRange/Indi_Bands.h" #include "../Indi_Demo.mqh" -#include "../Price/Indi_MA.h" #include "../Oscillator/Indi_RSI.h" +#include "../Price/Indi_MA.h" #include "../Price/Indi_Price.h" -#include "../../Test.mqh" +#include "../PriceRange/Indi_Bands.h" // Global variables. Ref candles; @@ -67,7 +67,7 @@ void OnTick() { if (candles REF_DEREF IsNewBar()) { bar_processed++; - for (DictIterator> iter = Platform::GetIndicators() PTR_DEREF Begin(); iter.IsValid(); + for (DictIterator> iter = Platform::GetIndicators() PTR_DEREF Begin(); iter.IsValid(); ++iter) { IndicatorData *_indi = iter.Value().Ptr(); _indi.OnTick(Platform::GetGlobalTickIndex()); @@ -149,7 +149,7 @@ bool InitIndicators() { */ // We'll be drawing all indicators' values on the chart. - for (DictIterator> iter = Platform::GetIndicators() PTR_DEREF Begin(); iter.IsValid(); + for (DictIterator> iter = Platform::GetIndicators() PTR_DEREF Begin(); iter.IsValid(); ++iter) { // iter.Value() REF_DEREF SetPlot(true); // @fixme } @@ -162,7 +162,7 @@ bool InitIndicators() { */ bool PrintIndicators(string _prefix = "") { ResetLastError(); - for (DictIterator> iter = Platform::GetIndicators() PTR_DEREF Begin(); iter.IsValid(); + for (DictIterator> iter = Platform::GetIndicators() PTR_DEREF Begin(); iter.IsValid(); ++iter) { IndicatorData *_indi = iter.Value().Ptr(); if (_indi.Get(STRUCT_ENUM(IndicatorDataState, INDICATOR_DATA_STATE_PROP_IS_READY))) { diff --git a/Log.mqh b/Log.mqh index 3f3f711d1..32679ae95 100644 --- a/Log.mqh +++ b/Log.mqh @@ -156,7 +156,7 @@ class Log : public Object { * Reports an last error. */ bool AddLastError(string prefix = "", string suffix = ""); - bool AddLastError(string prefix, long suffix); + bool AddLastError(string prefix, int64 suffix); /** * Reports an error. @@ -337,6 +337,6 @@ class Log : public Object { bool Log::AddLastError(string prefix, string suffix) { return Add(V_ERROR, Terminal::GetLastErrorText(), prefix, suffix); } -bool Log::AddLastError(string prefix, long suffix) { +bool Log::AddLastError(string prefix, int64 suffix) { return Add(V_ERROR, Terminal::GetLastErrorText(), prefix, StringFormat("%d", suffix)); } diff --git a/MD5.mqh b/MD5.mqh index 265f9f5f5..bb1644eb9 100644 --- a/MD5.mqh +++ b/MD5.mqh @@ -65,7 +65,7 @@ class MD5 { int index = len % 64; // mod 64 int count = (len - index) / 64; - long a = 0x67452301, b = 0xEFCDAB89, c = 0x98BADCFE, d = 0x10325476; + int64 a = 0x67452301, b = 0xEFCDAB89, c = 0x98BADCFE, d = 0x10325476; int buff[16], last[16], i, k = 0, last_char[4], last_index; string item; for (i = 0; i < count; i++) { @@ -101,35 +101,35 @@ class MD5 { return result; } - static long F(long x, long y, long z) { return ((x & y) | ((~x) & z)); } + static int64 F(int64 x, int64 y, int64 z) { return ((x & y) | ((~x) & z)); } - static long G(long x, long y, long z) { return ((x & z) | (y & (~z))); } + static int64 G(int64 x, int64 y, int64 z) { return ((x & z) | (y & (~z))); } - static long H(long x, long y, long z) { return ((x ^ y ^ z)); } + static int64 H(int64 x, int64 y, int64 z) { return ((x ^ y ^ z)); } - static long I(long x, long y, long z) { return ((y ^ (x | (~z)))); } + static int64 I(int64 x, int64 y, int64 z) { return ((y ^ (x | (~z)))); } - static long AddUnsigned(long a, long b) { - long c = a + b; + static int64 AddUnsigned(int64 a, int64 b) { + int64 c = a + b; return (c); } - static long FF(long a, long b, long c, long d, long x, int s, long ac) { + static int64 FF(int64 a, int64 b, int64 c, int64 d, int64 x, int s, int64 ac) { a = AddUnsigned(a, AddUnsigned(AddUnsigned(F(b, c, d), x), ac)); return (AddUnsigned(RotateLeft(a, s), b)); } - static long GG(long a, long b, long c, long d, long x, int s, long ac) { + static int64 GG(int64 a, int64 b, int64 c, int64 d, int64 x, int s, int64 ac) { a = AddUnsigned(a, AddUnsigned(AddUnsigned(G(b, c, d), x), ac)); return (AddUnsigned(RotateLeft(a, s), b)); } - static long HH(long a, long b, long c, long d, long x, int s, long ac) { + static int64 HH(int64 a, int64 b, int64 c, int64 d, int64 x, int s, int64 ac) { a = AddUnsigned(a, AddUnsigned(AddUnsigned(H(b, c, d), x), ac)); return (AddUnsigned(RotateLeft(a, s), b)); } - static long II(long a, long b, long c, long d, long x, int s, long ac) { + static int64 II(int64 a, int64 b, int64 c, int64 d, int64 x, int s, int64 ac) { a = AddUnsigned(a, AddUnsigned(AddUnsigned(I(b, c, d), x), ac)); return (AddUnsigned(RotateLeft(a, s), b)); } @@ -138,17 +138,17 @@ class MD5 { * Implementation of right shift operation for unsigned int. * See: http://www.cnblogs.com/niniwzw/archive/2009/12/04/1617130.html */ - static long RotateLeft(long lValue, int iShiftBits) { + static int64 RotateLeft(int64 lValue, int iShiftBits) { if (iShiftBits == 32) return (lValue); - long result = (lValue << iShiftBits) | (((lValue >> 1) & 0x7fffffff) >> (31 - iShiftBits)); + int64 result = (lValue << iShiftBits) | (((lValue >> 1) & 0x7fffffff) >> (31 - iShiftBits)); return (result); } /** * Assume: ArraySize(x) == 16. */ - static void MD5Transform(long &a, long &b, long &c, long &d, int &x[]) { - long AA, BB, CC, DD; + static void MD5Transform(int64 &a, int64 &b, int64 &c, int64 &d, int &x[]) { + int64 AA, BB, CC, DD; int S11 = 7, S12 = 12, S13 = 17, S14 = 22; int S21 = 5, S22 = 9, S23 = 14, S24 = 20; int S31 = 4, S32 = 11, S33 = 16, S34 = 23; diff --git a/Market.mqh b/Market.mqh index 47d7a516c..08a74f74a 100644 --- a/Market.mqh +++ b/Market.mqh @@ -25,11 +25,12 @@ #define MARKET_MQH // Includes. +#include "Exchange/SymbolInfo/SymbolInfo.h" +#include "Exchange/SymbolInfo/SymbolInfo.struct.static.h" #include "Market.struct.h" #include "Math/Math.h" +#include "Platform/Chart/Chart.define.h" #include "Serializer/Serializer.h" -#include "Exchange/SymbolInfo/SymbolInfo.h" -#include "Exchange/SymbolInfo/SymbolInfo.struct.static.h" #include "Task/TaskCondition.enum.h" /** diff --git a/Math/Math.define.h b/Math/Math.define.h index 27c2409a6..439becf80 100644 --- a/Math/Math.define.h +++ b/Math/Math.define.h @@ -77,11 +77,11 @@ #endif #ifndef LONG_MIN -#define LONG_MIN std::numeric_limits::min() +#define LONG_MIN std::numeric_limits::min() #endif #ifndef LONG_MAX -#define LONG_MAX std::numeric_limits::max() +#define LONG_MAX std::numeric_limits::max() #endif #ifndef ULONG_MAX diff --git a/Platform/Chart/Chart.h b/Platform/Chart/Chart.h index 50893cdc2..8fe18d3fa 100644 --- a/Platform/Chart/Chart.h +++ b/Platform/Chart/Chart.h @@ -66,21 +66,18 @@ ChartPriceOpen Open; int iBarShift(string _symbol, int _tf, datetime _time, bool _exact = false) { return ChartStatic::iBarShift(_symbol, (ENUM_TIMEFRAMES)_tf, _time, _exact); } -double iClose(string _symbol, int _tf, int _shift) { - return ChartStatic::iClose(_symbol, (ENUM_TIMEFRAMES)_tf, _shift); -} #endif #ifndef __MQL__ struct MqlRates { - datetime time; // Period start time - double open; // Open price - double high; // The highest price of the period - double low; // The lowest price of the period - double close; // Close price - long tick_volume; // Tick volume - int spread; // Spread - long real_volume; // Trade volume + datetime time; // Period start time + double open; // Open price + double high; // The highest price of the period + double low; // The lowest price of the period + double close; // Close price + int64 tick_volume; // Tick volume + int spread; // Spread + int64 real_volume; // Trade volume }; #endif @@ -99,7 +96,7 @@ class Chart : public Market { // Stores indicator instances. // @todo - // Dict indis; + // Dict indis; // Variables. datetime last_bar_time; diff --git a/Platform/Chart/Chart.struct.h b/Platform/Chart/Chart.struct.h index 0570bd4ca..6bd9477ce 100644 --- a/Platform/Chart/Chart.struct.h +++ b/Platform/Chart/Chart.struct.h @@ -35,15 +35,15 @@ class Class; struct ChartTf; // Includes. -#include "../../Storage/Array.h" #include "../../Bar.struct.h" +#include "../../Serializer/Serializer.h" +#include "../../Serializer/SerializerNode.enum.h" +#include "../../Storage/Array.h" +#include "../Terminal.define.h" #include "Chart.define.h" #include "Chart.enum.h" #include "Chart.struct.static.h" #include "Chart.struct.tf.h" -#include "../../Serializer/Serializer.h" -#include "../../Serializer/SerializerNode.enum.h" -#include "../Terminal.define.h" /* Defines struct to store bar entries. */ struct ChartEntry { @@ -64,15 +64,15 @@ struct ChartEntry { /* Defines struct for chart parameters. */ struct ChartParams { - long id; + int64 id; string symbol; ChartTf tf; // Copy constructor. ChartParams(ChartParams& _cparams) : symbol(_cparams.symbol), tf(_cparams.tf) {} // Constructors. - ChartParams(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, string _symbol = NULL, long _id = 0) + ChartParams(ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, string _symbol = NULL, int64 _id = 0) : id(_id), symbol(_symbol), tf(_tf){}; - ChartParams(ENUM_TIMEFRAMES_INDEX _tfi, string _symbol = NULL, long _id = 0) : id(_id), symbol(_symbol), tf(_tfi){}; + ChartParams(ENUM_TIMEFRAMES_INDEX _tfi, string _symbol = NULL, int64 _id = 0) : id(_id), symbol(_symbol), tf(_tfi){}; // Getters. template T Get(ENUM_CHART_PARAM _param) { @@ -97,7 +97,7 @@ struct ChartParams { void Set(ENUM_CHART_PARAM _param, T _value) { switch (_param) { case CHART_PARAM_ID: - id = (long)_value; + id = (int64)_value; return; case CHART_PARAM_SYMBOL: symbol = (string)_value; diff --git a/Platform/Chart/Chart.struct.static.h b/Platform/Chart/Chart.struct.static.h index 7c5269129..fae59fb87 100644 --- a/Platform/Chart/Chart.struct.static.h +++ b/Platform/Chart/Chart.struct.static.h @@ -31,10 +31,10 @@ #endif // Includes. -#include "Chart.define.h" -#include "Chart.symboltf.h" #include "../Platform.extern.h" #include "../Terminal.define.h" +#include "Chart.define.h" +#include "Chart.symboltf.h" /* Defines struct for chart static methods. */ struct ChartStatic { @@ -304,10 +304,10 @@ struct ChartStatic { * * If local history is empty (not loaded), function returns 0. */ - static long iVolume(string _symbol = NULL, ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) { + static int64 iVolume(string _symbol = NULL, ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int _shift = 0) { #ifdef __MQL4__ ResetLastError(); - long _volume = ::iVolume(_symbol, _tf, _shift); // Same as: Volume[_shift] + int64 _volume = ::iVolume(_symbol, _tf, _shift); // Same as: Volume[_shift] if (_LastError != ERR_NO_ERROR) { _volume = EMPTY_VALUE; ResetLastError(); @@ -354,5 +354,5 @@ struct ChartStatic { /** * Gets Chart ID. */ - static long ID() { return ::ChartID(); } + static int64 ID() { return ::ChartID(); } }; diff --git a/Platform/Chart/ChartBase.h b/Platform/Chart/ChartBase.h index ab7160bef..cf3b939c7 100644 --- a/Platform/Chart/ChartBase.h +++ b/Platform/Chart/ChartBase.h @@ -38,9 +38,9 @@ #include "Chart.struct.h" #include "Chart.symboltf.h" #include "Data.define.h" -#include "Storage/Dict/Dict.h" #include "Log.mqh" #include "Refs.mqh" +#include "Storage/Dict/Dict.h" #include "Task/TaskCondition.enum.h" /** @@ -193,7 +193,7 @@ class ChartBase : public Dynamic { * * If local history is empty (not loaded), function returns 0. */ - virtual long GetVolume(int _shift = 0) = 0; + virtual int64 GetVolume(int _shift = 0) = 0; /** * Returns the shift of the maximum value over a specific number of periods depending on type. @@ -386,10 +386,10 @@ class ChartBase : public Dynamic { int nBarsInNearPr = 0; ENUM_TIMEFRAMES TimeNearPr = PERIOD_M1; double ModellingQuality = 0; - long StartGen = 0; - long StartBar = 0; - long StartGenM1 = 0; - long HistoryTotal = 0; + int64 StartGen = 0; + int64 StartBar = 0; + int64 StartGenM1 = 0; + int64 HistoryTotal = 0; datetime x = StrToTime("1971.01.01 00:00"); datetime modeling_start_time = StrToTime("1971.01.01 00:00"); @@ -697,7 +697,7 @@ class ChartBase : public Dynamic { /** * Return size of BarOHLC array. */ - unsigned long SizeChartEntry() { return ArraySize(chart_saves); } + uint64 SizeChartEntry() { return ArraySize(chart_saves); } /* Serializers */ diff --git a/Platform/Chart/ChartMt.h b/Platform/Chart/ChartMt.h index da5b895b1..6dc74488e 100644 --- a/Platform/Chart/ChartMt.h +++ b/Platform/Chart/ChartMt.h @@ -31,9 +31,9 @@ #endif // Includes. +#include "../Terminal.define.h" #include "Chart.struct.static.h" #include "Chart.symboltf.h" -#include "../Terminal.define.h" #ifdef __DISABLED @@ -214,7 +214,7 @@ class ChartMt : public ChartBase { * * If local history is empty (not loaded), function returns 0. */ - virtual long GetVolume(int _shift = 0) override { return ::iVolume(GetSymbol(), GetTf(), _shift); } + virtual int64 GetVolume(int _shift = 0) override { return ::iVolume(GetSymbol(), GetTf(), _shift); } }; #endif diff --git a/Platform/Chart3D/Interface.h b/Platform/Chart3D/Interface.h index c833094f3..b86f80ed4 100644 --- a/Platform/Chart3D/Interface.h +++ b/Platform/Chart3D/Interface.h @@ -58,7 +58,7 @@ struct InterfaceEvent { * * Invoked when the ChartEvent event occurs. */ -void OnChartEvent(const int id, const long& lparam, const double& dparam, const string& sparam) { +void OnChartEvent(const int id, const int64& lparam, const double& dparam, const string& sparam) { datetime _dt; double _mp; int _window = 0; diff --git a/Platform/Chart3D/Math.h b/Platform/Chart3D/Math.h index 78c283976..25cd12e1d 100644 --- a/Platform/Chart3D/Math.h +++ b/Platform/Chart3D/Math.h @@ -216,10 +216,10 @@ struct DXQuaternion { //| DViewport | //+------------------------------------------------------------------+ struct DViewport { - unsigned long x; - unsigned long y; - unsigned long width; - unsigned long height; + uint64 x; + uint64 y; + uint64 width; + uint64 height; float minz; float maxz; }; diff --git a/Platform/Chart3D/Mesh.h b/Platform/Chart3D/Mesh.h index cf8a200d0..0597b3484 100644 --- a/Platform/Chart3D/Mesh.h +++ b/Platform/Chart3D/Mesh.h @@ -48,7 +48,7 @@ class Device; template struct PointEntry { T point; - long key; + int64 key; // Default constructor. PointEntry() {} @@ -66,9 +66,9 @@ struct PointEntry { return key == MakeKey(_r.point.Position.x, _r.point.Position.y, _r.point.Position.z); } - static long MakeKey(float x, float y, float z) { - return long(x / GFX_MESH_LOOKUP_PRECISION) + 4194304 * long(y / GFX_MESH_LOOKUP_PRECISION) + - 17592186044416 * long(z / GFX_MESH_LOOKUP_PRECISION); + static int64 MakeKey(float x, float y, float z) { + return int64(x / GFX_MESH_LOOKUP_PRECISION) + 4194304 * int64(y / GFX_MESH_LOOKUP_PRECISION) + + 17592186044416 * int64(z / GFX_MESH_LOOKUP_PRECISION); } }; diff --git a/Platform/MQL5.mqh b/Platform/MQL5.mqh index 1138325b6..d848b43ae 100644 --- a/Platform/MQL5.mqh +++ b/Platform/MQL5.mqh @@ -38,273 +38,284 @@ // @see: https://www.mql5.com/en/docs/constants/errorswarnings #ifdef __MQL4__ // Return codes of the trade server. -#define TRADE_RETCODE_REQUOTE 10004 // Requote -#define TRADE_RETCODE_REJECT 10006 // Request rejected -#define TRADE_RETCODE_CANCEL 10007 // Request canceled by trader -#define TRADE_RETCODE_PLACED 10008 // Order placed -#define TRADE_RETCODE_DONE 10009 // Request completed -#define TRADE_RETCODE_DONE_PARTIAL 10010 // Only part of the request was completed -#define TRADE_RETCODE_ERROR 10011 // Request processing error -#define TRADE_RETCODE_TIMEOUT 10012 // Request canceled by timeout -#define TRADE_RETCODE_INVALID 10013 // Invalid request -#define TRADE_RETCODE_INVALID_VOLUME 10014 // Invalid volume in the request -#define TRADE_RETCODE_INVALID_PRICE 10015 // Invalid price in the request -#define TRADE_RETCODE_INVALID_STOPS 10016 // Invalid stops in the request -#define TRADE_RETCODE_TRADE_DISABLED 10017 // Trade is disabled -#define TRADE_RETCODE_MARKET_CLOSED 10018 // Market is closed -#define TRADE_RETCODE_NO_MONEY 10019 // There is not enough money to complete the request -#define TRADE_RETCODE_PRICE_CHANGED 10020 // Prices changed -#define TRADE_RETCODE_PRICE_OFF 10021 // There are no quotes to process the request -#define TRADE_RETCODE_INVALID_EXPIRATION 10022 // Invalid order expiration date in the request -#define TRADE_RETCODE_ORDER_CHANGED 10023 // Order state changed -#define TRADE_RETCODE_TOO_MANY_REQUESTS 10024 // Too frequent requests -#define TRADE_RETCODE_NO_CHANGES 10025 // No changes in request -#define TRADE_RETCODE_SERVER_DISABLES_AT 10026 // Autotrading disabled by server -#define TRADE_RETCODE_CLIENT_DISABLES_AT 10027 // Autotrading disabled by client terminal -#define TRADE_RETCODE_LOCKED 10028 // Request locked for processing -#define TRADE_RETCODE_FROZEN 10029 // Order or position frozen -#define TRADE_RETCODE_INVALID_FILL 10030 // Invalid order filling type -#define TRADE_RETCODE_CONNECTION 10031 // No connection with the trade server -#define TRADE_RETCODE_ONLY_REAL 10032 // Operation is allowed only for live accounts -#define TRADE_RETCODE_LIMIT_ORDERS 10033 // The number of pending orders has reached the limit -#define TRADE_RETCODE_LIMIT_VOLUME 10034 // The volume of orders and positions for the symbol has reached the limit -#define TRADE_RETCODE_INVALID_ORDER 10035 // Incorrect or prohibited order type -#define TRADE_RETCODE_POSITION_CLOSED 10036 // Position with the specified POSITION_IDENTIFIER has already been closed -#define TRADE_RETCODE_INVALID_CLOSE_VOLUME 10038 // A close volume exceeds the current position volume -#define TRADE_RETCODE_CLOSE_ORDER_EXIST 10039 // A close order already exists. -#define TRADE_RETCODE_LIMIT_POSITIONS 10040 // The number of open positions can be limited (e.g. Netting, Hedging). +#define TRADE_RETCODE_REQUOTE 10004 // Requote +#define TRADE_RETCODE_REJECT 10006 // Request rejected +#define TRADE_RETCODE_CANCEL 10007 // Request canceled by trader +#define TRADE_RETCODE_PLACED 10008 // Order placed +#define TRADE_RETCODE_DONE 10009 // Request completed +#define TRADE_RETCODE_DONE_PARTIAL 10010 // Only part of the request was completed +#define TRADE_RETCODE_ERROR 10011 // Request processing error +#define TRADE_RETCODE_TIMEOUT 10012 // Request canceled by timeout +#define TRADE_RETCODE_INVALID 10013 // Invalid request +#define TRADE_RETCODE_INVALID_VOLUME 10014 // Invalid volume in the request +#define TRADE_RETCODE_INVALID_PRICE 10015 // Invalid price in the request +#define TRADE_RETCODE_INVALID_STOPS 10016 // Invalid stops in the request +#define TRADE_RETCODE_TRADE_DISABLED 10017 // Trade is disabled +#define TRADE_RETCODE_MARKET_CLOSED 10018 // Market is closed +#define TRADE_RETCODE_NO_MONEY 10019 // There is not enough money to complete the request +#define TRADE_RETCODE_PRICE_CHANGED 10020 // Prices changed +#define TRADE_RETCODE_PRICE_OFF 10021 // There are no quotes to process the request +#define TRADE_RETCODE_INVALID_EXPIRATION 10022 // Invalid order expiration date in the request +#define TRADE_RETCODE_ORDER_CHANGED 10023 // Order state changed +#define TRADE_RETCODE_TOO_MANY_REQUESTS 10024 // Too frequent requests +#define TRADE_RETCODE_NO_CHANGES 10025 // No changes in request +#define TRADE_RETCODE_SERVER_DISABLES_AT 10026 // Autotrading disabled by server +#define TRADE_RETCODE_CLIENT_DISABLES_AT 10027 // Autotrading disabled by client terminal +#define TRADE_RETCODE_LOCKED 10028 // Request locked for processing +#define TRADE_RETCODE_FROZEN 10029 // Order or position frozen +#define TRADE_RETCODE_INVALID_FILL 10030 // Invalid order filling type +#define TRADE_RETCODE_CONNECTION 10031 // No connection with the trade server +#define TRADE_RETCODE_ONLY_REAL 10032 // Operation is allowed only for live accounts +#define TRADE_RETCODE_LIMIT_ORDERS 10033 // The number of pending orders has reached the limit +#define TRADE_RETCODE_LIMIT_VOLUME 10034 // The volume of orders and positions for the symbol has reached the limit +#define TRADE_RETCODE_INVALID_ORDER 10035 // Incorrect or prohibited order type +#define TRADE_RETCODE_POSITION_CLOSED 10036 // Position with the specified POSITION_IDENTIFIER has already been closed +#define TRADE_RETCODE_INVALID_CLOSE_VOLUME 10038 // A close volume exceeds the current position volume +#define TRADE_RETCODE_CLOSE_ORDER_EXIST 10039 // A close order already exists. +#define TRADE_RETCODE_LIMIT_POSITIONS 10040 // The number of open positions can be limited (e.g. Netting, Hedging). #endif // Runtime Errors (@see: https://www.mql5.com/en/docs/constants/errorswarnings/errorcodes) // General error codes. #ifndef ERR_SUCCESS -#define ERR_SUCCESS 0 // The operation completed successfully. +#define ERR_SUCCESS 0 // The operation completed successfully. #endif -#define ERR_NO_MQLERROR 4000 +#define ERR_NO_MQLERROR 4000 #ifndef ERR_INTERNAL_ERROR -#define ERR_INTERNAL_ERROR 4001 // Operating system error. +#define ERR_INTERNAL_ERROR 4001 // Operating system error. #endif -#define ERR_WRONG_INTERNAL_PARAMETER 4002 // Wrong parameter in the inner call of the client terminal function. +#define ERR_WRONG_INTERNAL_PARAMETER 4002 // Wrong parameter in the inner call of the client terminal function. //#define ERR_INVALID_PARAMETER 4003 // Wrong parameter when calling the system function. -#define ERR_NOT_ENOUGH_MEMORY 4004 // Not enough memory to perform the system function. -#define ERR_STRUCT_WITHOBJECTS_ORCLASS 4005 // The structure contains objects of strings and/or dynamic arrays and/or structure of such objects and/or classes. -#define ERR_INVALID_ARRAY 4006 // Array of a wrong type, wrong size, or a damaged object of a dynamic array. -#define ERR_ARRAY_RESIZE_ERROR 4007 // Not enough memory for the relocation of an array, or an attempt to change the size of a static array. -#define ERR_STRING_RESIZE_ERROR 4008 // Not enough memory for the relocation of string. -#define ERR_NOTINITIALIZED_STRING 4009 // Not initialized string. -#define ERR_INVALID_DATETIME 4010 // Invalid date and/or time. -#define ERR_ARRAY_BAD_SIZE 4011 // Requested array size exceeds 2 GB. +#define ERR_NOT_ENOUGH_MEMORY 4004 // Not enough memory to perform the system function. +#define ERR_STRUCT_WITHOBJECTS_ORCLASS \ + 4005 // The structure contains objects of strings and/or dynamic arrays and/or structure of such objects and/or + // classes. +#define ERR_INVALID_ARRAY 4006 // Array of a wrong type, wrong size, or a damaged object of a dynamic array. +#define ERR_ARRAY_RESIZE_ERROR \ + 4007 // Not enough memory for the relocation of an array, or an attempt to change the size of a static array. +#define ERR_STRING_RESIZE_ERROR 4008 // Not enough memory for the relocation of string. +#define ERR_NOTINITIALIZED_STRING 4009 // Not initialized string. +#define ERR_INVALID_DATETIME 4010 // Invalid date and/or time. +#define ERR_ARRAY_BAD_SIZE 4011 // Requested array size exceeds 2 GB. #ifndef ERR_INVALID_POINTER -#define ERR_INVALID_POINTER 4012 // Wrong pointer. +#define ERR_INVALID_POINTER 4012 // Wrong pointer. #endif -#define ERR_INVALID_POINTER_TYPE 4013 // Wrong type of pointer. -#define ERR_FUNCTION_NOT_ALLOWED 4014 // Function is not allowed for call. -#define ERR_RESOURCE_NAME_DUPLICATED 4015 // The names of the dynamic and the static resource match. +#define ERR_INVALID_POINTER_TYPE 4013 // Wrong type of pointer. +#define ERR_FUNCTION_NOT_ALLOWED 4014 // Function is not allowed for call. +#define ERR_RESOURCE_NAME_DUPLICATED 4015 // The names of the dynamic and the static resource match. #ifndef ERR_RESOURCE_NOT_FOUND -#define ERR_RESOURCE_NOT_FOUND 4016 // Resource with this name has not been found in EX5. +#define ERR_RESOURCE_NOT_FOUND 4016 // Resource with this name has not been found in EX5. #endif -#define ERR_RESOURCE_UNSUPPOTED_TYPE 4017 // Unsupported resource type or its size exceeds 16 Mb. -#define ERR_RESOURCE_NAME_IS_TOO_LONG 4018 // The resource name exceeds 63 characters. +#define ERR_RESOURCE_UNSUPPOTED_TYPE 4017 // Unsupported resource type or its size exceeds 16 Mb. +#define ERR_RESOURCE_NAME_IS_TOO_LONG 4018 // The resource name exceeds 63 characters. // Charts. -#define ERR_CHART_WRONG_ID 4101 // Wrong chart ID. -#define ERR_CHART_NO_REPLY 4102 // Chart does not respond. +#define ERR_CHART_WRONG_ID 4101 // Wrong chart ID. +#define ERR_CHART_NO_REPLY 4102 // Chart does not respond. #ifndef ERR_CHART_NOT_FOUND -#define ERR_CHART_NOT_FOUND 4103 // Chart not found. +#define ERR_CHART_NOT_FOUND 4103 // Chart not found. #endif -#define ERR_CHART_NO_EXPERT 4104 // No Expert Advisor in the chart that could handle the event. -#define ERR_CHART_CANNOT_OPEN 4105 // Chart opening error. -#define ERR_CHART_CANNOT_CHANGE 4106 // Failed to change chart symbol and period. -#define ERR_CHART_WRONG_PARAMETER 4107 // Error value of the parameter for the function of working with charts. -#define ERR_CHART_CANNOT_CREATE_TIMER 4108 // Failed to create timer. -#define ERR_CHART_WRONG_PROPERTY 4109 // Wrong chart property ID. -#define ERR_CHART_SCREENSHOT_FAILED 4110 // Error creating screenshots. -#define ERR_CHART_NAVIGATE_FAILED 4111 // Error navigating through chart. -#define ERR_CHART_TEMPLATE_FAILED 4112 // Error applying template. -#define ERR_CHART_WINDOW_NOT_FOUND 4113 // Subwindow containing the indicator was not found. -#define ERR_CHART_INDICATOR_CANNOT_ADD 4114 // Error adding an indicator to chart. -#define ERR_CHART_INDICATOR_CANNOT_DEL 4115 // Error deleting an indicator from the chart. -#define ERR_CHART_INDICATOR_NOT_FOUND 4116 // Indicator not found on the specified chart. +#define ERR_CHART_NO_EXPERT 4104 // No Expert Advisor in the chart that could handle the event. +#define ERR_CHART_CANNOT_OPEN 4105 // Chart opening error. +#define ERR_CHART_CANNOT_CHANGE 4106 // Failed to change chart symbol and period. +#define ERR_CHART_WRONG_PARAMETER 4107 // Error value of the parameter for the function of working with charts. +#define ERR_CHART_CANNOT_CREATE_TIMER 4108 // Failed to create timer. +#define ERR_CHART_WRONG_PROPERTY 4109 // Wrong chart property ID. +#define ERR_CHART_SCREENSHOT_FAILED 4110 // Error creating screenshots. +#define ERR_CHART_NAVIGATE_FAILED 4111 // Error navigating through chart. +#define ERR_CHART_TEMPLATE_FAILED 4112 // Error applying template. +#define ERR_CHART_WINDOW_NOT_FOUND 4113 // Subwindow containing the indicator was not found. +#define ERR_CHART_INDICATOR_CANNOT_ADD 4114 // Error adding an indicator to chart. +#define ERR_CHART_INDICATOR_CANNOT_DEL 4115 // Error deleting an indicator from the chart. +#define ERR_CHART_INDICATOR_NOT_FOUND 4116 // Indicator not found on the specified chart. // Graphical Objects. -#define ERR_OBJECT_ERROR 4201 // Error working with a graphical object. -#define ERR_OBJECT_NOT_FOUND 4202 // Graphical object was not found. -#define ERR_OBJECT_WRONG_PROPERTY 4203 // Wrong ID of a graphical object property. -#define ERR_OBJECT_GETDATE_FAILED 4204 // Unable to get date corresponding to the value. -#define ERR_OBJECT_GETVALUE_FAILED 4205 // Unable to get value corresponding to the date. +#define ERR_OBJECT_ERROR 4201 // Error working with a graphical object. +#define ERR_OBJECT_NOT_FOUND 4202 // Graphical object was not found. +#define ERR_OBJECT_WRONG_PROPERTY 4203 // Wrong ID of a graphical object property. +#define ERR_OBJECT_GETDATE_FAILED 4204 // Unable to get date corresponding to the value. +#define ERR_OBJECT_GETVALUE_FAILED 4205 // Unable to get value corresponding to the date. // MarketInfo. -#define ERR_MARKET_UNKNOWN_SYMBOL 4301 // Unknown symbol. -#define ERR_MARKET_NOT_SELECTED 4302 // Symbol is not selected in MarketWatch. -#define ERR_MARKET_WRONG_PROPERTY 4303 // Wrong identifier of a symbol property. -#define ERR_MARKET_LASTTIME_UNKNOWN 4304 // Time of the last tick is not known (no ticks). -#define ERR_MARKET_SELECT_ERROR 4305 // Error adding or deleting a symbol in MarketWatch. +#define ERR_MARKET_UNKNOWN_SYMBOL 4301 // Unknown symbol. +#define ERR_MARKET_NOT_SELECTED 4302 // Symbol is not selected in MarketWatch. +#define ERR_MARKET_WRONG_PROPERTY 4303 // Wrong identifier of a symbol property. +#define ERR_MARKET_LASTTIME_UNKNOWN 4304 // Time of the last tick is not known (no ticks). +#define ERR_MARKET_SELECT_ERROR 4305 // Error adding or deleting a symbol in MarketWatch. // History Access. -#define ERR_HISTORY_NOT_FOUND 4401 // Requested history not found. -#define ERR_HISTORY_WRONG_PROPERTY 4402 // Wrong ID of the history property. -#define ERR_HISTORY_TIMEOUT 4403 // Exceeded history request timeout. -#define ERR_HISTORY_BARS_LIMIT 4404 // Number of requested bars limited by terminal settings. -#define ERR_HISTORY_LOAD_ERRORS 4405 // Multiple errors when loading history. -#define ERR_HISTORY_SMALL_BUFFER 4407 // Receiving array is too small to store all requested data. +#define ERR_HISTORY_NOT_FOUND 4401 // Requested history not found. +#define ERR_HISTORY_WRONG_PROPERTY 4402 // Wrong ID of the history property. +#define ERR_HISTORY_TIMEOUT 4403 // Exceeded history request timeout. +#define ERR_HISTORY_BARS_LIMIT 4404 // Number of requested bars limited by terminal settings. +#define ERR_HISTORY_LOAD_ERRORS 4405 // Multiple errors when loading history. +#define ERR_HISTORY_SMALL_BUFFER 4407 // Receiving array is too small to store all requested data. // Global_Variables. -#define ERR_GLOBALVARIABLE_NOT_FOUND 4501 // Global variable of the client terminal is not found. -#define ERR_GLOBALVARIABLE_EXISTS 4502 // Global variable of the client terminal with the same name already exists. -#define ERR_MAIL_SEND_FAILED 4510 // Email sending failed. -#define ERR_PLAY_SOUND_FAILED 4511 // Sound playing failed. -#define ERR_MQL5_WRONG_PROPERTY 4512 // Wrong identifier of the program property. -#define ERR_TERMINAL_WRONG_PROPERTY 4513 // Wrong identifier of the terminal property. -#define ERR_FTP_SEND_FAILED 4514 // File sending via ftp failed. -#define ERR_NOTIFICATION_SEND_FAILED 4515 // Failed to send a notification. -#define ERR_NOTIFICATION_WRONG_PARAMETER 4516 // Invalid parameter for sending a notification - an empty string or NULL has been passed to the SendNotification() function. -#define ERR_NOTIFICATION_WRONG_SETTINGS 4517 // Wrong settings of notifications in the terminal (ID is not specified or permission is not set). +#define ERR_GLOBALVARIABLE_NOT_FOUND 4501 // Global variable of the client terminal is not found. +#define ERR_GLOBALVARIABLE_EXISTS 4502 // Global variable of the client terminal with the same name already exists. +#define ERR_MAIL_SEND_FAILED 4510 // Email sending failed. +#define ERR_PLAY_SOUND_FAILED 4511 // Sound playing failed. +#define ERR_MQL5_WRONG_PROPERTY 4512 // Wrong identifier of the program property. +#define ERR_TERMINAL_WRONG_PROPERTY 4513 // Wrong identifier of the terminal property. +#define ERR_FTP_SEND_FAILED 4514 // File sending via ftp failed. +#define ERR_NOTIFICATION_SEND_FAILED 4515 // Failed to send a notification. +#define ERR_NOTIFICATION_WRONG_PARAMETER \ + 4516 // Invalid parameter for sending a notification - an empty string or NULL has been passed to the + // SendNotification() function. +#define ERR_NOTIFICATION_WRONG_SETTINGS \ + 4517 // Wrong settings of notifications in the terminal (ID is not specified or permission is not set). #ifndef ERR_NOTIFICATION_TOO_FREQUENT -#define ERR_NOTIFICATION_TOO_FREQUENT 4518 // Too frequent sending of notifications. +#define ERR_NOTIFICATION_TOO_FREQUENT 4518 // Too frequent sending of notifications. #endif #ifndef ERR_FTP_NOSERVER -#define ERR_FTP_NOSERVER 4519 // FTP server is not specified. +#define ERR_FTP_NOSERVER 4519 // FTP server is not specified. #endif #ifndef ERR_FTP_NOLOGIN -#define ERR_FTP_NOLOGIN 4520 // FTP login is not specified. +#define ERR_FTP_NOLOGIN 4520 // FTP login is not specified. #endif #ifndef ERR_FTP_FILE_ERROR -#define ERR_FTP_FILE_ERROR 4521 // File not found in the MQL5\Files directory to send on FTP server. +#define ERR_FTP_FILE_ERROR 4521 // File not found in the MQL5\Files directory to send on FTP server. #endif #ifndef ERR_FTP_CONNECT_FAILED -#define ERR_FTP_CONNECT_FAILED 4522 // FTP connection failed. +#define ERR_FTP_CONNECT_FAILED 4522 // FTP connection failed. #endif #ifndef ERR_FTP_CHANGEDIR -#define ERR_FTP_CHANGEDIR 4523 // FTP path not found on server. +#define ERR_FTP_CHANGEDIR 4523 // FTP path not found on server. #endif #ifndef ERR_FTP_CLOSED -#define ERR_FTP_CLOSED 4524 // FTP connection closed. +#define ERR_FTP_CLOSED 4524 // FTP connection closed. #endif // Custom Indicator Buffers. -#define ERR_BUFFERS_NO_MEMORY 4601 // Not enough memory for the distribution of indicator buffers. -#define ERR_BUFFERS_WRONG_INDEX 4602 // Wrong indicator buffer index. +#define ERR_BUFFERS_NO_MEMORY 4601 // Not enough memory for the distribution of indicator buffers. +#define ERR_BUFFERS_WRONG_INDEX 4602 // Wrong indicator buffer index. // Custom Indicator Properties. -#define ERR_CUSTOM_WRONG_PROPERTY 4603 // Wrong ID of the custom indicator property. +#define ERR_CUSTOM_WRONG_PROPERTY 4603 // Wrong ID of the custom indicator property. // Account. -#define ERR_ACCOUNT_WRONG_PROPERTY 4701 // Wrong account property ID. -#define ERR_TRADE_WRONG_PROPERTY 4751 // Wrong trade property ID. +#define ERR_ACCOUNT_WRONG_PROPERTY 4701 // Wrong account property ID. +#define ERR_TRADE_WRONG_PROPERTY 4751 // Wrong trade property ID. #ifndef ERR_TRADE_DISABLED -#define ERR_TRADE_DISABLED 4752 // Trading by Expert Advisors prohibited. +#define ERR_TRADE_DISABLED 4752 // Trading by Expert Advisors prohibited. #endif -#define ERR_TRADE_POSITION_NOT_FOUND 4753 // Position not found. -#define ERR_TRADE_ORDER_NOT_FOUND 4754 // Order not found. -#define ERR_TRADE_DEAL_NOT_FOUND 4755 // Deal not found. -#define ERR_TRADE_SEND_FAILED 4756 // Trade request sending failed. +#define ERR_TRADE_POSITION_NOT_FOUND 4753 // Position not found. +#define ERR_TRADE_ORDER_NOT_FOUND 4754 // Order not found. +#define ERR_TRADE_DEAL_NOT_FOUND 4755 // Deal not found. +#define ERR_TRADE_SEND_FAILED 4756 // Trade request sending failed. // Indicators. -#define ERR_INDICATOR_UNKNOWN_SYMBOL 4801 // Unknown symbol. -#define ERR_INDICATOR_CANNOT_CREATE 4802 // Indicator cannot be created. -#define ERR_INDICATOR_NO_MEMORY 4803 // Not enough memory to add the indicator. -#define ERR_INDICATOR_CANNOT_APPLY 4804 // The indicator cannot be applied to another indicator. -#define ERR_INDICATOR_CANNOT_ADD 4805 // Error applying an indicator to chart. -#define ERR_INDICATOR_DATA_NOT_FOUND 4806 // Requested data not found. -#define ERR_INDICATOR_WRONG_HANDLE 4807 // Wrong indicator handle. -#define ERR_INDICATOR_WRONG_PARAMETERS 4808 // Wrong number of parameters when creating an indicator. -#define ERR_INDICATOR_PARAMETERS_MISSING 4809 // No parameters when creating an indicator. -#define ERR_INDICATOR_CUSTOM_NAME 4810 // The first parameter in the array must be the name of the custom indicator. -#define ERR_INDICATOR_PARAMETER_TYPE 4811 // Invalid parameter type in the array when creating an indicator. -#define ERR_INDICATOR_WRONG_INDEX 4812 // Wrong index of the requested indicator buffer. +#define ERR_INDICATOR_UNKNOWN_SYMBOL 4801 // Unknown symbol. +#define ERR_INDICATOR_CANNOT_CREATE 4802 // Indicator cannot be created. +#define ERR_INDICATOR_NO_MEMORY 4803 // Not enough memory to add the indicator. +#define ERR_INDICATOR_CANNOT_APPLY 4804 // The indicator cannot be applied to another indicator. +#define ERR_INDICATOR_CANNOT_ADD 4805 // Error applying an indicator to chart. +#define ERR_INDICATOR_DATA_NOT_FOUND 4806 // Requested data not found. +#define ERR_INDICATOR_WRONG_HANDLE 4807 // Wrong indicator handle. +#define ERR_INDICATOR_WRONG_PARAMETERS 4808 // Wrong number of parameters when creating an indicator. +#define ERR_INDICATOR_PARAMETERS_MISSING 4809 // No parameters when creating an indicator. +#define ERR_INDICATOR_CUSTOM_NAME 4810 // The first parameter in the array must be the name of the custom indicator. +#define ERR_INDICATOR_PARAMETER_TYPE 4811 // Invalid parameter type in the array when creating an indicator. +#define ERR_INDICATOR_WRONG_INDEX 4812 // Wrong index of the requested indicator buffer. // Depth of Market. -#define ERR_BOOKS_CANNOT_ADD 4901 // Depth Of Market can not be added. -#define ERR_BOOKS_CANNOT_DELETE 4902 // Depth Of Market can not be removed. -#define ERR_BOOKS_CANNOT_GET 4903 // The data from Depth Of Market can not be obtained. -#define ERR_BOOKS_CANNOT_SUBSCRIBE 4904 // Error in subscribing to receive new data from Depth Of Market. +#define ERR_BOOKS_CANNOT_ADD 4901 // Depth Of Market can not be added. +#define ERR_BOOKS_CANNOT_DELETE 4902 // Depth Of Market can not be removed. +#define ERR_BOOKS_CANNOT_GET 4903 // The data from Depth Of Market can not be obtained. +#define ERR_BOOKS_CANNOT_SUBSCRIBE 4904 // Error in subscribing to receive new data from Depth Of Market. // File Operations. -#define ERR_TOO_MANY_FILES 5001 // More than 64 files cannot be opened at the same time. -#define ERR_WRONG_FILENAME 5002 // Invalid file name. -#define ERR_TOO_LONG_FILENAME 5003 // Too long file name. +#define ERR_TOO_MANY_FILES 5001 // More than 64 files cannot be opened at the same time. +#define ERR_WRONG_FILENAME 5002 // Invalid file name. +#define ERR_TOO_LONG_FILENAME 5003 // Too long file name. #ifndef ERR_CANNOT_OPEN_FILE -#define ERR_CANNOT_OPEN_FILE 5004 // File opening error. +#define ERR_CANNOT_OPEN_FILE 5004 // File opening error. #endif -#define ERR_FILE_CACHEBUFFER_ERROR 5005 // Not enough memory for cache to read. -#define ERR_CANNOT_DELETE_FILE 5006 // File deleting error. -#define ERR_INVALID_FILEHANDLE 5007 // A file with this handle was closed, or was not opening at all. -#define ERR_WRONG_FILEHANDLE 5008 // Wrong file handle. -#define ERR_FILE_NOTTOWRITE 5009 // The file must be opened for writing. -#define ERR_FILE_NOTTOREAD 5010 // The file must be opened for reading. -#define ERR_FILE_NOTBIN 5011 // The file must be opened as a binary one. -#define ERR_FILE_NOTTXT 5012 // The file must be opened as a text. -#define ERR_FILE_NOTTXTORCSV 5013 // The file must be opened as a text or CSV. -#define ERR_FILE_NOTCSV 5014 // The file must be opened as CSV. -#define ERR_FILE_READERROR 5015 // File reading error. -#define ERR_FILE_BINSTRINGSIZE 5016 // String size must be specified, because the file is opened as binary. -#define ERR_INCOMPATIBLE_FILE 5017 // A text file must be for string arrays, for other arrays - binary. +#define ERR_FILE_CACHEBUFFER_ERROR 5005 // Not enough memory for cache to read. +#define ERR_CANNOT_DELETE_FILE 5006 // File deleting error. +#define ERR_INVALID_FILEHANDLE 5007 // A file with this handle was closed, or was not opening at all. +#define ERR_WRONG_FILEHANDLE 5008 // Wrong file handle. +#define ERR_FILE_NOTTOWRITE 5009 // The file must be opened for writing. +#define ERR_FILE_NOTTOREAD 5010 // The file must be opened for reading. +#define ERR_FILE_NOTBIN 5011 // The file must be opened as a binary one. +#define ERR_FILE_NOTTXT 5012 // The file must be opened as a text. +#define ERR_FILE_NOTTXTORCSV 5013 // The file must be opened as a text or CSV. +#define ERR_FILE_NOTCSV 5014 // The file must be opened as CSV. +#define ERR_FILE_READERROR 5015 // File reading error. +#define ERR_FILE_BINSTRINGSIZE 5016 // String size must be specified, because the file is opened as binary. +#define ERR_INCOMPATIBLE_FILE 5017 // A text file must be for string arrays, for other arrays - binary. #ifndef ERR_FILE_IS_DIRECTORY -#define ERR_FILE_IS_DIRECTORY 5018 // This is not a file, this is a directory. +#define ERR_FILE_IS_DIRECTORY 5018 // This is not a file, this is a directory. #endif #ifndef ERR_FILE_NOT_EXIST -#define ERR_FILE_NOT_EXIST 5019 // File does not exist. +#define ERR_FILE_NOT_EXIST 5019 // File does not exist. #endif #ifndef ERR_FILE_CANNOT_REWRITE -#define ERR_FILE_CANNOT_REWRITE 5020 // File can not be rewritten. +#define ERR_FILE_CANNOT_REWRITE 5020 // File can not be rewritten. #endif -#define ERR_WRONG_DIRECTORYNAME 5021 // Wrong directory name. -#define ERR_DIRECTORY_NOT_EXIST 5022 // Directory does not exist. -#define ERR_FILE_ISNOT_DIRECTORY 5023 // This is a file, not a directory. -#define ERR_CANNOT_DELETE_DIRECTORY 5024 // The directory cannot be removed. -#define ERR_CANNOT_CLEAN_DIRECTORY 5025 // Failed to clear the directory (probably one or more files are blocked and removal operation failed). -#define ERR_FILE_WRITEERROR 5026 // Failed to write a resource to a file. -#define ERR_FILE_ENDOFFILE 5027 // Unable to read the next piece of data from a CSV file (FileReadString, FileReadNumber, FileReadDatetime, FileReadBool), since the end of file is reached. +#define ERR_WRONG_DIRECTORYNAME 5021 // Wrong directory name. +#define ERR_DIRECTORY_NOT_EXIST 5022 // Directory does not exist. +#define ERR_FILE_ISNOT_DIRECTORY 5023 // This is a file, not a directory. +#define ERR_CANNOT_DELETE_DIRECTORY 5024 // The directory cannot be removed. +#define ERR_CANNOT_CLEAN_DIRECTORY \ + 5025 // Failed to clear the directory (probably one or more files are blocked and removal operation failed). +#define ERR_FILE_WRITEERROR 5026 // Failed to write a resource to a file. +#define ERR_FILE_ENDOFFILE \ + 5027 // Unable to read the next piece of data from a CSV file (FileReadString, FileReadNumber, FileReadDatetime, + // FileReadBool), since the end of file is reached. // String Casting. -#define ERR_NO_STRING_DATE 5030 // No date in the string. -#define ERR_WRONG_STRING_DATE 5031 // Wrong date in the string. -#define ERR_WRONG_STRING_TIME 5032 // Wrong time in the string. -#define ERR_STRING_TIME_ERROR 5033 // Error converting string to date. -#define ERR_STRING_OUT_OF_MEMORY 5034 // Not enough memory for the string. -#define ERR_STRING_SMALL_LEN 5035 // The string length is less than expected. -#define ERR_STRING_TOO_BIGNUMBER 5036 // Too large number, more than ULONG_MAX. -#define ERR_WRONG_FORMATSTRING 5037 // Invalid format string. -#define ERR_TOO_MANY_FORMATTERS 5038 // Amount of format specifiers more than the parameters. -#define ERR_TOO_MANY_PARAMETERS 5039 // Amount of parameters more than the format specifiers. -#define ERR_WRONG_STRING_PARAMETER 5040 // Damaged parameter of string type. -#define ERR_STRINGPOS_OUTOFRANGE 5041 // Position outside the string. -#define ERR_STRING_ZEROADDED 5042 // 0 added to the string end, a useless operation. -#define ERR_STRING_UNKNOWNTYPE 5043 // Unknown data type when converting to a string. -#define ERR_WRONG_STRING_OBJECT 5044 // Damaged string object. +#define ERR_NO_STRING_DATE 5030 // No date in the string. +#define ERR_WRONG_STRING_DATE 5031 // Wrong date in the string. +#define ERR_WRONG_STRING_TIME 5032 // Wrong time in the string. +#define ERR_STRING_TIME_ERROR 5033 // Error converting string to date. +#define ERR_STRING_OUT_OF_MEMORY 5034 // Not enough memory for the string. +#define ERR_STRING_SMALL_LEN 5035 // The string length is less than expected. +#define ERR_STRING_TOO_BIGNUMBER 5036 // Too large number, more than ULONG_MAX. +#define ERR_WRONG_FORMATSTRING 5037 // Invalid format string. +#define ERR_TOO_MANY_FORMATTERS 5038 // Amount of format specifiers more than the parameters. +#define ERR_TOO_MANY_PARAMETERS 5039 // Amount of parameters more than the format specifiers. +#define ERR_WRONG_STRING_PARAMETER 5040 // Damaged parameter of string type. +#define ERR_STRINGPOS_OUTOFRANGE 5041 // Position outside the string. +#define ERR_STRING_ZEROADDED 5042 // 0 added to the string end, a useless operation. +#define ERR_STRING_UNKNOWNTYPE 5043 // Unknown data type when converting to a string. +#define ERR_WRONG_STRING_OBJECT 5044 // Damaged string object. // Operations with Array. #ifndef ERR_INCOMPATIBLE_ARRAYS -#define ERR_INCOMPATIBLE_ARRAYS 5050 // Copying incompatible arrays. String array can be copied only to a string array, and a numeric array - in numeric array only. +#define ERR_INCOMPATIBLE_ARRAYS \ + 5050 // Copying incompatible arrays. String array can be copied only to a string array, and a numeric array - in + // numeric array only. #endif -#define ERR_SMALL_ASSERIES_ARRAY 5051 // The receiving array is declared as AS_SERIES, and it is of insufficient size. -#define ERR_SMALL_ARRAY 5052 // Too small array, the starting position is outside the array. -#define ERR_ZEROSIZE_ARRAY 5053 // An array of zero length. -#define ERR_NUMBER_ARRAYS_ONLY 5054 // Must be a numeric array. -#define ERR_ONEDIM_ARRAYS_ONLY 5055 // Must be a one-dimensional array. -#define ERR_SERIES_ARRAY 5056 // Timeseries cannot be used. -#define ERR_DOUBLE_ARRAY_ONLY 5057 // Must be an array of type double. -#define ERR_FLOAT_ARRAY_ONLY 5058 // Must be an array of type float. -#define ERR_LONG_ARRAY_ONLY 5059 // Must be an array of type long. -#define ERR_INT_ARRAY_ONLY 5060 // Must be an array of type int. -#define ERR_SHORT_ARRAY_ONLY 5061 // Must be an array of type short. -#define ERR_CHAR_ARRAY_ONLY 5062 // Must be an array of type char. +#define ERR_SMALL_ASSERIES_ARRAY 5051 // The receiving array is declared as AS_SERIES, and it is of insufficient size. +#define ERR_SMALL_ARRAY 5052 // Too small array, the starting position is outside the array. +#define ERR_ZEROSIZE_ARRAY 5053 // An array of zero length. +#define ERR_NUMBER_ARRAYS_ONLY 5054 // Must be a numeric array. +#define ERR_ONEDIM_ARRAYS_ONLY 5055 // Must be a one-dimensional array. +#define ERR_SERIES_ARRAY 5056 // Timeseries cannot be used. +#define ERR_DOUBLE_ARRAY_ONLY 5057 // Must be an array of type double. +#define ERR_FLOAT_ARRAY_ONLY 5058 // Must be an array of type float. +#define ERR_LONG_ARRAY_ONLY 5059 // Must be an array of type int64. +#define ERR_INT_ARRAY_ONLY 5060 // Must be an array of type int. +#define ERR_SHORT_ARRAY_ONLY 5061 // Must be an array of type short. +#define ERR_CHAR_ARRAY_ONLY 5062 // Must be an array of type char. // Operations with OpenCL. -#define ERR_OPENCL_NOT_SUPPORTED 5100 // OpenCL functions are not supported on this computer. -#define ERR_OPENCL_INTERNAL 5101 // Internal error occurred when running OpenCL. -#define ERR_OPENCL_INVALID_HANDLE 5102 // Invalid OpenCL handle. -#define ERR_OPENCL_CONTEXT_CREATE 5103 // Error creating the OpenCL context. -#define ERR_OPENCL_QUEUE_CREATE 5104 // Failed to create a run queue in OpenCL. -#define ERR_OPENCL_PROGRAM_CREATE 5105 // Error occurred when compiling an OpenCL program. -#define ERR_OPENCL_TOO_LONG_KERNEL_NAME 5106 // Too long kernel name (OpenCL kernel). -#define ERR_OPENCL_KERNEL_CREATE 5107 // Error creating an OpenCL kernel. -#define ERR_OPENCL_SET_KERNEL_PARAMETER 5108 // Error occurred when setting parameters for the OpenCL kernel. -#define ERR_OPENCL_EXECUTE 5109 // OpenCL program runtime error. -#define ERR_OPENCL_WRONG_BUFFER_SIZE 5110 // Invalid size of the OpenCL buffer. -#define ERR_OPENCL_WRONG_BUFFER_OFFSET 5111 // Invalid offset in the OpenCL buffer. -#define ERR_OPENCL_BUFFER_CREATE 5112 // Failed to create an OpenCL buffer. +#define ERR_OPENCL_NOT_SUPPORTED 5100 // OpenCL functions are not supported on this computer. +#define ERR_OPENCL_INTERNAL 5101 // Internal error occurred when running OpenCL. +#define ERR_OPENCL_INVALID_HANDLE 5102 // Invalid OpenCL handle. +#define ERR_OPENCL_CONTEXT_CREATE 5103 // Error creating the OpenCL context. +#define ERR_OPENCL_QUEUE_CREATE 5104 // Failed to create a run queue in OpenCL. +#define ERR_OPENCL_PROGRAM_CREATE 5105 // Error occurred when compiling an OpenCL program. +#define ERR_OPENCL_TOO_LONG_KERNEL_NAME 5106 // Too long kernel name (OpenCL kernel). +#define ERR_OPENCL_KERNEL_CREATE 5107 // Error creating an OpenCL kernel. +#define ERR_OPENCL_SET_KERNEL_PARAMETER 5108 // Error occurred when setting parameters for the OpenCL kernel. +#define ERR_OPENCL_EXECUTE 5109 // OpenCL program runtime error. +#define ERR_OPENCL_WRONG_BUFFER_SIZE 5110 // Invalid size of the OpenCL buffer. +#define ERR_OPENCL_WRONG_BUFFER_OFFSET 5111 // Invalid offset in the OpenCL buffer. +#define ERR_OPENCL_BUFFER_CREATE 5112 // Failed to create an OpenCL buffer. // Operations with WebRequest. #ifndef ERR_WEBREQUEST_INVALID_ADDRESS -#define ERR_WEBREQUEST_INVALID_ADDRESS 5200 // Invalid URL. +#define ERR_WEBREQUEST_INVALID_ADDRESS 5200 // Invalid URL. #endif #ifndef ERR_WEBREQUEST_CONNECT_FAILED -#define ERR_WEBREQUEST_CONNECT_FAILED 5201 // Failed to connect to specified URL. +#define ERR_WEBREQUEST_CONNECT_FAILED 5201 // Failed to connect to specified URL. #endif #ifndef ERR_WEBREQUEST_TIMEOUT -#define ERR_WEBREQUEST_TIMEOUT 5202 // Timeout exceeded. +#define ERR_WEBREQUEST_TIMEOUT 5202 // Timeout exceeded. #endif #ifndef ERR_WEBREQUEST_REQUEST_FAILED -#define ERR_WEBREQUEST_REQUEST_FAILED 5203 // HTTP request failed. +#define ERR_WEBREQUEST_REQUEST_FAILED 5203 // HTTP request failed. #endif // User-Defined Errors. #ifndef ERR_USER_ERROR_FIRST -#define ERR_USER_ERROR_FIRST 65536 // User defined errors start with this code. +#define ERR_USER_ERROR_FIRST 65536 // User defined errors start with this code. #endif -#endif // MQL5_MQH +#endif // MQL5_MQH diff --git a/Platform/Order.h b/Platform/Order.h index d15186ff5..b7c84a5c7 100644 --- a/Platform/Order.h +++ b/Platform/Order.h @@ -117,7 +117,7 @@ class Order : public SymbolInfo { #ifndef __MQL4__ // Used for order selection in MQL5 & C++. - static unsigned long selected_ticket_id; + static uint64 selected_ticket_id; static ENUM_ORDER_SELECT_TYPE selected_ticket_type; #endif @@ -126,7 +126,7 @@ class Order : public SymbolInfo { * Class constructors. */ Order() {} - Order(long _ticket_no) { + Order(int64 _ticket_no) { odata.Set(ORDER_PROP_TICKET, _ticket_no); Refresh(true); } @@ -265,7 +265,7 @@ class Order : public SymbolInfo { /** * Sets an order property integer value. */ - void Set(ENUM_ORDER_PROPERTY_INTEGER _prop, long _value) { odata.Set(_prop, _value); } + void Set(ENUM_ORDER_PROPERTY_INTEGER _prop, int64 _value) { odata.Set(_prop, _value); } /** * Sets an order property string value. @@ -278,15 +278,15 @@ class Order : public SymbolInfo { * Is order is open. */ bool IsClosed(bool _refresh = false) { - if (odata.Get(ORDER_PROP_TIME_CLOSED) == 0) { + if (odata.Get(ORDER_PROP_TIME_CLOSED) == 0) { if (_refresh || ShouldRefresh()) { if (Order::TryOrderSelect(Order::OrderTicket(), SELECT_BY_TICKET, MODE_HISTORY)) { - odata.Set(ORDER_PROP_TIME_CLOSED, Order::OrderCloseTime()); + odata.Set(ORDER_PROP_TIME_CLOSED, Order::OrderCloseTime()); odata.Set(ORDER_PROP_REASON_CLOSE, ORDER_REASON_CLOSED_UNKNOWN); } } } - return odata.Get(ORDER_PROP_TIME_CLOSED) > 0; + return odata.Get(ORDER_PROP_TIME_CLOSED) > 0; } /** @@ -307,7 +307,7 @@ class Order : public SymbolInfo { for (int _ci = 0; _ci < _num; _ci++) { ENUM_ORDER_CONDITION _cond = oparams.Get(ORDER_PARAM_COND_CLOSE, _ci); ARRAY(DataParamEntry, _cond_args); - DataParamEntry _item0 = oparams.Get(ORDER_PARAM_COND_CLOSE_ARG_VALUE, _ci); + DataParamEntry _item0 = oparams.Get(ORDER_PARAM_COND_CLOSE_ARG_VALUE, _ci); ArrayPushObject(_cond_args, _item0); _result |= Order::CheckCondition(_cond, _cond_args); } @@ -322,7 +322,7 @@ class Order : public SymbolInfo { * Returns true when order values can be refreshed, otherwise false. */ bool ShouldRefresh() { - return odata.Get(ORDER_PROP_TIME_LAST_REFRESH) + oparams.Get(ORDER_PARAM_REFRESH_FREQ) <= + return odata.Get(ORDER_PROP_TIME_LAST_REFRESH) + oparams.Get(ORDER_PARAM_REFRESH_FREQ) <= TimeCurrent(); } @@ -333,7 +333,7 @@ class Order : public SymbolInfo { * Returns true when order stops can be updated, otherwise false. */ bool ShouldUpdate() { - return odata.Get(ORDER_PROP_TIME_LAST_UPDATE) + oparams.Get(ORDER_PARAM_UPDATE_FREQ) <= + return odata.Get(ORDER_PROP_TIME_LAST_UPDATE) + oparams.Get(ORDER_PARAM_UPDATE_FREQ) <= TimeCurrent(); } @@ -343,13 +343,13 @@ class Order : public SymbolInfo { * Check whether order is selected and it is same as the class one. */ bool IsSelected() { - unsigned long ticket_id = Order::OrderTicket(); + uint64 ticket_id = Order::OrderTicket(); bool is_selected; if (IsDummy()) { is_selected = true; } else { - is_selected = (odata.Get(ORDER_PROP_TICKET) > 0 && ticket_id == odata.Get(ORDER_PROP_TICKET)); + is_selected = (odata.Get(ORDER_PROP_TICKET) > 0 && ticket_id == odata.Get(ORDER_PROP_TICKET)); } ResetLastError(); @@ -374,7 +374,7 @@ class Order : public SymbolInfo { // and only for the symbols with Market or Exchange execution. // In case of partial filling a market or limit order with remaining volume is not canceled but processed further. ENUM_ORDER_TYPE_FILLING _result = ORDER_FILLING_RETURN; - const long _filling_mode = SymbolInfoStatic::GetFillingMode(_symbol); + const int64 _filling_mode = SymbolInfoStatic::GetFillingMode(_symbol); if ((_filling_mode & SYMBOL_FILLING_IOC) == SYMBOL_FILLING_IOC) { // Execute a deal with the volume maximally available in the market within that indicated in the order. // In case the order cannot be filled completely, the available volume of the order will be filled, and the @@ -401,10 +401,10 @@ class Order : public SymbolInfo { /** * Get allowed order filling modes. */ - static ENUM_ORDER_TYPE_FILLING GetOrderFilling(const string _symbol, const long _type) { + static ENUM_ORDER_TYPE_FILLING GetOrderFilling(const string _symbol, const int64 _type) { const ENUM_SYMBOL_TRADE_EXECUTION _exe_mode = (ENUM_SYMBOL_TRADE_EXECUTION)SymbolInfoStatic::SymbolInfoInteger(_symbol, SYMBOL_TRADE_EXEMODE); - const long _filling_mode = SymbolInfoStatic::GetFillingMode(_symbol); + const int64 _filling_mode = SymbolInfoStatic::GetFillingMode(_symbol); return ((_filling_mode == 0 || (_type >= ORDER_FILLING_RETURN) || ((_filling_mode & (_type + 1)) != _type + 1)) ? (((_exe_mode == SYMBOL_TRADE_EXECUTION_EXCHANGE) || (_exe_mode == SYMBOL_TRADE_EXECUTION_INSTANT)) ? ORDER_FILLING_RETURN @@ -431,7 +431,7 @@ class Order : public SymbolInfo { if (Order::TryOrderSelect(Order::OrderTicket(), SELECT_BY_TICKET, MODE_HISTORY)) { for (int i = HistoryDealsTotal() - 1; i >= 0; i--) { // https://www.mql5.com/en/docs/trading/historydealgetticket - const unsigned long _deal_ticket = HistoryDealGetTicket(i); + const uint64 _deal_ticket = HistoryDealGetTicket(i); const ENUM_DEAL_ENTRY _deal_entry = (ENUM_DEAL_ENTRY)HistoryDealGetInteger(_deal_ticket, DEAL_ENTRY); if (_deal_entry == DEAL_ENTRY_OUT || _deal_entry == DEAL_ENTRY_OUT_BY) { _result = HistoryDealGetDouble(_deal_ticket, DEAL_PRICE); @@ -456,11 +456,11 @@ class Order : public SymbolInfo { // http://docs.mql4.com/trading/orderopentime return (datetime)Order::OrderGetInteger(ORDER_TIME_SETUP); #else - long _result = 0; + int64 _result = 0; if (Order::TryOrderSelect(Order::OrderTicket(), SELECT_BY_TICKET, MODE_HISTORY)) { for (int i = HistoryDealsTotal() - 1; i >= 0; i--) { // https://www.mql5.com/en/docs/trading/historydealgetticket - const unsigned long _deal_ticket = HistoryDealGetTicket(i); + const uint64 _deal_ticket = HistoryDealGetTicket(i); const ENUM_DEAL_ENTRY _deal_entry = (ENUM_DEAL_ENTRY)HistoryDealGetInteger(_deal_ticket, DEAL_ENTRY); if (_deal_entry == DEAL_ENTRY_IN) { _result = HistoryDealGetInteger(_deal_ticket, DEAL_TIME); @@ -490,11 +490,11 @@ class Order : public SymbolInfo { return ::OrderCloseTime(); #else // __MQL5__ // @docs https://www.mql5.com/en/docs/trading/historydealgetinteger - long _result = 0; + int64 _result = 0; if (Order::TryOrderSelect(Order::OrderTicket(), SELECT_BY_TICKET, MODE_HISTORY)) { for (int i = HistoryDealsTotal() - 1; i >= 0; i--) { // https://www.mql5.com/en/docs/trading/historydealgetticket - const unsigned long _deal_ticket = HistoryDealGetTicket(i); + const uint64 _deal_ticket = HistoryDealGetTicket(i); const ENUM_DEAL_ENTRY _deal_entry = (ENUM_DEAL_ENTRY)HistoryDealGetInteger(_deal_ticket, DEAL_ENTRY); if (_deal_entry == DEAL_ENTRY_OUT || _deal_entry == DEAL_ENTRY_OUT_BY) { _result = HistoryDealGetInteger(_deal_ticket, DEAL_TIME); @@ -531,7 +531,7 @@ class Order : public SymbolInfo { if (Order::TryOrderSelect(Order::OrderTicket(), SELECT_BY_TICKET, MODE_HISTORY)) { for (int i = HistoryDealsTotal() - 1; i >= 0; i--) { // https://www.mql5.com/en/docs/trading/historydealgetticket - const unsigned long _deal_ticket = HistoryDealGetTicket(i); + const uint64 _deal_ticket = HistoryDealGetTicket(i); _result += _deal_ticket > 0 ? HistoryDealGetDouble(_deal_ticket, DEAL_COMMISSION) : 0; } } @@ -559,7 +559,7 @@ class Order : public SymbolInfo { if (Order::TryOrderSelect(Order::OrderTicket(), SELECT_BY_TICKET, MODE_HISTORY)) { for (int i = HistoryDealsTotal() - 1; i >= 0; i--) { // https://www.mql5.com/en/docs/trading/historydealgetticket - const unsigned long _deal_ticket = HistoryDealGetTicket(i); + const uint64 _deal_ticket = HistoryDealGetTicket(i); if (_deal_ticket > 0) { _result += HistoryDealGetDouble(_deal_ticket, DEAL_COMMISSION); _result += HistoryDealGetDouble(_deal_ticket, DEAL_FEE); @@ -613,8 +613,8 @@ class Order : public SymbolInfo { * - http://docs.mql4.com/trading/ordermagicnumber * - https://www.mql5.com/en/docs/trading/ordergetinteger */ - static long OrderMagicNumber() { return Order::OrderGetInteger(ORDER_MAGIC); } - unsigned long GetMagicNumber() { return orequest.magic; } + static int64 OrderMagicNumber() { return Order::OrderGetInteger(ORDER_MAGIC); } + uint64 GetMagicNumber() { return orequest.magic; } /** * Returns open price of the currently selected order/position. @@ -646,7 +646,7 @@ class Order : public SymbolInfo { if (Order::TryOrderSelect(Order::OrderTicket(), SELECT_BY_TICKET, MODE_HISTORY)) { for (int i = HistoryDealsTotal() - 1; i >= 0; i--) { // https://www.mql5.com/en/docs/trading/historydealgetticket - const unsigned long _deal_ticket = HistoryDealGetTicket(i); + const uint64 _deal_ticket = HistoryDealGetTicket(i); _result += _deal_ticket > 0 ? HistoryDealGetDouble(_deal_ticket, DEAL_PROFIT) : 0; } } @@ -714,7 +714,7 @@ class Order : public SymbolInfo { if (Order::TryOrderSelect(Order::OrderTicket(), SELECT_BY_TICKET, MODE_HISTORY)) { for (int i = HistoryDealsTotal() - 1; i >= 0; i--) { // https://www.mql5.com/en/docs/trading/historydealgetticket - const unsigned long _deal_ticket = HistoryDealGetTicket(i); + const uint64 _deal_ticket = HistoryDealGetTicket(i); _result += _deal_ticket > 0 ? HistoryDealGetDouble(_deal_ticket, DEAL_SWAP) : 0; } } @@ -755,14 +755,14 @@ class Order : public SymbolInfo { * @see https://docs.mql4.com/trading/orderticket * @see https://www.mql5.com/en/docs/trading/ordergetticket */ - static unsigned long OrderTicket() { + static uint64 OrderTicket() { #ifdef __MQL4__ return ::OrderTicket(); #else return selected_ticket_id; #endif } - // unsigned long GetTicket() const { return odata.Get(ORDER_PROP_TICKET); } + // uint64 GetTicket() const { return odata.Get(ORDER_PROP_TICKET); } /** * Returns order operation type of the currently selected order/position. @@ -798,9 +798,9 @@ class Order : public SymbolInfo { * Each executed order results in a deal that opens or modifies an already existing position. * The identifier of exactly this position is set to the executed order at this moment. */ - static unsigned long OrderGetPositionID() { + static uint64 OrderGetPositionID() { #ifdef __MQL4__ - unsigned long _ticket = ::OrderTicket(); + uint64 _ticket = ::OrderTicket(); for (int _pos = 0; _pos < OrdersTotal(); _pos++) { if (::OrderSelect(_pos, SELECT_BY_POS, MODE_TRADES) && ::OrderTicket() == _ticket) { return _pos; @@ -812,14 +812,14 @@ class Order : public SymbolInfo { #endif } /* @todo - unsigned long GetPositionID() { + uint64 GetPositionID() { #ifdef ORDER_POSITION_ID if (odata.position_id == 0) { OrderSelect(); Refresh(ORDER_POSITION_ID); } #endif - return odata.Get(ORDER_POSITION_ID); + return odata.Get(ORDER_POSITION_ID); } */ @@ -832,7 +832,7 @@ class Order : public SymbolInfo { * - https://www.mql5.com/en/docs/constants/structures/mqltraderequest * - https://www.mql5.com/en/docs/constants/tradingconstants/orderproperties */ - static unsigned long OrderGetPositionBy() { + static uint64 OrderGetPositionBy() { #ifdef __MQL4__ // @todo /* @@ -848,14 +848,14 @@ class Order : public SymbolInfo { #endif } /* @todo - unsigned long GetOrderPositionBy() { + uint64 GetOrderPositionBy() { #ifdef ORDER_POSITION_BY_ID if (odata.position_by_id == 0) { OrderSelect(); Refresh(ORDER_POSITION_BY_ID); } #endif - return odata.Get(ORDER_POSITION_BY_ID); + return odata.Get(ORDER_POSITION_BY_ID); } */ @@ -864,7 +864,7 @@ class Order : public SymbolInfo { * * @see https://www.mql5.com/en/docs/trading/positiongetticket */ - unsigned long PositionGetTicket(int _index) { + uint64 PositionGetTicket(int _index) { #ifdef __MQL4__ if (::OrderSelect(_index, SELECT_BY_POS, MODE_TRADES)) { return ::OrderTicket(); @@ -888,9 +888,9 @@ class Order : public SymbolInfo { * Returns true if successful, otherwise false. * To get details about error, call the GetLastError() function. */ - static bool OrderClose(unsigned long _ticket, // Unique number of the order ticket. - double _lots, // Number of lots. - double _price, // Closing price. + static bool OrderClose(uint64 _ticket, // Unique number of the order ticket. + double _lots, // Number of lots. + double _price, // Closing price. int _deviation, // Maximal possible deviation/slippage from the requested price (in points). color _arrow_color = CLR_NONE // Color of the closing arrow on the chart. ) { @@ -971,7 +971,7 @@ class Order : public SymbolInfo { /** * Closes a position by an opposite one. */ - static bool OrderCloseBy(long _ticket, long _opposite, color _color) { + static bool OrderCloseBy(int64 _ticket, int64 _opposite, color _color) { #ifdef __MQL4__ return ::OrderCloseBy((int)_ticket, (int)_opposite, _color); #else @@ -994,8 +994,8 @@ class Order : public SymbolInfo { /** * Closes a position by an opposite one. */ - bool OrderCloseBy(long _opposite, color _color) { - bool _result = OrderCloseBy(odata.Get(ORDER_PROP_TICKET), _opposite, _color); + bool OrderCloseBy(int64 _opposite, color _color) { + bool _result = OrderCloseBy(odata.Get(ORDER_PROP_TICKET), _opposite, _color); if (_result) { odata.Set(ORDER_PROP_REASON_CLOSE, ORDER_REASON_CLOSED_BY_OPPOSITE); } @@ -1007,7 +1007,7 @@ class Order : public SymbolInfo { * * @see: https://docs.mql4.com/trading/orderdelete */ - static bool OrderDelete(unsigned long _ticket, color _color = color()) { + static bool OrderDelete(uint64 _ticket, color _color = color()) { #ifdef __MQL4__ return ::OrderDelete((int)_ticket, _color); #else @@ -1022,7 +1022,7 @@ class Order : public SymbolInfo { #endif } bool OrderDelete(ENUM_ORDER_REASON_CLOSE _reason = ORDER_REASON_CLOSED_UNKNOWN) { - bool _result = Order::OrderDelete(odata.Get(ORDER_PROP_TICKET)); + bool _result = Order::OrderDelete(odata.Get(ORDER_PROP_TICKET)); if (_result) { odata.Set(ORDER_PROP_REASON_CLOSE, _reason); } @@ -1034,7 +1034,7 @@ class Order : public SymbolInfo { * * @see http://docs.mql4.com/trading/ordermodify */ - static bool OrderModify(unsigned long _ticket, // Ticket of the position. + static bool OrderModify(uint64 _ticket, // Ticket of the position. double _price, // Price. double _stoploss, // Stop loss. double _takeprofit, // Take profit. @@ -1061,7 +1061,7 @@ class Order : public SymbolInfo { #endif } bool OrderModify(double _sl, double _tp, double _price = 0, datetime _expiration = 0) { - if (odata.Get(ORDER_PROP_TIME_CLOSED) > 0) { + if (odata.Get(ORDER_PROP_TIME_CLOSED) > 0) { // Ignore change for already closed orders. return false; } else if (_sl == odata.Get(ORDER_SL) && _tp == odata.Get(ORDER_TP) && @@ -1069,8 +1069,8 @@ class Order : public SymbolInfo { // Ignore change for the same values. return false; } - bool _result = Order::OrderModify(odata.Get(ORDER_PROP_TICKET), _price, _sl, _tp, _expiration); - long _last_error = GetLastError(); + bool _result = Order::OrderModify(odata.Get(ORDER_PROP_TICKET), _price, _sl, _tp, _expiration); + int64 _last_error = GetLastError(); if (_result && OrderSelect()) { // Updating expected values. odata.Set(ORDER_SL, _sl); @@ -1084,9 +1084,10 @@ class Order : public SymbolInfo { if (IsClosed()) { Refresh(); } else { - GetLogger() PTR_DEREF Warning(StringFormat("Failed to modify order (#%d/p:%g/sl:%g/tp:%g/code:%d).", - odata.Get(ORDER_PROP_TICKET), _price, _sl, _tp, _last_error), - __FUNCTION_LINE__, ToCSV()); + GetLogger() + PTR_DEREF Warning(StringFormat("Failed to modify order (#%d/p:%g/sl:%g/tp:%g/code:%d).", + odata.Get(ORDER_PROP_TICKET), _price, _sl, _tp, _last_error), + __FUNCTION_LINE__, ToCSV()); Refresh(ORDER_SL); Refresh(ORDER_TP); // TODO: Refresh(ORDER_PRI) @@ -1098,7 +1099,7 @@ class Order : public SymbolInfo { _result = false; } else { ologger.Error(StringFormat("Error: %d! Failed to modify non-existing order (#%d/p:%g/sl:%g/tp:%g).", - _last_error, odata.Get(ORDER_PROP_TICKET), _price, _sl, _tp), + _last_error, odata.Get(ORDER_PROP_TICKET), _price, _sl, _tp), __FUNCTION_LINE__, ToCSV()); } } @@ -1161,17 +1162,17 @@ class Order : public SymbolInfo { * Returns number of the ticket assigned to the order by the trade server * or -1 if it fails. */ - static long OrderSend(string _symbol, // Symbol. - int _cmd, // Operation. - double _volume, // Volume. - double _price, // Price. - unsigned long _deviation, // Deviation. - double _stoploss, // Stop loss. - double _takeprofit, // Take profit. - string _comment = NULL_STRING, // Comment. - unsigned long _magic = 0, // Magic number. - datetime _expiration = 0, // Pending order expiration. - color _arrow_color = clrNONE // Color. + static int64 OrderSend(string _symbol, // Symbol. + int _cmd, // Operation. + double _volume, // Volume. + double _price, // Price. + uint64 _deviation, // Deviation. + double _stoploss, // Stop loss. + double _takeprofit, // Take profit. + string _comment = NULL_STRING, // Comment. + uint64 _magic = 0, // Magic number. + datetime _expiration = 0, // Pending order expiration. + color _arrow_color = clrNONE // Color. ) { #ifdef __MQL4__ #ifdef __debug__ @@ -1211,7 +1212,7 @@ class Order : public SymbolInfo { if (!Order::OrderSend(_request, _result)) { return -1; } - return (long)_result.order; + return (int64)_result.order; #endif } static bool OrderSend(const MqlTradeRequest &_request, MqlTradeResult &_result, MqlTradeCheckResult &_result_check, @@ -1337,8 +1338,8 @@ class Order : public SymbolInfo { MqlTradeCheckResult _result_check = {0}; return Order::OrderSend(_request, _result, _result_check); } - long OrderSend() { - long _result = -1; + int64 OrderSend() { + int64 _result = -1; odata.ResetError(); #ifdef __MQL4__ _result = Order::OrderSend(orequest.symbol, // Symbol. @@ -1369,8 +1370,8 @@ class Order : public SymbolInfo { // However, this is not a sign of successful execution of a trade operation. // @see: https://www.mql5.com/en/docs/trading/ordersend // In order to obtain information about the error, call the GetLastError() function. - odata.Set(ORDER_PROP_TICKET, oresult.order); - _result = (long)oresult.order; + odata.Set(ORDER_PROP_TICKET, oresult.order); + _result = (int64)oresult.order; } else { // The function execution result is placed to structure MqlTradeResult, // whose retcode field contains the trade server return code. @@ -1422,7 +1423,7 @@ class Order : public SymbolInfo { * @return * Returns number of the fake ticket assigned to the order. */ - long OrderSendDummy() { + int64 OrderSendDummy() { static int _dummy_order_id = 0; odata.ResetError(); orequest.type_filling = orequest.type_filling ? orequest.type_filling : GetOrderFilling(orequest.symbol); @@ -1441,13 +1442,13 @@ class Order : public SymbolInfo { oresult.retcode = TRADE_RETCODE_DONE; // Mark trade operation as done. oresult.comment = orequest.comment; // Order comment. oresult.order = ++_dummy_order_id; // Assign sequential order id. Starts from 1. - odata.Set(ORDER_PROP_TICKET, oresult.order); + odata.Set(ORDER_PROP_TICKET, oresult.order); RefreshDummy(); odata.Set(ORDER_PROP_LAST_ERROR, oresult.retcode); // @todo Register order in a static dictionary order_id -> order for further select. - return (long)oresult.order; + return (int64)oresult.order; } /** @@ -1504,7 +1505,7 @@ class Order : public SymbolInfo { * * @see http://docs.mql4.com/trading/orderselect */ - static bool OrderSelect(unsigned long _index, int select, int pool = MODE_TRADES) { + static bool OrderSelect(uint64 _index, int select, int pool = MODE_TRADES) { ResetLastError(); #ifdef __MQL4__ return ::OrderSelect((int)_index, select, pool); @@ -1526,7 +1527,7 @@ class Order : public SymbolInfo { // HistoryOrderSelect(ticket) function, which clears the cache and re-fill it with only one order, in the // case of success. Recall that the value, returned from HistoryOrdersTotal() depends on the number of orders // in the cache. - unsigned long _ticket_id = HistoryOrderGetTicket((int)_index); + uint64 _ticket_id = HistoryOrderGetTicket((int)_index); if (_ticket_id != 0) { selected_ticket_type = ORDER_SELECT_TYPE_HISTORY; } else if (::HistoryOrderSelect(_ticket_id)) { @@ -1588,27 +1589,27 @@ class Order : public SymbolInfo { * * @see http://docs.mql4.com/trading/orderselect */ - static bool TryOrderSelect(unsigned long _index, int select, int pool = MODE_TRADES) { + static bool TryOrderSelect(uint64 _index, int select, int pool = MODE_TRADES) { bool result = OrderSelect(_index, select, pool); ResetLastError(); return result; } - static bool OrderSelectByTicket(unsigned long _ticket) { + static bool OrderSelectByTicket(uint64 _ticket) { return Order::OrderSelect(_ticket, SELECT_BY_TICKET, MODE_TRADES) || Order::OrderSelect(_ticket, SELECT_BY_TICKET, MODE_HISTORY); } - static bool TryOrderSelectByTicket(unsigned long _ticket) { + static bool TryOrderSelectByTicket(uint64 _ticket) { return Order::TryOrderSelect(_ticket, SELECT_BY_TICKET, MODE_TRADES) || Order::TryOrderSelect(_ticket, SELECT_BY_TICKET, MODE_HISTORY); } - bool OrderSelect() { return !IsSelected() ? Order::OrderSelectByTicket(odata.Get(ORDER_PROP_TICKET)) : true; } + bool OrderSelect() { return !IsSelected() ? Order::OrderSelectByTicket(odata.Get(ORDER_PROP_TICKET)) : true; } bool TryOrderSelect() { - return !IsSelected() ? Order::TryOrderSelectByTicket(odata.Get(ORDER_PROP_TICKET)) : true; + return !IsSelected() ? Order::TryOrderSelectByTicket(odata.Get(ORDER_PROP_TICKET)) : true; } - bool OrderSelectHistory() { return OrderSelect(odata.Get(ORDER_PROP_TICKET), MODE_HISTORY); } + bool OrderSelectHistory() { return OrderSelect(odata.Get(ORDER_PROP_TICKET), MODE_HISTORY); } /* Setters */ @@ -1631,7 +1632,7 @@ class Order : public SymbolInfo { ResetLastError(); // Checks if order is updated for the first time. - bool _is_init = odata.Get(ORDER_PRICE_OPEN) == 0 || odata.Get(ORDER_TIME_SETUP) == 0; + bool _is_init = odata.Get(ORDER_PRICE_OPEN) == 0 || odata.Get(ORDER_TIME_SETUP) == 0; // Update integer values. if (_is_init) { @@ -1666,9 +1667,9 @@ class Order : public SymbolInfo { } // Updates whether order is open or closed. - if (odata.Get(ORDER_PROP_TIME_CLOSED) == 0) { + if (odata.Get(ORDER_PROP_TIME_CLOSED) == 0) { // Updates close time. - odata.Set(ORDER_PROP_TIME_CLOSED, Order::OrderCloseTime()); + odata.Set(ORDER_PROP_TIME_CLOSED, Order::OrderCloseTime()); } if (IsOpen()) { @@ -1701,7 +1702,7 @@ class Order : public SymbolInfo { odata.ProcessLastError(); ResetLastError(); } - odata.Set(ORDER_PROP_TIME_LAST_REFRESH, TimeCurrent()); + odata.Set(ORDER_PROP_TIME_LAST_REFRESH, TimeCurrent()); return _result && _last_error == ERR_NO_ERROR; } @@ -1736,7 +1737,7 @@ class Order : public SymbolInfo { // @todo: More RefreshDummy(XXX); odata.ResetError(); - odata.Set(ORDER_PROP_TIME_LAST_REFRESH, TimeCurrent()); + odata.Set(ORDER_PROP_TIME_LAST_REFRESH, TimeCurrent()); odata.ProcessLastError(); return _result && GetLastError() == ERR_NO_ERROR; } @@ -1888,7 +1889,7 @@ class Order : public SymbolInfo { */ bool Refresh(ENUM_ORDER_PROPERTY_INTEGER _prop_id) { bool _result = false; - long _value = WRONG_VALUE; + int64 _value = WRONG_VALUE; ResetLastError(); switch (_prop_id) { case ORDER_MAGIC: @@ -2092,9 +2093,9 @@ class Order : public SymbolInfo { * - https://www.mql5.com/en/docs/trading/ordergetinteger * */ - static long OrderGetInteger(ENUM_ORDER_PROPERTY_INTEGER property_id) { + static int64 OrderGetInteger(ENUM_ORDER_PROPERTY_INTEGER property_id) { ResetLastError(); - long _result = 0; + int64 _result = 0; #ifdef __MQL4__ #ifdef __debug__ Print("OrderGetInteger(", EnumToString(property_id), ")..."); @@ -2183,9 +2184,9 @@ class Order : public SymbolInfo { return OrderGetParam(property_id, selected_ticket_type, ORDER_SELECT_DATA_TYPE_INTEGER, _result); #endif } - static bool OrderGetInteger(ENUM_ORDER_PROPERTY_INTEGER property_id, long &_out) { + static bool OrderGetInteger(ENUM_ORDER_PROPERTY_INTEGER property_id, int64 &_out) { #ifdef __MQL4__ - _out = (long)OrderGetInteger(property_id); + _out = (int64)OrderGetInteger(property_id); return true; #else return OrderGetParam(property_id, selected_ticket_type, ORDER_SELECT_DATA_TYPE_INTEGER, _out) >= 0; @@ -2334,15 +2335,15 @@ class Order : public SymbolInfo { * @param ENUM_ORDER_SELECT_TYPE type * Identifier of a property. * - * @param long& _out + * @param int64& _out * Reference to output value (the same as returned from the function). * - * @return long + * @return int64 * Returns the value of the property (same as for `_out` variable). * In case of error, information can be obtained using GetLastError() function. * */ - static long OrderGetValue(int property_id, ENUM_ORDER_SELECT_TYPE type, long &_out) { + static int64 OrderGetValue(int property_id, ENUM_ORDER_SELECT_TYPE type, int64 &_out) { switch (type) { case ORDER_SELECT_TYPE_NONE: return 0; @@ -2462,7 +2463,7 @@ class Order : public SymbolInfo { template static X OrderGetParam(int _prop_id, ENUM_ORDER_SELECT_TYPE _type, ENUM_ORDER_SELECT_DATA_TYPE _data_type, X &_out) { #ifndef __MQL4__ - long _long; + int64 _long; string _string; switch (selected_ticket_type) { case ORDER_SELECT_TYPE_NONE: @@ -2705,12 +2706,12 @@ class Order : public SymbolInfo { * Returns true when the condition is met. */ bool CheckCondition(ENUM_ORDER_CONDITION _cond, ARRAY_REF(DataParamEntry, _args)) { - // float _profit = (float)Get(ORDER_PROP_PROFIT_PIPS); + // float _profit = (float)Get(ORDER_PROP_PROFIT_PIPS); switch (_cond) { case ORDER_COND_IN_LOSS: - return Get(ORDER_PROP_PROFIT_PIPS) < (ArraySize(_args) > 0 ? -DataParamEntry::ToDouble(_args[0]) : 0); + return Get(ORDER_PROP_PROFIT_PIPS) < (ArraySize(_args) > 0 ? -DataParamEntry::ToDouble(_args[0]) : 0); case ORDER_COND_IN_PROFIT: - return Get(ORDER_PROP_PROFIT_PIPS) > (ArraySize(_args) > 0 ? DataParamEntry::ToDouble(_args[0]) : 0); + return Get(ORDER_PROP_PROFIT_PIPS) > (ArraySize(_args) > 0 ? DataParamEntry::ToDouble(_args[0]) : 0); case ORDER_COND_IS_CLOSED: return IsClosed(); case ORDER_COND_IS_OPEN: @@ -2718,7 +2719,7 @@ class Order : public SymbolInfo { case ORDER_COND_LIFETIME_GT_ARG: case ORDER_COND_LIFETIME_LT_ARG: if (ArraySize(_args) > 0) { - long _arg_value = DataParamEntry::ToInteger(_args[0]); + int64 _arg_value = DataParamEntry::ToInteger(_args[0]); switch (_cond) { case ORDER_COND_LIFETIME_GT_ARG: return TimeCurrent() - odata.Get(ORDER_TIME_SETUP) > _arg_value; @@ -2733,7 +2734,7 @@ class Order : public SymbolInfo { case ORDER_COND_PROP_LT_ARG: { if (ArraySize(_args) >= 2) { // First argument is enum value (order property). - long _prop_id = _args[0].integer_value; + int64 _prop_id = _args[0].integer_value; // Second argument is the actual value with compare with. switch (_args[1].type) { case TYPE_DOUBLE: @@ -2852,7 +2853,7 @@ class Order : public SymbolInfo { /** * Returns order details in text. */ - string ToString(ARRAY_REF(long, _props), ENUM_DATATYPE _type = TYPE_DOUBLE, string _dlm = ";") { + string ToString(ARRAY_REF(int64, _props), ENUM_DATATYPE _type = TYPE_DOUBLE, string _dlm = ";") { int i = 0; string _output = ""; switch (_type) { @@ -2863,7 +2864,7 @@ class Order : public SymbolInfo { break; case TYPE_LONG: for (i = 0; i < Array::ArraySize(_props); i++) { - _output += StringFormat("%d%s", odata.Get((ENUM_ORDER_PROPERTY_INTEGER)_props[i]), C_STR(_dlm)); + _output += StringFormat("%d%s", odata.Get((ENUM_ORDER_PROPERTY_INTEGER)_props[i]), C_STR(_dlm)); } break; case TYPE_STRING: @@ -2908,5 +2909,5 @@ class Order : public SymbolInfo { #ifdef __MQL5__ // Assigns values to static variables. ENUM_ORDER_SELECT_TYPE Order::selected_ticket_type = ORDER_SELECT_TYPE_NONE; -unsigned long Order::selected_ticket_id = 0; +uint64 Order::selected_ticket_id = 0; #endif diff --git a/Platform/Order.struct.h b/Platform/Order.struct.h index a1773c1bb..f35b63a8a 100644 --- a/Platform/Order.struct.h +++ b/Platform/Order.struct.h @@ -59,29 +59,29 @@ struct MqlTradeCheckResult { // @see: https://www.mql5.com/en/docs/constants/structures/mqltraderequest struct MqlTradeRequest { ENUM_TRADE_REQUEST_ACTIONS action; // Trade operation type. - unsigned long magic; // Expert Advisor ID (magic number). - unsigned long order; // Order ticket. + uint64 magic; // Expert Advisor ID (magic number). + uint64 order; // Order ticket. string symbol; // Trade symbol. double volume; // Requested volume for a deal in lots. double price; // Price. double stoplimit; // StopLimit level of the order. double sl; // Stop Loss level of the order. double tp; // Take Profit level of the order. - unsigned long deviation; // Maximal possible deviation from the requested price. + uint64 deviation; // Maximal possible deviation from the requested price. ENUM_ORDER_TYPE type; // Order type. ENUM_ORDER_TYPE_FILLING type_filling; // Order execution type. ENUM_ORDER_TYPE_TIME type_time; // Order expiration type. datetime expiration; // Order expiration time (for the orders of ORDER_TIME_SPECIFIED type. string comment; // Order comment. - unsigned long position; // Position ticket. - unsigned long position_by; // The ticket of an opposite position. + uint64 position; // Position ticket. + uint64 position_by; // The ticket of an opposite position. }; // @see: https://www.mql5.com/en/docs/constants/structures/mqltraderesult struct MqlTradeResult { unsigned int retcode; // Operation return code. - unsigned long deal; // Deal ticket, if it is performed. - unsigned long order; // Order ticket, if it is placed. + uint64 deal; // Deal ticket, if it is performed. + uint64 order; // Order ticket, if it is placed. double volume; // Deal volume, confirmed by broker. double price; // Deal price, confirmed by broker. double bid; // Current Bid price. @@ -232,10 +232,10 @@ struct OrderParams { */ struct OrderData { protected: - unsigned long magic; // Magic number. - unsigned long position_id; // Position ID. - unsigned long position_by_id; // Position By ID. - unsigned long ticket; // Ticket number. + uint64 magic; // Magic number. + uint64 position_id; // Position ID. + uint64 position_by_id; // Position By ID. + uint64 ticket; // Ticket number. ENUM_ORDER_STATE state; // State. string comment; // Comment. double commission; // Commission. @@ -248,12 +248,12 @@ struct OrderData { double swap; // Order cumulative swap. datetime time_closed; // Closed time. datetime time_done; // Execution/cancellation time. - long time_done_msc; // The time of execution/cancellation time (in msc). + int64 time_done_msc; // The time of execution/cancellation time (in msc). datetime time_expiration; // Order expiration time (for the orders of ORDER_TIME_SPECIFIED type). datetime time_last_refresh; // Last refresh of order values. datetime time_last_update; // Last update of order stops. datetime time_setup; // Setup time. - long time_setup_msc; // The time of placing the order (in msc). + int64 time_setup_msc; // The time of placing the order (in msc). double total_fees; // Total fees. double sl; // Current Stop loss level of the order. double tp; // Current Take Profit level of the order. @@ -373,13 +373,13 @@ struct OrderData { case ORDER_STATE: return (T)state; case ORDER_TIME_EXPIRATION: - return (T)(long)time_expiration; + return (T)(int64)time_expiration; case ORDER_TIME_DONE: - return (T)(long)time_done; + return (T)(int64)time_done; case ORDER_TIME_DONE_MSC: return (T)time_done_msc; case ORDER_TIME_SETUP: - return (T)(long)time_setup; + return (T)(int64)time_setup; case ORDER_TIME_SETUP_MSC: return (T)time_setup_msc; case ORDER_TYPE_FILLING: @@ -507,10 +507,10 @@ struct OrderData { profit = (double)_value; return; case ORDER_PROP_REASON_CLOSE: - reason_close = (ENUM_ORDER_REASON_CLOSE)(long)_value; + reason_close = (ENUM_ORDER_REASON_CLOSE)(int64)_value; return; case ORDER_PROP_TICKET: - ticket = (unsigned long)_value; + ticket = (uint64)_value; return; case ORDER_PROP_TIME_CLOSED: time_closed = (datetime)_value; @@ -559,7 +559,7 @@ struct OrderData { } SetUserError(ERR_INVALID_PARAMETER); } - void Set(ENUM_ORDER_PROPERTY_INTEGER _prop_name, long _value) { + void Set(ENUM_ORDER_PROPERTY_INTEGER _prop_name, int64 _value) { switch (_prop_name) { case ORDER_TYPE: type = (ENUM_ORDER_TYPE)_value; @@ -626,7 +626,7 @@ struct OrderData { } /* template - T Set(long _prop_name) { + T Set(int64 _prop_name) { // MQL4 back-compatibility version for non-enum properties. return Set((ENUM_ORDER_PROPERTY_INTEGER)_prop_name); } @@ -878,7 +878,7 @@ struct OrderStatic { * @return * Identifying (magic) number of the currently selected order/position. */ - static long MagicNumber() { + static int64 MagicNumber() { #ifdef __MQL4__ return ::OrderMagicNumber(); #else @@ -945,7 +945,7 @@ struct OrderStatic { * - https://docs.mql4.com/trading/orderticket * - https://www.mql5.com/en/docs/trading/positiongetticket */ - static unsigned long Ticket() { + static uint64 Ticket() { #ifdef __MQL4__ return ::OrderTicket(); #else diff --git a/Platform/OrderQuery.h b/Platform/OrderQuery.h index c76f485e5..ad27efbbc 100644 --- a/Platform/OrderQuery.h +++ b/Platform/OrderQuery.h @@ -38,7 +38,7 @@ class OrderQuery : public Dynamic { protected: - DictStruct> *orders; + DictStruct> *orders; public: // Enumeration of comparison operators. @@ -53,7 +53,7 @@ class OrderQuery : public Dynamic { }; OrderQuery() {} - OrderQuery(DictStruct> &_orders) : orders(GetPointer(_orders)) {} + OrderQuery(DictStruct> &_orders) : orders(GetPointer(_orders)) {} /** * Calculates sum of order's value based on the property's enum. @@ -67,7 +67,7 @@ class OrderQuery : public Dynamic { template T CalcSumByProp(E _prop) { T _sum = 0; - for (DictStructIterator> iter = orders PTR_DEREF Begin(); iter.IsValid(); ++iter) { + for (DictStructIterator> iter = orders PTR_DEREF Begin(); iter.IsValid(); ++iter) { _sum += iter.Value() REF_DEREF Get(_prop); } return _sum; @@ -82,7 +82,7 @@ class OrderQuery : public Dynamic { template T CalcSumByPropWithCond(E _prop, ECT _prop_cond_type, ECV _prop_cond_value) { T _sum = 0; - for (DictStructIterator> iter = orders PTR_DEREF Begin(); iter.IsValid(); ++iter) { + for (DictStructIterator> iter = orders PTR_DEREF Begin(); iter.IsValid(); ++iter) { Order *_order = iter.Value().Ptr(); if (_order PTR_DEREF Get(_prop_cond_type) == _prop_cond_value) { _sum += _order PTR_DEREF Get(_prop); @@ -105,7 +105,7 @@ class OrderQuery : public Dynamic { return _order_ref_found; } _order_ref_found = orders PTR_DEREF Begin().Value(); - for (DictStructIterator> iter = orders PTR_DEREF Begin(); iter.IsValid(); ++iter) { + for (DictStructIterator> iter = orders PTR_DEREF Begin(); iter.IsValid(); ++iter) { Ref _order_ref = iter.Value(); if (Compare(_order_ref REF_DEREF Get(_prop), _op, _order_ref_found REF_DEREF Get(_prop))) { _order_ref_found = _order_ref; @@ -127,7 +127,7 @@ class OrderQuery : public Dynamic { if (orders PTR_DEREF Size() == 0) { return _order_ref_found; } - for (DictStructIterator> iter = orders PTR_DEREF Begin(); iter.IsValid(); ++iter) { + for (DictStructIterator> iter = orders PTR_DEREF Begin(); iter.IsValid(); ++iter) { Ref _order_ref = iter.Value(); if (Compare(_order_ref REF_DEREF Get(_prop), _op, _value)) { _order_ref_found = _order_ref; @@ -197,5 +197,5 @@ class OrderQuery : public Dynamic { * @return * Returns a pointer to the new instance. */ - static OrderQuery *GetInstance(DictStruct> &_orders) { return new OrderQuery(_orders); } + static OrderQuery *GetInstance(DictStruct> &_orders) { return new OrderQuery(_orders); } }; diff --git a/Platform/Orders.h b/Platform/Orders.h index 42279c9fd..dceeb1d7a 100644 --- a/Platform/Orders.h +++ b/Platform/Orders.h @@ -124,9 +124,9 @@ class Orders { /** * Finds order in the selected pool. */ - Order *SelectOrder(unsigned long _ticket) { + Order *SelectOrder(uint64 _ticket) { for (unsigned int _pos = ArraySize(orders); _pos >= 0; _pos--) { - if (orders[_pos] PTR_DEREF Get(ORDER_PROP_TICKET) == _ticket) { + if (orders[_pos] PTR_DEREF Get(ORDER_PROP_TICKET) == _ticket) { return orders[_pos]; } } @@ -136,7 +136,7 @@ class Orders { /** * Select order object by ticket. */ - Order *SelectByTicket(unsigned long _ticket) { + Order *SelectByTicket(uint64 _ticket) { Order *_order = SelectOrder(_ticket); if (_order != NULL) { return _order; @@ -155,7 +155,7 @@ class Orders { /** * Calculate number of lots for open positions. */ - static double GetOpenLots(string _symbol = NULL_STRING, long magic_number = 0, int magic_range = 0) { + static double GetOpenLots(string _symbol = NULL_STRING, int64 magic_number = 0, int magic_range = 0) { double total_lots = 0; // @todo: Convert to MQL5. _symbol = _symbol != NULL_STRING ? _symbol : _Symbol; diff --git a/Platform/Platform.enum.h b/Platform/Platform.enum.h new file mode 100644 index 000000000..edd657855 --- /dev/null +++ b/Platform/Platform.enum.h @@ -0,0 +1,44 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + * + */ + +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + +#ifndef __MQL4__ +// @note Values differ from the documentation at +// https://www.mql5.com/en/docs/matrix/matrix_initialization/matrix_copyticks +// @see https://www.mql5.com/en/forum/448933 +enum ENUM_COPY_TICKS { + COPY_TICKS_INFO = 1, + COPY_TICKS_TRADE = 2, + COPY_TICKS_ALL = 3, + COPY_TICKS_VERTICAL = 32768, + COPY_TICKS_TIME_MS = 65536, + COPY_TICKS_BID = 131072, + COPY_TICKS_ASK = 262144, + COPY_TICKS_LAST = 524288, + COPY_TICKS_VOLUME = 1048576, + COPY_TICKS_FLAGS = 2097152 +}; +#endif \ No newline at end of file diff --git a/Platform/Platform.extern.h b/Platform/Platform.extern.h index b9c93db05..538725218 100644 --- a/Platform/Platform.extern.h +++ b/Platform/Platform.extern.h @@ -80,7 +80,12 @@ extern int CopyLow(string symbol_name, ENUM_TIMEFRAMES timeframe, int start_pos, extern int CopyClose(string symbol_name, ENUM_TIMEFRAMES timeframe, int start_pos, int count, ARRAY_REF(double, close_array)); -extern unsigned int64 PositionGetTicket(int _index); +extern double iOpen(string symbol, int timeframe, int shift); +extern double iHigh(string symbol, int timeframe, int shift); +extern double iLow(string symbol, int timeframe, int shift); +extern double iClose(string symbol, int timeframe, int shift); + +extern uint64 PositionGetTicket(int _index); extern int64 PositionGetInteger(ENUM_POSITION_PROPERTY_INTEGER property_id); @@ -90,13 +95,13 @@ extern string PositionGetString(ENUM_POSITION_PROPERTY_STRING property_id); extern int HistoryDealsTotal(); -extern unsigned int64 HistoryDealGetTicket(int index); +extern uint64 HistoryDealGetTicket(int index); -extern int64 HistoryDealGetInteger(unsigned int64 ticket_number, ENUM_DEAL_PROPERTY_INTEGER property_id); +extern int64 HistoryDealGetInteger(uint64 ticket_number, ENUM_DEAL_PROPERTY_INTEGER property_id); -extern double HistoryDealGetDouble(unsigned int64 ticket_number, ENUM_DEAL_PROPERTY_DOUBLE property_id); +extern double HistoryDealGetDouble(uint64 ticket_number, ENUM_DEAL_PROPERTY_DOUBLE property_id); -extern string HistoryDealGetString(unsigned int64 ticket_number, ENUM_DEAL_PROPERTY_STRING property_id); +extern string HistoryDealGetString(uint64 ticket_number, ENUM_DEAL_PROPERTY_STRING property_id); extern bool OrderSelect(int index); @@ -108,25 +113,25 @@ extern bool OrderSend(const MqlTradeRequest& request, MqlTradeResult& result); extern bool OrderCheck(const MqlTradeRequest& request, MqlTradeCheckResult& result); -extern unsigned int64 OrderGetTicket(int index); +extern uint64 OrderGetTicket(int index); -extern unsigned int64 HistoryOrderGetTicket(int index); +extern uint64 HistoryOrderGetTicket(int index); extern bool HistorySelectByPosition(int64 position_id); -extern bool HistoryDealSelect(unsigned int64 ticket); +extern bool HistoryDealSelect(uint64 ticket); extern int64 OrderGetInteger(ENUM_ORDER_PROPERTY_INTEGER property_id); -extern int64 HistoryOrderGetInteger(unsigned int64 ticket_number, ENUM_ORDER_PROPERTY_INTEGER property_id); +extern int64 HistoryOrderGetInteger(uint64 ticket_number, ENUM_ORDER_PROPERTY_INTEGER property_id); extern double OrderGetDouble(ENUM_ORDER_PROPERTY_DOUBLE property_id); -extern double HistoryOrderGetDouble(unsigned int64 ticket_number, ENUM_ORDER_PROPERTY_DOUBLE property_id); +extern double HistoryOrderGetDouble(uint64 ticket_number, ENUM_ORDER_PROPERTY_DOUBLE property_id); string OrderGetString(ENUM_ORDER_PROPERTY_STRING property_id); -string HistoryOrderGetString(unsigned int64 ticket_number, ENUM_ORDER_PROPERTY_STRING property_id); +string HistoryOrderGetString(uint64 ticket_number, ENUM_ORDER_PROPERTY_STRING property_id); extern int PositionsTotal(); diff --git a/Platform/Platform.h b/Platform/Platform.h index 67d33153b..9fbbc7ae9 100644 --- a/Platform/Platform.h +++ b/Platform/Platform.h @@ -78,10 +78,10 @@ class Platform { static bool time_clear_flags; // List of added indicators. - static DictStruct> indis; + static DictStruct> indis; // List of default Candle/Tick indicators. - static DictStruct> indis_dflt; + static DictStruct> indis_dflt; // Result of the last tick. static bool last_tick_result; @@ -121,7 +121,7 @@ class Platform { // Checking starting periods and updating time to current one. time_flags = time.GetStartedPeriods(); - DictStructIterator> _iter; + DictStructIterator> _iter; last_tick_result = false; @@ -173,7 +173,7 @@ class Platform { /** * Returns dictionary of added indicators (keyed by unique id). */ - static DictStruct> *GetIndicators() { return &indis; } + static DictStruct> *GetIndicators() { return &indis; } /** * Adds indicator to be processed by platform. @@ -181,7 +181,7 @@ class Platform { static void Add(IndicatorData *_indi) { Ref _ref = _indi; - DictStructIterator> _iter; + DictStructIterator> _iter; for (_iter = indis_dflt.Begin(); _iter.IsValid(); ++_iter) { if (_iter.Value() == _ref) { Alert("Warning: ", _indi PTR_DEREF GetFullName(), @@ -411,7 +411,7 @@ class Platform { */ static string IndicatorsToString(int _shift = 0) { string _result; - for (DictStructIterator> _iter = indis.Begin(); _iter.IsValid(); ++_iter) { + for (DictStructIterator> _iter = indis.Begin(); _iter.IsValid(); ++_iter) { IndicatorDataEntry _entry = _iter.Value() REF_DEREF GetEntry(_shift); _result += _iter.Value() REF_DEREF GetFullName() + " = " + _entry.ToString() + "\n"; } @@ -492,8 +492,8 @@ bool Platform::time_clear_flags = true; int Platform::global_tick_index = 0; string Platform::symbol = PLATFORM_WRONG_SYMBOL; ENUM_TIMEFRAMES Platform::period = PLATFORM_WRONG_TIMEFRAME; -DictStruct> Platform::indis; -DictStruct> Platform::indis_dflt; +DictStruct> Platform::indis; +DictStruct> Platform::indis_dflt; #ifndef __MQL__ // Following methods must be there are they're externed in Platform.extern.h @@ -517,7 +517,7 @@ int CopyBuffer(int indicator_handle, int buffer_num, int start_pos, int count, A return 0; } -unsigned int64 PositionGetTicket(int _index) { +uint64 PositionGetTicket(int _index) { Print("Not yet implemented: ", __FUNCTION__, " returns 0."); return 0; } @@ -542,22 +542,22 @@ int HistoryDealsTotal() { return 0; } -unsigned int64 HistoryDealGetTicket(int index) { +uint64 HistoryDealGetTicket(int index) { Print("Not yet implemented: ", __FUNCTION__, " returns 0."); return 0; } -int64 HistoryDealGetInteger(unsigned int64 ticket_number, ENUM_DEAL_PROPERTY_INTEGER property_id) { +int64 HistoryDealGetInteger(uint64 ticket_number, ENUM_DEAL_PROPERTY_INTEGER property_id) { Print("Not yet implemented: ", __FUNCTION__, " returns 0."); return 0; } -double HistoryDealGetDouble(unsigned int64 ticket_number, ENUM_DEAL_PROPERTY_DOUBLE property_id) { +double HistoryDealGetDouble(uint64 ticket_number, ENUM_DEAL_PROPERTY_DOUBLE property_id) { Print("Not yet implemented: ", __FUNCTION__, " returns 0."); return 0; } -string HistoryDealGetString(unsigned int64 ticket_number, ENUM_DEAL_PROPERTY_STRING property_id) { +string HistoryDealGetString(uint64 ticket_number, ENUM_DEAL_PROPERTY_STRING property_id) { Print("Not yet implemented: ", __FUNCTION__, " returns empty string."); return 0; } @@ -587,12 +587,12 @@ bool OrderCheck(const MqlTradeRequest &request, MqlTradeCheckResult &result) { return false; } -unsigned int64 OrderGetTicket(int index) { +uint64 OrderGetTicket(int index) { Print("Not yet implemented: ", __FUNCTION__, " returns 0."); return 0; } -unsigned int64 HistoryOrderGetTicket(int index) { +uint64 HistoryOrderGetTicket(int index) { Print("Not yet implemented: ", __FUNCTION__, " returns 0."); return 0; } @@ -602,7 +602,7 @@ bool HistorySelectByPosition(int64 position_id) { return false; } -bool HistoryDealSelect(unsigned int64 ticket) { +bool HistoryDealSelect(uint64 ticket) { Print("Not yet implemented: ", __FUNCTION__, " returns false."); return false; } @@ -612,7 +612,7 @@ int64 OrderGetInteger(ENUM_ORDER_PROPERTY_INTEGER property_id) { return 0; } -int64 HistoryOrderGetInteger(unsigned int64 ticket_number, ENUM_ORDER_PROPERTY_INTEGER property_id) { +int64 HistoryOrderGetInteger(uint64 ticket_number, ENUM_ORDER_PROPERTY_INTEGER property_id) { Print("Not yet implemented: ", __FUNCTION__, " returns 0."); return 0; } @@ -622,7 +622,7 @@ double OrderGetDouble(ENUM_ORDER_PROPERTY_DOUBLE property_id) { return 0; } -double HistoryOrderGetDouble(unsigned int64 ticket_number, ENUM_ORDER_PROPERTY_DOUBLE property_id) { +double HistoryOrderGetDouble(uint64 ticket_number, ENUM_ORDER_PROPERTY_DOUBLE property_id) { Print("Not yet implemented: ", __FUNCTION__, " returns 0."); return 0; } @@ -632,7 +632,7 @@ string OrderGetString(ENUM_ORDER_PROPERTY_STRING property_id) { return 0; } -string HistoryOrderGetString(unsigned int64 ticket_number, ENUM_ORDER_PROPERTY_STRING property_id) { +string HistoryOrderGetString(uint64 ticket_number, ENUM_ORDER_PROPERTY_STRING property_id) { Print("Not yet implemented: ", __FUNCTION__, " returns empty string."); return 0; } @@ -687,6 +687,26 @@ int CopyRealVolume(string symbol_name, ENUM_TIMEFRAMES timeframe, int start_pos, return 0; } +double iOpen(string symbol, int timeframe, int shift) { + Print("Not yet implemented: ", __FUNCTION__, " returns 1.0."); + return 1.0; +} + +double iHigh(string symbol, int timeframe, int shift) { + Print("Not yet implemented: ", __FUNCTION__, " returns 1.0."); + return 1.0; +} + +double iLow(string symbol, int timeframe, int shift) { + Print("Not yet implemented: ", __FUNCTION__, " returns 1.0."); + return 1.0; +} + +double iClose(string symbol, int timeframe, int shift) { + Print("Not yet implemented: ", __FUNCTION__, " returns 1.0."); + return 1.0; +} + int ChartID() { return Platform::ChartID(); } bool OrderCalcMargin(ENUM_ORDER_TYPE _action, string _symbol, double _volume, double _price, double &_margin) { diff --git a/Platform/Plot.h b/Platform/Plot.h index d2f8aa64e..427f488cb 100644 --- a/Platform/Plot.h +++ b/Platform/Plot.h @@ -73,14 +73,14 @@ class Plot; class Plot : public Object { protected: // Variables. - long chart_id; + int64 chart_id; // Class variables. public: /** * Class constructor. */ - Plot(long _chart_id = 0) : chart_id(_chart_id != 0 ? _chart_id : ::ChartID()) {} + Plot(int64 _chart_id = 0) : chart_id(_chart_id != 0 ? _chart_id : ::ChartID()) {} /* Graphic object related methods */ @@ -92,7 +92,7 @@ class Plot : public Object { * @return * Name of the object is returned in case of success. */ - static string ObjectName(long _chart_id, int _pos, int _sub_window = -1, int _type = -1) { + static string ObjectName(int64 _chart_id, int _pos, int _sub_window = -1, int _type = -1) { return ::ObjectName(_chart_id, _pos, _sub_window, _type); } static string ObjectName(int _index) { return Plot::ObjectName(0, _index); } @@ -104,7 +104,7 @@ class Plot : public Object { * @return * The number of objects. */ - static int ObjectsTotal(long chart_id, int type = EMPTY, int window = -1) { + static int ObjectsTotal(int64 chart_id, int type = EMPTY, int window = -1) { #ifdef __MQL4__ return ::ObjectsTotal(chart_id, window, type); #else @@ -159,7 +159,7 @@ class Plot : public Object { * - https://docs.mql4.com/objects/objectset * - https://docs.mql4.com/constants/objectconstants/enum_object_property */ - static bool ObjectSet(string name, int prop_id, double prop_value, long chart_id = 0) { + static bool ObjectSet(string name, int prop_id, double prop_value, int64 chart_id = 0) { #ifdef __MQL4__ return ::ObjectSet(name, prop_id, prop_value); #else // __MQL5__ @@ -170,10 +170,10 @@ class Plot : public Object { return ObjectSetDouble(chart_id, name, (ENUM_OBJECT_PROPERTY_DOUBLE)prop_id, (double)prop_value); case OBJPROP_RAY: // Boolean value to set/get ray flag of object. - return ObjectSetInteger(chart_id, name, OBJPROP_RAY_RIGHT, (long)prop_value); + return ObjectSetInteger(chart_id, name, OBJPROP_RAY_RIGHT, (int64)prop_value); case OBJPROP_FIBOLEVELS: // Integer value to set/get Fibonacci object level count. Can be from 0 to 32. - return ObjectSetInteger(chart_id, name, OBJPROP_LEVELS, (long)prop_value); + return ObjectSetInteger(chart_id, name, OBJPROP_LEVELS, (int64)prop_value); case OBJPROP_ARROWCODE: // Arrow code for the Arrow object (char). case OBJPROP_BACK: // Boolean value to set/get background drawing flag for object. case OBJPROP_COLOR: // Color value to set/get object color. @@ -188,7 +188,7 @@ class Plot : public Object { case OBJPROP_WIDTH: // Integer value to set/get object line width. Can be from 1 to 5. case OBJPROP_XDISTANCE: // The distance in pixels along the X axis from the binding corner (int). case OBJPROP_YDISTANCE: // The distance in pixels along the Y axis from the binding corner (int). - return ObjectSetInteger(chart_id, name, (ENUM_OBJECT_PROPERTY_INTEGER)prop_id, (long)prop_value); + return ObjectSetInteger(chart_id, name, (ENUM_OBJECT_PROPERTY_INTEGER)prop_id, (int64)prop_value); default: break; } @@ -197,13 +197,13 @@ class Plot : public Object { switch (prop_id) { // Datetime value to set/get first coordinate time part. case OBJPROP_TIME1: - return ObjectSetInteger(chart_id, name, OBJPROP_TIME, (long)prop_value); + return ObjectSetInteger(chart_id, name, OBJPROP_TIME, (int64)prop_value); // Datetime value to set/get second coordinate time part. case OBJPROP_TIME2: - return ObjectSetInteger(chart_id, name, OBJPROP_TIME, 1, (long)prop_value); + return ObjectSetInteger(chart_id, name, OBJPROP_TIME, 1, (int64)prop_value); // Datetime value to set/get third coordinate time part. case OBJPROP_TIME3: - return ObjectSetInteger(chart_id, name, OBJPROP_TIME, 2, (long)prop_value); + return ObjectSetInteger(chart_id, name, OBJPROP_TIME, 2, (int64)prop_value); // Double value to set/get first coordinate price part. case OBJPROP_PRICE1: return ObjectSetDouble(chart_id, name, OBJPROP_PRICE, (double)prop_value); @@ -224,7 +224,7 @@ class Plot : public Object { /** * Creates an object with the specified name, type, and the initial coordinates. */ - static bool ObjectCreate(long _cid, string _name, ENUM_OBJECT _otype, int _swindow, datetime _t1, double _p1) { + static bool ObjectCreate(int64 _cid, string _name, ENUM_OBJECT _otype, int _swindow, datetime _t1, double _p1) { #ifdef __MQL4__ // https://docs.mql4.com/objects/objectcreate return ::ObjectCreate(_name, _otype, _swindow, _t1, _p1); @@ -233,7 +233,7 @@ class Plot : public Object { return ::ObjectCreate(_cid, _name, _otype, _swindow, _t1, _p1); #endif } - static bool ObjectCreate(long _cid, string _name, ENUM_OBJECT _otype, int _swindow, datetime _t1, double _p1, + static bool ObjectCreate(int64 _cid, string _name, ENUM_OBJECT _otype, int _swindow, datetime _t1, double _p1, datetime _t2, double _p2) { #ifdef __MQL4__ // https://docs.mql4.com/objects/objectcreate @@ -258,7 +258,7 @@ class Plot : public Object { /** * Deletes object via name. */ - static bool ObjectDelete(long chart_id, string name) { + static bool ObjectDelete(int64 chart_id, string name) { #ifdef __MQL4__ // https://docs.mql4.com/objects/objectdelete return ::ObjectDelete(name); diff --git a/Platform/Terminal.h b/Platform/Terminal.h index f720c9e00..09f308823 100644 --- a/Platform/Terminal.h +++ b/Platform/Terminal.h @@ -874,8 +874,8 @@ class Terminal : public Object { * Returns true when the condition is met. */ bool CheckCondition(ENUM_TERMINAL_CONDITION _cond, ARRAY_REF(DataParamEntry, _args)) { - // long _arg1l = ArraySize(_args) > 0 ? DataParamEntry::ToInteger(_args[0]) : WRONG_VALUE; - // long _arg2l = ArraySize(_args) > 1 ? DataParamEntry::ToInteger(_args[1]) : WRONG_VALUE; + // int64 _arg1l = ArraySize(_args) > 0 ? DataParamEntry::ToInteger(_args[0]) : WRONG_VALUE; + // int64 _arg2l = ArraySize(_args) > 1 ? DataParamEntry::ToInteger(_args[1]) : WRONG_VALUE; switch (_cond) { case TERMINAL_COND_IS_CONNECTED: return !IsConnected(); @@ -884,7 +884,7 @@ class Terminal : public Object { return false; } } - bool CheckCondition(ENUM_TERMINAL_CONDITION _cond, long _arg1) { + bool CheckCondition(ENUM_TERMINAL_CONDITION _cond, int64 _arg1) { ARRAY(DataParamEntry, _args); DataParamEntry _param1 = _arg1; ArrayPushObject(_args, _param1); @@ -908,9 +908,9 @@ class Terminal : public Object { * Returns true when the condition is met. */ bool ExecuteAction(ENUM_TERMINAL_ACTION _action, ARRAY_REF(MqlParam, _args)) { - // long _arg1l = ArraySize(_args) > 0 ? DataParamEntry::ToInteger(_args[0]) : WRONG_VALUE; - // long _arg2l = ArraySize(_args) > 1 ? DataParamEntry::ToInteger(_args[1]) : WRONG_VALUE; - // long _arg3l = ArraySize(_args) > 2 ? DataParamEntry::ToInteger(_args[2]) : WRONG_VALUE; + // int64 _arg1l = ArraySize(_args) > 0 ? DataParamEntry::ToInteger(_args[0]) : WRONG_VALUE; + // int64 _arg2l = ArraySize(_args) > 1 ? DataParamEntry::ToInteger(_args[1]) : WRONG_VALUE; + // int64 _arg3l = ArraySize(_args) > 2 ? DataParamEntry::ToInteger(_args[2]) : WRONG_VALUE; switch (_action) { case TERMINAL_ACTION_CRASH: delete THIS_PTR; diff --git a/Platform/tests/Order.test.mq5 b/Platform/tests/Order.test.mq5 index 99f10111b..c80c3c14e 100644 --- a/Platform/tests/Order.test.mq5 +++ b/Platform/tests/Order.test.mq5 @@ -25,12 +25,12 @@ */ // Includes. -#include "../Chart/Chart.h" -#include "../Order.h" -#include "../Platform.h" #include "../../Serializer/SerializerConverter.h" #include "../../Serializer/SerializerJson.h" #include "../../Test.mqh" +#include "../Chart/Chart.h" +#include "../Order.h" +#include "../Platform.h" // Global defines. #define MAX_ORDERS 10 @@ -86,7 +86,7 @@ void OnTick() { break; } assertFalseOrExit(_order.IsOpen(true), StringFormat("Order %d not closed!", _order.OrderTicket())); - assertTrueOrExit(_order.Get(ORDER_PROP_TIME_CLOSED) > 0, + assertTrueOrExit(_order.Get(ORDER_PROP_TIME_CLOSED) > 0, StringFormat("Order %d close time not correct!", _order.OrderTicket())); } bar_processed++; diff --git a/Platform/tests/OrderQuery.test.mq5 b/Platform/tests/OrderQuery.test.mq5 index 0e7e02065..df761c664 100644 --- a/Platform/tests/OrderQuery.test.mq5 +++ b/Platform/tests/OrderQuery.test.mq5 @@ -25,13 +25,13 @@ */ // Includes. -#include "../OrderQuery.h" #include "../../Test.mqh" +#include "../OrderQuery.h" bool Test01() { bool _result = true; // Initialize orders. - DictStruct> orders; + DictStruct> orders; // Populate orders. for (int i = -10; i <= 10; i++) { OrderData _odata; diff --git a/Profiler.mqh b/Profiler.mqh index fed207d91..685bba105 100644 --- a/Profiler.mqh +++ b/Profiler.mqh @@ -48,7 +48,7 @@ class Profiler { public: // Variables. static Collection *timers; - static unsigned long min_time; + static uint64 min_time; /* Class methods */ @@ -62,4 +62,4 @@ class Profiler { // Initialize static global variables. Collection *Profiler::timers = new Collection(MQLInfoString(MQL_PROGRAM_NAME)); -unsigned long Profiler::min_time = 1; +uint64 Profiler::min_time = 1; diff --git a/Serializer/SerializerBinary.h b/Serializer/SerializerBinary.h index e5e94e9e5..7edc3ae48 100644 --- a/Serializer/SerializerBinary.h +++ b/Serializer/SerializerBinary.h @@ -38,7 +38,7 @@ enum ENUM_SERIALIZER_BINARY_FLAGS { SERIALIZER_BINARY_INCLUDE_VERSION }; union SerializerBinaryValue { unsigned char Bytes[8]; double Double; - long Long; + int64 Long; int Integer; short Short; }; diff --git a/Serializer/SerializerConversions.h b/Serializer/SerializerConversions.h index 20f1269a1..61f65548c 100644 --- a/Serializer/SerializerConversions.h +++ b/Serializer/SerializerConversions.h @@ -31,9 +31,9 @@ #endif #include "../Convert.extern.h" +#include "../Refs.struct.h" #include "../Storage/DateTime.extern.h" #include "../Storage/Object.h" -#include "../Refs.struct.h" class SerializerConversions { public: @@ -53,7 +53,7 @@ class SerializerConversions { return string(includeQuotes ? "\"" : "") + IntegerToString(value) + (includeQuotes ? "\"" : ""); } - static string ValueToString(long value, bool includeQuotes = false, bool escape = true, int _fp_precision = 8) { + static string ValueToString(int64 value, bool includeQuotes = false, bool escape = true, int _fp_precision = 8) { return string(includeQuotes ? "\"" : "") + IntegerToString(value) + (includeQuotes ? "\"" : ""); } diff --git a/Serializer/SerializerNodeParam.h b/Serializer/SerializerNodeParam.h index c5718a179..14a7268fd 100644 --- a/Serializer/SerializerNodeParam.h +++ b/Serializer/SerializerNodeParam.h @@ -49,7 +49,7 @@ class SerializerNodeParam { */ union USerializerNodeValue { bool _bool; - long _long; + int64 _long; double _double; } _integral; @@ -72,12 +72,12 @@ class SerializerNodeParam { /** * Returns new SerializerNodeParam object from given source value. */ - static SerializerNodeParam* FromBool(long value); + static SerializerNodeParam* FromBool(int64 value); /** * Returns new SerializerNodeParam object from given source value. */ - static SerializerNodeParam* FromLong(long value); + static SerializerNodeParam* FromLong(int64 value); /** * Returns new SerializerNodeParam object from given source value. @@ -122,7 +122,7 @@ class SerializerNodeParam { /** * Returns new SerializerNodeParam object from given source value. */ - static SerializerNodeParam* FromValue(long value) { return FromLong(value); } + static SerializerNodeParam* FromValue(int64 value) { return FromLong(value); } /** * Returns new SerializerNodeParam object from given source value. @@ -147,7 +147,7 @@ class SerializerNodeParam { /** * Returns new SerializerNodeParam object from given source value. */ - static SerializerNodeParam* FromValue(unsigned long value) { return FromLong(value); } + static SerializerNodeParam* FromValue(uint64 value) { return FromLong(value); } /** * Returns new SerializerNodeParam object from given source value. @@ -182,7 +182,7 @@ class SerializerNodeParam { */ SerializerNodeParamType GetType() { return _type; } - long ToBool() { + int64 ToBool() { switch (_type) { case SerializerNodeParamBool: return _integral._bool; @@ -216,18 +216,18 @@ class SerializerNodeParam { return 0; } - long ToLong() { + int64 ToLong() { switch (_type) { case SerializerNodeParamBool: return _integral._bool ? 1 : 0; case SerializerNodeParamLong: return _integral._long; case SerializerNodeParamDouble: - return (long)_integral._double; + return (int64)_integral._double; case SerializerNodeParamString: return StringToInteger(_string); default: - Alert("Internal Error. Cannot convert source type to long"); + Alert("Internal Error. Cannot convert source type to int64"); } return 0; @@ -286,7 +286,7 @@ class SerializerNodeParam { int ConvertTo(int) { return ToInt(); } - long ConvertTo(long) { return ToInt(); } + int64 ConvertTo(int64) { return ToInt(); } float ConvertTo(float) { return ToFloat(); } @@ -298,7 +298,7 @@ class SerializerNodeParam { /** * Returns new SerializerNodeParam object from given source value. */ -SerializerNodeParam* SerializerNodeParam::FromBool(long value) { +SerializerNodeParam* SerializerNodeParam::FromBool(int64 value) { SerializerNodeParam* param = new SerializerNodeParam(); PTR_ATTRIB(param, _type) = SerializerNodeParamBool; PTR_ATTRIB(param, _integral)._bool = value; @@ -308,7 +308,7 @@ SerializerNodeParam* SerializerNodeParam::FromBool(long value) { /** * Returns new SerializerNodeParam object from given source value. */ -SerializerNodeParam* SerializerNodeParam::FromLong(long value) { +SerializerNodeParam* SerializerNodeParam::FromLong(int64 value) { SerializerNodeParam* param = new SerializerNodeParam(); PTR_ATTRIB(param, _type) = SerializerNodeParamLong; PTR_ATTRIB(param, _integral)._long = value; diff --git a/Stats.mqh b/Stats.mqh index 0580ae986..14c455844 100644 --- a/Stats.mqh +++ b/Stats.mqh @@ -34,8 +34,8 @@ */ class Stats { public: - unsigned long total_bars; - unsigned long total_ticks; + uint64 total_bars; + uint64 total_ticks; int curr_period; // int custom_int[]; // double custom_dbl[]; @@ -60,7 +60,7 @@ class Stats { * Update stats on tick. */ void OnTick() { - static long _last_bar_time = 0; + static int64 _last_bar_time = 0; total_ticks++; if (_last_bar_time != Platform::Timestamp()) { _last_bar_time = Platform::Timestamp(); @@ -78,22 +78,22 @@ class Stats { /** * Get number of counted bars. */ - unsigned long GetTotalBars() { return (total_bars); } + uint64 GetTotalBars() { return (total_bars); } /** * Get number of counted ticks. */ - unsigned long GetTotalTicks() { return (total_ticks); } + uint64 GetTotalTicks() { return (total_ticks); } /** * Get number of ticks per bar. */ - unsigned long GetTicksPerBar() { return (total_bars > 0 ? (total_ticks / total_bars) : 0); } + uint64 GetTicksPerBar() { return (total_bars > 0 ? (total_ticks / total_bars) : 0); } /** * Get number of ticks per minute. */ - unsigned long GetTicksPerMin() { return (total_bars > 0 ? (total_ticks / total_bars / curr_period) : 0); } + uint64 GetTicksPerMin() { return (total_bars > 0 ? (total_ticks / total_bars / curr_period) : 0); } /** * Get number of ticks per second. @@ -103,10 +103,10 @@ class Stats { /** * Get number of ticks per given time period. */ - unsigned long GetTicksPerPeriod(int period = PERIOD_H1) { return (GetTicksPerMin() * period); } + uint64 GetTicksPerPeriod(int period = PERIOD_H1) { return (GetTicksPerMin() * period); } /** * Get number of bars per given time period. */ - unsigned long GetBarsPerPeriod(int period = PERIOD_H1) { return (total_bars / period); } + uint64 GetBarsPerPeriod(int period = PERIOD_H1) { return (total_bars / period); } }; diff --git a/Std.h b/Std.h index f5d05f864..a27bef3b4 100644 --- a/Std.h +++ b/Std.h @@ -61,6 +61,7 @@ #define nullptr NULL #define REF_DEREF .Ptr(). #define int64 long +#define uint64 unsigned long #define VOID_DATA(N) void*& N[] #else #define THIS_ATTR this-> @@ -74,6 +75,7 @@ #define MAKE_REF_FROM_PTR(TYPE, NAME, PTR) TYPE& NAME = PTR #define REF_DEREF .Ptr()-> #define int64 long long +#define uint64 unsigned long long #define VOID_DATA(N) void* N #endif diff --git a/Storage/Array.h b/Storage/Array.h index 392ad263a..44fa76f47 100644 --- a/Storage/Array.h +++ b/Storage/Array.h @@ -555,12 +555,12 @@ static int GetLowestArrDoubleValue(double& arr[][], int key) { * - https://www.mql5.com/en/docs/array/arrayprint */ template - void ArrayPrint(ARRAY_REF(T, _arr), // Printed array. - int _digits = 0, // Number of decimal places. - const string _dlm = NULL, // Separator of the structure field values. - long _start = 0, // First printed element index. - long _count = WHOLE_ARRAY, // Number of printed elements. - long _flags = NULL) { + void ArrayPrint(ARRAY_REF(T, _arr), // Printed array. + int _digits = 0, // Number of decimal places. + const string _dlm = NULL, // Separator of the structure field values. + int64 _start = 0, // First printed element index. + int64 _count = WHOLE_ARRAY, // Number of printed elements. + int64 _flags = NULL) { #ifdef __MQL5__ ::ArrayPrint(_arr, _digits, _dlm, _start, _count, _flags); #else diff --git a/Storage/Collection.h b/Storage/Collection.h index f88820a34..89d76d1ee 100644 --- a/Storage/Collection.h +++ b/Storage/Collection.h @@ -141,7 +141,7 @@ class Collection { /** * Returns object item by object id. */ - X *GetById(long _id) { + X *GetById(int64 _id) { int i; X *_object = GetSize() > 0 ? data[0].Ptr() : NULL; for (i = 0; i < ArraySize(data); i++) { diff --git a/Storage/Data.enum.h b/Storage/Data.enum.h index a3f7c1f19..212a57b2d 100644 --- a/Storage/Data.enum.h +++ b/Storage/Data.enum.h @@ -45,12 +45,12 @@ enum ENUM_DATATYPE { TYPE_DOUBLE, // double TYPE_FLOAT, // float TYPE_INT, // int - TYPE_LONG, // long + TYPE_LONG, // int64 TYPE_SHORT, // short TYPE_STRING, // string TYPE_UCHAR, // unsigned char TYPE_UINT, // unsigned int - TYPE_ULONG, // unsigned long + TYPE_ULONG, // uint64 TYPE_USHORT, // unsigned short }; #endif diff --git a/Storage/Data.struct.h b/Storage/Data.struct.h index 028f560be..dbc4a8563 100644 --- a/Storage/Data.struct.h +++ b/Storage/Data.struct.h @@ -54,7 +54,7 @@ struct MqlRates; struct MqlParam { ENUM_DATATYPE type; // Type of the input parameter, value of ENUM_DATATYPE. union { - long integer_value; // Field to store an integer type. + int64 integer_value; // Field to store an integer type. double double_value; // Field to store a double type. string string_value; // Field to store a string type. }; @@ -88,7 +88,7 @@ struct MqlParam { return THIS_REF; } - MqlParam(long _value) { + MqlParam(int64 _value) { type = ENUM_DATATYPE::TYPE_LONG; integer_value = _value; } @@ -122,7 +122,7 @@ struct MqlParam { struct DataParamEntry : public MqlParam { public: DataParamEntry() { type = InvalidEnumValue::value(); } - DataParamEntry(ENUM_DATATYPE _type, long _integer_value, double _double_value, string _string_value) { + DataParamEntry(ENUM_DATATYPE _type, int64 _integer_value, double _double_value, string _string_value) { type = _type; integer_value = _integer_value; double_value = _double_value; @@ -154,13 +154,13 @@ struct DataParamEntry : public MqlParam { type = TYPE_UINT; integer_value = _value; } - DataParamEntry(long _value) { + DataParamEntry(int64 _value) { type = TYPE_LONG; integer_value = _value; } - DataParamEntry(unsigned long _value) { + DataParamEntry(uint64 _value) { type = TYPE_ULONG; - integer_value = (long)_value; + integer_value = (int64)_value; } // Struct operators. @@ -188,13 +188,13 @@ struct DataParamEntry : public MqlParam { type = TYPE_UINT; integer_value = _value; } - void operator=(long _value) { + void operator=(int64 _value) { type = TYPE_LONG; integer_value = _value; } - void operator=(unsigned long _value) { + void operator=(uint64 _value) { type = TYPE_ULONG; - integer_value = (long)_value; + integer_value = (int64)_value; } bool operator==(const DataParamEntry &_s) { @@ -206,7 +206,7 @@ struct DataParamEntry : public MqlParam { /* DataParamEntry() {} - DataParamEntry(ENUM_DATATYPE _type, long _int, double _dbl, string _str) { + DataParamEntry(ENUM_DATATYPE _type, int64 _int, double _dbl, string _str) { type = _type; integer_value = _int; double_value = _dbl; @@ -277,10 +277,10 @@ struct DataParamEntry : public MqlParam { } /** - * Gets DataParamEntry struct based on the value of long type. + * Gets DataParamEntry struct based on the value of int64 type. * */ - static DataParamEntry FromValue(long _value) { + static DataParamEntry FromValue(int64 _value) { DataParamEntry _dpe; _dpe.type = TYPE_LONG; _dpe.integer_value = _value; @@ -332,7 +332,7 @@ struct DataParamEntry : public MqlParam { * Converts MqlParam struct to integer. * */ - static long ToInteger(MqlParam ¶m) { + static int64 ToInteger(MqlParam ¶m) { switch (param.type) { case TYPE_BOOL: return param.integer_value ? 1 : 0; diff --git a/Storage/Database.h b/Storage/Database.h index 65a96b745..4e200832f 100644 --- a/Storage/Database.h +++ b/Storage/Database.h @@ -216,7 +216,7 @@ class Database { _cols = StringSubstr(_cols, 0, StringLen(_cols) - 1); // Removes extra comma. #ifndef __MQL4__ if (DatabaseTransactionBegin(handle)) { - for (DictStructIterator iter = _bstruct.Begin(); iter.IsValid(); ++iter) { + for (DictStructIterator iter = _bstruct.Begin(); iter.IsValid(); ++iter) { _query = StringFormat("INSERT INTO %s(%s) VALUES (%s)", _name, _cols, iter.Value().ToCSV()); _result &= DatabaseExecute(handle, _query); } diff --git a/Storage/Dict/Buffer/Buffer.h b/Storage/Dict/Buffer/Buffer.h index 2f25b79f4..a372690ec 100644 --- a/Storage/Dict/Buffer/Buffer.h +++ b/Storage/Dict/Buffer/Buffer.h @@ -32,14 +32,14 @@ * Class to store data values. */ template -class Buffer : public Dict { +class Buffer : public Dict { public: Buffer() {} /** * Adds new value. */ - void Add(T _value, long _dt = 0) { + void Add(T _value, int64 _dt = 0) { _dt = _dt > 0 ? _dt : TimeCurrent(); Set(_dt, _value); } @@ -50,7 +50,7 @@ class Buffer : public Dict { T GetMin() { T min = NULL; - for (DictIterator iter = Begin(); iter.IsValid(); ++iter) + for (DictIterator iter = Begin(); iter.IsValid(); ++iter) if (min == NULL || min > iter.Value()) min = iter.Value(); return min; @@ -62,7 +62,7 @@ class Buffer : public Dict { T GetMax() { T max = NULL; - for (DictIterator iter = Begin(); iter.IsValid(); ++iter) + for (DictIterator iter = Begin(); iter.IsValid(); ++iter) if (max == NULL || max < iter.Value()) max = iter.Value(); return max; @@ -75,7 +75,7 @@ class Buffer : public Dict { T sum = 0; unsigned int numValues = 0; - for (DictIterator iter = Begin(); iter.IsValid(); ++iter) { + for (DictIterator iter = Begin(); iter.IsValid(); ++iter) { sum += iter.Value(); ++numValues; } @@ -91,7 +91,7 @@ class Buffer : public Dict { ArrayResize(array, Size()); - for (DictIterator iter = Begin(); iter.IsValid(); ++iter) { + for (DictIterator iter = Begin(); iter.IsValid(); ++iter) { array[iter.Index()] = iter.Value(); } diff --git a/Storage/Dict/Buffer/BufferFXT.h b/Storage/Dict/Buffer/BufferFXT.h index f4985aa31..ebb43b3bf 100644 --- a/Storage/Dict/Buffer/BufferFXT.h +++ b/Storage/Dict/Buffer/BufferFXT.h @@ -69,7 +69,7 @@ struct BufferFXTEntry { double high; double low; double close; - long volume; + int64 volume; int ctm; // The current time within a bar. int flag; // Flag to launch an expert (0 - bar will be modified, but the expert will not be launched). @@ -262,7 +262,7 @@ string ToJSON(BufferFXTEntry &_value, const bool, const unsigned int) { return _ /** * Implements class to store tick data. */ -class BufferFXT : public DictStruct { +class BufferFXT : public DictStruct { protected: BufferFXTParams params; @@ -281,7 +281,7 @@ class BufferFXT : public DictStruct { /** * Adds new entry. */ - void Add(BufferFXTEntry &_value, long _dt = 0) { + void Add(BufferFXTEntry &_value, int64 _dt = 0) { _dt = _dt > 0 ? _dt : TimeCurrent(); Set(_dt, _value); } diff --git a/Storage/Dict/Buffer/BufferStruct.h b/Storage/Dict/Buffer/BufferStruct.h index 5db539b6f..e38de8b08 100644 --- a/Storage/Dict/Buffer/BufferStruct.h +++ b/Storage/Dict/Buffer/BufferStruct.h @@ -54,9 +54,9 @@ bool BufferStructOverflowListener(ENUM_DICT_OVERFLOW_REASON _reason, int _size, * Class to store struct data. */ template -class BufferStruct : public DictStruct { +class BufferStruct : public DictStruct { protected: - long min, max; + int64 min, max; public: /* Constructors */ @@ -73,8 +73,8 @@ class BufferStruct : public DictStruct { /** * Adds new value. */ - void Add(TStruct& _value, long _dt = 0) { - _dt = _dt > 0 ? _dt : (long)TimeCurrent(); + void Add(TStruct& _value, int64 _dt = 0) { + _dt = _dt > 0 ? _dt : (int64)TimeCurrent(); if (THIS_ATTR Set(_dt, _value)) { min = _dt < min ? _dt : min; max = _dt > max ? _dt : max; @@ -84,12 +84,12 @@ class BufferStruct : public DictStruct { /** * Clear entries older than given timestamp. */ - void Clear(long _dt = 0, bool _older = true) { + void Clear(int64 _dt = 0, bool _older = true) { min = INT_MAX; max = INT_MIN; if (_dt > 0) { - for (DictStructIterator iter(THIS_ATTR Begin()); iter.IsValid(); ++iter) { - long _time = iter.Key(); + for (DictStructIterator iter(THIS_ATTR Begin()); iter.IsValid(); ++iter) { + int64 _time = iter.Key(); if (_older && _time < _dt) { Unset(iter.Key()); continue; @@ -101,7 +101,7 @@ class BufferStruct : public DictStruct { max = _time > max ? _time : max; } } else { - DictStruct::Clear(); + DictStruct::Clear(); } } @@ -110,10 +110,10 @@ class BufferStruct : public DictStruct { /** * Gets the newest timestamp. */ - long GetMax() { return max; } + int64 GetMax() { return max; } /** * Gets the oldest timestamp. */ - long GetMin() { return min; } + int64 GetMin() { return min; } }; diff --git a/Storage/Dict/DictBase.h b/Storage/Dict/DictBase.h index 34e4b011b..082fbe377 100644 --- a/Storage/Dict/DictBase.h +++ b/Storage/Dict/DictBase.h @@ -389,5 +389,5 @@ class DictBase { /** * Specialization of hashing function. */ - unsigned int Hash(float x) { return (unsigned int)((unsigned long)x * 10000 % 10000); } + unsigned int Hash(float x) { return (unsigned int)((uint64)x * 10000 % 10000); } }; diff --git a/Storage/Dict/DictStruct.h b/Storage/Dict/DictStruct.h index fd1ca79c6..08981389b 100644 --- a/Storage/Dict/DictStruct.h +++ b/Storage/Dict/DictStruct.h @@ -71,7 +71,7 @@ class DictStruct : public DictBase { Clear(); Resize(right.GetSlotCount()); for (unsigned int i = 0; i < (unsigned int)ArraySize(right._DictSlots_ref.DictSlots); ++i) { - this PTR_DEREF _DictSlots_ref PTR_DEREF DictSlots[i] = right._DictSlots_ref.DictSlots[i]; + THIS_ATTR _DictSlots_ref.DictSlots[i] = right._DictSlots_ref.DictSlots[i]; } THIS_ATTR _DictSlots_ref._num_used = right._DictSlots_ref._num_used; THIS_ATTR _current_id = right._current_id; diff --git a/Storage/ItemsHistory.h b/Storage/ItemsHistory.h index c5454b894..74458b095 100644 --- a/Storage/ItemsHistory.h +++ b/Storage/ItemsHistory.h @@ -58,7 +58,7 @@ class ItemsHistoryItemProvider : public Dynamic { * Retrieves given number of items starting from the given microseconds or index (inclusive). "_dir" identifies if we * want previous or next items from selected starting point. */ - void GetItems(ItemsHistory>* _history, long _from_time_ms, + void GetItems(ItemsHistory>* _history, int64 _from_time_ms, ENUM_ITEMS_HISTORY_DIRECTION _dir, int _num_items, ARRAY_REF(IV, _out_arr)) { // Method is called if there is a missing item (candle) in the history. We need to regenerate it. Print("Error: Retrieving items by this item provider is not implemented!"); @@ -68,10 +68,10 @@ class ItemsHistoryItemProvider : public Dynamic { /** * Time of the first possible item/candle/tick. */ - virtual long GetInitialTimeMs() { + virtual int64 GetInitialTimeMs() { // Item's provider does not implement GetInitialTimeMs(), but it should. We'll use current time for the time of the // first item. - return (long)TimeCurrent() * 1000; + return (int64)TimeCurrent() * 1000; } /** @@ -150,7 +150,7 @@ class ItemsHistory { * Gets time in milliseconds of the last(oldest) item's time in current history time or 0. */ /* - long GetLastValidTimeInCache() { + int64 GetLastValidTimeInCache() { return history.GetByKey(last_valid_index).GetTime(); } */ @@ -173,7 +173,7 @@ class ItemsHistory { ArrayResize(_items, 0); int _item_count = _to_index - _from_index + 1; - long _from_time_ms; + int64 _from_time_ms; IV _item; // Calculating time to be passed to GetItems(). @@ -196,9 +196,9 @@ class ItemsHistory { _from_time_ms = _item.GetTimeMs() + _item.GetLengthMs() + 1; } - // long _current_time_ms = TimeCurrent() * 1000; + // int64 _current_time_ms = TimeCurrent() * 1000; - if (_from_time_ms > (long)TimeCurrent() * 1000) { + if (_from_time_ms > (int64)TimeCurrent() * 1000) { // There won't be items in the future. return; } @@ -441,7 +441,7 @@ class ItemsHistory { /** * Returns item time in milliseconds for the given shift. */ - long GetItemTimeByShiftMsc(int _shift) { + int64 GetItemTimeByShiftMsc(int _shift) { if (!EnsureShiftExists(_shift)) { // There won't be item at given shift. return (datetime)0; diff --git a/Storage/Object.h b/Storage/Object.h index cf9feaf40..8d5f9a3bf 100644 --- a/Storage/Object.h +++ b/Storage/Object.h @@ -38,14 +38,14 @@ class Object : public Dynamic { protected: void *obj; - long id; + int64 id; public: /** * Class constructor. */ Object() : obj(THIS_PTR), id(rand()) {} - Object(void *_obj, long _id = __LINE__) { + Object(void *_obj, int64 _id = __LINE__) { obj = _obj; id = _id; } @@ -55,14 +55,14 @@ class Object : public Dynamic { /** * Get ID of the object. */ - virtual long GetId() { return id; } + virtual int64 GetId() { return id; } /* Setters */ /** * Set ID of the object. */ - void SetId(long _id) { id = _id; } + void SetId(int64 _id) { id = _id; } /** * Get the object handler. diff --git a/Storage/String.extern.h b/Storage/String.extern.h index 924c2d79c..b8de543b2 100644 --- a/Storage/String.extern.h +++ b/Storage/String.extern.h @@ -65,7 +65,7 @@ int StringSplit(const string& string_value, const unsigned short separator, ARRA } return result.size(); } -long StringToInteger(string value) { return std::stol(value); } +int64 StringToInteger(string value) { return std::stol(value); } string IntegerToString(int64 number, int str_len = 0, unsigned short fill_symbol = ' ') { return std::to_string(number); } diff --git a/Storage/ValueStorage.h b/Storage/ValueStorage.h index 07cbbc449..7c7707741 100644 --- a/Storage/ValueStorage.h +++ b/Storage/ValueStorage.h @@ -47,15 +47,15 @@ enum ENUM_IPEAK { IPEAK_LOWEST, IPEAK_HIGHEST }; #define INDICATOR_CALCULATE_PARAMS_LONG \ ValueStorage &_time, ValueStorage &_open, ValueStorage &_high, ValueStorage &_low, \ - ValueStorage &_close, ValueStorage &_tick_volume, ValueStorage &_volume, \ - ValueStorage &_spread + ValueStorage &_close, ValueStorage &_tick_volume, ValueStorage &_volume, \ + ValueStorage &_spread #define INDICATOR_CALCULATE_PARAMS_SHORT ValueStorage &_price #define INDICATOR_CALCULATE_METHOD_PARAMS_LONG \ const int rates_total, const int prev_calculated, ValueStorage &time, ValueStorage &open, \ ValueStorage &high, ValueStorage &low, ValueStorage &close, \ - ValueStorage &tick_volume, ValueStorage &volume, ValueStorage &spread + ValueStorage &tick_volume, ValueStorage &volume, ValueStorage &spread #define INDICATOR_CALCULATE_METHOD_PARAMS_SHORT \ const int rates_total, const int prev_calculated, const int begin, ValueStorage &price @@ -103,14 +103,14 @@ enum ENUM_IPEAK { IPEAK_LOWEST, IPEAK_HIGHEST }; REF_TO(ValueStorage) \ _time = REF_CAST(ValueStorage) \ PTR_TO_REF(_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_TIME)); \ - REF_TO(ValueStorage) \ - _tick_volume = REF_CAST(ValueStorage) \ + REF_TO(ValueStorage) \ + _tick_volume = REF_CAST(ValueStorage) \ PTR_TO_REF(_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_TICK_VOLUME)); \ - REF_TO(ValueStorage) \ - _volume = REF_CAST(ValueStorage) \ + REF_TO(ValueStorage) \ + _volume = REF_CAST(ValueStorage) \ PTR_TO_REF(_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_VOLUME)); \ - REF_TO(ValueStorage) \ - _spread = REF_CAST(ValueStorage) \ + REF_TO(ValueStorage) \ + _spread = REF_CAST(ValueStorage) \ PTR_TO_REF(_suitable_ds PTR_DEREF GetSpecificValueStorage(INDI_DATA_VS_TYPE_SPREAD)); \ REF_TO(ValueStorage) \ _price_open = REF_CAST(ValueStorage) \ diff --git a/Storage/ValueStorage.spread.h b/Storage/ValueStorage.spread.h index 4b18fe614..3dfccfb8e 100644 --- a/Storage/ValueStorage.spread.h +++ b/Storage/ValueStorage.spread.h @@ -36,20 +36,20 @@ /** * Storage to retrieve spread. */ -class SpreadValueStorage : public HistoryValueStorage { +class SpreadValueStorage : public HistoryValueStorage { public: /** * Constructor. */ - SpreadValueStorage(IndicatorBase *_indi_candle) : HistoryValueStorage(_indi_candle) {} + SpreadValueStorage(IndicatorBase *_indi_candle) : HistoryValueStorage(_indi_candle) {} /** * Copy constructor. */ - SpreadValueStorage(SpreadValueStorage &_r) : HistoryValueStorage(_r.indi_candle.Ptr()) {} + SpreadValueStorage(SpreadValueStorage &_r) : HistoryValueStorage(_r.indi_candle.Ptr()) {} /** * Fetches value from a given shift. Takes into consideration as-series flag. */ - long Fetch(int _rel_shift) override { return indi_candle REF_DEREF GetSpread(RealShift(_rel_shift)); } + int64 Fetch(int _rel_shift) override { return indi_candle REF_DEREF GetSpread(RealShift(_rel_shift)); } }; diff --git a/Storage/ValueStorage.tick_volume.h b/Storage/ValueStorage.tick_volume.h index 61e9845e4..649c0fcf3 100644 --- a/Storage/ValueStorage.tick_volume.h +++ b/Storage/ValueStorage.tick_volume.h @@ -36,20 +36,20 @@ /** * Storage to retrieve tick volume. */ -class TickVolumeValueStorage : public HistoryValueStorage { +class TickVolumeValueStorage : public HistoryValueStorage { public: /** * Constructor. */ - TickVolumeValueStorage(IndicatorBase *_indi_candle) : HistoryValueStorage(_indi_candle) {} + TickVolumeValueStorage(IndicatorBase *_indi_candle) : HistoryValueStorage(_indi_candle) {} /** * Copy constructor. */ - TickVolumeValueStorage(TickVolumeValueStorage &_r) : HistoryValueStorage(_r.indi_candle.Ptr()) {} + TickVolumeValueStorage(TickVolumeValueStorage &_r) : HistoryValueStorage(_r.indi_candle.Ptr()) {} /** * Fetches value from a given shift. Takes into consideration as-series flag. */ - long Fetch(int _rel_shift) override { return indi_candle REF_DEREF GetVolume(RealShift(_rel_shift)); } + int64 Fetch(int _rel_shift) override { return indi_candle REF_DEREF GetVolume(RealShift(_rel_shift)); } }; diff --git a/Storage/ValueStorage.volume.h b/Storage/ValueStorage.volume.h index dc3d07690..f76b08424 100644 --- a/Storage/ValueStorage.volume.h +++ b/Storage/ValueStorage.volume.h @@ -36,24 +36,24 @@ /** * Storage to retrieve volume. */ -class VolumeValueStorage : public HistoryValueStorage { +class VolumeValueStorage : public HistoryValueStorage { public: /** * Constructor. */ - VolumeValueStorage(IndicatorBase *_indi_candle) : HistoryValueStorage(_indi_candle) {} + VolumeValueStorage(IndicatorBase *_indi_candle) : HistoryValueStorage(_indi_candle) {} /** * Copy constructor. */ - VolumeValueStorage(VolumeValueStorage &_r) : HistoryValueStorage(_r.indi_candle.Ptr()) {} + VolumeValueStorage(VolumeValueStorage &_r) : HistoryValueStorage(_r.indi_candle.Ptr()) {} /** * Fetches value from a given shift. Takes into consideration as-series flag. */ - long Fetch(int _rel_shift) override { + int64 Fetch(int _rel_shift) override { ResetLastError(); - long _volume = indi_candle REF_DEREF GetVolume(RealShift(_rel_shift)); + int64 _volume = indi_candle REF_DEREF GetVolume(RealShift(_rel_shift)); if (_LastError != ERR_NO_ERROR) { Print("Cannot fetch iVolume! Error: ", _LastError); DebugBreak(); diff --git a/Strategy.mqh b/Strategy.mqh index 6cd991674..b322ff805 100644 --- a/Strategy.mqh +++ b/Strategy.mqh @@ -28,14 +28,14 @@ class Trade; // Includes. -#include "Storage/Data.struct.h" -#include "Storage/Dict/Dict.h" #include "Indicator/Indicator.h" #include "Market.mqh" +#include "Storage/Data.struct.h" +#include "Storage/Dict/Dict.h" #include "Storage/Object.h" +#include "Storage/String.h" #include "Strategy.enum.h" #include "Strategy.struct.h" -#include "Storage/String.h" #include "Task/TaskManager.h" #include "Task/Taskable.h" #include "Trade.mqh" @@ -113,9 +113,9 @@ class Strategy : public Taskable { // Base variables. string name; // Other variables. - int filter_method[]; // Filter method to consider the trade REF_DEREF - int open_condition[]; // Open conditions. - int close_condition[]; // Close conditions. + ARRAY(int, filter_method); // Filter method to consider the trade REF_DEREF + ARRAY(int, open_condition); // Open conditions. + ARRAY(int, close_condition); // Close conditions. public: /* Special methods */ @@ -123,11 +123,12 @@ class Strategy : public Taskable { /** * Class constructor. */ - Strategy(StgParams &_sparams, TradeParams &_tparams, IndicatorBase *_indi_source, string _name = "") + Strategy(StgParams &_sparams, TradeParams &_tparams, IndicatorData *_indi_source, string _name = "") : sparams(_sparams), trade(new Trade(_tparams, _indi_source)), indi_source(_indi_source) { // Initialize variables. name = _name; - MqlTick _tick = {0}; + MqlTick _tick; + _tick.time = (datetime)0; last_tick = _tick; // Link log instances. @@ -208,7 +209,7 @@ class Strategy : public Taskable { /** * Returns handler to the strategy's indicator class. */ - IndicatorBase *GetIndicator(int _id = 0) { + IndicatorData *GetIndicator(int _id = 0) { if (indicators.KeyExists(_id)) { return indicators[_id].Ptr(); } @@ -260,8 +261,8 @@ class Strategy : public Taskable { */ StgEntry GetEntry() { StgEntry _entry; - for (ENUM_STRATEGY_STATS_PERIOD _p = EA_STATS_DAILY; _p < FINAL_ENUM_STRATEGY_STATS_PERIOD; _p++) { - _entry.SetStats(stats_period[(int)_p], _p); + for (int _p = EA_STATS_DAILY; _p < FINAL_ENUM_STRATEGY_STATS_PERIOD; _p++) { + _entry.SetStats(stats_period[_p], (ENUM_STRATEGY_STATS_PERIOD)_p); } return _entry; } @@ -285,7 +286,7 @@ class Strategy : public Taskable { * Executes OnTick() on every attached indicator. */ void Tick(int _global_tick_index) { - for (DictIterator> it = indicators.Begin(); it.IsValid(); ++it) { + for (DictStructIterator> it = indicators.Begin(); it.IsValid(); ++it) { it.Value() REF_DEREF Tick(_global_tick_index); } } @@ -298,7 +299,7 @@ class Strategy : public Taskable { /** * Get strategy's ID. */ - virtual long GetId() { return sparams.id; } + virtual int64 GetId() { return sparams.id; } /** * Get strategy's signal open method. @@ -454,9 +455,9 @@ class Strategy : public Taskable { /** * Sets strategy's ID. */ - void SetId(long _id) { + void SetId(int64 _id) { sparams.id = _id; - ((Object *)GetPointer(this)).SetId(_id); + ((Object *)THIS_PTR) PTR_DEREF SetId(_id); } /** @@ -480,9 +481,9 @@ class Strategy : public Taskable { /** * Sets custom data. */ - void SetData(Dict *_ddata) { ddata = _ddata; } - void SetData(Dict *_fdata) { fdata = _fdata; } - void SetData(Dict *_idata) { idata = _idata; } + void SetData(Dict *_ddata) { ddata = PTR_TO_REF(_ddata); } + void SetData(Dict *_fdata) { fdata = PTR_TO_REF(_fdata); } + void SetData(Dict *_idata) { idata = PTR_TO_REF(_idata); } /** * Sets reference to indicator. @@ -687,8 +688,8 @@ class Strategy : public Taskable { ENUM_TIMEFRAMES _stf = GetSource() PTR_DEREF GetTf(); unsigned int _stf_secs = ChartTf::TfToSeconds(_stf); if (sparams.order_close_time != 0) { - long _close_time_arg = sparams.order_close_time > 0 ? sparams.order_close_time * 60 - : (int)round(-sparams.order_close_time * _stf_secs); + int64 _close_time_arg = sparams.order_close_time > 0 ? sparams.order_close_time * 60 + : MathRound(-sparams.order_close_time * _stf_secs); _oparams.Set(ORDER_PARAM_COND_CLOSE, ORDER_COND_LIFETIME_GT_ARG, _index); _oparams.Set(ORDER_PARAM_COND_CLOSE_ARG_VALUE, _close_time_arg, _index); _index++; @@ -734,7 +735,7 @@ class Strategy : public Taskable { if ((_periods & DATETIME_DAY) != 0) { // New day started. #ifndef __optimize__ - GetLogger().Flush(); + GetLogger() PTR_DEREF Flush(); #endif } if ((_periods & DATETIME_WEEK) != 0) { @@ -767,7 +768,7 @@ class Strategy : public Taskable { bool _res = _method >= 0; bool _val; - int _method_abs = fabs(_method); + int _method_abs = MathAbs(_method); if (_method_abs != 0) { if (METHOD(_method_abs, 0)) { // 1 // Process on every minute. @@ -1026,7 +1027,7 @@ class Strategy : public Taskable { return (float)_result; } float _trade_dist = trade REF_DEREF GetTradeDistanceInValue(); - int _count = (int)fmax(fabs(_level), fabs(_method)); + int _count = (int)fmax(MathAbs(_level), MathAbs(_method)); int _direction = Order::OrderDirection(_cmd, _mode); IndicatorData *_data_source = trade REF_DEREF GetSource(); IndicatorData *_indi = GetIndicators().Begin().Value().Ptr(); @@ -1034,7 +1035,7 @@ class Strategy : public Taskable { _psm.SetCandleSource(_data_source); if (Object::IsValid(_indi)) { int _ishift = 12; // @todo: Make it dynamic or as variable. - double _value = _indi.GetValuePrice(_ishift, 0, _direction > 0 ? PRICE_HIGH : PRICE_LOW); + double _value = _indi PTR_DEREF GetValuePrice(_ishift, 0, _direction > 0 ? PRICE_HIGH : PRICE_LOW); _value = _value + (float)Math::ChangeByPct(fabs(_value - SymbolInfoStatic::GetCloseOffer(_Symbol, _cmd)), _level) * _direction; @@ -1048,7 +1049,8 @@ class Strategy : public Taskable { */ _result = _psm.GetValue(_ishift, _direction, _trade_dist); } else { - int _pshift = _direction > 0 ? _data_source.GetHighest(_count) : _data_source.GetLowest(_count); + int _pshift = + _direction > 0 ? _data_source PTR_DEREF GetHighest(_count) : _data_source PTR_DEREF GetLowest(_count); _result = _psm.GetValue(_pshift, _direction, _trade_dist); } return (float)_result; @@ -1068,14 +1070,14 @@ class Strategy : public Taskable { float _result = 0; IndicatorData *_data_source = trade REF_DEREF GetSource(); - BarOHLC _bar1 = _data_source.GetOHLC(_shift); + BarOHLC _bar1 = _data_source PTR_DEREF GetOHLC(_shift); if (!_bar1.IsValid()) { return 0; } float _range = (float)_bar1.GetRange(); if (_range > 0) { - float _open = (float)_data_source.GetOpen(_tf); + float _open = (float)_data_source PTR_DEREF GetOpen(_tf); float _pp = (float)_bar1.GetPivot(); _result = 1 / _range * (_open - _pp); _result = fmin(1, fmax(-1, _result)); @@ -1127,7 +1129,7 @@ class Strategy : public Taskable { return SignalOpen(_entry.GetArg(0).ToValue(), _entry.GetArg(1).ToValue(), _entry.GetArg(2).ToValue()); default: - GetLogger().Error(StringFormat("Invalid EA condition: %d!", _entry.GetId(), __FUNCTION_LINE__)); + GetLogger() PTR_DEREF Error(StringFormat("Invalid EA condition: %d at %s!", _entry.GetId(), __FUNCTION_LINE__)); SetUserError(ERR_INVALID_PARAMETER); break; } @@ -1169,7 +1171,8 @@ class Strategy : public Taskable { sparams.Suspended(false); return true; default: - GetLogger().Error(StringFormat("Invalid Strategy action: %d!", _entry.GetId(), __FUNCTION_LINE__)); + GetLogger() + PTR_DEREF Error(StringFormat("Invalid Strategy action: %d at %s!", _entry.GetId(), __FUNCTION_LINE__)); SetUserError(ERR_INVALID_PARAMETER); break; } diff --git a/Strategy.struct.h b/Strategy.struct.h index d7e852c04..160c43980 100644 --- a/Strategy.struct.h +++ b/Strategy.struct.h @@ -47,7 +47,7 @@ struct StgParams { bool is_suspended; // State of the strategy (whether suspended or not) bool is_boosted; // State of the boost feature (to increase lot size). float weight; // Weight of the strategy. - long order_close_time; // Order close time in mins (>0) or bars (<0). + int64 order_close_time; // Order close time in mins (>0) or bars (<0). float order_close_loss; // Order close loss (in pips). float order_close_profit; // Order close profit (in pips). int signal_open_method; // Signal open method. @@ -72,7 +72,7 @@ struct StgParams { int tp_max; // Hard limit on maximum take profit (in pips). int sl_max; // Hard limit on maximum stop loss (in pips). int type; // Strategy type (@see: ENUM_STRATEGY). - long id; // Unique identifier of the strategy. + int64 id; // Unique identifier of the strategy. datetime refresh_time; // Order refresh frequency (in sec). short shift; // Shift (relative to the current bar, 0 - default) ChartTf tf; // Main timeframe where strategy operates on. @@ -142,7 +142,7 @@ struct StgParams { sl_max(0), type(0), refresh_time(0) {} - StgParams(StgParams &_stg_params) { this = _stg_params; } + StgParams(const StgParams &_stg_params) { THIS_REF = _stg_params; } // Deconstructor. ~StgParams() {} @@ -212,7 +212,7 @@ struct StgParams { void Set(ENUM_STRATEGY_PARAM _param, T _value) { switch (_param) { case STRAT_PARAM_ID: // ID (magic number). - id = (long)_value; + id = (int64)_value; return; case STRAT_PARAM_LS: // Lot size lot_size = (float)_value; @@ -248,7 +248,7 @@ struct StgParams { order_close_profit = (float)_value; return; case STRAT_PARAM_OCT: // Order close time - order_close_time = (long)_value; + order_close_time = (int64)_value; return; case STRAT_PARAM_SOM: // Signal open method signal_open_method = (int)_value; @@ -297,7 +297,7 @@ struct StgParams { Set(_enum_param, _mql_param.integer_value); } } - void SetId(long _id) { id = _id; } + void SetId(int64 _id) { id = _id; } void SetStops(Strategy *_sl = NULL, Strategy *_tp = NULL) { // @todo: To remove. } diff --git a/Strategy.struct.pricestop.h b/Strategy.struct.pricestop.h index 240ef01b3..3f935ef2d 100644 --- a/Strategy.struct.pricestop.h +++ b/Strategy.struct.pricestop.h @@ -56,7 +56,7 @@ struct StrategyPriceStop { float ivalue; // Indicator price value. unsigned int method; // Store price stop methods (@see: ENUM_STRATEGY_PRICE_STOP). // unsigned int mode[2]; // Indicator modes to use. - Ref indi_candle; + Ref indi_candle; // IndicatorDataEntry idata[]; // IndicatorParams iparams; @@ -103,7 +103,7 @@ struct StrategyPriceStop { return (float)_result; } /* Setters */ - void SetCandleSource(IndicatorBase* _indi_candle) { indi_candle = _indi_candle; } + void SetCandleSource(IndicatorData* _indi_candle) { indi_candle = _indi_candle; } void SetIndicatorPriceValue(float _ivalue) { ivalue = _ivalue; } /* void SetIndicatorDataEntry(IndicatorDataEntry &_data[]) { @@ -143,7 +143,8 @@ struct StrategyPriceStop { int _size = sizeof(int) * 8; for (int i = 0; i < _size; i++) { int _value = CheckMethod(1 << i) ? 1 : 0; - _s.Pass(this, (string)(i + 1), _value, SERIALIZER_FIELD_FLAG_DYNAMIC | SERIALIZER_FIELD_FLAG_FEATURE); + _s.Pass(THIS_REF, IntegerToString(i + 1), _value, + (int)(SERIALIZER_FIELD_FLAG_DYNAMIC | SERIALIZER_FIELD_FLAG_FEATURE)); } return SerializerNodeObject; } diff --git a/Task/Task.struct.h b/Task/Task.struct.h index 8b9544ce0..bf87e10bf 100644 --- a/Task/Task.struct.h +++ b/Task/Task.struct.h @@ -32,6 +32,7 @@ // Includes. #include "../Platform/Terminal.define.h" +#include "../Serializer/Serializer.h" #include "Task.enum.h" #include "TaskAction.struct.h" #include "TaskCondition.struct.h" diff --git a/Task/tests/TaskAction.test.mq5 b/Task/tests/TaskAction.test.mq5 index 5523bbfd7..2c12f7eee 100644 --- a/Task/tests/TaskAction.test.mq5 +++ b/Task/tests/TaskAction.test.mq5 @@ -36,11 +36,11 @@ enum ENUM_TASK_ACTION_TEST { class TaskActionTest01 : public TaskActionBase { protected: - long sum; + int64 sum; public: TaskActionTest01() : sum(0){}; - long GetSum() { return sum; } + int64 GetSum() { return sum; } bool Run(const TaskActionEntry &_entry) { sum += _entry.GetId(); PrintFormat("%s; sum=%d", __FUNCSIG__, sum); @@ -50,11 +50,11 @@ class TaskActionTest01 : public TaskActionBase { class TaskActionTest02 : public TaskActionBase { protected: - long sum; + int64 sum; public: TaskActionTest02() : sum(0){}; - long GetSum() { return sum; } + int64 GetSum() { return sum; } bool Run(const TaskActionEntry &_entry) { sum += _entry.GetId(); PrintFormat("%s; sum=%d", __FUNCSIG__, sum); diff --git a/Task/tests/TaskCondition.test.mq5 b/Task/tests/TaskCondition.test.mq5 index 0af6e94da..231ac5e33 100644 --- a/Task/tests/TaskCondition.test.mq5 +++ b/Task/tests/TaskCondition.test.mq5 @@ -36,11 +36,11 @@ enum ENUM_TASK_CONDITION_TEST { class TaskConditionTest01 : public TaskConditionBase { protected: - long sum; + int64 sum; public: TaskConditionTest01() : sum(0){}; - long GetSum() { return sum; } + int64 GetSum() { return sum; } bool Check(const TaskConditionEntry &_entry) { sum += _entry.GetId(); PrintFormat("%s; sum=%d", __FUNCSIG__, sum); @@ -50,11 +50,11 @@ class TaskConditionTest01 : public TaskConditionBase { class TaskConditionTest02 : public TaskConditionBase { protected: - long sum; + int64 sum; public: TaskConditionTest02() : sum(0){}; - long GetSum() { return sum; } + int64 GetSum() { return sum; } bool Check(const TaskConditionEntry &_entry) { sum += _entry.GetId(); PrintFormat("%s; sum=%d", __FUNCSIG__, sum); diff --git a/Task/tests/TaskGetter.test.mq5 b/Task/tests/TaskGetter.test.mq5 index fe2a72d0e..ee41b0c80 100644 --- a/Task/tests/TaskGetter.test.mq5 +++ b/Task/tests/TaskGetter.test.mq5 @@ -47,7 +47,7 @@ class TaskGetterTest01 : public TaskGetter { public: TaskGetterTest01(){}; - // long GetSum() { return sum; } + // int64 GetSum() { return sum; } TaskGetterTest01Data Get() { return TaskGetter::Get(); } TaskGetterTest01Data Get(const TaskGetterEntry &_entry) { data.SetValue(_entry.GetId()); diff --git a/Tick/Tick.struct.h b/Tick/Tick.struct.h index 3308089e8..1f790b999 100644 --- a/Tick/Tick.struct.h +++ b/Tick/Tick.struct.h @@ -30,8 +30,8 @@ #endif // Includes. -#include "../Storage/DateTime.extern.h" #include "../Std.h" +#include "../Storage/DateTime.extern.h" #ifndef __MQL__ /** @@ -40,14 +40,14 @@ * https://www.mql5.com/en/docs/constants/structures/mqltick */ struct MqlTick { - datetime time; // Time of the last prices update. - double ask; // Current Ask price. - double bid; // Current Bid price. - double last; // Price of the last deal (last). - double volume_real; // Volume for the current last price with greater accuracy. - int64 time_msc; // Time of a price last update in milliseconds. - unsigned int flags; // Tick flags. - unsigned int64 volume; // Volume for the current last price. + datetime time; // Time of the last prices update. + double ask; // Current Ask price. + double bid; // Current Bid price. + double last; // Price of the last deal (last). + double volume_real; // Volume for the current last price with greater accuracy. + int64 time_msc; // Time of a price last update in milliseconds. + unsigned int flags; // Tick flags. + uint64 volume; // Volume for the current last price. // Default constructor. MqlTick() {} diff --git a/Ticker.mqh b/Ticker.mqh index a1d90d55c..0658f348a 100644 --- a/Ticker.mqh +++ b/Ticker.mqh @@ -28,9 +28,9 @@ class Chart; // Includes. -#include "Platform/Chart/Chart.h" -#include "Log.mqh" #include "Exchange/SymbolInfo/SymbolInfo.h" +#include "Log.mqh" +#include "Platform/Chart/Chart.h" //#include "Market.mqh" // Define an assert macros. @@ -48,7 +48,7 @@ class Ticker { }; protected: - unsigned long total_added, total_ignored, total_processed, total_saved; + uint64 total_added, total_ignored, total_processed, total_saved; // Struct variables. MqlTick data[]; // Class variables. @@ -85,22 +85,22 @@ class Ticker { /** * Get number of added ticks. */ - unsigned long GetTotalAdded() { return total_added; } + uint64 GetTotalAdded() { return total_added; } /** * Get number of ignored ticks. */ - unsigned long GetTotalIgnored() { return total_ignored; } + uint64 GetTotalIgnored() { return total_ignored; } /** * Get number of parsed ticks. */ - unsigned long GetTotalProcessed() { return total_processed; } + uint64 GetTotalProcessed() { return total_processed; } /** * Get number of saved ticks. */ - unsigned long GetTotalSaved() { return total_saved; } + uint64 GetTotalSaved() { return total_saved; } /* Other methods */ diff --git a/Timer.mqh b/Timer.mqh index c15d89314..e5eec1a08 100644 --- a/Timer.mqh +++ b/Timer.mqh @@ -39,7 +39,7 @@ class Timer : public Object { int index; unsigned int data[]; unsigned int start, end; - unsigned long max; + uint64 max; public: /** @@ -78,7 +78,7 @@ class Timer : public Object { /** * Print the current timer times when maximum value is reached. */ - Timer *PrintOnMax(unsigned long _min = 1) { + Timer *PrintOnMax(uint64 _min = 1) { return data[index] > _min && data[this PTR_DEREF index] >= this PTR_DEREF max ? PrintSummary() : GetPointer(this); } @@ -98,9 +98,9 @@ class Timer : public Object { /** * Get the sum of all values. */ - unsigned long GetSum() { + uint64 GetSum() { unsigned int _size = ArraySize(this PTR_DEREF data); - unsigned long _sum = 0; + uint64 _sum = 0; for (unsigned int _i = 0; _i < _size; _i++) { _sum += data[_i]; } diff --git a/Trade.mqh b/Trade.mqh index 3bea5a760..c39d2fb49 100644 --- a/Trade.mqh +++ b/Trade.mqh @@ -30,14 +30,14 @@ class Trade; #define TRADE_MQH // Includes. -#include "Exchange/Account/AccountMt.h" #include "Convert.mqh" -#include "Storage/Dict/DictStruct.h" +#include "Exchange/Account/AccountMt.h" #include "Indicator/IndicatorData.h" #include "Math/Math.h" -#include "Storage/Object.h" #include "Platform/Order.h" #include "Platform/OrderQuery.h" +#include "Storage/Dict/DictStruct.h" +#include "Storage/Object.h" #include "Task/TaskManager.h" #include "Task/Taskable.h" #include "Trade.enum.h" @@ -47,9 +47,9 @@ class Trade : public Taskable { public: AccountMt account; Ref indi_candle; - DictStruct> orders_active; - DictStruct> orders_history; - DictStruct> orders_pending; + DictStruct> orders_active; + DictStruct> orders_history; + DictStruct> orders_pending; Log logger; // Trade logger. TaskManager tasks; // Tasks. TradeParams tparams; // Trade parameters. @@ -170,7 +170,7 @@ class Trade : public Taskable { * @return * Returns DictStruct's of active orders. */ - DictStruct> *GetOrdersActive() { return &orders_active; } + DictStruct> *GetOrdersActive() { return &orders_active; } /** * Gets list of history orders. @@ -178,7 +178,7 @@ class Trade : public Taskable { * @return * Returns DictStruct's of orders from history. */ - DictStruct> *GetOrdersHistory() { return &orders_history; } + DictStruct> *GetOrdersHistory() { return &orders_history; } /** * Gets list of pending orders. @@ -186,7 +186,7 @@ class Trade : public Taskable { * @return * Returns DictStruct's of pending orders. */ - DictStruct> *GetOrdersPending() { return &orders_pending; } + DictStruct> *GetOrdersPending() { return &orders_pending; } /** * Get a trade request. @@ -194,13 +194,14 @@ class Trade : public Taskable { * @return * Returns true on successful request. */ - MqlTradeRequest GetTradeOpenRequest(ENUM_ORDER_TYPE _type, float _volume = 0, long _magic = 0, string _comment = "") { + MqlTradeRequest GetTradeOpenRequest(ENUM_ORDER_TYPE _type, float _volume = 0, int64 _magic = 0, + string _comment = "") { // Create a request. MqlTradeRequest _request = {(ENUM_TRADE_REQUEST_ACTIONS)0}; _request.action = TRADE_ACTION_DEAL; _request.comment = _comment; _request.deviation = 10; - _request.magic = _magic > 0 ? _magic : tparams.Get(TRADE_PARAM_MAGIC_NO); + _request.magic = _magic > 0 ? _magic : tparams.Get(TRADE_PARAM_MAGIC_NO); _request.symbol = GetSource() PTR_DEREF GetSymbol(); _request.price = GetSource() PTR_DEREF GetOpenOffer(_type); _request.type = _type; @@ -337,15 +338,15 @@ class Trade : public Taskable { Ref _order = order_last; if (_order.IsSet() && _order REF_DEREF Get(ORDER_TYPE) == _cmd && - _order REF_DEREF Get(ORDER_TIME_SETUP) > GetSource() PTR_DEREF GetBarTime()) { + _order REF_DEREF Get(ORDER_TIME_SETUP) > GetSource() PTR_DEREF GetBarTime()) { _result |= true; } if (!_result) { - for (DictStructIterator> iter = orders_active.Begin(); iter.IsValid(); ++iter) { + for (DictStructIterator> iter = orders_active.Begin(); iter.IsValid(); ++iter) { _order = iter.Value(); if (_order REF_DEREF Get(ORDER_TYPE) == _cmd) { - long _time_opened = _order REF_DEREF Get(ORDER_TIME_SETUP); + int64 _time_opened = _order REF_DEREF Get(ORDER_TIME_SETUP); _result |= _shift > 0 && _time_opened < GetSource() PTR_DEREF GetBarTime(_shift - 1); _result |= _time_opened >= GetSource() PTR_DEREF GetBarTime(_shift); if (_result) { @@ -383,7 +384,7 @@ class Trade : public Taskable { } if (!_result) { - for (DictStructIterator> iter = orders_active.Begin(); iter.IsValid() && !_result; ++iter) { + for (DictStructIterator> iter = orders_active.Begin(); iter.IsValid() && !_result; ++iter) { _order = iter.Value(); if (_order.IsSet() && _order REF_DEREF IsOpen()) { if (_odata.Get(ORDER_TYPE) == _cmd) { @@ -421,7 +422,7 @@ class Trade : public Taskable { } if (!_result) { - for (DictStructIterator> iter = orders_active.Begin(); iter.IsValid() && !_result; ++iter) { + for (DictStructIterator> iter = orders_active.Begin(); iter.IsValid() && !_result; ++iter) { _order = iter.Value(); if (_order.IsSet()) { _result = _odata.Get(ORDER_TYPE) != _cmd; @@ -678,7 +679,7 @@ HistorySelect(0, TimeCurrent()); // Select history for access. tstats.Add(TRADE_STAT_ORDERS_ERRORS); // Pass-through. case ERR_NO_ERROR: // 0 - orders_active.Set(_order PTR_DEREF Get(ORDER_PROP_TICKET), _ref_order); + orders_active.Set(_order PTR_DEREF Get(ORDER_PROP_TICKET), _ref_order); order_last = _order; tstates.AddState(TRADE_STATE_ORDERS_ACTIVE); tstats.Add(TRADE_STAT_ORDERS_OPENED); @@ -711,9 +712,9 @@ HistorySelect(0, TimeCurrent()); // Select history for access. */ bool OrderMoveToHistory(Order *_order) { _order PTR_DEREF Refresh(true); - orders_active.Unset(_order PTR_DEREF Get(ORDER_PROP_TICKET)); + orders_active.Unset(_order PTR_DEREF Get(ORDER_PROP_TICKET)); Ref _ref_order = _order; - bool result = orders_history.Set(_order PTR_DEREF Get(ORDER_PROP_TICKET), _ref_order); + bool result = orders_history.Set(_order PTR_DEREF Get(ORDER_PROP_TICKET), _ref_order); /* @todo if (strategy != NULL) { strategy.OnOrderClose(_order); @@ -727,7 +728,7 @@ HistorySelect(0, TimeCurrent()); // Select history for access. tstates.RemoveState(TRADE_STATE_ORDERS_MAX_SOFT); return result; } - bool OrderMoveToHistory(unsigned long _ticket) { + bool OrderMoveToHistory(uint64 _ticket) { Ref _order = orders_active.GetByKey(_ticket); return OrderMoveToHistory(_order.Ptr()); } @@ -737,7 +738,7 @@ HistorySelect(0, TimeCurrent()); // Select history for access. */ bool RefreshActiveOrders(bool _force = false, bool _first_close = false) { bool _result = true; - for (DictStructIterator> iter = orders_active.Begin(); iter.IsValid(); ++iter) { + for (DictStructIterator> iter = orders_active.Begin(); iter.IsValid(); ++iter) { Ref _order = iter.Value(); if (_order.IsSet() && _order REF_DEREF IsOpen(true)) { _order REF_DEREF Refresh(_force); @@ -757,7 +758,7 @@ HistorySelect(0, TimeCurrent()); // Select history for access. template bool RefreshActiveOrdersByProp(E _prop, bool _force = false) { bool _result = true; - for (DictStructIterator> iter = orders_active.Begin(); iter.IsValid(); ++iter) { + for (DictStructIterator> iter = orders_active.Begin(); iter.IsValid(); ++iter) { Ref _order = iter.Value(); if (_order.IsSet() && _order REF_DEREF IsOpen(true)) { if (_force || _order REF_DEREF ShouldRefresh()) { @@ -815,9 +816,9 @@ HistorySelect(0, TimeCurrent()); // Select history for access. Ref _order_ref = _order; if (_order PTR_DEREF IsOpen()) { // @todo: _order.IsPending()? - _result &= orders_active.Set(_order PTR_DEREF Get(ORDER_PROP_TICKET), _order_ref); + _result &= orders_active.Set(_order PTR_DEREF Get(ORDER_PROP_TICKET), _order_ref); } else { - _result &= orders_history.Set(_order PTR_DEREF Get(ORDER_PROP_TICKET), _order_ref); + _result &= orders_history.Set(_order PTR_DEREF Get(ORDER_PROP_TICKET), _order_ref); } return _result && GetLastError() == ERR_NO_ERROR; } @@ -825,13 +826,13 @@ HistorySelect(0, TimeCurrent()); // Select history for access. /** * Loads active orders by magic number. */ - bool OrdersLoadByMagic(unsigned long _magic_no) { + bool OrdersLoadByMagic(uint64 _magic_no) { ResetLastError(); int _total_active = TradeStatic::TotalActive(); for (int pos = 0; pos < _total_active; pos++) { if (OrderStatic::SelectByPosition(pos)) { if (OrderStatic::MagicNumber() == _magic_no) { - unsigned long _ticket = OrderStatic::Ticket(); + uint64 _ticket = OrderStatic::Ticket(); Ref _order = new Order(_ticket); orders_active.Set(_ticket, _order); } @@ -870,7 +871,7 @@ HistorySelect(0, TimeCurrent()); // Select history for access. int _closed = 0; Ref _order; _comment = _comment != "" ? _comment : __FUNCTION__; - for (DictStructIterator> iter = orders_active.Begin(); iter.IsValid(); ++iter) { + for (DictStructIterator> iter = orders_active.Begin(); iter.IsValid(); ++iter) { _order = iter.Value(); if (_order REF_DEREF IsOpen(true)) { if (_order REF_DEREF OrderClose(_reason, _comment)) { @@ -878,7 +879,7 @@ HistorySelect(0, TimeCurrent()); // Select history for access. OrderMoveToHistory(_order.Ptr()); order_last = _order; } else { - logger.AddLastError(__FUNCTION_LINE__, _order REF_DEREF Get(ORDER_PROP_LAST_ERROR)); + logger.AddLastError(__FUNCTION_LINE__, _order REF_DEREF Get(ORDER_PROP_LAST_ERROR)); return -1; } } else { @@ -900,7 +901,7 @@ HistorySelect(0, TimeCurrent()); // Select history for access. int _closed = 0; Ref _order; _comment = _comment != "" ? _comment : __FUNCTION__; - for (DictStructIterator> iter = orders_active.Begin(); iter.IsValid(); ++iter) { + for (DictStructIterator> iter = orders_active.Begin(); iter.IsValid(); ++iter) { _order = iter.Value(); if (_order REF_DEREF IsOpen(true)) { _order REF_DEREF Refresh(); @@ -911,7 +912,7 @@ HistorySelect(0, TimeCurrent()); // Select history for access. order_last = _order; } else { logger.Error("Error while closing order!", __FUNCTION_LINE__, - StringFormat("Code: %d", _order REF_DEREF Get(ORDER_PROP_LAST_ERROR))); + StringFormat("Code: %d", _order REF_DEREF Get(ORDER_PROP_LAST_ERROR))); return -1; } order_last = _order; @@ -938,7 +939,7 @@ HistorySelect(0, TimeCurrent()); // Select history for access. int _closed = 0; Ref _order; _comment = _comment != "" ? _comment : __FUNCTION__; - for (DictStructIterator> iter = orders_active.Begin(); iter.IsValid(); ++iter) { + for (DictStructIterator> iter = orders_active.Begin(); iter.IsValid(); ++iter) { _order = iter.Value(); if (_order REF_DEREF IsOpen(true)) { _order REF_DEREF Refresh((E)_prop); @@ -948,7 +949,7 @@ HistorySelect(0, TimeCurrent()); // Select history for access. OrderMoveToHistory(_order.Ptr()); order_last = _order; } else { - logger.AddLastError(__FUNCTION_LINE__, _order REF_DEREF Get(ORDER_PROP_LAST_ERROR)); + logger.AddLastError(__FUNCTION_LINE__, _order REF_DEREF Get(ORDER_PROP_LAST_ERROR)); return -1; } } @@ -974,7 +975,7 @@ HistorySelect(0, TimeCurrent()); // Select history for access. int _closed = 0; Ref _order; _comment = _comment != "" ? _comment : __FUNCTION__; - for (DictStructIterator> iter = orders_active.Begin(); iter.IsValid(); ++iter) { + for (DictStructIterator> iter = orders_active.Begin(); iter.IsValid(); ++iter) { _order = iter.Value(); if (_order REF_DEREF IsOpen(true)) { _order REF_DEREF Refresh(); @@ -1016,15 +1017,15 @@ HistorySelect(0, TimeCurrent()); // Select history for access. /** * Calculate number of allowed orders to open. */ - unsigned long CalcMaxOrders(float volume_size, float _risk_ratio = 1.0, long prev_max_orders = 0, long hard_limit = 0, - bool smooth = true) { + uint64 CalcMaxOrders(float volume_size, float _risk_ratio = 1.0, int64 prev_max_orders = 0, int64 hard_limit = 0, + bool smooth = true) { float _avail_margin = fmin(account.GetMarginFree(), account.GetBalance() + account.GetCredit()); if (_avail_margin == 0 || volume_size == 0) { return 0; } float _margin_required = GetMarginRequired(); float _avail_orders = _avail_margin / _margin_required / volume_size; - long new_max_orders = (long)(_avail_orders * _risk_ratio); + int64 new_max_orders = (int64)(_avail_orders * _risk_ratio); if (hard_limit > 0) new_max_orders = fmin(hard_limit, new_max_orders); if (smooth && new_max_orders > prev_max_orders) { // Increase the limit smoothly. @@ -1172,10 +1173,10 @@ HistorySelect(0, TimeCurrent()); // Select history for access. * * @see: https://book.mql4.com/appendix/limits */ - static long GetTradeDistanceInPts(string _symbol) { + static int64 GetTradeDistanceInPts(string _symbol) { return fmax(SymbolInfoStatic::GetTradeStopsLevel(_symbol), SymbolInfoStatic::GetFreezeLevel(_symbol)); } - long GetTradeDistanceInPts() { return GetTradeDistanceInPts(GetSource() PTR_DEREF GetSymbol()); } + int64 GetTradeDistanceInPts() { return GetTradeDistanceInPts(GetSource() PTR_DEREF GetSymbol()); } /** * Get a market distance in pips. @@ -1733,7 +1734,7 @@ HistorySelect(0, TimeCurrent()); // Select history for access. */ virtual void OnOrderOpen(const Order &_order) { if (logger.GetLevel() >= V_INFO) { - // logger.Info(_order.ToString(), (string)_order.Get(ORDER_TICKET)); // @fixme + // logger.Info(_order.ToString(), (string)_order.Get(ORDER_TICKET)); // @fixme ResetLastError(); // @fixme: Error 69539 } } diff --git a/Trade.struct.h b/Trade.struct.h index c581db218..c959c1e94 100644 --- a/Trade.struct.h +++ b/Trade.struct.h @@ -132,7 +132,7 @@ struct TradeParams { unsigned short bars_min; // Minimum bars to trade. string order_comment; // Order comment. float lot_size; // Default lot size. - unsigned long magic_no; // Unique magic number used for the trading. + uint64 magic_no; // Unique magic number used for the trading. float risk_margin; // Maximum account margin to risk (in %). unsigned int limits_stats[FINAL_ENUM_TRADE_STAT_TYPE][FINAL_ENUM_TRADE_STAT_PERIOD]; unsigned int slippage; // Value of the maximum price slippage in points. @@ -147,7 +147,7 @@ struct TradeParams { slippage(_slippage) { SetLimits(0); } - TradeParams(unsigned long _magic_no, ENUM_LOG_LEVEL _ll = V_INFO) + TradeParams(uint64 _magic_no, ENUM_LOG_LEVEL _ll = V_INFO) : bars_min(100), order_comment(""), lot_size(0), magic_no(_magic_no), log_level(_ll) {} TradeParams(const TradeParams &_tparams) { THIS_REF = _tparams; } // Deconstructor. @@ -219,7 +219,7 @@ struct TradeParams { lot_size = (float)_value; return; case TRADE_PARAM_MAGIC_NO: - magic_no = (unsigned long)_value; + magic_no = (uint64)_value; return; case TRADE_PARAM_ORDER_COMMENT: order_comment = SerializerConversions::ValueToString(_value); @@ -276,7 +276,7 @@ struct TradeParams { } } void SetLotSize(float _lot_size) { lot_size = _lot_size; } - void SetMagicNo(unsigned long _mn) { magic_no = _mn; } + void SetMagicNo(uint64 _mn) { magic_no = _mn; } void SetRiskMargin(float _value) { risk_margin = _value; } // Serializers. void SerializeStub(int _n1 = 1, int _n2 = 1, int _n3 = 1, int _n4 = 1, int _n5 = 1) {} diff --git a/Trade/TradeSignal.struct.h b/Trade/TradeSignal.struct.h index 92946633f..76d171b89 100644 --- a/Trade/TradeSignal.struct.h +++ b/Trade/TradeSignal.struct.h @@ -58,11 +58,11 @@ // Structure for a trade signal. struct TradeSignalEntry { protected: - long magic_id; // Magic identifier. + int64 magic_id; // Magic identifier. unsigned int signals; // Store signals (@see: ENUM_TRADE_SIGNAL_FLAG). float strength; // Signal strength. ENUM_TIMEFRAMES tf; // Timeframe. - long timestamp; // Creation timestamp + int64 timestamp; // Creation timestamp float weight; // Signal weight. public: @@ -117,8 +117,8 @@ struct TradeSignalEntry { }; /* Constructor */ - TradeSignalEntry(unsigned int _signals = 0, ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, long _magic_id = 0, - float _strength = 0.0f, float _weight = 0.0f, long _time = 0) + TradeSignalEntry(unsigned int _signals = 0, ENUM_TIMEFRAMES _tf = PERIOD_CURRENT, int64 _magic_id = 0, + float _strength = 0.0f, float _weight = 0.0f, int64 _time = 0) : magic_id(_magic_id), signals(_signals), strength(_strength), tf(_tf), timestamp(_time), weight(_weight) {} TradeSignalEntry(const TradeSignalEntry &_entry) { THIS_REF = _entry; } /* Getters */ @@ -147,7 +147,7 @@ struct TradeSignalEntry { void Set(STRUCT_ENUM(TradeSignalEntry, ENUM_TRADE_SIGNAL_PROP) _prop, T _value) { switch (_prop) { case TRADE_SIGNAL_PROP_MAGIC_ID: - magic_id = (long)_value; + magic_id = (int64)_value; return; case TRADE_SIGNAL_PROP_SIGNALS: signals = (unsigned int)_value; @@ -159,7 +159,7 @@ struct TradeSignalEntry { tf = (ENUM_TIMEFRAMES)_value; return; case TRADE_SIGNAL_PROP_TIME: - timestamp = (long)_value; + timestamp = (int64)_value; return; case TRADE_SIGNAL_PROP_WEIGHT: weight = (float)_value; diff --git a/Trade/TradeSignalManager.h b/Trade/TradeSignalManager.h index da966da63..c481bc684 100644 --- a/Trade/TradeSignalManager.h +++ b/Trade/TradeSignalManager.h @@ -140,7 +140,7 @@ class TradeSignalManager : Dynamic { continue; } } - Set(TSM_PROP_LAST_CHECK, ::TimeGMT()); + Set(TSM_PROP_LAST_CHECK, ::TimeGMT()); } /* State methods */ @@ -152,9 +152,9 @@ class TradeSignalManager : Dynamic { * _update Update last check timestamp when true. */ bool IsReady(bool _update = true) { - bool _res = Get(TSM_PROP_LAST_CHECK) + Get(TSM_PROP_FREQ) >= ::TimeGMT(); + bool _res = Get(TSM_PROP_LAST_CHECK) + Get(TSM_PROP_FREQ) >= ::TimeGMT(); if (_res) { - Set(TSM_PROP_LAST_CHECK, ::TimeGMT()); + Set(TSM_PROP_LAST_CHECK, ::TimeGMT()); } return _res; } diff --git a/Trade/TradeSignalManager.struct.h b/Trade/TradeSignalManager.struct.h index bf3e56c08..aebaac524 100644 --- a/Trade/TradeSignalManager.struct.h +++ b/Trade/TradeSignalManager.struct.h @@ -39,8 +39,8 @@ */ struct TradeSignalManagerParams { protected: - short freq; // Signal process refresh frequency (in sec). - long last_check; // Last check. + short freq; // Signal process refresh frequency (in sec). + int64 last_check; // Last check. public: /* Struct's enumerations */ @@ -84,7 +84,7 @@ struct TradeSignalManagerParams { freq = (short)_value; return; case TSM_PARAMS_PROP_LAST_CHECK: - last_check = (long)_value; + last_check = (int64)_value; return; } SetUserError(ERR_INVALID_PARAMETER); diff --git a/tests/StrategyTest-RSI.mq5 b/tests/StrategyTest-RSI.mq5 index 489ababc1..a43da0df7 100644 --- a/tests/StrategyTest-RSI.mq5 +++ b/tests/StrategyTest-RSI.mq5 @@ -28,10 +28,10 @@ //#define __debug_verbose__ // Includes. -#include "../Platform/Chart/ChartMt.h" #include "../Indicator/tests/classes/IndicatorTfDummy.h" #include "../Indicators/Oscillator/Indi_RSI.h" #include "../Indicators/Tick/Indi_TickMt.h" +#include "../Platform/Chart/ChartMt.h" #include "../Strategy.mqh" #include "../Test.mqh" @@ -95,7 +95,7 @@ int OnInit() { // Initialize strategy instance. stg_rsi = Stg_RSI::Init(_candles = Platform::FetchDefaultCandleIndicator(_Symbol, PERIOD_M5)); stg_rsi REF_DEREF SetName("Stg_RSI"); - stg_rsi REF_DEREF Set(STRAT_PARAM_ID, 1234); + stg_rsi REF_DEREF Set(STRAT_PARAM_ID, 1234); // Initialize trade instance. TradeParams _tparams; @@ -113,7 +113,7 @@ int OnInit() { Print(stg_rsi REF_DEREF ToString()); // Check for errors. - long _last_error = GetLastError(); + int64 _last_error = GetLastError(); if (_last_error > 0) { assertTrueOrFail(_last_error == ERR_NO_ERROR, StringFormat("Error occured! Code: %d", _last_error)); } @@ -129,23 +129,23 @@ void OnTick() { if (Platform::IsNewMinute()) { if (stg_rsi REF_DEREF SignalOpen(ORDER_TYPE_BUY)) { MqlTradeRequest _request = trade REF_DEREF GetTradeOpenRequest( - ORDER_TYPE_BUY, 0, stg_rsi REF_DEREF Get(STRAT_PARAM_ID), stg_rsi REF_DEREF GetName()); + ORDER_TYPE_BUY, 0, stg_rsi REF_DEREF Get(STRAT_PARAM_ID), stg_rsi REF_DEREF GetName()); trade REF_DEREF RequestSend(_request); } else if (stg_rsi REF_DEREF SignalOpen(ORDER_TYPE_SELL)) { MqlTradeRequest _request = trade REF_DEREF GetTradeOpenRequest( - ORDER_TYPE_SELL, 0, stg_rsi REF_DEREF Get(STRAT_PARAM_ID), stg_rsi REF_DEREF GetName()); + ORDER_TYPE_SELL, 0, stg_rsi REF_DEREF Get(STRAT_PARAM_ID), stg_rsi REF_DEREF GetName()); trade REF_DEREF RequestSend(_request); } if (trade REF_DEREF Get(TRADE_STATE_ORDERS_ACTIVE)) { if (stg_rsi REF_DEREF SignalClose(ORDER_TYPE_BUY)) { // Close signal for buy order. - trade REF_DEREF OrdersCloseViaProp2( - ORDER_MAGIC, stg_rsi REF_DEREF Get(STRAT_PARAM_ID), ORDER_TYPE, ORDER_TYPE_BUY, MATH_COND_EQ, + trade REF_DEREF OrdersCloseViaProp2( + ORDER_MAGIC, stg_rsi REF_DEREF Get(STRAT_PARAM_ID), ORDER_TYPE, ORDER_TYPE_BUY, MATH_COND_EQ, ORDER_REASON_CLOSED_BY_SIGNAL, stg_rsi REF_DEREF GetOrderCloseComment()); } if (stg_rsi REF_DEREF SignalClose(ORDER_TYPE_SELL)) { - trade REF_DEREF OrdersCloseViaProp2( - ORDER_MAGIC, stg_rsi REF_DEREF Get(STRAT_PARAM_ID), ORDER_TYPE, ORDER_TYPE_SELL, MATH_COND_EQ, + trade REF_DEREF OrdersCloseViaProp2( + ORDER_MAGIC, stg_rsi REF_DEREF Get(STRAT_PARAM_ID), ORDER_TYPE, ORDER_TYPE_SELL, MATH_COND_EQ, ORDER_REASON_CLOSED_BY_SIGNAL, stg_rsi REF_DEREF GetOrderCloseComment()); } } @@ -155,7 +155,7 @@ void OnTick() { // Print strategy values every hour. Print(stg_rsi REF_DEREF ToString()); } - long _last_error = GetLastError(); + int64 _last_error = GetLastError(); if (_last_error > 0) { assertTrueOrExit(_last_error == ERR_NO_ERROR, StringFormat("Error occured! Code: %d", _last_error)); } diff --git a/tests/TickerTest.mq5 b/tests/TickerTest.mq5 index b1f8870d5..c4b89b56e 100644 --- a/tests/TickerTest.mq5 +++ b/tests/TickerTest.mq5 @@ -31,7 +31,7 @@ // Global variables. Ref indi_tick; -unsigned long total_ticks; +uint64 total_ticks; Ticker *ticker_csv; Ticker *ticker01; Ticker *ticker02; From cf14d7854dc1620f3fc1f2dc4d715ff83973a47a Mon Sep 17 00:00:00 2001 From: Adrian Kierzkowski Date: Thu, 6 Jul 2023 20:00:59 +0200 Subject: [PATCH 105/109] C++ tests now compiles. --- Convert.basic.h | 24 ++++++++++++++++++++++++ EA.mqh | 2 +- EA.struct.h | 18 ++++++++++++------ Indicator/IndicatorData.h | 19 +++++++++++++++++++ Serializer/SerializerNodeParam.h | 6 +++++- Storage/Dict/DictIteratorBase.h | 9 ++++++++- Storage/Dict/DictStruct.h | 2 +- Trade.struct.h | 12 ++++++------ Trade/TradeSignal.struct.h | 2 +- 9 files changed, 77 insertions(+), 17 deletions(-) diff --git a/Convert.basic.h b/Convert.basic.h index b1a7d546d..bd208e044 100644 --- a/Convert.basic.h +++ b/Convert.basic.h @@ -176,4 +176,28 @@ class ConvertBasic { DoubleToType(_value, _out); return _out; } + + template + static T Convert(bool _value, T& _out) { + BoolToType(_value, _out); + return _out; + } + + template + static T Convert(int64 _value, T& _out) { + LongToType(_value, _out); + return _out; + } + + template + static T Convert(double _value, T& _out) { + DoubleToType(_value, _out); + return _out; + } + + template + static T Convert(CONST_REF_TO(string) _value, T& _out) { + StringToType(_value, _out); + return _out; + } }; diff --git a/EA.mqh b/EA.mqh index a3179f174..a307aa7a8 100644 --- a/EA.mqh +++ b/EA.mqh @@ -1136,7 +1136,7 @@ class EA : public Taskable { * Returns serialized representation of the object instance. */ SerializerNodeType Serialize(Serializer &_s) { - _s.Pass(THIS_REF, "account", account, SERIALIZER_FIELD_FLAG_DYNAMIC); + _s.PassObject(THIS_REF, "account", PTR_TO_REF(account), SERIALIZER_FIELD_FLAG_DYNAMIC); for (DictStructIterator> _iter = GetStrategies() PTR_DEREF Begin(); _iter.IsValid(); ++_iter) { Strategy *_strat = _iter.Value().Ptr(); diff --git a/EA.struct.h b/EA.struct.h index 26f4ea3ff..9f72e46f8 100644 --- a/EA.struct.h +++ b/EA.struct.h @@ -111,9 +111,11 @@ struct EAParams { // Getters. template T Get(unsigned int _param) { + T _out; switch (_param) { case EA_PARAM_PROP_AUTHOR: - return (T)author; + ConvertBasic::StringToType(author, _out); + return _out; case EA_PARAM_PROP_CHART_INFO_FREQ: return (T)chart_info_freq; case EA_PARAM_PROP_DATA_EXPORT: @@ -121,19 +123,23 @@ struct EAParams { case EA_PARAM_PROP_DATA_STORE: return (T)data_store; case EA_PARAM_PROP_DESC: - return (T)desc; + ConvertBasic::StringToType(desc, _out); + return _out; case EA_PARAM_PROP_LOG_LEVEL: return (T)log_level; case EA_PARAM_PROP_NAME: - return (T)name; + ConvertBasic::StringToType(name, _out); + return _out; case EA_PARAM_PROP_RISK_MARGIN_MAX: return (T)risk_margin_max; case EA_PARAM_PROP_SIGNAL_FILTER: return (T)signal_filter; case EA_PARAM_PROP_SYMBOL: - return (T)symbol; + ConvertBasic::StringToType(symbol, _out); + return _out; case EA_PARAM_PROP_VER: - return (T)ver; + ConvertBasic::StringToType(ver, _out); + return _out; } SetUserError(ERR_INVALID_PARAMETER); return (T)WRONG_VALUE; @@ -145,7 +151,7 @@ struct EAParams { return (T)task_init; } SetUserError(ERR_INVALID_PARAMETER); - T _empty(); + T _empty; return _empty; } // Setters. diff --git a/Indicator/IndicatorData.h b/Indicator/IndicatorData.h index 5289778ee..4b1f0e083 100644 --- a/Indicator/IndicatorData.h +++ b/Indicator/IndicatorData.h @@ -562,6 +562,25 @@ class IndicatorData : public IndicatorBase { return _is_valid; } +#ifdef __cplusplus + template + bool CopyValues(FIXED_ARRAY_REF(T, _data, size), int _count, int _start_shift = 0, int _mode = 0) { + bool _is_valid = true; + if (size < _count) { + Alert("Error: CopyValues(): Provided _count = ", IntegerToString(_count), " is too much for fixed array of size ", + IntegerToString(size)); + return false; + } + for (int i = 0; i < _count; i++) { + IndicatorDataEntry _entry = GetEntry(_start_shift + i); + _is_valid &= _entry.IsValid(); + _data[i] = (T)_entry[_mode]; + } + return _is_valid; + } + +#endif + /* Getters */ int GetBarsCalculated() { return GetBars(); } diff --git a/Serializer/SerializerNodeParam.h b/Serializer/SerializerNodeParam.h index 14a7268fd..8d6c27616 100644 --- a/Serializer/SerializerNodeParam.h +++ b/Serializer/SerializerNodeParam.h @@ -158,7 +158,11 @@ class SerializerNodeParam { * Returns stringified version of the value. Note "forceQuotesOnString" flag. */ string AsString(bool includeQuotes = false, bool forceQuotesOnString = true, bool escapeString = true, - int _fp_precision = 8) { + int _fp_precision = -1) { + if (_fp_precision == -1) { + _fp_precision = GetFloatingPointPrecision(); + } + switch (_type) { case SerializerNodeParamBool: return SerializerConversions::ValueToString(_integral._bool, includeQuotes, escapeString, _fp_precision); diff --git a/Storage/Dict/DictIteratorBase.h b/Storage/Dict/DictIteratorBase.h index 4714239ab..c9ac08fbf 100644 --- a/Storage/Dict/DictIteratorBase.h +++ b/Storage/Dict/DictIteratorBase.h @@ -93,7 +93,14 @@ class DictIteratorBase { K Key() { CheckValidity(); - return PTR_ATTRIB(_dict, GetMode()) == DictModeList ? (K)_slotIdx : _dict PTR_DEREF GetSlot(_slotIdx) PTR_DEREF key; + + if (PTR_ATTRIB(_dict, GetMode()) == DictModeList) { + K _key; + ConvertBasic::LongToType(_slotIdx, _key); + return _key; + } + + return _dict PTR_DEREF GetSlot(_slotIdx) PTR_DEREF key; } string KeyAsString(bool includeQuotes = false) { diff --git a/Storage/Dict/DictStruct.h b/Storage/Dict/DictStruct.h index 08981389b..6b73ebc55 100644 --- a/Storage/Dict/DictStruct.h +++ b/Storage/Dict/DictStruct.h @@ -444,7 +444,7 @@ class DictStruct : public DictBase { SerializerNodeType Serialize(Serializer& s) { if (s.IsWriting()) { for (DictIteratorBase i(Begin()); i.IsValid(); ++i) - s.PassObject(this, THIS_ATTR GetMode() == DictModeDict ? i.KeyAsString() : "", i.Value()); + s.PassObject(THIS_REF, THIS_ATTR GetMode() == DictModeDict ? i.KeyAsString() : "", i.Value()); return (THIS_ATTR GetMode() == DictModeDict) ? SerializerNodeObject : SerializerNodeArray; } else { diff --git a/Trade.struct.h b/Trade.struct.h index c959c1e94..40d48d3a4 100644 --- a/Trade.struct.h +++ b/Trade.struct.h @@ -213,22 +213,22 @@ struct TradeParams { void Set(ENUM_TRADE_PARAM _param, T _value) { switch (_param) { case TRADE_PARAM_BARS_MIN: - bars_min = (unsigned short)_value; + ConvertBasic::Convert(_value, bars_min); return; case TRADE_PARAM_LOT_SIZE: - lot_size = (float)_value; + ConvertBasic::Convert(_value, lot_size); return; case TRADE_PARAM_MAGIC_NO: - magic_no = (uint64)_value; + ConvertBasic::Convert(_value, magic_no); return; case TRADE_PARAM_ORDER_COMMENT: - order_comment = SerializerConversions::ValueToString(_value); + ConvertBasic::Convert(SerializerConversions::ValueToString(_value), order_comment); return; case TRADE_PARAM_RISK_MARGIN: - risk_margin = (float)_value; + ConvertBasic::Convert(_value, risk_margin); return; case TRADE_PARAM_SLIPPAGE: - slippage = (unsigned int)_value; + ConvertBasic::Convert(_value, slippage); return; default: break; diff --git a/Trade/TradeSignal.struct.h b/Trade/TradeSignal.struct.h index 76d171b89..5ccc55c6b 100644 --- a/Trade/TradeSignal.struct.h +++ b/Trade/TradeSignal.struct.h @@ -156,7 +156,7 @@ struct TradeSignalEntry { strength = (float)_value; return; case TRADE_SIGNAL_PROP_TF: - tf = (ENUM_TIMEFRAMES)_value; + tf = (ENUM_TIMEFRAMES)(int)_value; return; case TRADE_SIGNAL_PROP_TIME: timestamp = (int64)_value; From 4dffc63748bdb4b5692fe9d487de4c44c04ed237 Mon Sep 17 00:00:00 2001 From: Adrian Kierzkowski Date: Fri, 14 Jul 2023 18:55:30 +0200 Subject: [PATCH 106/109] C++ and MQL fixes. Cleaned up Std.h regarding array/reference macros. Added Visual Studio file exclusions into .gitignore. --- .gitignore | 4 + Bar.struct.h | 2 +- Convert.basic.h | 2 +- Pattern.struct.h | 37 ++++++++ Platform/Chart/Chart.struct.static.h | 2 +- Platform/Chart/Chart.symboltf.h | 4 +- Platform/Chart/ChartBase.h | 2 +- Platform/Chart/ChartMt.h | 4 +- Platform/Platform.extern.h | 2 +- Platform/Platform.h | 12 +-- Std.h | 137 ++++++++++++++++++--------- Storage/Objects.h | 4 +- Trade.struct.h | 6 +- 13 files changed, 154 insertions(+), 64 deletions(-) diff --git a/.gitignore b/.gitignore index d21efcaed..d689d2162 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,7 @@ docs/api/build .DS_Store docs/build +.vs +x64 +*.sln +*.vcx* diff --git a/Bar.struct.h b/Bar.struct.h index fe55530d2..e7c649bd9 100644 --- a/Bar.struct.h +++ b/Bar.struct.h @@ -70,7 +70,7 @@ struct BarOHLC low = fmin(low, _prices[i]); } } - BarOHLC(CONST_ARRAY_REF(double, _prices, 4), datetime _time = 0) : time(_time) { + BarOHLC(CONST_FIXED_ARRAY_REF(double, _prices, 4), datetime _time = 0) : time(_time) { _time = _time == (datetime)0 ? TimeCurrent() : _time; int _size = 4; close = _prices[0]; diff --git a/Convert.basic.h b/Convert.basic.h index bd208e044..fcec38b90 100644 --- a/Convert.basic.h +++ b/Convert.basic.h @@ -196,7 +196,7 @@ class ConvertBasic { } template - static T Convert(CONST_REF_TO(string) _value, T& _out) { + static T Convert(CONST_REF_TO_SIMPLE(string) _value, T& _out) { StringToType(_value, _out); return _out; } diff --git a/Pattern.struct.h b/Pattern.struct.h index 97c756d28..8191780e7 100644 --- a/Pattern.struct.h +++ b/Pattern.struct.h @@ -302,12 +302,15 @@ struct PatternCandle2 : PatternCandle { SetPattern(_enum, CheckPattern(_enum, _c)); } } +#ifndef __MQL__ + // In MQL we use non-fixed-array constructor. PatternCandle2(CONST_FIXED_ARRAY_REF(BarOHLC, _c, 8)) : PatternCandle(PATTERN_2CANDLE_NONE) { for (int i = 0; i < sizeof(int) * 8; i++) { ENUM_PATTERN_2CANDLE _enum = (ENUM_PATTERN_2CANDLE)(1 << i); SetPattern(_enum, CheckPattern(_enum, _c)); } } +#endif // Calculation methods. static bool CheckPattern(ENUM_PATTERN_2CANDLE _enum, CONST_ARRAY_REF(BarOHLC, _c)) { switch (_enum) { @@ -417,12 +420,15 @@ struct PatternCandle3 : PatternCandle { SetPattern(_enum, CheckPattern(_enum, _c)); } } +#ifndef __MQL__ + // In MQL we use non-fixed-array constructor. PatternCandle3(CONST_FIXED_ARRAY_REF(BarOHLC, _c, 8)) : PatternCandle(PATTERN_3CANDLE_NONE) { for (int i = 0; i < sizeof(int) * 8; i++) { ENUM_PATTERN_3CANDLE _enum = (ENUM_PATTERN_3CANDLE)(1 << i); SetPattern(_enum, CheckPattern(_enum, _c)); } } +#endif // Calculation methods. static bool CheckPattern(ENUM_PATTERN_3CANDLE _enum, CONST_ARRAY_REF(BarOHLC, _c)) { switch (_enum) { @@ -539,12 +545,15 @@ struct PatternCandle4 : PatternCandle { SetPattern(_enum, CheckPattern(_enum, _c)); } } +#ifndef __MQL__ + // In MQL we use non-fixed-array constructor. PatternCandle4(CONST_FIXED_ARRAY_REF(BarOHLC, _c, 8)) : PatternCandle(PATTERN_4CANDLE_NONE) { for (int i = 0; i < sizeof(int) * 8; i++) { ENUM_PATTERN_4CANDLE _enum = (ENUM_PATTERN_4CANDLE)(1 << i); SetPattern(_enum, CheckPattern(_enum, _c)); } } +#endif // Calculation methods. static bool CheckPattern(ENUM_PATTERN_4CANDLE _enum, CONST_ARRAY_REF(BarOHLC, _c)) { PatternCandle3 _c3(_c); @@ -711,12 +720,16 @@ struct PatternCandle5 : PatternCandle { SetPattern(_enum, CheckPattern(_enum, _c)); } } +#ifndef __MQL__ + // In MQL we use non-fixed-array constructor. PatternCandle5(CONST_FIXED_ARRAY_REF(BarOHLC, _c, 8)) : PatternCandle(PATTERN_5CANDLE_NONE) { for (int i = 0; i < sizeof(int) * 8; i++) { ENUM_PATTERN_5CANDLE _enum = (ENUM_PATTERN_5CANDLE)(1 << i); SetPattern(_enum, CheckPattern(_enum, _c)); } } +#endif + // Calculation methods. static bool CheckPattern(ENUM_PATTERN_5CANDLE _enum, CONST_ARRAY_REF(BarOHLC, _c)) { switch (_enum) { @@ -868,12 +881,16 @@ struct PatternCandle6 : PatternCandle { SetPattern(_enum, CheckPattern(_enum, _c)); } } +#ifndef __MQL__ + // In MQL we use non-fixed-array constructor. PatternCandle6(CONST_FIXED_ARRAY_REF(BarOHLC, _c, 8)) : PatternCandle(PATTERN_6CANDLE_NONE) { for (int i = 0; i < sizeof(int) * 8; i++) { ENUM_PATTERN_6CANDLE _enum = (ENUM_PATTERN_6CANDLE)(1 << i); SetPattern(_enum, CheckPattern(_enum, _c)); } } +#endif + // Calculation methods. static bool CheckPattern(ENUM_PATTERN_6CANDLE _enum, CONST_ARRAY_REF(BarOHLC, _c)) { switch (_enum) { @@ -893,12 +910,16 @@ struct PatternCandle7 : PatternCandle { SetPattern(_enum, CheckPattern(_enum, _c)); } } +#ifndef __MQL__ + // In MQL we use non-fixed-array constructor. PatternCandle7(CONST_FIXED_ARRAY_REF(BarOHLC, _c, 8)) : PatternCandle(PATTERN_7CANDLE_NONE) { for (int i = 0; i < sizeof(int) * 8; i++) { ENUM_PATTERN_7CANDLE _enum = (ENUM_PATTERN_7CANDLE)(1 << i); SetPattern(_enum, CheckPattern(_enum, _c)); } } +#endif + // Calculation methods. static bool CheckPattern(ENUM_PATTERN_7CANDLE _enum, CONST_ARRAY_REF(BarOHLC, _c)) { switch (_enum) { @@ -918,12 +939,16 @@ struct PatternCandle8 : PatternCandle { SetPattern(_enum, CheckPattern(_enum, _c)); } } +#ifndef __MQL__ + // In MQL we use non-fixed-array constructor. PatternCandle8(CONST_FIXED_ARRAY_REF(BarOHLC, _c, 8)) : PatternCandle(PATTERN_8CANDLE_NONE) { for (int i = 0; i < sizeof(int) * 8; i++) { ENUM_PATTERN_8CANDLE _enum = (ENUM_PATTERN_8CANDLE)(1 << i); SetPattern(_enum, CheckPattern(_enum, _c)); } } +#endif + // Calculation methods. static bool CheckPattern(ENUM_PATTERN_8CANDLE _enum, CONST_ARRAY_REF(BarOHLC, _c)) { switch (_enum) { @@ -943,12 +968,16 @@ struct PatternCandle9 : PatternCandle { SetPattern(_enum, CheckPattern(_enum, _c)); } } +#ifndef __MQL__ + // In MQL we use non-fixed-array constructor. PatternCandle9(CONST_FIXED_ARRAY_REF(BarOHLC, _c, 8)) : PatternCandle(PATTERN_9CANDLE_NONE) { for (int i = 0; i < sizeof(int) * 8; i++) { ENUM_PATTERN_9CANDLE _enum = (ENUM_PATTERN_9CANDLE)(1 << i); SetPattern(_enum, CheckPattern(_enum, _c)); } } +#endif + // Calculation methods. static bool CheckPattern(ENUM_PATTERN_9CANDLE _enum, CONST_ARRAY_REF(BarOHLC, _c)) { switch (_enum) { @@ -968,12 +997,16 @@ struct PatternCandle10 : PatternCandle { SetPattern(_enum, CheckPattern(_enum, _c)); } } +#ifndef __MQL__ + // In MQL we use non-fixed-array constructor. PatternCandle10(CONST_FIXED_ARRAY_REF(BarOHLC, _c, 8)) : PatternCandle(PATTERN_10CANDLE_NONE) { for (int i = 0; i < sizeof(int) * 8; i++) { ENUM_PATTERN_10CANDLE _enum = (ENUM_PATTERN_10CANDLE)(1 << i); SetPattern(_enum, CheckPattern(_enum, _c)); } } +#endif + // Calculation methods. static bool CheckPattern(ENUM_PATTERN_10CANDLE _enum, CONST_ARRAY_REF(BarOHLC, _c)) { switch (_enum) { @@ -1019,6 +1052,8 @@ struct PatternEntry { pattern8(_c), pattern9(_c), pattern10(_c) {} +#ifndef __MQL__ + // In MQL we use non-fixed-array constructor. PatternEntry(FIXED_ARRAY_REF(BarOHLC, _c, 8)) : pattern1(_c[0]), pattern2(_c), @@ -1030,6 +1065,8 @@ struct PatternEntry { pattern8(_c), pattern9(_c), pattern10(_c) {} +#endif + // Operator methods. unsigned int operator[](const int _index) const { switch (_index) { diff --git a/Platform/Chart/Chart.struct.static.h b/Platform/Chart/Chart.struct.static.h index fae59fb87..ba9c086fa 100644 --- a/Platform/Chart/Chart.struct.static.h +++ b/Platform/Chart/Chart.struct.static.h @@ -325,7 +325,7 @@ struct ChartStatic { * * If local history is empty (not loaded), function returns 0. */ - static datetime GetBarTime(CONST_REF_TO(string) _symbol, ENUM_TIMEFRAMES _tf, unsigned int _shift = 0) { + static datetime GetBarTime(CONST_REF_TO_SIMPLE(string) _symbol, ENUM_TIMEFRAMES _tf, unsigned int _shift = 0) { #ifdef __MQL4__ datetime _time = ::iTime(_symbol, _tf, _shift); // Same as: Time[_shift] diff --git a/Platform/Chart/Chart.symboltf.h b/Platform/Chart/Chart.symboltf.h index 9fbb59e20..29a82e6bc 100644 --- a/Platform/Chart/Chart.symboltf.h +++ b/Platform/Chart/Chart.symboltf.h @@ -42,8 +42,8 @@ struct SymbolTf { const ENUM_TIMEFRAMES tf; const string symbol_tf_key; - CONST_REF_TO(string) Key() const { return symbol_tf_key; } - CONST_REF_TO(string) Symbol() const { return symbol; } + RETURN_REF_TO_SIMPLE(string) Key() const { return symbol_tf_key; } + RETURN_REF_TO_SIMPLE(string) Symbol() const { return symbol; } ENUM_TIMEFRAMES Tf() const { return tf; } SymbolTf(string _symbol, ENUM_TIMEFRAMES _tf) diff --git a/Platform/Chart/ChartBase.h b/Platform/Chart/ChartBase.h index cf3b939c7..1b4a049c7 100644 --- a/Platform/Chart/ChartBase.h +++ b/Platform/Chart/ChartBase.h @@ -133,7 +133,7 @@ class ChartBase : public Dynamic { /** * Return symbol bound to chart. */ - CONST_REF_TO(string) GetSymbol() { return cparams.Get(CHART_PARAM_SYMBOL); } + CONST_REF_TO_SIMPLE(string) GetSymbol() { return cparams.Get(CHART_PARAM_SYMBOL); } /** * Return time-frame bound to chart. diff --git a/Platform/Chart/ChartMt.h b/Platform/Chart/ChartMt.h index 6dc74488e..d98b4c8e1 100644 --- a/Platform/Chart/ChartMt.h +++ b/Platform/Chart/ChartMt.h @@ -300,6 +300,8 @@ struct ChartBarTime { ChartBarTime() : symbol_tf(Symbol(), PERIOD_CURRENT) {} datetime operator[](const int _shift) const { return Get(symbol_tf, _shift); } static datetime Get(const SymbolTf& _symbol_tf, const int _shift) { - return ChartStatic::GetBarTime(_symbol_tf.Symbol(), _symbol_tf.Tf(), _shift); + string _symbol = _symbol_tf.Symbol(); + ENUM_TIMEFRAMES _tf = _symbol_tf.Tf(); + return ChartStatic::GetBarTime(_symbol, _tf, _shift); } }; diff --git a/Platform/Platform.extern.h b/Platform/Platform.extern.h index 538725218..f5b62bd7f 100644 --- a/Platform/Platform.extern.h +++ b/Platform/Platform.extern.h @@ -59,7 +59,7 @@ extern void Alert(string argument); /** * Returns number of candles for a given symbol and time-frame. */ -extern int Bars(CONST_REF_TO(string) _symbol, ENUM_TIMEFRAMES _tf); +extern int Bars(CONST_REF_TO_SIMPLE(string) _symbol, ENUM_TIMEFRAMES _tf); /** * Returns the number of calculated data for the specified indicator. diff --git a/Platform/Platform.h b/Platform/Platform.h index 9fbbc7ae9..4890e377c 100644 --- a/Platform/Platform.h +++ b/Platform/Platform.h @@ -36,7 +36,7 @@ /** * Returns number of candles for a given symbol and time-frame. */ -extern int Bars(CONST_REF_TO(string) _symbol, ENUM_TIMEFRAMES _tf); +extern int Bars(CONST_REF_TO_SIMPLE(string) _symbol, ENUM_TIMEFRAMES _tf); #endif @@ -197,7 +197,7 @@ class Platform { /** * Adds indicator to be processed by platform and tries to initialize its data source(s). */ - static void AddWithDefaultBindings(IndicatorData *_indi, CONST_REF_TO(string) _symbol, ENUM_TIMEFRAMES _tf) { + static void AddWithDefaultBindings(IndicatorData *_indi, string _symbol, ENUM_TIMEFRAMES _tf) { Add(_indi); BindDefaultDataSource(_indi, _symbol, _tf); } @@ -255,7 +255,7 @@ class Platform { /** * Returns number of candles for a given symbol and time-frame. */ - static int Bars(CONST_REF_TO(string) _symbol, ENUM_TIMEFRAMES _tf) { + static int Bars(CONST_REF_TO_SIMPLE(string) _symbol, ENUM_TIMEFRAMES _tf) { Print("Not yet implemented: ", __FUNCTION__, " returns 0."); return 0; } @@ -282,7 +282,7 @@ class Platform { * Note that some indicators may work on custom set of buffers required from data source and not on Candle or Tick * indicator. */ - static void BindDefaultDataSource(IndicatorData *_indi, CONST_REF_TO(string) _symbol, ENUM_TIMEFRAMES _tf) { + static void BindDefaultDataSource(IndicatorData *_indi, CONST_REF_TO_SIMPLE(string) _symbol, ENUM_TIMEFRAMES _tf) { Flags _suitable_ds_types = _indi PTR_DEREF GetSuitableDataSourceTypes(); IndicatorData *_default_indi_candle = FetchDefaultCandleIndicator(_symbol, _tf); @@ -383,7 +383,7 @@ class Platform { /** * Returns default properties for given symbol for current platform. */ - static SymbolInfoProp FetchDefaultSymbolProps(CONST_REF_TO(string) _symbol) { + static SymbolInfoProp FetchDefaultSymbolProps(CONST_REF_TO_SIMPLE(string) _symbol) { SymbolInfoProp props; #ifdef __MQLBUILD__ props.pip_value = SymbolInfoStatic::GetPipValue(_symbol); @@ -502,7 +502,7 @@ DictStruct> Platform::indis_dflt; /** * Returns number of candles for a given symbol and time-frame. */ -int Bars(CONST_REF_TO(string) _symbol, ENUM_TIMEFRAMES _tf) { return Platform::Bars(_symbol, _tf); } +int Bars(CONST_REF_TO_SIMPLE(string) _symbol, ENUM_TIMEFRAMES _tf) { return Platform::Bars(_symbol, _tf); } /** * Returns the number of calculated data for the specified indicator. diff --git a/Std.h b/Std.h index a27bef3b4..caa222a15 100644 --- a/Std.h +++ b/Std.h @@ -79,84 +79,129 @@ #define VOID_DATA(N) void* N #endif -// References. -#ifdef __cplusplus -#define REF(X) (&X) -#else +// Reference to simple type like bool, int, double, string. +#ifdef __MQL__ #define REF(X) X& +#else +#define REF(X) (&X) #endif // Arrays and references to arrays. #define _COMMA , + +// Reference to object. #ifdef __MQL__ -#define ARRAY_DECLARATION_BRACKETS [] +#define REF_TO(T) T* #else -// C++'s _cpp_array is an object, so no brackets are needed. -#define ARRAY_DECLARATION_BRACKETS +#define REF_TO(T) T& #endif +// Const reference to object. +#define CONST_REF_TO(T) const REF_TO(T) + +// Reference to simple type like bool, int, double, string. +#define REF_TO_SIMPLE(T) T& + +// Const reference to simple type like bool, int, double, string. +#define CONST_REF_TO_SIMPLE(T) const REF_TO_SIMPLE(T) + +// Returning type for methods that returns simple types as int, double, string. #ifdef __MQL__ -/** - * Reference to object. - */ +#define RETURN_REF_TO_SIMPLE(T) T +#else +#define RETURN_REF_TO_SIMPLE(T) T& +#endif -#define REF_TO(T) T* -#define CONST_REF_TO(T) const REF_TO(T) +// Returning type for methods that returns simple contstant types as int, double, string. +#define RETURN_CONST_REF_TO_SIMPLE(T) const RETURN_REF_TO_SIMPLE(T) + +// Casts reference to object to given type. +#ifdef __MQL__ #define REF_CAST(T) (T*) +#else +#define REF_CAST(T) (T&) +#endif /** - * Reference to the array. - * - * @usage - * ARRAY_REF(, ) + * Type of the array. + * T = Type of the array items. + * Example: ARRAY_TYPE(int) items; ArrayPush(items, 1); */ +#ifdef __MQL__ #define ARRAY_TYPE(T) T[] -#define ARRAY_REF(T, N) REF(T) N ARRAY_DECLARATION_BRACKETS -#define FIXED_ARRAY_REF(T, N, S) ARRAY_REF(T, N) - -#define CONST_ARRAY_REF(T, N) const N ARRAY_DECLARATION_BRACKETS +#else +#define ARRAY_TYPE(T) _cpp_array +#endif /** - * Array definition. - * - * @usage - * ARRAY(, ) + * Declaration of the array of given type and name. + * T = Type of the array items. + * N = Name of the array. + * Example: ARRAY(int, items); ArrayPush(items, 1); */ +#ifdef __MQL__ #define ARRAY(T, N) T N[] -#define FIXED_ARRAY(T, N, SIZE) T N[SIZE] - -#define CONST_FIXED_ARRAY_REF(T, N, S) const FIXED_ARRAY_REF(T, N, S) +#else +#define ARRAY(T, N) ::_cpp_array N +#endif +/** + * Reference to the array of given type and name. + * T = Type of the array items. + * N = Name of the array. + * Example: void Append(ARRAY_REF(int, values)); + */ +#ifdef __MQL__ +#define ARRAY_REF(T, N) REF(T) N[] #else +#define ARRAY_REF(T, N) ARRAY_TYPE(T) & N +#endif + /** - * Reference to object. + * Reference to the constant array of given type and name. + * T = Type of the array items. + * N = Name of the array. + * Example: void Append(CONST_ARRAY_REF(int, values)); */ -#define REF_TO(T) T& -#define CONST_REF_TO(T) const REF_TO(T) -#define REF_CAST(T) (T&) +#ifdef __MQL__ +#define CONST_ARRAY_REF(T, N) const T& N[] +#else +#define CONST_ARRAY_REF(T, N) const _cpp_array& N +#endif /** + * Declaration of the array of given type, name and fixed size. + * T = Type of the array items. + * N = Name of the array. + * S = Fixed size of the array. + * Example: FIXED_ARRAY(int, values, 1); values[0] = 1; + */ +#define FIXED_ARRAY(T, N, SIZE) T N[SIZE] - * Reference to the array. - * - * @usage - * ARRAY_REF(, ) +/** + * Reference to the array of given type and name and fixed size. + * T = Type of the array items. + * N = Name of the array. + * S = Fixed size of the array. + * Example: void Append(FIXED_ARRAY_REF(int, values, 5)); */ -#define ARRAY_TYPE(T) _cpp_array -#define ARRAY_REF(T, N) ARRAY_TYPE(T) & N +#ifdef __MQL__ +#define FIXED_ARRAY_REF(T, N, S) ARRAY_REF(T, N) +#else #define FIXED_ARRAY_REF(T, N, S) T(&N)[S] - -#define CONST_ARRAY_REF(T, N) const _cpp_array& N -#define CONST_FIXED_ARRAY_REF(T, N, S) const FIXED_ARRAY_REF(T, N, S) +#endif /** - * Array definition. - * - * @usage - * ARRAY(, ) + * Reference to the constant array of given type and name and fixed size. + * T = Type of the array items. + * N = Name of the array. + * S = Fixed size of the array. + * Example: void Append(FIXED_ARRAY_REF(int, values, 5)); */ -#define ARRAY(T, N) ::_cpp_array N -#define FIXED_ARRAY(T, N, SIZE) T N[SIZE] +#ifdef __MQL__ +#define CONST_FIXED_ARRAY_REF(T, N, S) const FIXED_ARRAY_REF(T, N, S) +#else +#define CONST_FIXED_ARRAY_REF(T, N, S) const FIXED_ARRAY_REF(T, N, S) #endif // typename(T) diff --git a/Storage/Objects.h b/Storage/Objects.h index 329028333..0b584041d 100644 --- a/Storage/Objects.h +++ b/Storage/Objects.h @@ -48,7 +48,7 @@ class Objects { /** * Tries to retrieve pointer to object for a given key. Returns true if object did exist. */ - static bool TryGet(CONST_REF_TO(string) key, C*& out_ptr) { + static bool TryGet(CONST_REF_TO_SIMPLE(string) key, C*& out_ptr) { unsigned int position; if (!GetObjects() PTR_DEREF KeyExists(key, position)) { out_ptr = NULL; @@ -62,7 +62,7 @@ class Objects { /** * Stores object pointer with a given key. */ - static C* Set(CONST_REF_TO(string) key, C* ptr) { + static C* Set(CONST_REF_TO_SIMPLE(string) key, C* ptr) { Ref _ref(ptr); GetObjects() PTR_DEREF Set(key, _ref); return ptr; diff --git a/Trade.struct.h b/Trade.struct.h index 40d48d3a4..a6cc518cc 100644 --- a/Trade.struct.h +++ b/Trade.struct.h @@ -221,9 +221,11 @@ struct TradeParams { case TRADE_PARAM_MAGIC_NO: ConvertBasic::Convert(_value, magic_no); return; - case TRADE_PARAM_ORDER_COMMENT: - ConvertBasic::Convert(SerializerConversions::ValueToString(_value), order_comment); + case TRADE_PARAM_ORDER_COMMENT: { + string _value_string = SerializerConversions::ValueToString(_value); + ConvertBasic::Convert(_value_string, order_comment); return; + } case TRADE_PARAM_RISK_MARGIN: ConvertBasic::Convert(_value, risk_margin); return; From 5395496beaebe7a8e41fc03aa4218778d72ca575 Mon Sep 17 00:00:00 2001 From: Adrian Kierzkowski Date: Sat, 15 Jul 2023 21:55:02 +0200 Subject: [PATCH 107/109] Looks like C++/MT4 errors are fixed. Need some additional fixed for MT5. --- Convert.basic.h | 6 ++++++ Convert.mqh | 2 +- EA.mqh | 4 ++-- Indicators/Bitwise/Indi_Pattern.mqh | 10 +++++----- Indicators/Indi_Drawer.mqh | 2 +- Indicators/tests/Indi_OHLC.test.cpp | 2 +- Indicators/tests/Indi_Pattern.test.cpp | 2 +- Indicators/tests/Indi_Price.test.cpp | 2 +- Platform/Chart/Chart.symboltf.h | 4 ++-- Platform/Web/Web.h | 1 + Serializer/SerializerSqlite.h | 3 ++- Std.h | 2 +- Storage/Array.extern.h | 8 ++------ Storage/Array.h | 14 ++++++++++++++ Storage/Database.h | 2 +- Storage/Dict/DictBase.h | 2 +- Storage/Dict/DictIteratorBase.h | 3 ++- Storage/ValueStorage.h | 2 +- tests/EATest.mq5 | 2 +- 19 files changed, 46 insertions(+), 27 deletions(-) diff --git a/Convert.basic.h b/Convert.basic.h index fcec38b90..42bb39e78 100644 --- a/Convert.basic.h +++ b/Convert.basic.h @@ -183,6 +183,12 @@ class ConvertBasic { return _out; } + template + static T Convert(int _value, T& _out) { + LongToType((long)_value, _out); + return _out; + } + template static T Convert(int64 _value, T& _out) { LongToType(_value, _out); diff --git a/Convert.mqh b/Convert.mqh index 86abc3ed9..73a235be7 100644 --- a/Convert.mqh +++ b/Convert.mqh @@ -223,7 +223,7 @@ class Convert { * Convert points into price value. */ static double PointsToValue(int64 pts, string _symbol = NULL) { - return PointsToValue(pts, SymbolInfoStatic::SymbolInfoInteger(_symbol, SYMBOL_TRADE_CALC_MODE)); + return PointsToValue(pts, (int)SymbolInfoStatic::SymbolInfoInteger(_symbol, SYMBOL_TRADE_CALC_MODE)); } /** diff --git a/EA.mqh b/EA.mqh index a307aa7a8..d5f2c74d9 100644 --- a/EA.mqh +++ b/EA.mqh @@ -67,8 +67,8 @@ class EA : public Taskable { Dict ddata; // Custom user data. Dict idata; // Custom user data. DictObject trade; - DictObject> data_indi; - DictObject> data_stg; + DictObject> data_indi; + DictObject> data_stg; EAParams eparams; EAProcessResult eresults; EAState estate; diff --git a/Indicators/Bitwise/Indi_Pattern.mqh b/Indicators/Bitwise/Indi_Pattern.mqh index 58b40c201..d00d30f13 100644 --- a/Indicators/Bitwise/Indi_Pattern.mqh +++ b/Indicators/Bitwise/Indi_Pattern.mqh @@ -93,7 +93,7 @@ class Indi_Pattern : public Indicator { int i; int _max_modes = Get(STRUCT_ENUM(IndicatorDataParams, IDATA_PARAM_MAX_MODES)); - INDI_REQUIRE_SHIFT_OR_RETURN(GetCandle(), ToRelShift(_abs_shift) + _max_modes, WRONG_VALUE); + INDI_REQUIRE_SHIFT_OR_RETURN(GetCandle(), ToRelShift(_abs_shift) + _max_modes, (double)WRONG_VALUE); FIXED_ARRAY(BarOHLC, _ohlcs, 8); @@ -104,7 +104,7 @@ class Indi_Pattern : public Indicator { _ohlcs[i] = GetCandle() PTR_DEREF GetOHLC(ToRelShift(_abs_shift) + i); if (!_ohlcs[i].IsValid()) { // Return empty entry on invalid candles. - return WRONG_VALUE; + return (double)WRONG_VALUE; } } break; @@ -122,7 +122,7 @@ class Indi_Pattern : public Indicator { "SetIndicatorData() " "method, which is a part of PatternParams structure."); SetUserError(ERR_INVALID_PARAMETER); - return WRONG_VALUE; + return (double)WRONG_VALUE; } for (i = 0; i < _max_modes; ++i) { @@ -132,13 +132,13 @@ class Indi_Pattern : public Indicator { _ohlcs[i].close = GetDataSource() PTR_DEREF GetValue(PRICE_CLOSE, ToRelShift(_abs_shift) + i); if (!_ohlcs[i].IsValid()) { // Return empty entry on invalid candles. - return WRONG_VALUE; + return (double)WRONG_VALUE; } } break; default: SetUserError(ERR_INVALID_PARAMETER); - return WRONG_VALUE; + return (double)WRONG_VALUE; } PatternEntry pattern(_ohlcs); return pattern[_mode + 1]; diff --git a/Indicators/Indi_Drawer.mqh b/Indicators/Indi_Drawer.mqh index 75cd23825..61f9890a6 100644 --- a/Indicators/Indi_Drawer.mqh +++ b/Indicators/Indi_Drawer.mqh @@ -166,7 +166,7 @@ class Indi_Drawer : public Indicator { */ } - Redis *Redis() { return &redis; } + Redis *GetRedis() { return &redis; } /** * Returns the indicator value. diff --git a/Indicators/tests/Indi_OHLC.test.cpp b/Indicators/tests/Indi_OHLC.test.cpp index ba42aef26..4ea8c86c3 100644 --- a/Indicators/tests/Indi_OHLC.test.cpp +++ b/Indicators/tests/Indi_OHLC.test.cpp @@ -25,7 +25,7 @@ */ // Includes. -#include "../Indi_OHLC.mqh" +#include "../../Indicators/OHLC/Indi_OHLC.mqh" #include "../../Platform/Platform.h" diff --git a/Indicators/tests/Indi_Pattern.test.cpp b/Indicators/tests/Indi_Pattern.test.cpp index 1828b7ae0..888cbd60c 100644 --- a/Indicators/tests/Indi_Pattern.test.cpp +++ b/Indicators/tests/Indi_Pattern.test.cpp @@ -25,7 +25,7 @@ */ // Includes. -#include "../Indi_Pattern.mqh" +#include "../../Indicators/Bitwise/Indi_Pattern.mqh" #include "../../Platform/Platform.h" diff --git a/Indicators/tests/Indi_Price.test.cpp b/Indicators/tests/Indi_Price.test.cpp index c0cd11094..203d9c372 100644 --- a/Indicators/tests/Indi_Price.test.cpp +++ b/Indicators/tests/Indi_Price.test.cpp @@ -25,7 +25,7 @@ */ // Includes. -#include "../Indi_Price.mqh" +#include "../../Indicators/Price/Indi_Price.h" #include "../../Platform/Platform.h" diff --git a/Platform/Chart/Chart.symboltf.h b/Platform/Chart/Chart.symboltf.h index 29a82e6bc..e3b9c2f9f 100644 --- a/Platform/Chart/Chart.symboltf.h +++ b/Platform/Chart/Chart.symboltf.h @@ -42,8 +42,8 @@ struct SymbolTf { const ENUM_TIMEFRAMES tf; const string symbol_tf_key; - RETURN_REF_TO_SIMPLE(string) Key() const { return symbol_tf_key; } - RETURN_REF_TO_SIMPLE(string) Symbol() const { return symbol; } + RETURN_CONST_REF_TO_SIMPLE(string) Key() const { return symbol_tf_key; } + RETURN_CONST_REF_TO_SIMPLE(string) Symbol() const { return symbol; } ENUM_TIMEFRAMES Tf() const { return tf; } SymbolTf(string _symbol, ENUM_TIMEFRAMES _tf) diff --git a/Platform/Web/Web.h b/Platform/Web/Web.h index fb1e27097..14d8af2aa 100644 --- a/Platform/Web/Web.h +++ b/Platform/Web/Web.h @@ -23,6 +23,7 @@ // Properties. #ifdef __MQL__ #property strict +#else // Allows the preprocessor to include a header file when it is needed. #pragma once #endif diff --git a/Serializer/SerializerSqlite.h b/Serializer/SerializerSqlite.h index 291c468cb..a26500dc1 100644 --- a/Serializer/SerializerSqlite.h +++ b/Serializer/SerializerSqlite.h @@ -80,7 +80,8 @@ class SerializerSqlite { } if (!_db.TableExists(_table)) { - if (!_db.CreateTable(_table, _db.GetTableSchema(_table))) { + DatabaseTableSchema _schema = _db.GetTableSchema(_table); + if (!_db.CreateTable(_table, _schema)) { return false; } } diff --git a/Std.h b/Std.h index caa222a15..60338aae6 100644 --- a/Std.h +++ b/Std.h @@ -99,7 +99,7 @@ // Const reference to object. #define CONST_REF_TO(T) const REF_TO(T) -// Reference to simple type like bool, int, double, string. +// Reference to simple type like bool, int, double, string or structure that is not treated as object by MT. #define REF_TO_SIMPLE(T) T& // Const reference to simple type like bool, int, double, string. diff --git a/Storage/Array.extern.h b/Storage/Array.extern.h index 20cf8635e..963f414e5 100644 --- a/Storage/Array.extern.h +++ b/Storage/Array.extern.h @@ -99,13 +99,9 @@ int ArraySort(ARRAY_REF(T, array)) { } template -void ArrayFill(ARRAY_REF(X, array), int start, int count, X value) { - Array::ArrayFill(array, start, count, value); -} +void ArrayFill(ARRAY_REF(X, array), int start, int count, X value); template -void ArrayFill(FIXED_ARRAY_REF(X, array, size), int start, int count, X value) { - Array::ArrayFill(array, start, count, value); -} +void ArrayFill(FIXED_ARRAY_REF(X, array, size), int start, int count, X value); #endif diff --git a/Storage/Array.h b/Storage/Array.h index 44fa76f47..84aa976a0 100644 --- a/Storage/Array.h +++ b/Storage/Array.h @@ -802,3 +802,17 @@ void ArrayPushObject(ARRAY_REF(X, array), X& value) { ::ArrayResize(array, Array::ArraySize(array) + 1); array[Array::ArraySize(array) - 1] = value; } + +#ifndef __MQL__ + +template +void ArrayFill(ARRAY_REF(X, array), int start, int count, X value) { + Array::ArrayFill(array, start, count, value); +} + +template +void ArrayFill(FIXED_ARRAY_REF(X, array, size), int start, int count, X value) { + Array::ArrayFill(array, start, count, value); +} + +#endif \ No newline at end of file diff --git a/Storage/Database.h b/Storage/Database.h index 4e200832f..3b0d878f4 100644 --- a/Storage/Database.h +++ b/Storage/Database.h @@ -99,7 +99,7 @@ class Database { /** * Creates table. */ - bool CreateTable(string _name, DatabaseTableSchema &_schema) { + bool CreateTable(string _name, REF_TO_SIMPLE(DatabaseTableSchema) _schema) { bool _result = false; #ifndef __MQL4__ if (DatabaseTableExists(handle, _name)) { diff --git a/Storage/Dict/DictBase.h b/Storage/Dict/DictBase.h index 082fbe377..6f0e05659 100644 --- a/Storage/Dict/DictBase.h +++ b/Storage/Dict/DictBase.h @@ -274,7 +274,7 @@ class DictBase { /** * Returns number of used DictSlots. */ - const unsigned int Size() { return _DictSlots_ref._num_used; } + const unsigned int Size() const { return _DictSlots_ref._num_used; } /** * Returns number of all (reserved) DictSlots. diff --git a/Storage/Dict/DictIteratorBase.h b/Storage/Dict/DictIteratorBase.h index c9ac08fbf..a1cee24d3 100644 --- a/Storage/Dict/DictIteratorBase.h +++ b/Storage/Dict/DictIteratorBase.h @@ -29,6 +29,7 @@ template class DictBase; +#include "../../Convert.basic.h" #include "../../Serializer/SerializerConversions.h" #include "DictBase.h" #include "DictSlotsRef.h" @@ -96,7 +97,7 @@ class DictIteratorBase { if (PTR_ATTRIB(_dict, GetMode()) == DictModeList) { K _key; - ConvertBasic::LongToType(_slotIdx, _key); + ConvertBasic::Convert(_slotIdx, _key); return _key; } diff --git a/Storage/ValueStorage.h b/Storage/ValueStorage.h index 7c7707741..36149f164 100644 --- a/Storage/ValueStorage.h +++ b/Storage/ValueStorage.h @@ -83,7 +83,7 @@ enum ENUM_IPEAK { IPEAK_LOWEST, IPEAK_HIGHEST }; * (the one that doesn't exist in the hierarchy). */ #define INDICATOR_CALCULATE_POPULATE_PARAMS_AND_CACHE_SHORT(INDI, APPLIED_PRICE, KEY) \ - ValueStorage *_price_ptr; \ + ValueStorage *_price_ptr = nullptr; \ if (INDI PTR_DEREF GetSuitableDataSource() PTR_DEREF HasSpecificAppliedPriceValueStorage(APPLIED_PRICE, INDI)) { \ _price_ptr = \ INDI PTR_DEREF GetSuitableDataSource() PTR_DEREF GetSpecificAppliedPriceValueStorage(APPLIED_PRICE, INDI); \ diff --git a/tests/EATest.mq5 b/tests/EATest.mq5 index 777b518c4..b8d14d5c2 100644 --- a/tests/EATest.mq5 +++ b/tests/EATest.mq5 @@ -28,8 +28,8 @@ struct DataParamEntry; // Includes. -#include "../Exchange/Account/Account.struct.h" #include "../EA.mqh" +#include "../Exchange/Account/Account.struct.h" #include "../Test.mqh" // Defines EA classes. From bc351cc4caab34e4dd8de46dd2eaaff42052cfae Mon Sep 17 00:00:00 2001 From: Adrian Kierzkowski Date: Sun, 16 Jul 2023 14:12:25 +0200 Subject: [PATCH 108/109] Looks like C++/MT4/MT5 errors are fixed. --- Exchange/SymbolInfo/SymbolInfo.h | 3 +++ Math/Math.h | 16 +++++++++++++++- Serializer/SerializerSqlite.h | 2 +- Stats.mqh | 2 +- Storage/Database.h | 20 ++++++++++---------- Storage/Database.struct.h | 2 +- Storage/Dict/Buffer/BufferStruct.h | 3 +++ Strategy.mqh | 1 + 8 files changed, 35 insertions(+), 14 deletions(-) diff --git a/Exchange/SymbolInfo/SymbolInfo.h b/Exchange/SymbolInfo/SymbolInfo.h index 2b3d5bc36..f4887aa93 100644 --- a/Exchange/SymbolInfo/SymbolInfo.h +++ b/Exchange/SymbolInfo/SymbolInfo.h @@ -25,6 +25,9 @@ #pragma once #endif +// Flag for Database.struct.h so SymbolInfo structure will be supported by it. +#define DATABASE_INCLUDE_SYMBOLINFO_STRUCT + // Includes symbol defines, enums and structs. #include "SymbolInfo.define.h" #include "SymbolInfo.enum.h" diff --git a/Math/Math.h b/Math/Math.h index 5df7476b2..4dc2735f5 100644 --- a/Math/Math.h +++ b/Math/Math.h @@ -26,8 +26,8 @@ #endif // Includes. -#include "../Storage/Data.struct.h" #include "../Indicator/Indicator.struct.h" +#include "../Storage/Data.struct.h" #include "Math.define.h" #include "Math.enum.h" #include "Math.extern.h" @@ -265,3 +265,17 @@ class Math { } } }; + +#ifdef __MQL__ + +/** + * Specialization of MQL's Round() to support int64 input. + */ +int64 MathRound(int64 _value) { return _value; } + +/** + * Specialization of MQL's round() to support int64 input. + */ +int64 round(int64 _value) { return MathRound(_value); } + +#endif \ No newline at end of file diff --git a/Serializer/SerializerSqlite.h b/Serializer/SerializerSqlite.h index a26500dc1..c087c93a8 100644 --- a/Serializer/SerializerSqlite.h +++ b/Serializer/SerializerSqlite.h @@ -86,7 +86,7 @@ class SerializerSqlite { } } - if (!_db.ImportData(_table, _matrix_out)) { + if (!_db.Import(_table, _matrix_out)) { return false; } diff --git a/Stats.mqh b/Stats.mqh index 14c455844..7b95ff564 100644 --- a/Stats.mqh +++ b/Stats.mqh @@ -98,7 +98,7 @@ class Stats { /** * Get number of ticks per second. */ - double GetTicksPerSec() { return round(total_bars > 0 ? (total_ticks / total_bars / curr_period) / 60 : 0); } + uint64 GetTicksPerSec() { return round(total_bars > 0 ? (total_ticks / total_bars / curr_period) / 60 : 0); } /** * Get number of ticks per given time period. diff --git a/Storage/Database.h b/Storage/Database.h index 3b0d878f4..5a59b3426 100644 --- a/Storage/Database.h +++ b/Storage/Database.h @@ -49,13 +49,13 @@ class Database { /** * Class constructor. */ -#ifndef __MQL4__ +#ifdef __MQL5__ Database(string _filename, unsigned int _flags = DATABASE_OPEN_CREATE) #else Database(string _filename, unsigned int _flags = 0) #endif { -#ifndef __MQL4__ +#ifdef __MQL5__ handle = DatabaseOpen(_filename, _flags); #else handle = -1; @@ -67,7 +67,7 @@ class Database { * Class deconstructor. */ ~Database() { -#ifndef __MQL4__ +#ifdef __MQL5__ DatabaseClose(handle); #endif } @@ -78,7 +78,7 @@ class Database { * Checks if table exists. */ bool TableExists(string _name) { -#ifndef __MQL4__ +#ifdef __MQL5__ return DatabaseTableExists(handle, _name); #else SetUserError(ERR_USER_NOT_SUPPORTED); @@ -101,7 +101,7 @@ class Database { */ bool CreateTable(string _name, REF_TO_SIMPLE(DatabaseTableSchema) _schema) { bool _result = false; -#ifndef __MQL4__ +#ifdef __MQL5__ if (DatabaseTableExists(handle, _name)) { // Generic error (ERR_DATABASE_ERROR). SetUserError(5601); @@ -145,7 +145,7 @@ class Database { */ bool DropTable(string _name) { tables.Unset(_name); -#ifndef __MQL4__ +#ifdef __MQL5__ return DatabaseExecute(handle, "DROP TABLE IF EXISTS `" + _name + "`"); #else return false; @@ -157,7 +157,7 @@ class Database { /** * Imports data into table. First row must contain column names. Strings must be enclosed with double quotes. */ - bool ImportData(const string _name, MatrixMini2d &data) { + bool Import(const string _name, MatrixMini2d &data) { if (data.SizeY() < 2 || data.SizeX() == 0) { // No data to import or there are no columns in input data (Serialize() serialized no fields). return true; @@ -171,7 +171,7 @@ class Database { _cols += "`" + StringSubstr(key, 1, StringLen(key) - 2) + "`,"; } _cols = StringSubstr(_cols, 0, StringLen(_cols) - 1); // Removes extra comma. -#ifndef __MQL4__ +#ifdef __MQL5__ if (DatabaseTransactionBegin(handle)) { _query = StringFormat("INSERT INTO `%s`(%s) VALUES\n", _name, _cols); for (int y = 1; y < data.SizeY(); ++y) { @@ -201,7 +201,7 @@ class Database { return _result; } -#ifdef BUFFER_STRUCT_H +#ifdef DATABASE_INCLUDE_BUFFER_STRUCT /** * Imports BufferStruct records into a table. */ @@ -214,7 +214,7 @@ class Database { _cols += iter.Value().name + ","; } _cols = StringSubstr(_cols, 0, StringLen(_cols) - 1); // Removes extra comma. -#ifndef __MQL4__ +#ifdef __MQL5__ if (DatabaseTransactionBegin(handle)) { for (DictStructIterator iter = _bstruct.Begin(); iter.IsValid(); ++iter) { _query = StringFormat("INSERT INTO %s(%s) VALUES (%s)", _name, _cols, iter.Value().ToCSV()); diff --git a/Storage/Database.struct.h b/Storage/Database.struct.h index e3c216401..9e380446c 100644 --- a/Storage/Database.struct.h +++ b/Storage/Database.struct.h @@ -93,7 +93,7 @@ struct DatabaseTableSchema { }; // Struct table entry for SymbolInfo. -#ifdef SYMBOLINFO_H +#ifdef DATABASE_INCLUDE_SYMBOLINFO_STRUCT struct DbSymbolInfoEntry : public SymbolInfoEntry { DatabaseTableSchema schema; // Constructors. diff --git a/Storage/Dict/Buffer/BufferStruct.h b/Storage/Dict/Buffer/BufferStruct.h index e38de8b08..0e8d3645b 100644 --- a/Storage/Dict/Buffer/BufferStruct.h +++ b/Storage/Dict/Buffer/BufferStruct.h @@ -25,6 +25,9 @@ #pragma once #endif +// Flag for Database.struct.h so BufferStruct structure will be supported by it. +#define DATABASE_INCLUDE_BUFFER_STRUCT + // Includes. #include "../../../Serializer/Serializer.h" #include "../DictBase.h" diff --git a/Strategy.mqh b/Strategy.mqh index b322ff805..446edb004 100644 --- a/Strategy.mqh +++ b/Strategy.mqh @@ -30,6 +30,7 @@ class Trade; // Includes. #include "Indicator/Indicator.h" #include "Market.mqh" +#include "Math/Math.h" #include "Storage/Data.struct.h" #include "Storage/Dict/Dict.h" #include "Storage/Object.h" From 5ccbf9631d82a13bfc9851fe8525d9cf742f9ab7 Mon Sep 17 00:00:00 2001 From: Adrian Kierzkowski Date: Mon, 17 Jul 2023 16:12:25 +0200 Subject: [PATCH 109/109] More of C++/MT4/MT5 error fixes. --- Indicators/Indi_Drawer.mqh | 4 +- Log.mqh | 3 +- Math/Math.define.h | 7 + Math/Math.extern.h | 28 ++- Math/Math.h | 287 ++++++++++++++++++++++++++++- Math/Math.normal.h | 92 +++++++++ Math/Matrix.h | 17 +- Platform/Chart/Chart.struct.h | 3 +- Platform/Platform.enum.h | 2 +- Serializer/SerializerConversions.h | 1 - Storage/Array.h | 2 +- 11 files changed, 423 insertions(+), 23 deletions(-) create mode 100644 Math/Math.normal.h diff --git a/Indicators/Indi_Drawer.mqh b/Indicators/Indi_Drawer.mqh index 61f9890a6..bd8ce5789 100644 --- a/Indicators/Indi_Drawer.mqh +++ b/Indicators/Indi_Drawer.mqh @@ -98,8 +98,8 @@ class Indi_Drawer : public Indicator { Set(STRUCT_ENUM(IndicatorDataParams, IDATA_PARAM_MAX_MODES), num_args - 1); if (num_args - 1 > _max_modes) { - GetLogger() PTR_DEREF Error( - StringFormat("Too many data for buffers for action %s!", EnumToString(_action), __FUNCTION_LINE__)); + GetLogger() PTR_DEREF Error(StringFormat("Too many data for buffers for action %s at %s!", + C_STR(EnumToString(_action)), __FUNCTION_LINE__)); return false; } diff --git a/Log.mqh b/Log.mqh index 32679ae95..ef9e21fcb 100644 --- a/Log.mqh +++ b/Log.mqh @@ -31,6 +31,7 @@ class DictStruct; // Includes. #include "File.mqh" +#include "Std.h" #include "Storage/Array.h" #include "Storage/Collection.h" #include "Storage/DateTime.h" @@ -39,7 +40,7 @@ class DictStruct; // Define assert macros. // Alias for function and line macros combined together. -#define __FUNCTION_LINE__ string(__FUNCTION__) + ":" + IntegerToString(__LINE__) +#define __FUNCTION_LINE__ C_STR(string(__FUNCTION__) + ":" + IntegerToString(__LINE__)) // Log verbosity level. enum ENUM_LOG_LEVEL { diff --git a/Math/Math.define.h b/Math/Math.define.h index 439becf80..f3cf78ff4 100644 --- a/Math/Math.define.h +++ b/Math/Math.define.h @@ -37,6 +37,13 @@ #define fmin5(_v1, _v2, _v3, _v4, _v5) fmin(fmin(fmin(fmin(_v1, _v2), _v3), _v4), _v5) #define fmin6(_v1, _v2, _v3, _v4, _v5, _v6) fmin(fmin(fmin(fmin(fmin(_v1, _v2), _v3), _v4), _v5), _v6) +// Math errors. +#define MATH_ERR_OK 0 +#define MATH_ERR_ARGUMENTS_NAN 1 +#define MATH_ERR_ARGUMENTS_INVALID 2 +#define MATH_ERR_RESULT_INFINITE 3 +#define MATH_ERR_NON_CONVERGENCE 4 + #ifdef __cplusplus #include diff --git a/Math/Math.extern.h b/Math/Math.extern.h index 9248b9253..64dfd0258 100644 --- a/Math/Math.extern.h +++ b/Math/Math.extern.h @@ -20,11 +20,34 @@ * */ -// Define external global functions. #ifndef __MQL__ // Allows the preprocessor to include a header file when it is needed. #pragma once +#include +#include +#endif + +#ifdef __MQL__ +const double NaN = (double)"nan"; +#else +const double NaN = std::nan(""); +#endif + +#ifdef __MQL__ +const double POSINF = (double)"inf"; +#else +const double POSINF = std::numeric_limits::infinity(); +#endif + +#ifdef __MQL__ +const double NEGINF = (double)"-inf"; +#else +const double NEGINF = std::numeric_limits::infinity() * -1; +#endif + +// Define external global functions. +#ifndef __MQL__ #include #include @@ -90,4 +113,7 @@ T log10(T value) { } int MathRand() { return std::rand() % 32768; } // int rand() { return std::rand() % 32768; } + +bool MathIsValidNumber(double _number) { return (_number != NaN && _number != NEGINF && _number != POSINF); } + #endif diff --git a/Math/Math.h b/Math/Math.h index 4dc2735f5..04d27f20b 100644 --- a/Math/Math.h +++ b/Math/Math.h @@ -31,6 +31,7 @@ #include "Math.define.h" #include "Math.enum.h" #include "Math.extern.h" +#include "Math.normal.h" #include "Math.struct.h" /** @@ -127,6 +128,290 @@ class Math { */ static double NonZero(double _v) { return _v == 0 ? DBL_MIN : _v; } + static double RandomNonZero(void) { + double rnd = 0; + + while (rnd == 0.0 || rnd == 1.0) { + rnd = MathRand() / 32767.0; + } + + return rnd; + } + + static double TailLogProbability(const double probability, const bool tail, const bool log_mode) { + if (tail == true) { + if (log_mode) + return MathExp(probability); + else + return (probability); + } else { + if (log_mode) + return (1.0 - MathExp(probability)); + else + return (1.0 - probability); + } + } + + static double QuantileNormal(const double probability, const double mu, const double sigma, const bool tail, + const bool log_mode, int &error_code) { + // Check NaN. + if (!MathIsValidNumber(probability) || !MathIsValidNumber(mu) || !MathIsValidNumber(sigma)) { + error_code = MATH_ERR_ARGUMENTS_NAN; + return NaN; + } + //--- check sigma + if (sigma <= 0) { + error_code = MATH_ERR_ARGUMENTS_INVALID; + return NaN; + } + + // Calculate real probability. + double prob = TailLogProbability(probability, tail, log_mode); + + // Check probability range. + if (prob < 0.0 || prob > 1.0) { + error_code = MATH_ERR_ARGUMENTS_INVALID; + return NaN; + } + + // f(0)=-infinity + if (prob == 0.0) { + error_code = MATH_ERR_RESULT_INFINITE; + return NEGINF; + } + // f(1)=+infinity + if (prob == 1.0) { + error_code = MATH_ERR_RESULT_INFINITE; + return POSINF; + } + + error_code = MATH_ERR_OK; + + double q = prob - 0.5; + double r = 0; + double ppnd16 = 0.0; + + if (MathAbs(q) <= 0.425) { + r = 0.180625 - q * q; + ppnd16 = q * + (((((((normal_q_a7 * r + normal_q_a6) * r + normal_q_a5) * r + normal_q_a4) * r + normal_q_a3) * r + + normal_q_a2) * + r + + normal_q_a1) * + r + + normal_q_a0) / + (((((((normal_q_b7 * r + normal_q_b6) * r + normal_q_b5) * r + normal_q_b4) * r + normal_q_b3) * r + + normal_q_b2) * + r + + normal_q_b1) * + r + + 1.0); + + error_code = MATH_ERR_OK; + + return mu + sigma * ppnd16; + } else { + if (q < 0.0) + r = prob; + else + r = 1.0 - prob; + + r = MathSqrt(-MathLog(r)); + + if (r <= 5.0) { + r = r - 1.6; + ppnd16 = (((((((normal_q_c7 * r + normal_q_c6) * r + normal_q_c5) * r + normal_q_c4) * r + normal_q_c3) * r + + normal_q_c2) * + r + + normal_q_c1) * + r + + normal_q_c0) / + (((((((normal_q_d7 * r + normal_q_d6) * r + normal_q_d5) * r + normal_q_d4) * r + normal_q_d3) * r + + normal_q_d2) * + r + + normal_q_d1) * + r + + 1.0); + } else { + r = r - 5.0; + ppnd16 = (((((((normal_q_e7 * r + normal_q_e6) * r + normal_q_e5) * r + normal_q_e4) * r + normal_q_e3) * r + + normal_q_e2) * + r + + normal_q_e1) * + r + + normal_q_e0) / + (((((((normal_q_f7 * r + normal_q_f6) * r + normal_q_f5) * r + normal_q_f4) * r + normal_q_f3) * r + + normal_q_f2) * + r + + normal_q_f1) * + r + + 1.0); + } + + if (q < 0.0) ppnd16 = -ppnd16; + } + // Return rescaled/shifted value. + return mu + sigma * ppnd16; + } + + static bool QuantileNormal(CONST_ARRAY_REF(double, probability), const double mu, const double sigma, const bool tail, + const bool log_mode, ARRAY_REF(double, result)) { + //--- check NaN + if (!MathIsValidNumber(mu) || !MathIsValidNumber(sigma)) return false; + //--- check sigma + if (sigma < 0) return false; + + int data_count = ArraySize(probability); + if (data_count == 0) return false; + + int error_code = 0, i; + ArrayResize(result, data_count); + + //--- case sigma==0 + if (sigma == 0.0) { + for (i = 0; i < data_count; i++) result[i] = mu; + return true; + } + + for (i = 0; i < data_count; i++) { + //--- calculate real probability + double prob = TailLogProbability(probability[i], tail, log_mode); + //--- check probability range + if (prob < 0.0 || prob > 1.0) return false; + + //--- f(0)=-infinity, f(1)=+infinity + if (prob == 0.0 || prob == 1.0) { + if (prob == 0.0) + result[i] = NEGINF; + else + result[i] = POSINF; + } else { + double q = prob - 0.5; + double r = 0; + double ppnd16 = 0.0; + //--- + if (MathAbs(q) <= 0.425) { + r = 0.180625 - q * q; + ppnd16 = q * + (((((((normal_q_a7 * r + normal_q_a6) * r + normal_q_a5) * r + normal_q_a4) * r + normal_q_a3) * r + + normal_q_a2) * + r + + normal_q_a1) * + r + + normal_q_a0) / + (((((((normal_q_b7 * r + normal_q_b6) * r + normal_q_b5) * r + normal_q_b4) * r + normal_q_b3) * r + + normal_q_b2) * + r + + normal_q_b1) * + r + + 1.0); + //--- set rescaled/shifted value + result[i] = mu + sigma * ppnd16; + } else { + if (q < 0.0) + r = prob; + else + r = 1.0 - prob; + //--- + r = MathSqrt(-MathLog(r)); + //--- + if (r <= 5.0) { + r = r - 1.6; + ppnd16 = + (((((((normal_q_c7 * r + normal_q_c6) * r + normal_q_c5) * r + normal_q_c4) * r + normal_q_c3) * r + + normal_q_c2) * + r + + normal_q_c1) * + r + + normal_q_c0) / + (((((((normal_q_d7 * r + normal_q_d6) * r + normal_q_d5) * r + normal_q_d4) * r + normal_q_d3) * r + + normal_q_d2) * + r + + normal_q_d1) * + r + + 1.0); + } else { + r = r - 5.0; + ppnd16 = + (((((((normal_q_e7 * r + normal_q_e6) * r + normal_q_e5) * r + normal_q_e4) * r + normal_q_e3) * r + + normal_q_e2) * + r + + normal_q_e1) * + r + + normal_q_e0) / + (((((((normal_q_f7 * r + normal_q_f6) * r + normal_q_f5) * r + normal_q_f4) * r + normal_q_f3) * r + + normal_q_f2) * + r + + normal_q_f1) * + r + + 1.0); + } + //--- + if (q < 0.0) ppnd16 = -ppnd16; + } + //--- set rescaled/shifted value + result[i] = mu + sigma * ppnd16; + } + } + return true; + } + + static bool QuantileNormal(CONST_ARRAY_REF(double, probability), const double mu, const double sigma, + ARRAY_REF(double, result)) { + return QuantileNormal(probability, mu, sigma, true, false, result); + } + + static double RandomNormal(const double mu, const double sigma, int &error_code) { + if (!MathIsValidNumber(mu) || !MathIsValidNumber(sigma)) { + error_code = MATH_ERR_ARGUMENTS_NAN; + return NaN; + } + + if (sigma < 0) { + error_code = MATH_ERR_ARGUMENTS_INVALID; + return NaN; + } + + error_code = MATH_ERR_OK; + + if (sigma == 0.0) return mu; + + double rnd = RandomNonZero(); + + return QuantileNormal(rnd, mu, sigma, true, false, error_code); + } + + static bool RandomNormal(const double mu, const double sigma, const int data_count, ARRAY_REF(double, result)) { + int i; + + // Check NaN. + if (!MathIsValidNumber(mu) || !MathIsValidNumber(sigma)) { + return false; + } + + // Check sigma. + if (sigma < 0) { + return false; + } + + // Prepare output array and calculate random values. + ArrayResize(result, data_count); + + if (sigma == 0.0) { + for (i = 0; i < data_count; i++) result[i] = mu; + return true; + } + + int err_code = 0; + + for (i = 0; i < data_count; i++) { + result[i] = RandomNonZero(); + } + + // Return normal random array using quantile. + return QuantileNormal(result, mu, sigma, result); + } + /* Conditions */ /** @@ -278,4 +563,4 @@ int64 MathRound(int64 _value) { return _value; } */ int64 round(int64 _value) { return MathRound(_value); } -#endif \ No newline at end of file +#endif diff --git a/Math/Math.normal.h b/Math/Math.normal.h new file mode 100644 index 000000000..6ceabd2c8 --- /dev/null +++ b/Math/Math.normal.h @@ -0,0 +1,92 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://ea31337.github.io | +//+------------------------------------------------------------------+ + +/* + * 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 . + * + */ + +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + +const static double normal_cdf_a[5] = {2.2352520354606839287E00, 1.6102823106855587881E02, 1.0676894854603709582E03, + 1.8154981253343561249E04, 6.5682337918207449113E-2}; +const static double normal_cdf_b[4] = {4.7202581904688241870E01, 9.7609855173777669322E02, 1.0260932208618978205E04, + 4.5507789335026729956E04}; +//--- coefficients for approximation in second interval +const static double normal_cdf_c[9] = {3.9894151208813466764E-1, 8.8831497943883759412E00, 9.3506656132177855979E01, + 5.9727027639480026226E02, 2.4945375852903726711E03, 6.8481904505362823326E03, + 1.1602651437647350124E04, 9.8427148383839780218E03, 1.0765576773720192317E-8}; +const static double normal_cdf_d[8] = {2.2266688044328115691E01, 2.3538790178262499861E02, 1.5193775994075548050E03, + 6.4855582982667607550E03, 1.8615571640885098091E04, 3.4900952721145977266E04, + 3.8912003286093271411E04, 1.9685429676859990727E04}; +//--- coefficients for approximation in third interval +const static double normal_cdf_p[6] = {2.1589853405795699E-1, 1.274011611602473639E-1, 2.2235277870649807E-2, + 1.421619193227893466E-3, 2.9112874951168792E-5, 2.307344176494017303E-2}; +const static double normal_cdf_q[5] = {1.28426009614491121E00, 4.68238212480865118E-1, 6.59881378689285515E-2, + 3.78239633202758244E-3, 7.29751555083966205E-5}; + +//--- coefficients for p close to 0.5 +const double normal_q_a0 = 3.3871328727963666080; +const double normal_q_a1 = 1.3314166789178437745E+2; +const double normal_q_a2 = 1.9715909503065514427E+3; +const double normal_q_a3 = 1.3731693765509461125E+4; +const double normal_q_a4 = 4.5921953931549871457E+4; +const double normal_q_a5 = 6.7265770927008700853E+4; +const double normal_q_a6 = 3.3430575583588128105E+4; +const double normal_q_a7 = 2.5090809287301226727E+3; +const double normal_q_b1 = 4.2313330701600911252E+1; +const double normal_q_b2 = 6.8718700749205790830E+2; +const double normal_q_b3 = 5.3941960214247511077E+3; +const double normal_q_b4 = 2.1213794301586595867E+4; +const double normal_q_b5 = 3.9307895800092710610E+4; +const double normal_q_b6 = 2.8729085735721942674E+4; +const double normal_q_b7 = 5.2264952788528545610E+3; +//--- coefficients for p not close to 0, 0.5 or 1 +const double normal_q_c0 = 1.42343711074968357734; +const double normal_q_c1 = 4.63033784615654529590; +const double normal_q_c2 = 5.76949722146069140550; +const double normal_q_c3 = 3.64784832476320460504; +const double normal_q_c4 = 1.27045825245236838258; +const double normal_q_c5 = 2.41780725177450611770E-1; +const double normal_q_c6 = 2.27238449892691845833E-2; +const double normal_q_c7 = 7.74545014278341407640E-4; +const double normal_q_d1 = 2.05319162663775882187; +const double normal_q_d2 = 1.67638483018380384940; +const double normal_q_d3 = 6.89767334985100004550E-1; +const double normal_q_d4 = 1.48103976427480074590E-1; +const double normal_q_d5 = 1.51986665636164571966E-2; +const double normal_q_d6 = 5.47593808499534494600E-4; +const double normal_q_d7 = 1.05075007164441684324E-9; +//--- coefficients for p near 0 or 1. +const double normal_q_e0 = 6.65790464350110377720E0; +const double normal_q_e1 = 5.46378491116411436990E0; +const double normal_q_e2 = 1.78482653991729133580E0; +const double normal_q_e3 = 2.96560571828504891230E-1; +const double normal_q_e4 = 2.65321895265761230930E-2; +const double normal_q_e5 = 1.24266094738807843860E-3; +const double normal_q_e6 = 2.71155556874348757815E-5; +const double normal_q_e7 = 2.01033439929228813265E-7; +const double normal_q_f1 = 5.99832206555887937690E-1; +const double normal_q_f2 = 1.36929880922735805310E-1; +const double normal_q_f3 = 1.48753612908506148525E-2; +const double normal_q_f4 = 7.86869131145613259100E-4; +const double normal_q_f5 = 1.84631831751005468180E-5; +const double normal_q_f6 = 1.42151175831644588870E-7; +const double normal_q_f7 = 2.04426310338993978564E-15; diff --git a/Math/Matrix.h b/Math/Matrix.h index 57fa065d5..840eaee82 100644 --- a/Math/Matrix.h +++ b/Math/Matrix.h @@ -25,12 +25,6 @@ #pragma once #endif -#ifdef USE_MQL_MATH_STAT -#ifdef __MQL5__ -#include -#endif -#endif - // Includes. #include "Math.h" @@ -1414,24 +1408,19 @@ class Matrix { */ void FillRandomUniform(X _min, X _max, int _seed = -1) { FillRandom(_min, _max, _seed); } -#ifdef USE_MQL_MATH_STAT /** * Initializer that generates tensors with a normal distribution. */ void FillRandomNormal(X _mean, X _stddev, int _seed = -1) { -#ifdef __MQL5__ if (_seed != -1) { Print("Matrix::FillRandomNormal(): _seed parameter is not yet implemented! Please use -1 as _seed."); } - double _values[]; - MathRandomNormal(_mean, _stddev, GetSize(), _values); + ARRAY(double, _values); + int _size = GetSize(); + Math::RandomNormal(_mean, _stddev, _size, _values); FillFromArray(_values); -#else - Print("Matrix::FillRandomNormal() is implemented only in MQL5!"); -#endif } -#endif void FillFromArray(ARRAY_REF(X, _array)) { if (ArraySize(_array) != GetSize()) { diff --git a/Platform/Chart/Chart.struct.h b/Platform/Chart/Chart.struct.h index 6bd9477ce..c3edc96a7 100644 --- a/Platform/Chart/Chart.struct.h +++ b/Platform/Chart/Chart.struct.h @@ -38,6 +38,7 @@ struct ChartTf; #include "../../Bar.struct.h" #include "../../Serializer/Serializer.h" #include "../../Serializer/SerializerNode.enum.h" +#include "../../Std.h" #include "../../Storage/Array.h" #include "../Terminal.define.h" #include "Chart.define.h" @@ -54,7 +55,7 @@ struct ChartEntry { ChartEntry(const ChartEntry& _r) { SetBar(_r.bar); } // Getters. BarEntry GetBar() { return bar; } - string ToCSV() { return StringFormat("%s", bar.ToCSV()); } + string ToCSV() { return StringFormat("%s", C_STR(bar.ToCSV())); } // Setters. void SetBar(const BarEntry& _bar) { bar = _bar; } // Serializers. diff --git a/Platform/Platform.enum.h b/Platform/Platform.enum.h index edd657855..8c8b75309 100644 --- a/Platform/Platform.enum.h +++ b/Platform/Platform.enum.h @@ -41,4 +41,4 @@ enum ENUM_COPY_TICKS { COPY_TICKS_VOLUME = 1048576, COPY_TICKS_FLAGS = 2097152 }; -#endif \ No newline at end of file +#endif diff --git a/Serializer/SerializerConversions.h b/Serializer/SerializerConversions.h index 61f65548c..dabdb89c4 100644 --- a/Serializer/SerializerConversions.h +++ b/Serializer/SerializerConversions.h @@ -31,7 +31,6 @@ #endif #include "../Convert.extern.h" -#include "../Refs.struct.h" #include "../Storage/DateTime.extern.h" #include "../Storage/Object.h" diff --git a/Storage/Array.h b/Storage/Array.h index 84aa976a0..f155ecd31 100644 --- a/Storage/Array.h +++ b/Storage/Array.h @@ -815,4 +815,4 @@ void ArrayFill(FIXED_ARRAY_REF(X, array, size), int start, int count, X value) { Array::ArrayFill(array, start, count, value); } -#endif \ No newline at end of file +#endif