From 0ecb54d5a12ef1cd065b3c22f8a4effe1a9cb426 Mon Sep 17 00:00:00 2001 From: kenorb Date: Mon, 8 Aug 2022 00:57:37 +0100 Subject: [PATCH 1/3] Moves Indicator related files into Indicator/ --- .github/workflows/test-indicator.yml | 3 + .github/workflows/test.yml | 1 - 3D/Chart3D.h | 2 +- Account/AccountMt.h | 3 +- BufferFXT.mqh | 3 +- Chart.mqh | 8 +- Chart.struct.h | 2 + Chart.struct.serialize.h | 2 +- Chart.struct.tf.h | 7 +- ChartMt.h | 1 + DictBase.mqh | 1 - DictIteratorBase.mqh | 7 +- DictSlot.mqh | 2 +- DictSlotsRef.h | 1 + DictStruct.mqh | 4 - Draw.mqh | 2 +- File.mqh | 3 +- .../Indicator.define.h | 3 - .../Indicator.enum.h | 52 ------------- Indicator.mqh => Indicator/Indicator.h | 43 ++++++----- .../Indicator.struct.h | 68 ++--------------- .../Indicator.struct.serialize.h | 7 +- IndicatorBase.h => Indicator/IndicatorBase.h | 75 ++++--------------- Indicator/IndicatorCandle.h | 4 +- .../IndicatorData.enum.h | 51 +++++++++++++ .../IndicatorData.h | 72 +++++++++++++++--- .../IndicatorData.struct.cache.h | 4 +- .../IndicatorData.struct.h | 55 +++++++++++++- .../IndicatorData.struct.serialize.h | 2 +- .../IndicatorData.struct.signal.h | 0 Indicator/IndicatorTf.h | 2 +- Indicator/IndicatorTf.struct.h | 2 +- Indicator/IndicatorTick.h | 4 +- Indicator/IndicatorTickSource.h | 2 +- .../tests/Indicator.test.mq4 | 4 +- .../tests/Indicator.test.mq5 | 6 +- .../tests/IndicatorBase.test.mq4 | 2 +- .../tests/IndicatorBase.test.mq5 | 2 +- .../tests/IndicatorData.test.mq4 | 2 +- .../tests/IndicatorData.test.mq5 | 4 +- Indicator/tests/IndicatorTf.test.mq5 | 5 +- Indicator/tests/IndicatorTick.test.mq5 | 1 + Indicator/tests/classes/Indicators.h | 2 +- Indicators/Bitwise/Indi_Candle.mqh | 2 +- Indicators/Bitwise/Indi_Pattern.mqh | 2 +- Indicators/Indi_AC.mqh | 2 +- Indicators/Indi_AD.mqh | 2 +- Indicators/Indi_ADX.mqh | 2 +- Indicators/Indi_ADXW.mqh | 2 +- Indicators/Indi_AMA.mqh | 4 +- Indicators/Indi_AO.mqh | 2 +- Indicators/Indi_ASI.mqh | 2 +- Indicators/Indi_ATR.mqh | 2 +- Indicators/Indi_Alligator.mqh | 2 +- Indicators/Indi_AppliedPrice.mqh | 2 +- Indicators/Indi_BWMFI.mqh | 2 +- Indicators/Indi_Bands.mqh | 2 +- Indicators/Indi_BearsPower.mqh | 2 +- Indicators/Indi_BullsPower.mqh | 2 +- Indicators/Indi_CCI.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 | 2 +- Indicators/Indi_DeMarker.mqh | 2 +- Indicators/Indi_Demo.mqh | 2 +- Indicators/Indi_DetrendedPrice.mqh | 2 +- Indicators/Indi_Drawer.mqh | 2 +- Indicators/Indi_Drawer.struct.h | 2 +- Indicators/Indi_Envelopes.mqh | 2 +- Indicators/Indi_Force.mqh | 2 +- Indicators/Indi_FractalAdaptiveMA.mqh | 2 +- Indicators/Indi_Fractals.mqh | 2 +- Indicators/Indi_Gator.mqh | 2 +- Indicators/Indi_HeikenAshi.mqh | 2 +- Indicators/Indi_Ichimoku.mqh | 2 +- Indicators/Indi_Killzones.mqh | 2 +- Indicators/Indi_MA.mqh | 2 +- Indicators/Indi_MACD.mqh | 2 +- Indicators/Indi_MFI.mqh | 2 +- Indicators/Indi_MassIndex.mqh | 2 +- Indicators/Indi_Momentum.mqh | 2 +- Indicators/Indi_OBV.mqh | 2 +- Indicators/Indi_OsMA.mqh | 2 +- Indicators/Indi_Pivot.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_RVI.mqh | 2 +- Indicators/Indi_RateOfChange.mqh | 2 +- Indicators/Indi_SAR.mqh | 2 +- Indicators/Indi_StdDev.mqh | 2 +- Indicators/Indi_Stochastic.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_WPR.mqh | 2 +- Indicators/Indi_WilliamsAD.mqh | 2 +- Indicators/Indi_ZigZag.mqh | 2 +- Indicators/Indi_ZigZagColor.mqh | 2 +- Indicators/OHLC/Indi_OHLC.mqh | 2 +- Indicators/Price/Indi_Price.mqh | 2 +- Indicators/Special/Indi_Custom.mqh | 2 +- Indicators/Special/Indi_Math.mqh | 2 +- Log.mqh | 12 ++- Market.mqh | 15 +--- Market.struct.h | 12 +++ Math.h | 2 +- Order.mqh | 5 ++ Platform.h | 2 +- Serializer.mqh | 16 ---- SerializerConverter.mqh | 7 +- Storage/ValueStorage.history.h | 5 +- Storage/ValueStorage.price_median.h | 3 + Strategy.mqh | 2 +- SymbolInfo.mqh | 11 ++- Terminal.enum.h | 2 +- Tests.mqh | 2 +- Trade.mqh | 4 +- tests/CompileTest.mq5 | 8 +- tests/DrawIndicatorTest.mq5 | 2 +- tests/IndicatorsTest.mq5 | 2 +- tests/LogTest.mq5 | 1 + tests/SerializerTest.mq5 | 1 + 132 files changed, 397 insertions(+), 383 deletions(-) rename Indicator.define.h => Indicator/Indicator.define.h (99%) rename Indicator.enum.h => Indicator/Indicator.enum.h (84%) rename Indicator.mqh => Indicator/Indicator.h (96%) rename Indicator.struct.h => Indicator/Indicator.struct.h (69%) rename Indicator.struct.serialize.h => Indicator/Indicator.struct.serialize.h (95%) rename IndicatorBase.h => Indicator/IndicatorBase.h (89%) rename IndicatorData.enum.h => Indicator/IndicatorData.enum.h (53%) rename IndicatorData.mqh => Indicator/IndicatorData.h (97%) rename Indicator.struct.cache.h => Indicator/IndicatorData.struct.cache.h (99%) rename IndicatorData.struct.h => Indicator/IndicatorData.struct.h (90%) rename IndicatorData.struct.serialize.h => Indicator/IndicatorData.struct.serialize.h (99%) rename IndicatorData.struct.signal.h => Indicator/IndicatorData.struct.signal.h (100%) rename tests/IndicatorTest.mq4 => Indicator/tests/Indicator.test.mq4 (91%) rename tests/IndicatorTest.mq5 => Indicator/tests/Indicator.test.mq5 (95%) rename tests/IndicatorBaseTest.mq4 => Indicator/tests/IndicatorBase.test.mq4 (96%) rename tests/IndicatorBaseTest.mq5 => Indicator/tests/IndicatorBase.test.mq5 (97%) rename tests/IndicatorDataTest.mq4 => Indicator/tests/IndicatorData.test.mq4 (96%) rename tests/IndicatorDataTest.mq5 => Indicator/tests/IndicatorData.test.mq5 (95%) diff --git a/.github/workflows/test-indicator.yml b/.github/workflows/test-indicator.yml index 1a51af539..5265762b4 100644 --- a/.github/workflows/test-indicator.yml +++ b/.github/workflows/test-indicator.yml @@ -50,7 +50,10 @@ jobs: strategy: matrix: test: + - Indicator.test + - IndicatorBase.test - IndicatorCandle.test + - IndicatorData.test - IndicatorTf.test - IndicatorTick.test steps: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9c8a7f8e7..f4802e889 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -60,7 +60,6 @@ jobs: - DatabaseTest - DrawIndicatorTest - EATest - - IndicatorTest - IndicatorsTest - MailTest - MarketTest diff --git a/3D/Chart3D.h b/3D/Chart3D.h index 6db0da702..1fd4fbdb7 100644 --- a/3D/Chart3D.h +++ b/3D/Chart3D.h @@ -26,7 +26,7 @@ */ #include "../Bar.struct.h" -#include "../IndicatorData.mqh" +#include "../Indicator/IndicatorData.h" #include "../Indicators/Indi_MA.mqh" #include "../Instances.h" #include "../Refs.mqh" diff --git a/Account/AccountMt.h b/Account/AccountMt.h index c03c300f9..11cb4c654 100644 --- a/Account/AccountMt.h +++ b/Account/AccountMt.h @@ -30,10 +30,9 @@ class AccountMt; // Includes. #include "../Array.mqh" #include "../BufferStruct.mqh" -#include "../Chart.mqh" #include "../Convert.mqh" #include "../Data.struct.h" -#include "../Indicator.struct.h" +#include "../Indicator/Indicator.struct.h" #include "../Order.struct.h" #include "../Orders.mqh" #include "../Serializer.mqh" diff --git a/BufferFXT.mqh b/BufferFXT.mqh index 8127c6775..61a372f85 100644 --- a/BufferFXT.mqh +++ b/BufferFXT.mqh @@ -25,9 +25,8 @@ // Includes. #include "Account/AccountMt.h" -#include "Chart.mqh" #include "DictStruct.mqh" -#include "IndicatorBase.h" +#include "Indicator/IndicatorData.h" #include "Object.mqh" // Defines. diff --git a/Chart.mqh b/Chart.mqh index 986e34bf4..e751a6bb9 100644 --- a/Chart.mqh +++ b/Chart.mqh @@ -29,10 +29,6 @@ * - https://www.mql5.com/en/docs/series */ -// Class dependencies. -class Chart; -class Market; - // Prevents processing this includes file for the second time. #ifndef CHART_MQH #define CHART_MQH @@ -47,6 +43,10 @@ class Market; #include "Serializer.mqh" #include "Task/TaskCondition.enum.h" +// Forward class declaration. +class Chart; +class Market; + #ifndef __MQL4__ // Defines structs (for MQL4 backward compatibility). // Struct arrays that contains given values of each bar of the current chart. diff --git a/Chart.struct.h b/Chart.struct.h index 32decc06f..9d5b75266 100644 --- a/Chart.struct.h +++ b/Chart.struct.h @@ -32,6 +32,7 @@ // Forward class declaration. class Class; +struct ChartTf; // Includes. #include "Array.mqh" @@ -41,6 +42,7 @@ class Class; #include "Chart.struct.static.h" #include "Chart.struct.tf.h" #include "Serializer.mqh" +#include "SerializerNode.enum.h" #include "Terminal.define.h" /* Defines struct to store bar entries. */ diff --git a/Chart.struct.serialize.h b/Chart.struct.serialize.h index 7c818167b..b33092843 100644 --- a/Chart.struct.serialize.h +++ b/Chart.struct.serialize.h @@ -42,6 +42,6 @@ SerializerNodeType ChartEntry::Serialize(Serializer& _s) { SerializerNodeType ChartParams::Serialize(Serializer& s) { s.Pass(THIS_REF, "id", id); s.Pass(THIS_REF, "symbol", symbol); - s.PassStruct(THIS_REF, "tf", tf); + // s.PassStruct(THIS_REF, "tf", tf); // @fixme return SerializerNodeObject; } diff --git a/Chart.struct.tf.h b/Chart.struct.tf.h index 3bff64239..3a0dfed6e 100644 --- a/Chart.struct.tf.h +++ b/Chart.struct.tf.h @@ -30,9 +30,12 @@ #pragma once #endif +// Forward declarations. +class Serializer; + // Includes. #include "Chart.enum.h" -#include "Serializer.mqh" +#include "SerializerNode.enum.h" #include "Terminal.define.h" /* Defines struct for chart timeframe. */ @@ -348,6 +351,8 @@ struct ChartTf { SerializerNodeType Serialize(Serializer& s); }; +#include "Serializer.mqh" + /* Method to serialize ChartTf structure. */ SerializerNodeType ChartTf::Serialize(Serializer& s) { s.PassEnum(THIS_REF, "tf", tf); diff --git a/ChartMt.h b/ChartMt.h index e87e8ddcc..b09ea050b 100644 --- a/ChartMt.h +++ b/ChartMt.h @@ -31,6 +31,7 @@ #endif // Includes. +#include "Chart.struct.static.h" #include "Chart.symboltf.h" #include "Terminal.define.h" diff --git a/DictBase.mqh b/DictBase.mqh index e7f0b8a75..251dbf11d 100644 --- a/DictBase.mqh +++ b/DictBase.mqh @@ -29,7 +29,6 @@ #include "Dict.enum.h" #include "DictIteratorBase.mqh" #include "DictSlot.mqh" -#include "Serializer.mqh" /** * Dictionary overflow listener. arguments are: diff --git a/DictIteratorBase.mqh b/DictIteratorBase.mqh index 8d11899fa..5a529c0cf 100644 --- a/DictIteratorBase.mqh +++ b/DictIteratorBase.mqh @@ -25,13 +25,14 @@ #pragma once #endif +// Forward class declaration. +template +class DictBase; + #include "DictBase.mqh" #include "DictSlotsRef.h" #include "SerializerConversions.h" -template -class DictBase; - template class DictIteratorBase { protected: diff --git a/DictSlot.mqh b/DictSlot.mqh index 3c1fe29e1..41a85408d 100644 --- a/DictSlot.mqh +++ b/DictSlot.mqh @@ -55,4 +55,4 @@ class DictSlot { void RemoveFlags(unsigned char flags) { _flags &= (unsigned char)~flags; } }; -#endif +#endif // DICT_SLOT_MQH diff --git a/DictSlotsRef.h b/DictSlotsRef.h index 1164261cd..03fd1c9de 100644 --- a/DictSlotsRef.h +++ b/DictSlotsRef.h @@ -37,6 +37,7 @@ #include "Std.h" #include "Util.h" +// Forward class declaration. template class DictSlot; diff --git a/DictStruct.mqh b/DictStruct.mqh index 6fc1425cd..9b362c1a1 100644 --- a/DictStruct.mqh +++ b/DictStruct.mqh @@ -24,10 +24,6 @@ #ifndef DICT_STRUCT_MQH #define DICT_STRUCT_MQH -// Forward declarations. -class Dynamic; -class Log; - #include "DictBase.mqh" #include "DictIteratorBase.mqh" #include "Serializer.mqh" diff --git a/Draw.mqh b/Draw.mqh index f39173d6e..5c2fcca9e 100644 --- a/Draw.mqh +++ b/Draw.mqh @@ -75,7 +75,7 @@ void SetIndexStyle(int _index, int _type, int _style = EMPTY, int _width = EMPTY /** * Class to provide drawing methods working with graphic objects. */ -class Draw : public Chart { +class Draw : public Object { protected: // Variables. long chart_id; diff --git a/File.mqh b/File.mqh index 56c33bd57..c6e62fb54 100644 --- a/File.mqh +++ b/File.mqh @@ -32,9 +32,10 @@ // Includes. #include "File.define.h" #include "File.extern.h" +#include "Std.h" #include "Terminal.define.h" -#include "Terminal.extern.h" #include "Terminal.enum.h" +#include "Terminal.extern.h" #ifndef __MQL__ enum ENUM_FILE_PROPERTY_INTEGER { diff --git a/Indicator.define.h b/Indicator/Indicator.define.h similarity index 99% rename from Indicator.define.h rename to Indicator/Indicator.define.h index ab51a433d..72e4333d5 100644 --- a/Indicator.define.h +++ b/Indicator/Indicator.define.h @@ -91,9 +91,6 @@ #define LOWER_LINE 1 // Bottom line. #endif -// Forward declarations. -class DrawIndicator; - #ifndef __MQL__ // // Empty value in an indicator buffer. diff --git a/Indicator.enum.h b/Indicator/Indicator.enum.h similarity index 84% rename from Indicator.enum.h rename to Indicator/Indicator.enum.h index b2b07a3a4..1306f1cd0 100644 --- a/Indicator.enum.h +++ b/Indicator/Indicator.enum.h @@ -146,14 +146,6 @@ enum ENUM_INDI_ADX_LINE { FINAL_INDI_ADX_LINE_ENTRY, }; -/* Define indicator index. */ -enum ENUM_INDICATOR_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. -}; - /* Indicator line identifiers used in Envelopes and Fractals */ enum ENUM_LO_UP_LINE { #ifdef __MQL4__ @@ -197,49 +189,6 @@ enum ENUM_SIGNAL_LINE { enum ENUM_APPLIED_VOLUME { VOLUME_TICK = 0, VOLUME_REAL = 1 }; #endif -/* Indicator entry flags. */ -enum INDICATOR_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_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_VALID = 1 << 6, - INDI_ENTRY_FLAG_INSUFFICIENT_DATA = 1 << 7, // Entry has missing value for that shift and probably won't ever have. -}; - -// 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. - // 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 -}; - // Indicator flags. enum ENUM_INDI_FLAGS { INDI_FLAG_INDEXABLE_BY_SHIFT, // Indicator supports indexation by shift. @@ -269,4 +218,3 @@ enum ENUM_INDI_DS_MODE_KIND { 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. }; -//+------------------------------------------------------------------+ diff --git a/Indicator.mqh b/Indicator/Indicator.h similarity index 96% rename from Indicator.mqh rename to Indicator/Indicator.h index b9b6d414f..f7aa36f4d 100644 --- a/Indicator.mqh +++ b/Indicator/Indicator.h @@ -24,27 +24,30 @@ #ifndef INDICATOR_MQH #define INDICATOR_MQH -// Includes. -#include "Array.mqh" -#include "BufferStruct.mqh" -#include "DateTime.mqh" -#include "DrawIndicator.mqh" -#include "Flags.h" +// Forward class declaration. +struct IndicatorParams; + #include "Indicator.define.h" #include "Indicator.enum.h" -#include "Indicator.struct.cache.h" #include "Indicator.struct.h" #include "Indicator.struct.serialize.h" -#include "IndicatorData.mqh" -#include "Math.h" -#include "Object.mqh" -#include "Refs.mqh" -#include "Serializer.mqh" -#include "SerializerCsv.mqh" -#include "SerializerJson.mqh" -#include "Storage/ValueStorage.h" -#include "Storage/ValueStorage.indicator.h" -#include "Storage/ValueStorage.native.h" +#include "IndicatorData.h" + +// Includes. +#include "../Array.mqh" +#include "../BufferStruct.mqh" +#include "../DateTime.mqh" +#include "../DrawIndicator.mqh" +#include "../Flags.h" +#include "../Math.h" +#include "../Object.mqh" +#include "../Refs.mqh" +#include "../Serializer.mqh" +#include "../SerializerCsv.mqh" +#include "../SerializerJson.mqh" +#include "../Storage/ValueStorage.h" +#include "../Storage/ValueStorage.indicator.h" +#include "../Storage/ValueStorage.native.h" #ifndef __MQL4__ // Defines global functions (for MQL4 backward compatibility). @@ -608,10 +611,10 @@ class Indicator : public IndicatorData { _entry.Resize(_max_modes); _entry.timestamp = GetBarTime(_ishift); #ifndef __MQL4__ - if (IndicatorBase::Get(STRUCT_ENUM(IndicatorState, INDICATOR_STATE_PROP_IS_CHANGED))) { + if (IndicatorData::Get(STRUCT_ENUM(IndicatorState, INDICATOR_STATE_PROP_IS_CHANGED))) { // Resets the handle on any parameter changes. - IndicatorBase::Set(STRUCT_ENUM(IndicatorState, INDICATOR_STATE_PROP_HANDLE), INVALID_HANDLE); - IndicatorBase::Set(STRUCT_ENUM(IndicatorState, INDICATOR_STATE_PROP_IS_CHANGED), false); + IndicatorData::Set(STRUCT_ENUM(IndicatorState, INDICATOR_STATE_PROP_HANDLE), INVALID_HANDLE); + IndicatorData::Set(STRUCT_ENUM(IndicatorState, INDICATOR_STATE_PROP_IS_CHANGED), false); } #endif for (int _mode = 0; _mode < _max_modes; _mode++) { diff --git a/Indicator.struct.h b/Indicator/Indicator.struct.h similarity index 69% rename from Indicator.struct.h rename to Indicator/Indicator.struct.h index 1819695f3..4e1a220de 100644 --- a/Indicator.struct.h +++ b/Indicator/Indicator.struct.h @@ -35,18 +35,15 @@ template class Indicator; struct ChartParams; -// Defines. -#define STRUCT_ENUM_INDICATOR_STATE_PROP STRUCT_ENUM(IndicatorState, ENUM_INDICATOR_STATE_PROP) - // Includes. -#include "Array.mqh" -#include "Chart.struct.tf.h" -#include "Data.struct.h" -#include "DateTime.struct.h" +#include "../Array.mqh" +#include "../Chart.struct.tf.h" +#include "../Data.struct.h" +#include "../DateTime.struct.h" +#include "../SerializerNode.enum.h" #include "Indicator.enum.h" -#include "Indicator.struct.cache.h" -#include "SerializerNode.enum.h" -#include "Storage/ValueStorage.indicator.h" +#include "IndicatorData.struct.cache.h" +//#include "Indicator.struct.serialize.h" /* Structure for indicator parameters. */ struct IndicatorParams { @@ -130,54 +127,3 @@ struct IndicatorParams { // template <> SerializerNodeType Serialize(Serializer &s); }; - -/* Structure for indicator state. */ -struct IndicatorState { - public: // @todo: Change it to protected. - int handle; // Indicator handle (MQL5 only). - 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, - }; - // Constructor. - IndicatorState() : handle(INVALID_HANDLE), is_changed(true), is_ready(false) {} - // Getters. - template - T Get(STRUCT_ENUM(IndicatorState, ENUM_INDICATOR_STATE_PROP) _prop) { - switch (_prop) { - case INDICATOR_STATE_PROP_HANDLE: - return (T)handle; - case INDICATOR_STATE_PROP_IS_CHANGED: - return (T)is_changed; - case INDICATOR_STATE_PROP_IS_READY: - return (T)is_ready; - }; - SetUserError(ERR_INVALID_PARAMETER); - return (T)WRONG_VALUE; - } - // Setters. - template - void Set(STRUCT_ENUM(IndicatorState, ENUM_INDICATOR_STATE_PROP) _prop, T _value) { - switch (_prop) { - case INDICATOR_STATE_PROP_HANDLE: - handle = (T)_value; - break; - case INDICATOR_STATE_PROP_IS_CHANGED: - is_changed = (T)_value; - break; - case INDICATOR_STATE_PROP_IS_READY: - is_ready = (T)_value; - break; - default: - SetUserError(ERR_INVALID_PARAMETER); - break; - }; - } - // State checkers. - bool IsChanged() { return is_changed; } - bool IsReady() { return is_ready; } -}; diff --git a/Indicator.struct.serialize.h b/Indicator/Indicator.struct.serialize.h similarity index 95% rename from Indicator.struct.serialize.h rename to Indicator/Indicator.struct.serialize.h index 6d705c609..512af9718 100644 --- a/Indicator.struct.serialize.h +++ b/Indicator/Indicator.struct.serialize.h @@ -25,10 +25,9 @@ * Includes Indicator's struct serializers. */ -#include "Serializer.mqh" - -// Forward class declaration. -class Serializer; +#include "../Serializer.mqh" +#include "../SerializerNode.enum.h" +#include "Indicator.struct.h" /* Method to serialize IndicatorParams structure. */ SerializerNodeType IndicatorParams::Serialize(Serializer &s) { diff --git a/IndicatorBase.h b/Indicator/IndicatorBase.h similarity index 89% rename from IndicatorBase.h rename to Indicator/IndicatorBase.h index 7982a4a08..f2738dcd4 100644 --- a/IndicatorBase.h +++ b/Indicator/IndicatorBase.h @@ -30,38 +30,26 @@ #pragma once #endif -// Forward declaration. -class Chart; - // Includes. -#include "Array.mqh" -#include "BufferStruct.mqh" -#include "Chart.mqh" -#include "Chart.struct.tf.h" -#include "ChartBase.h" -#include "ChartMt.h" -#include "DateTime.mqh" -#include "DrawIndicator.mqh" -#include "Flags.h" -#include "Indicator.define.h" -#include "Indicator.enum.h" -#include "Indicator.struct.cache.h" -#include "Indicator.struct.h" -#include "Indicator.struct.serialize.h" -#include "Log.mqh" -#include "Object.mqh" -#include "Refs.mqh" -#include "Serializer.mqh" -#include "SerializerCsv.mqh" -#include "SerializerJson.mqh" -#include "Util.h" +#include "../Array.mqh" +#include "../BufferStruct.mqh" +#include "../Chart.struct.tf.h" +//#include "../ChartBase.h" +#include "../ChartMt.h" +#include "../DateTime.mqh" +#include "../Log.mqh" +#include "../Object.mqh" +#include "../Refs.mqh" +#include "../Serializer.mqh" +#include "../SerializerCsv.mqh" +#include "../SerializerJson.mqh" +#include "../Util.h" /** * Class to deal with indicators. */ class IndicatorBase : public Object { protected: - IndicatorState istate; Ref logger; public: @@ -87,7 +75,7 @@ class IndicatorBase : public Object { /** * Class deconstructor. */ - virtual ~IndicatorBase() { ReleaseHandle(); } + virtual ~IndicatorBase() {} /* Operator overloading methods */ @@ -168,14 +156,6 @@ class IndicatorBase : public Object { /* Getters */ - /** - * Gets an indicator's state property value. - */ - template - T Get(STRUCT_ENUM(IndicatorState, ENUM_INDICATOR_STATE_PROP) _prop) { - return istate.Get(_prop); - } - /** * Returns logger. */ @@ -190,14 +170,6 @@ class IndicatorBase : public Object { /* Setters */ - /** - * Sets an indicator's state property value. - */ - template - void Set(STRUCT_ENUM(IndicatorState, ENUM_INDICATOR_STATE_PROP) _prop, T _value) { - istate.Set(_prop, _value); - } - /** * Sets name of the indicator. */ @@ -215,25 +187,6 @@ class IndicatorBase : public Object { */ // void SetSymbol(string _symbol) { Set(CHART_PARAM_SYMBOL, _symbol); } - /* Other methods */ - - /** - * Releases indicator's handle. - * - * Note: Not supported in MT4. - */ - void ReleaseHandle() { -#ifdef __MQL5__ - if (istate.handle != INVALID_HANDLE) { - IndicatorRelease(istate.handle); - } -#endif - istate.handle = INVALID_HANDLE; - istate.is_changed = true; - } - - /* Data representation methods */ - /* Virtual methods */ /** diff --git a/Indicator/IndicatorCandle.h b/Indicator/IndicatorCandle.h index 8221afe82..53a338cdb 100644 --- a/Indicator/IndicatorCandle.h +++ b/Indicator/IndicatorCandle.h @@ -32,7 +32,6 @@ // Includes. #include "../Buffer/BufferCandle.h" #include "../Candle.struct.h" -#include "../Indicator.mqh" #include "../Storage/ValueStorage.price_median.h" #include "../Storage/ValueStorage.price_typical.h" #include "../Storage/ValueStorage.price_weighted.h" @@ -40,6 +39,7 @@ #include "../Storage/ValueStorage.tick_volume.h" #include "../Storage/ValueStorage.time.h" #include "../Storage/ValueStorage.volume.h" +#include "Indicator.h" #include "TickBarCounter.h" // Indicator modes. @@ -456,4 +456,4 @@ class IndicatorCandle : public Indicator { /* Virtual methods */ }; -#endif +#endif // INDICATOR_CANDLE_H diff --git a/IndicatorData.enum.h b/Indicator/IndicatorData.enum.h similarity index 53% rename from IndicatorData.enum.h rename to Indicator/IndicatorData.enum.h index 3ac513b26..9c22d82af 100644 --- a/IndicatorData.enum.h +++ b/Indicator/IndicatorData.enum.h @@ -30,6 +30,57 @@ #pragma once #endif +/* Indicator entry flags. */ +enum INDICATOR_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_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_VALID = 1 << 6, + INDI_ENTRY_FLAG_INSUFFICIENT_DATA = 1 << 7, // Entry has missing value for that shift and probably won't ever have. +}; + +/* Define indicator index. */ +enum ENUM_INDICATOR_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. +}; + +// 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. + // 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 +}; + /* Defines type of source data for. Also used for Indicator::GetPossibleDataModes(). */ enum ENUM_IDATA_SOURCE_TYPE { IDATA_BUILTIN = 1 << 0, // Platform built-in diff --git a/IndicatorData.mqh b/Indicator/IndicatorData.h similarity index 97% rename from IndicatorData.mqh rename to Indicator/IndicatorData.h index 46225b8d3..fa4e55904 100644 --- a/IndicatorData.mqh +++ b/Indicator/IndicatorData.h @@ -20,15 +20,33 @@ * */ +// Ignore processing of this file if already included. +#ifndef INDICATOR_DATA_H +#define INDICATOR_DATA_H + +#ifndef __MQL__ +// Allows the preprocessor to include a header file when it is needed. +#pragma once +#endif + +// Forward class declaration. +class IndicatorBase; + // Includes. +#include "../Bar.struct.h" +#include "../DrawIndicator.mqh" +#include "../Flags.h" +#include "../Storage/ValueStorage.h" +#include "../Storage/ValueStorage.indicator.h" +#include "../Storage/ValueStorage.native.h" +#include "../SymbolInfo.struct.h" +#include "Indicator.enum.h" #include "IndicatorBase.h" #include "IndicatorData.enum.h" +#include "IndicatorData.struct.cache.h" #include "IndicatorData.struct.h" #include "IndicatorData.struct.serialize.h" #include "IndicatorData.struct.signal.h" -#include "Storage/ValueStorage.h" -#include "Storage/ValueStorage.indicator.h" -#include "Storage/ValueStorage.native.h" /** * Implements class to store indicator data. @@ -51,7 +69,8 @@ class IndicatorData : public IndicatorBase { DrawIndicator* draw; IndicatorCalculateCache cache; IndicatorDataParams idparams; // Indicator data params. - Ref indi_src; // Indicator used as data source. + IndicatorState istate; + Ref indi_src; // Indicator used as data source. protected: /* Protected methods */ @@ -87,11 +106,14 @@ class IndicatorData : public IndicatorBase { * Initialize indicator data drawing on custom data. */ bool InitDraw() { - if (idparams.is_draw && !Object::IsValid(draw)) { - draw = new DrawIndicator(THIS_PTR); - draw.SetColorLine(idparams.indi_color); - } - return idparams.is_draw; + /* @todo: To refactor. + if (idparams.is_draw && !Object::IsValid(draw)) { + draw = new DrawIndicator(THIS_PTR); + draw.SetColorLine(idparams.indi_color); + } + return idparams.is_draw; + */ + return false; } /** @@ -121,7 +143,10 @@ class IndicatorData : public IndicatorBase { /** * Class deconstructor. */ - virtual ~IndicatorData() { DeinitDraw(); } + virtual ~IndicatorData() { + DeinitDraw(); + ReleaseHandle(); + } /* Operator overloading methods */ @@ -761,6 +786,14 @@ class IndicatorData : public IndicatorBase { idparams.Set(_param, _value); } + /** + * Sets an indicator's state property value. + */ + template + void Set(STRUCT_ENUM_INDICATOR_STATE_PROP _prop, T _value) { + istate.Set(_prop, _value); + } + /** * Sets indicator data source. */ @@ -972,6 +1005,23 @@ class IndicatorData : public IndicatorBase { } } + /* Handle methods */ + + /** + * Releases indicator's handle. + * + * Note: Not supported in MT4. + */ + void ReleaseHandle() { +#ifdef __MQL5__ + if (istate.handle != INVALID_HANDLE) { + IndicatorRelease(istate.handle); + } +#endif + istate.handle = INVALID_HANDLE; + istate.is_changed = true; + } + /* Printers */ /** @@ -1775,3 +1825,5 @@ int CopyBuffer(IndicatorData* _indi, int _mode, int _start, int _count, ValueSto return _num_copied; } + +#endif // INDICATOR_DATA_H diff --git a/Indicator.struct.cache.h b/Indicator/IndicatorData.struct.cache.h similarity index 99% rename from Indicator.struct.cache.h rename to Indicator/IndicatorData.struct.cache.h index 2c4df7097..05264e24b 100644 --- a/Indicator.struct.cache.h +++ b/Indicator/IndicatorData.struct.cache.h @@ -31,8 +31,8 @@ #endif // Includes. -#include "Refs.mqh" -#include "Storage/ValueStorage.h" +#include "../Refs.mqh" +#include "../Storage/ValueStorage.h" /** * Holds buffers used to cache values calculated via OnCalculate methods. diff --git a/IndicatorData.struct.h b/Indicator/IndicatorData.struct.h similarity index 90% rename from IndicatorData.struct.h rename to Indicator/IndicatorData.struct.h index 1bc258497..27eaa124b 100644 --- a/IndicatorData.struct.h +++ b/Indicator/IndicatorData.struct.h @@ -27,9 +27,11 @@ // 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) // Includes. -#include "SerializerNode.enum.h" +#include "../SerializerNode.enum.h" +#include "IndicatorData.enum.h" // Type-less value for IndicatorDataEntryValue structure. union IndicatorDataEntryTypelessValue { @@ -528,3 +530,54 @@ struct IndicatorDataParams { } void SetIndicatorColor(color _clr) { indi_color = _clr; } }; + +/* Structure for indicator state. */ +struct IndicatorState { + public: // @todo: Change it to protected. + int handle; // Indicator handle (MQL5 only). + 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, + }; + // Constructor. + IndicatorState() : handle(INVALID_HANDLE), is_changed(true), is_ready(false) {} + // Getters. + template + T Get(STRUCT_ENUM(IndicatorState, ENUM_INDICATOR_STATE_PROP) _prop) { + switch (_prop) { + case INDICATOR_STATE_PROP_HANDLE: + return (T)handle; + case INDICATOR_STATE_PROP_IS_CHANGED: + return (T)is_changed; + case INDICATOR_STATE_PROP_IS_READY: + return (T)is_ready; + }; + SetUserError(ERR_INVALID_PARAMETER); + return (T)WRONG_VALUE; + } + // Setters. + template + void Set(STRUCT_ENUM(IndicatorState, ENUM_INDICATOR_STATE_PROP) _prop, T _value) { + switch (_prop) { + case INDICATOR_STATE_PROP_HANDLE: + handle = (T)_value; + break; + case INDICATOR_STATE_PROP_IS_CHANGED: + is_changed = (T)_value; + break; + case INDICATOR_STATE_PROP_IS_READY: + is_ready = (T)_value; + break; + default: + SetUserError(ERR_INVALID_PARAMETER); + break; + }; + } + // State checkers. + bool IsChanged() { return is_changed; } + bool IsReady() { return is_ready; } +}; diff --git a/IndicatorData.struct.serialize.h b/Indicator/IndicatorData.struct.serialize.h similarity index 99% rename from IndicatorData.struct.serialize.h rename to Indicator/IndicatorData.struct.serialize.h index 0381cfcde..7655450bd 100644 --- a/IndicatorData.struct.serialize.h +++ b/Indicator/IndicatorData.struct.serialize.h @@ -25,7 +25,7 @@ * Includes IndicatorData's struct serializers. */ -#include "Serializer.mqh" +#include "../Serializer.mqh" // Forward class declaration. class Serializer; diff --git a/IndicatorData.struct.signal.h b/Indicator/IndicatorData.struct.signal.h similarity index 100% rename from IndicatorData.struct.signal.h rename to Indicator/IndicatorData.struct.signal.h diff --git a/Indicator/IndicatorTf.h b/Indicator/IndicatorTf.h index 60540acd9..9822e226f 100644 --- a/Indicator/IndicatorTf.h +++ b/Indicator/IndicatorTf.h @@ -147,4 +147,4 @@ class IndicatorTf : public IndicatorCandle { ENUM_TIMEFRAMES GetTf() override { return tf; } }; -#endif +#endif // INDICATOR_TF_H diff --git a/Indicator/IndicatorTf.struct.h b/Indicator/IndicatorTf.struct.h index 7259d6d9b..6eb42bfb2 100644 --- a/Indicator/IndicatorTf.struct.h +++ b/Indicator/IndicatorTf.struct.h @@ -31,7 +31,7 @@ #endif // Includes. -#include "../Indicator.struct.h" +#include "Indicator.struct.h" /* Structure for IndicatorTf class parameters. */ struct IndicatorTfParams : IndicatorParams { diff --git a/Indicator/IndicatorTick.h b/Indicator/IndicatorTick.h index 5438923cb..b1ecfb13f 100644 --- a/Indicator/IndicatorTick.h +++ b/Indicator/IndicatorTick.h @@ -31,8 +31,8 @@ // Includes. #include "../Buffer/BufferTick.h" -#include "../Indicator.mqh" -#include "../Indicator.struct.h" +#include "Indicator.h" +#include "Indicator.struct.h" // Indicator modes. enum ENUM_INDI_TICK_MODE { diff --git a/Indicator/IndicatorTickSource.h b/Indicator/IndicatorTickSource.h index 8b47180a5..0c0e3b5a1 100644 --- a/Indicator/IndicatorTickSource.h +++ b/Indicator/IndicatorTickSource.h @@ -26,7 +26,7 @@ #endif // Includes. -#include "../Indicator.mqh" +#include "Indicator.h" /** * Indicator to be used with IndicatorTick as a data source. diff --git a/tests/IndicatorTest.mq4 b/Indicator/tests/Indicator.test.mq4 similarity index 91% rename from tests/IndicatorTest.mq4 rename to Indicator/tests/Indicator.test.mq4 index f1bee4667..81a7da627 100644 --- a/tests/IndicatorTest.mq4 +++ b/Indicator/tests/Indicator.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2022, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -25,4 +25,4 @@ */ // Includes. -#include "IndicatorTest.mq5" +#include "Indicator.test.mq5" diff --git a/tests/IndicatorTest.mq5 b/Indicator/tests/Indicator.test.mq5 similarity index 95% rename from tests/IndicatorTest.mq5 rename to Indicator/tests/Indicator.test.mq5 index e837f8e92..437dfb252 100644 --- a/tests/IndicatorTest.mq5 +++ b/Indicator/tests/Indicator.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2022, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -25,8 +25,8 @@ */ // Includes. -#include "../Indicator.mqh" -#include "../Test.mqh" +#include "../Indicator.h" +#include "../../Test.mqh" /** * Implements OnInit(). diff --git a/tests/IndicatorBaseTest.mq4 b/Indicator/tests/IndicatorBase.test.mq4 similarity index 96% rename from tests/IndicatorBaseTest.mq4 rename to Indicator/tests/IndicatorBase.test.mq4 index 167dec35e..e350d5630 100644 --- a/tests/IndicatorBaseTest.mq4 +++ b/Indicator/tests/IndicatorBase.test.mq4 @@ -25,4 +25,4 @@ */ // Includes. -#include "IndicatorBaseTest.mq5" +#include "IndicatorBase.test.mq5" diff --git a/tests/IndicatorBaseTest.mq5 b/Indicator/tests/IndicatorBase.test.mq5 similarity index 97% rename from tests/IndicatorBaseTest.mq5 rename to Indicator/tests/IndicatorBase.test.mq5 index 8ca89f936..49ff02872 100644 --- a/tests/IndicatorBaseTest.mq5 +++ b/Indicator/tests/IndicatorBase.test.mq5 @@ -25,8 +25,8 @@ */ // Includes. +#include "../../Test.mqh" #include "../IndicatorBase.h" -#include "../Test.mqh" /** * Implements OnInit(). diff --git a/tests/IndicatorDataTest.mq4 b/Indicator/tests/IndicatorData.test.mq4 similarity index 96% rename from tests/IndicatorDataTest.mq4 rename to Indicator/tests/IndicatorData.test.mq4 index ec907afe1..354e8a763 100644 --- a/tests/IndicatorDataTest.mq4 +++ b/Indicator/tests/IndicatorData.test.mq4 @@ -25,4 +25,4 @@ */ // Includes. -#include "IndicatorDataTest.mq5" +#include "IndicatorData.test.mq5" diff --git a/tests/IndicatorDataTest.mq5 b/Indicator/tests/IndicatorData.test.mq5 similarity index 95% rename from tests/IndicatorDataTest.mq5 rename to Indicator/tests/IndicatorData.test.mq5 index bd6a17c11..d78133913 100644 --- a/tests/IndicatorDataTest.mq5 +++ b/Indicator/tests/IndicatorData.test.mq5 @@ -25,8 +25,8 @@ */ // Includes. -#include "../IndicatorData.mqh" -#include "../Test.mqh" +#include "../../Test.mqh" +#include "../IndicatorData.h" /** * Implements OnInit(). diff --git a/Indicator/tests/IndicatorTf.test.mq5 b/Indicator/tests/IndicatorTf.test.mq5 index 65e09817c..139e1275f 100644 --- a/Indicator/tests/IndicatorTf.test.mq5 +++ b/Indicator/tests/IndicatorTf.test.mq5 @@ -27,16 +27,19 @@ */ // Includes. +#include "../../DictBase.mqh" #include "../../Indicators/Indi_AMA.mqh" #include "../../Indicators/Tick/Indi_TickMt.mqh" +#include "../../Log.mqh" #include "../../Platform.h" +#include "../../SymbolInfo.mqh" #include "../../Test.mqh" #include "../../Util.h" #include "../IndicatorTf.h" -#include "../IndicatorTick.h" #include "classes/IndicatorTfDummy.h" #include "classes/Indicators.h" +// Global variables. Ref indi_tick; Ref indi_tf; Ref indi_tf_real; diff --git a/Indicator/tests/IndicatorTick.test.mq5 b/Indicator/tests/IndicatorTick.test.mq5 index 87016f2dc..04a8da463 100644 --- a/Indicator/tests/IndicatorTick.test.mq5 +++ b/Indicator/tests/IndicatorTick.test.mq5 @@ -26,6 +26,7 @@ // Includes. #include "../../Test.mqh" +#include "../IndicatorTick.h" #include "classes/IndicatorTickDummy.h" /** diff --git a/Indicator/tests/classes/Indicators.h b/Indicator/tests/classes/Indicators.h index 1d1da2066..c57362551 100644 --- a/Indicator/tests/classes/Indicators.h +++ b/Indicator/tests/classes/Indicators.h @@ -30,7 +30,7 @@ #endif // Includes. -#include "../../../IndicatorData.mqh" +#include "../../../Indicator/IndicatorData.h" #include "../../../Refs.mqh" /** diff --git a/Indicators/Bitwise/Indi_Candle.mqh b/Indicators/Bitwise/Indi_Candle.mqh index 306c018e2..61e7f3d56 100644 --- a/Indicators/Bitwise/Indi_Candle.mqh +++ b/Indicators/Bitwise/Indi_Candle.mqh @@ -23,7 +23,7 @@ // Includes. #include "../../Bar.struct.h" #include "../../BufferStruct.mqh" -#include "../../Indicator.mqh" +#include "../../Indicator/Indicator.h" #include "../../Pattern.struct.h" #include "../../Serializer.mqh" #include "../Price/Indi_Price.mqh" diff --git a/Indicators/Bitwise/Indi_Pattern.mqh b/Indicators/Bitwise/Indi_Pattern.mqh index 0c2d9d631..229faf261 100644 --- a/Indicators/Bitwise/Indi_Pattern.mqh +++ b/Indicators/Bitwise/Indi_Pattern.mqh @@ -23,7 +23,7 @@ // Includes. #include "../../Bar.struct.h" #include "../../BufferStruct.mqh" -#include "../../Indicator.mqh" +#include "../../Indicator/Indicator.h" #include "../../Pattern.struct.h" #include "../../Serializer.mqh" #include "../Price/Indi_Price.mqh" diff --git a/Indicators/Indi_AC.mqh b/Indicators/Indi_AC.mqh index 2e497109b..9d577bb81 100644 --- a/Indicators/Indi_AC.mqh +++ b/Indicators/Indi_AC.mqh @@ -22,7 +22,7 @@ // Includes. #include "../BufferStruct.mqh" -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #ifndef __MQL4__ // Defines global functions (for MQL4 backward compability). diff --git a/Indicators/Indi_AD.mqh b/Indicators/Indi_AD.mqh index a7385e259..ad7b0f95f 100644 --- a/Indicators/Indi_AD.mqh +++ b/Indicators/Indi_AD.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #ifndef __MQL4__ // Defines global functions (for MQL4 backward compability). diff --git a/Indicators/Indi_ADX.mqh b/Indicators/Indi_ADX.mqh index 0c151c3f7..f01dad621 100644 --- a/Indicators/Indi_ADX.mqh +++ b/Indicators/Indi_ADX.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #include "Price/Indi_Price.mqh" #ifndef __MQL4__ diff --git a/Indicators/Indi_ADXW.mqh b/Indicators/Indi_ADXW.mqh index 4b3876059..a46d95977 100644 --- a/Indicators/Indi_ADXW.mqh +++ b/Indicators/Indi_ADXW.mqh @@ -22,7 +22,7 @@ // Includes. #include "../BufferStruct.mqh" -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.applied_price.h" #include "../Storage/ValueStorage.h" #include "../Storage/ValueStorage.spread.h" diff --git a/Indicators/Indi_AMA.mqh b/Indicators/Indi_AMA.mqh index ec615c8ac..4d39aefb6 100644 --- a/Indicators/Indi_AMA.mqh +++ b/Indicators/Indi_AMA.mqh @@ -22,7 +22,7 @@ // Includes. #include "../BufferStruct.mqh" -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.h" #include "Price/Indi_Price.mqh" @@ -45,7 +45,7 @@ struct IndiAMAParams : IndicatorParams { // Defaulting to on-indicator mode (will use real ticks from platform via IndicatorTickReal). SetShift(_shift); if (custom_indi_name == "") { - SetCustomIndicatorName("Examples\\AMA"); + SetCustomIndicatorName("Examples\\AMA"); } }; IndiAMAParams(IndiAMAParams &_params) { THIS_REF = _params; } diff --git a/Indicators/Indi_AO.mqh b/Indicators/Indi_AO.mqh index cb51048b0..b80c5e4b9 100644 --- a/Indicators/Indi_AO.mqh +++ b/Indicators/Indi_AO.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #ifndef __MQL4__ // Defines global functions (for MQL4 backward compability). diff --git a/Indicators/Indi_ASI.mqh b/Indicators/Indi_ASI.mqh index a2ee523f1..cf0ff9270 100644 --- a/Indicators/Indi_ASI.mqh +++ b/Indicators/Indi_ASI.mqh @@ -22,7 +22,7 @@ // Includes. #include "../BufferStruct.mqh" -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.all.h" // Structs. diff --git a/Indicators/Indi_ATR.mqh b/Indicators/Indi_ATR.mqh index dca8224f2..e79cc5f43 100644 --- a/Indicators/Indi_ATR.mqh +++ b/Indicators/Indi_ATR.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #ifndef __MQL4__ // Defines global functions (for MQL4 backward compability). diff --git a/Indicators/Indi_Alligator.mqh b/Indicators/Indi_Alligator.mqh index 27623a42e..601660a52 100644 --- a/Indicators/Indi_Alligator.mqh +++ b/Indicators/Indi_Alligator.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #ifndef __MQL4__ // Defines global functions (for MQL4 backward compability). diff --git a/Indicators/Indi_AppliedPrice.mqh b/Indicators/Indi_AppliedPrice.mqh index dbfc0dfee..bbdbccc27 100644 --- a/Indicators/Indi_AppliedPrice.mqh +++ b/Indicators/Indi_AppliedPrice.mqh @@ -22,7 +22,7 @@ // Includes. #include "../BufferStruct.mqh" -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #include "OHLC/Indi_OHLC.mqh" // Structs. diff --git a/Indicators/Indi_BWMFI.mqh b/Indicators/Indi_BWMFI.mqh index a295f45a2..30c5f81db 100644 --- a/Indicators/Indi_BWMFI.mqh +++ b/Indicators/Indi_BWMFI.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #ifndef __MQL4__ // Defines global functions (for MQL4 backward compability). diff --git a/Indicators/Indi_Bands.mqh b/Indicators/Indi_Bands.mqh index 4c8dcd268..b978dd10c 100644 --- a/Indicators/Indi_Bands.mqh +++ b/Indicators/Indi_Bands.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #include "Indi_CCI.mqh" #include "Indi_Envelopes.mqh" #include "Indi_MA.mqh" diff --git a/Indicators/Indi_BearsPower.mqh b/Indicators/Indi_BearsPower.mqh index 46d8c53f2..538cffa28 100644 --- a/Indicators/Indi_BearsPower.mqh +++ b/Indicators/Indi_BearsPower.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #ifndef __MQL4__ // Defines global functions (for MQL4 backward compability). diff --git a/Indicators/Indi_BullsPower.mqh b/Indicators/Indi_BullsPower.mqh index b63d5b706..6097a4f1d 100644 --- a/Indicators/Indi_BullsPower.mqh +++ b/Indicators/Indi_BullsPower.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #ifndef __MQL4__ // Defines global functions (for MQL4 backward compability). diff --git a/Indicators/Indi_CCI.mqh b/Indicators/Indi_CCI.mqh index fa5880366..1e31396de 100644 --- a/Indicators/Indi_CCI.mqh +++ b/Indicators/Indi_CCI.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #include "Indi_MA.mqh" #include "Indi_PriceFeeder.mqh" #include "Price/Indi_Price.mqh" diff --git a/Indicators/Indi_CHO.mqh b/Indicators/Indi_CHO.mqh index 580c5014f..2e4587f53 100644 --- a/Indicators/Indi_CHO.mqh +++ b/Indicators/Indi_CHO.mqh @@ -22,7 +22,7 @@ // Includes. #include "../BufferStruct.mqh" -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.all.h" #include "../Util.h" #include "Indi_MA.mqh" diff --git a/Indicators/Indi_CHV.mqh b/Indicators/Indi_CHV.mqh index 97319df98..bc2e85a41 100644 --- a/Indicators/Indi_CHV.mqh +++ b/Indicators/Indi_CHV.mqh @@ -22,7 +22,7 @@ // Includes. #include "../BufferStruct.mqh" -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.all.h" #include "../Util.h" #include "Indi_MA.mqh" diff --git a/Indicators/Indi_ColorBars.mqh b/Indicators/Indi_ColorBars.mqh index 5cbcd43b3..a12b88b40 100644 --- a/Indicators/Indi_ColorBars.mqh +++ b/Indicators/Indi_ColorBars.mqh @@ -22,7 +22,7 @@ // Includes. #include "../BufferStruct.mqh" -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.all.h" // Structs. diff --git a/Indicators/Indi_ColorCandlesDaily.mqh b/Indicators/Indi_ColorCandlesDaily.mqh index 321421580..dd43bf9a0 100644 --- a/Indicators/Indi_ColorCandlesDaily.mqh +++ b/Indicators/Indi_ColorCandlesDaily.mqh @@ -22,7 +22,7 @@ // Includes. #include "../BufferStruct.mqh" -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.all.h" // Structs. diff --git a/Indicators/Indi_ColorLine.mqh b/Indicators/Indi_ColorLine.mqh index 6b777890b..837276a22 100644 --- a/Indicators/Indi_ColorLine.mqh +++ b/Indicators/Indi_ColorLine.mqh @@ -22,7 +22,7 @@ // Includes. #include "../BufferStruct.mqh" -#include "../Indicator.mqh" +#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 2d3835656..e9e855edb 100644 --- a/Indicators/Indi_CustomMovingAverage.mqh +++ b/Indicators/Indi_CustomMovingAverage.mqh @@ -22,7 +22,7 @@ // Includes. #include "../BufferStruct.mqh" -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" // Structs. struct IndiCustomMovingAverageParams : IndicatorParams { diff --git a/Indicators/Indi_DEMA.mqh b/Indicators/Indi_DEMA.mqh index b6485522c..7e7478144 100644 --- a/Indicators/Indi_DEMA.mqh +++ b/Indicators/Indi_DEMA.mqh @@ -34,7 +34,7 @@ // Includes. #include "../Dict.mqh" #include "../DictObject.mqh" -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #include "../Refs.mqh" #include "../Storage/Objects.h" #include "../Storage/ValueStorage.h" diff --git a/Indicators/Indi_DeMarker.mqh b/Indicators/Indi_DeMarker.mqh index 5a2fa857a..f15cfeea2 100644 --- a/Indicators/Indi_DeMarker.mqh +++ b/Indicators/Indi_DeMarker.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #ifndef __MQL4__ // Defines global functions (for MQL4 backward compability). diff --git a/Indicators/Indi_Demo.mqh b/Indicators/Indi_Demo.mqh index 4ab3c765d..09a399c27 100644 --- a/Indicators/Indi_Demo.mqh +++ b/Indicators/Indi_Demo.mqh @@ -22,7 +22,7 @@ // Includes. #include "../BufferStruct.mqh" -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #include "Price/Indi_Price.mqh" /** diff --git a/Indicators/Indi_DetrendedPrice.mqh b/Indicators/Indi_DetrendedPrice.mqh index f560a1a23..229dc2e31 100644 --- a/Indicators/Indi_DetrendedPrice.mqh +++ b/Indicators/Indi_DetrendedPrice.mqh @@ -22,7 +22,7 @@ // Includes. #include "../BufferStruct.mqh" -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #include "Indi_MA.mqh" // Structs. diff --git a/Indicators/Indi_Drawer.mqh b/Indicators/Indi_Drawer.mqh index 2ef66b6f0..8ec621163 100644 --- a/Indicators/Indi_Drawer.mqh +++ b/Indicators/Indi_Drawer.mqh @@ -22,7 +22,7 @@ // Includes. #include "../DictStruct.mqh" -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #include "../Redis.mqh" #include "../Task/TaskAction.h" #include "Indi_Drawer.struct.h" diff --git a/Indicators/Indi_Drawer.struct.h b/Indicators/Indi_Drawer.struct.h index 473209d9f..b1957e566 100644 --- a/Indicators/Indi_Drawer.struct.h +++ b/Indicators/Indi_Drawer.struct.h @@ -26,7 +26,7 @@ */ // Includes. -#include "../Indicator.struct.h" +#include "../Indicator/Indicator.struct.h" #include "../SerializerNode.enum.h" // Structs. diff --git a/Indicators/Indi_Envelopes.mqh b/Indicators/Indi_Envelopes.mqh index 58d9725aa..1d7304c80 100644 --- a/Indicators/Indi_Envelopes.mqh +++ b/Indicators/Indi_Envelopes.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #include "../Storage/Singleton.h" #include "Indi_MA.mqh" #include "Indi_PriceFeeder.mqh" diff --git a/Indicators/Indi_Force.mqh b/Indicators/Indi_Force.mqh index 291f52f39..361b2e449 100644 --- a/Indicators/Indi_Force.mqh +++ b/Indicators/Indi_Force.mqh @@ -32,7 +32,7 @@ */ // Includes. -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #ifndef __MQL4__ // Defines global functions (for MQL4 backward compability). diff --git a/Indicators/Indi_FractalAdaptiveMA.mqh b/Indicators/Indi_FractalAdaptiveMA.mqh index 7109e7522..a009f9011 100644 --- a/Indicators/Indi_FractalAdaptiveMA.mqh +++ b/Indicators/Indi_FractalAdaptiveMA.mqh @@ -22,7 +22,7 @@ // Includes. #include "../BufferStruct.mqh" -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.all.h" // Structs. diff --git a/Indicators/Indi_Fractals.mqh b/Indicators/Indi_Fractals.mqh index 9ea6b1930..b947e0a32 100644 --- a/Indicators/Indi_Fractals.mqh +++ b/Indicators/Indi_Fractals.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #ifndef __MQL4__ // Defines global functions (for MQL4 backward compability). diff --git a/Indicators/Indi_Gator.mqh b/Indicators/Indi_Gator.mqh index 73afa2f9e..b6d93a43d 100644 --- a/Indicators/Indi_Gator.mqh +++ b/Indicators/Indi_Gator.mqh @@ -28,7 +28,7 @@ */ // Includes. -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #ifndef __MQL4__ // Defines global functions (for MQL4 backward compability). diff --git a/Indicators/Indi_HeikenAshi.mqh b/Indicators/Indi_HeikenAshi.mqh index 93422110a..c29059b0d 100644 --- a/Indicators/Indi_HeikenAshi.mqh +++ b/Indicators/Indi_HeikenAshi.mqh @@ -28,7 +28,7 @@ */ // Includes. -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.all.h" // Enums. diff --git a/Indicators/Indi_Ichimoku.mqh b/Indicators/Indi_Ichimoku.mqh index 6b331cd04..aeab321ce 100644 --- a/Indicators/Indi_Ichimoku.mqh +++ b/Indicators/Indi_Ichimoku.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #ifndef __MQL4__ // Defines global functions (for MQL4 backward compability). diff --git a/Indicators/Indi_Killzones.mqh b/Indicators/Indi_Killzones.mqh index a33740549..8f9933ae4 100644 --- a/Indicators/Indi_Killzones.mqh +++ b/Indicators/Indi_Killzones.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #include "../Market.struct.h" // Defines enumerations. diff --git a/Indicators/Indi_MA.mqh b/Indicators/Indi_MA.mqh index 4efa7154f..19fbe48b1 100644 --- a/Indicators/Indi_MA.mqh +++ b/Indicators/Indi_MA.mqh @@ -27,7 +27,7 @@ // Includes. #include "../Dict.mqh" #include "../DictObject.mqh" -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #include "../Refs.mqh" #include "../Storage/Singleton.h" #include "../Storage/ValueStorage.h" diff --git a/Indicators/Indi_MACD.mqh b/Indicators/Indi_MACD.mqh index 64cc2be27..835d387bd 100644 --- a/Indicators/Indi_MACD.mqh +++ b/Indicators/Indi_MACD.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #ifndef __MQL4__ // Defines global functions (for MQL4 backward compability). diff --git a/Indicators/Indi_MFI.mqh b/Indicators/Indi_MFI.mqh index 950f1806b..b813590cd 100644 --- a/Indicators/Indi_MFI.mqh +++ b/Indicators/Indi_MFI.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #ifndef __MQL4__ // Defines global functions (for MQL4 backward compability). diff --git a/Indicators/Indi_MassIndex.mqh b/Indicators/Indi_MassIndex.mqh index 57c3c5075..61866de86 100644 --- a/Indicators/Indi_MassIndex.mqh +++ b/Indicators/Indi_MassIndex.mqh @@ -22,7 +22,7 @@ // Includes. #include "../BufferStruct.mqh" -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.all.h" #include "Indi_MA.mqh" diff --git a/Indicators/Indi_Momentum.mqh b/Indicators/Indi_Momentum.mqh index 750923bbf..0a1cf9b77 100644 --- a/Indicators/Indi_Momentum.mqh +++ b/Indicators/Indi_Momentum.mqh @@ -30,7 +30,7 @@ */ // Includes. -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #include "Indi_PriceFeeder.mqh" #ifndef __MQL4__ diff --git a/Indicators/Indi_OBV.mqh b/Indicators/Indi_OBV.mqh index b53f50fd0..d6764c9a5 100644 --- a/Indicators/Indi_OBV.mqh +++ b/Indicators/Indi_OBV.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #ifndef __MQL4__ // Defines global functions (for MQL4 backward compability). diff --git a/Indicators/Indi_OsMA.mqh b/Indicators/Indi_OsMA.mqh index 64e0edaa7..801b4673a 100644 --- a/Indicators/Indi_OsMA.mqh +++ b/Indicators/Indi_OsMA.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #ifndef __MQL4__ // Defines global functions (for MQL4 backward compability). diff --git a/Indicators/Indi_Pivot.mqh b/Indicators/Indi_Pivot.mqh index d49539d91..bb90f9e96 100644 --- a/Indicators/Indi_Pivot.mqh +++ b/Indicators/Indi_Pivot.mqh @@ -22,7 +22,7 @@ // Includes. #include "../Bar.struct.h" -#include "../Indicator.struct.h" +#include "../Indicator/Indicator.struct.h" #include "../Serializer.mqh" #include "Special/Indi_Math.mqh" diff --git a/Indicators/Indi_PriceChannel.mqh b/Indicators/Indi_PriceChannel.mqh index dde4c871c..526643960 100644 --- a/Indicators/Indi_PriceChannel.mqh +++ b/Indicators/Indi_PriceChannel.mqh @@ -22,7 +22,7 @@ // Includes. #include "../BufferStruct.mqh" -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #include "Indi_ZigZag.mqh" // Structs. diff --git a/Indicators/Indi_PriceFeeder.mqh b/Indicators/Indi_PriceFeeder.mqh index 54761b01c..206a0e7a5 100644 --- a/Indicators/Indi_PriceFeeder.mqh +++ b/Indicators/Indi_PriceFeeder.mqh @@ -22,7 +22,7 @@ // Includes. #include "../BufferStruct.mqh" -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" // Structs. struct IndiPriceFeederParams : IndicatorParams { diff --git a/Indicators/Indi_PriceVolumeTrend.mqh b/Indicators/Indi_PriceVolumeTrend.mqh index 74fbee278..12619bcdf 100644 --- a/Indicators/Indi_PriceVolumeTrend.mqh +++ b/Indicators/Indi_PriceVolumeTrend.mqh @@ -22,7 +22,7 @@ // Includes. #include "../BufferStruct.mqh" -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.all.h" // Structs. diff --git a/Indicators/Indi_RS.mqh b/Indicators/Indi_RS.mqh index 00486303f..4f399aaee 100644 --- a/Indicators/Indi_RS.mqh +++ b/Indicators/Indi_RS.mqh @@ -22,7 +22,7 @@ // Includes. #include "../BufferStruct.mqh" -#include "../Indicator.mqh" +#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 d26861c39..55aee8ba9 100644 --- a/Indicators/Indi_RSI.mqh +++ b/Indicators/Indi_RSI.mqh @@ -22,7 +22,7 @@ // Includes. #include "../DictStruct.mqh" -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #include "Indi_Bands.mqh" #include "Indi_CCI.mqh" #include "Indi_Envelopes.mqh" diff --git a/Indicators/Indi_RVI.mqh b/Indicators/Indi_RVI.mqh index 8e2a1bde7..c160deb65 100644 --- a/Indicators/Indi_RVI.mqh +++ b/Indicators/Indi_RVI.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #ifndef __MQL4__ // Defines global functions (for MQL4 backward compability). diff --git a/Indicators/Indi_RateOfChange.mqh b/Indicators/Indi_RateOfChange.mqh index c671ad9e1..59e8fe8c6 100644 --- a/Indicators/Indi_RateOfChange.mqh +++ b/Indicators/Indi_RateOfChange.mqh @@ -22,7 +22,7 @@ // Includes. #include "../BufferStruct.mqh" -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" // Structs. struct IndiRateOfChangeParams : IndicatorParams { diff --git a/Indicators/Indi_SAR.mqh b/Indicators/Indi_SAR.mqh index 873efea35..fbbf230e4 100644 --- a/Indicators/Indi_SAR.mqh +++ b/Indicators/Indi_SAR.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #ifndef __MQL4__ // Defines global functions (for MQL4 backward compability). diff --git a/Indicators/Indi_StdDev.mqh b/Indicators/Indi_StdDev.mqh index 5b599b9e1..d46bbac61 100644 --- a/Indicators/Indi_StdDev.mqh +++ b/Indicators/Indi_StdDev.mqh @@ -28,7 +28,7 @@ */ // Includes. -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #include "../Storage/ObjectsCache.h" #include "Indi_MA.mqh" #include "Indi_PriceFeeder.mqh" diff --git a/Indicators/Indi_Stochastic.mqh b/Indicators/Indi_Stochastic.mqh index dfc306636..a55e91def 100644 --- a/Indicators/Indi_Stochastic.mqh +++ b/Indicators/Indi_Stochastic.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #ifndef __MQL4__ // Defines global functions (for MQL4 backward compability). diff --git a/Indicators/Indi_TEMA.mqh b/Indicators/Indi_TEMA.mqh index dbd060f85..cc288ac56 100644 --- a/Indicators/Indi_TEMA.mqh +++ b/Indicators/Indi_TEMA.mqh @@ -22,7 +22,7 @@ // Includes. #include "../BufferStruct.mqh" -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #include "Indi_MA.mqh" // Structs. diff --git a/Indicators/Indi_TRIX.mqh b/Indicators/Indi_TRIX.mqh index b3fe1fe60..4ec953133 100644 --- a/Indicators/Indi_TRIX.mqh +++ b/Indicators/Indi_TRIX.mqh @@ -22,7 +22,7 @@ // Includes. #include "../BufferStruct.mqh" -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #include "Indi_MA.mqh" // Structs. diff --git a/Indicators/Indi_UltimateOscillator.mqh b/Indicators/Indi_UltimateOscillator.mqh index 0b83bdb07..8c3c17784 100644 --- a/Indicators/Indi_UltimateOscillator.mqh +++ b/Indicators/Indi_UltimateOscillator.mqh @@ -22,7 +22,7 @@ // Includes. #include "../BufferStruct.mqh" -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.all.h" #include "Indi_ATR.mqh" #include "Indi_MA.mqh" diff --git a/Indicators/Indi_VIDYA.mqh b/Indicators/Indi_VIDYA.mqh index d91edcda3..4416f29ba 100644 --- a/Indicators/Indi_VIDYA.mqh +++ b/Indicators/Indi_VIDYA.mqh @@ -22,7 +22,7 @@ // Includes. #include "../BufferStruct.mqh" -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" // Structs. struct IndiVIDYAParams : IndicatorParams { diff --git a/Indicators/Indi_VROC.mqh b/Indicators/Indi_VROC.mqh index 5914674f0..d25a59883 100644 --- a/Indicators/Indi_VROC.mqh +++ b/Indicators/Indi_VROC.mqh @@ -22,7 +22,7 @@ // Includes. #include "../BufferStruct.mqh" -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.all.h" // Structs. diff --git a/Indicators/Indi_Volumes.mqh b/Indicators/Indi_Volumes.mqh index ec903f03d..fed9195d3 100644 --- a/Indicators/Indi_Volumes.mqh +++ b/Indicators/Indi_Volumes.mqh @@ -22,7 +22,7 @@ // Includes. #include "../BufferStruct.mqh" -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.all.h" // Structs. diff --git a/Indicators/Indi_WPR.mqh b/Indicators/Indi_WPR.mqh index 33f2df979..45490562c 100644 --- a/Indicators/Indi_WPR.mqh +++ b/Indicators/Indi_WPR.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #ifndef __MQL4__ // Defines global functions (for MQL4 backward compability). diff --git a/Indicators/Indi_WilliamsAD.mqh b/Indicators/Indi_WilliamsAD.mqh index e8a1017ad..19e73b82b 100644 --- a/Indicators/Indi_WilliamsAD.mqh +++ b/Indicators/Indi_WilliamsAD.mqh @@ -22,7 +22,7 @@ // Includes. #include "../BufferStruct.mqh" -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.all.h" // Structs. diff --git a/Indicators/Indi_ZigZag.mqh b/Indicators/Indi_ZigZag.mqh index 0f0dc6e65..a9397faad 100644 --- a/Indicators/Indi_ZigZag.mqh +++ b/Indicators/Indi_ZigZag.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #include "../Storage/ValueStorage.all.h" // Defines. diff --git a/Indicators/Indi_ZigZagColor.mqh b/Indicators/Indi_ZigZagColor.mqh index 647d25b72..8cd8e9248 100644 --- a/Indicators/Indi_ZigZagColor.mqh +++ b/Indicators/Indi_ZigZagColor.mqh @@ -22,7 +22,7 @@ // Includes. #include "../BufferStruct.mqh" -#include "../Indicator.mqh" +#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 eb4f8a997..9b32546e1 100644 --- a/Indicators/OHLC/Indi_OHLC.mqh +++ b/Indicators/OHLC/Indi_OHLC.mqh @@ -22,7 +22,7 @@ // Includes. #include "../../BufferStruct.mqh" -#include "../../Indicator.mqh" +#include "../../Indicator/Indicator.h" #include "../../Storage/Objects.h" // Enums. diff --git a/Indicators/Price/Indi_Price.mqh b/Indicators/Price/Indi_Price.mqh index 76299b153..64db99a5b 100644 --- a/Indicators/Price/Indi_Price.mqh +++ b/Indicators/Price/Indi_Price.mqh @@ -22,7 +22,7 @@ // Includes. #include "../../BufferStruct.mqh" -#include "../../Indicator.mqh" +#include "../../Indicator/Indicator.h" #include "../../Platform.h" #include "../../Storage/Objects.h" diff --git a/Indicators/Special/Indi_Custom.mqh b/Indicators/Special/Indi_Custom.mqh index 4e5a8a676..c02e1d247 100644 --- a/Indicators/Special/Indi_Custom.mqh +++ b/Indicators/Special/Indi_Custom.mqh @@ -33,7 +33,7 @@ #endif // Includes. -#include "../../Indicator.mqh" +#include "../../Indicator/Indicator.h" // Structs. diff --git a/Indicators/Special/Indi_Math.mqh b/Indicators/Special/Indi_Math.mqh index f6bcb890c..365ce08af 100644 --- a/Indicators/Special/Indi_Math.mqh +++ b/Indicators/Special/Indi_Math.mqh @@ -22,7 +22,7 @@ // Includes. #include "../../BufferStruct.mqh" -#include "../../Indicator.mqh" +#include "../../Indicator/Indicator.h" #include "../../Math.enum.h" enum ENUM_MATH_OP_MODE { MATH_OP_MODE_BUILTIN, MATH_OP_MODE_CUSTOM_FUNCTION }; diff --git a/Log.mqh b/Log.mqh index 28dff8671..f542b93e7 100644 --- a/Log.mqh +++ b/Log.mqh @@ -20,6 +20,14 @@ * */ +// Prevents processing this includes file for the second time. +#ifndef LOG_MQH +#define LOG_MQH + +// Forward class declaration. +template +class DictStruct; + // Includes. #include "Array.mqh" #include "Collection.mqh" @@ -27,10 +35,6 @@ #include "DictStruct.mqh" #include "Object.mqh" -// Prevents processing this includes file for the second time. -#ifndef LOG_MQH -#define LOG_MQH - // Define assert macros. // Alias for function and line macros combined together. #define __FUNCTION_LINE__ string(__FUNCTION__) + ":" + IntegerToString(__LINE__) diff --git a/Market.mqh b/Market.mqh index 7cd8bdc33..157eb4c3d 100644 --- a/Market.mqh +++ b/Market.mqh @@ -24,27 +24,14 @@ #ifndef MARKET_MQH #define MARKET_MQH -// Forward declaration. -class Market; -class SymbolInfo; - // Includes. #include "Market.struct.h" #include "Math.h" -#include "Order.mqh" #include "Serializer.mqh" #include "SymbolInfo.mqh" +#include "SymbolInfo.struct.static.h" #include "Task/TaskCondition.enum.h" -// Structs. -// Market info. -struct MarketData { - int empty; - // Serializers. - void SerializeStub(int _n1 = 1, int _n2 = 1, int _n3 = 1, int _n4 = 1, int _n5 = 1) {} - SerializerNodeType Serialize(Serializer &_s) { return SerializerNodeObject; } -}; - /** * Class to provide market information. */ diff --git a/Market.struct.h b/Market.struct.h index bf9315527..0937823ae 100644 --- a/Market.struct.h +++ b/Market.struct.h @@ -25,10 +25,22 @@ * Includes Market's structs. */ +// Forward declaration. +class Serializer; + // Includes. #include "DateTime.struct.h" +#include "SerializerNode.enum.h" #include "Std.h" +// Market info. +struct MarketData { + int empty; + // Serializers. + void SerializeStub(int _n1 = 1, int _n2 = 1, int _n3 = 1, int _n4 = 1, int _n5 = 1) {} + SerializerNodeType Serialize(Serializer &_s) { return SerializerNodeObject; } +}; + // Structure for trade time static methods. struct MarketTimeForex : DateTimeEntry { // Market sessions for trading Forex. diff --git a/Math.h b/Math.h index 691837b31..2460f7e61 100644 --- a/Math.h +++ b/Math.h @@ -27,7 +27,7 @@ // Includes. #include "Data.struct.h" -#include "Indicator.struct.h" +#include "Indicator/Indicator.struct.h" #include "Math.define.h" #include "Math.enum.h" #include "Math.extern.h" diff --git a/Order.mqh b/Order.mqh index 1b84095d4..d277a03c2 100644 --- a/Order.mqh +++ b/Order.mqh @@ -29,6 +29,9 @@ #ifndef ORDER_MQH #define ORDER_MQH +// Forward declaration. +class SymbolInfo; + // Includes. #include "Convert.mqh" #include "Data.define.h" @@ -38,6 +41,8 @@ #include "Order.define.h" #include "Order.enum.h" #include "Order.struct.h" +#include "Serializer.define.h" +#include "Serializer.mqh" #include "SerializerConverter.mqh" #include "SerializerJson.mqh" #include "Std.h" diff --git a/Platform.h b/Platform.h index 88ec23736..ba153d533 100644 --- a/Platform.h +++ b/Platform.h @@ -27,7 +27,7 @@ */ #include "Flags.h" -#include "IndicatorBase.h" +#include "Indicator/IndicatorData.h" #include "Std.h" #ifdef __MQLBUILD__ diff --git a/Serializer.mqh b/Serializer.mqh index d7f3e89d2..d76c001b2 100644 --- a/Serializer.mqh +++ b/Serializer.mqh @@ -38,7 +38,6 @@ // Forward declarations. template class SerializerIterator; -class IndicatorBase; class Serializer { protected: @@ -380,21 +379,6 @@ class Serializer { } } - template - void Pass(T& self, string name, IndicatorBase*& value, unsigned int flags = SERIALIZER_FIELD_FLAG_DEFAULT) { - if (_mode == Serialize) { - if (!IsFieldVisible(_flags, flags)) { - return; - } - - PassObject(self, name, value, flags); - } else { - Print("Error: Deserialization of IndicatorBase* cannot be done as method is abstract!"); - DebugBreak(); - value = nullptr; - } - } - /** * Serializes or unserializes simple value. */ diff --git a/SerializerConverter.mqh b/SerializerConverter.mqh index 985845dd8..4ce3d5f28 100644 --- a/SerializerConverter.mqh +++ b/SerializerConverter.mqh @@ -20,10 +20,14 @@ * */ +#ifndef __MQL__ +// 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 SERIALIZER_CONVERTER_MQH #define SERIALIZER_CONVERTER_MQH -#include "SerializerDict.mqh" // Forward declarations. class SerializerNode; @@ -32,6 +36,7 @@ class SerializerNode; #include "File.mqh" #include "Serializer.enum.h" #include "Serializer.mqh" +#include "SerializerDict.mqh" #include "SerializerNode.mqh" class SerializerConverter { diff --git a/Storage/ValueStorage.history.h b/Storage/ValueStorage.history.h index 9019a6bff..61c378964 100644 --- a/Storage/ValueStorage.history.h +++ b/Storage/ValueStorage.history.h @@ -31,10 +31,11 @@ #endif // Includes. +#include "../Indicator/IndicatorData.h" #include "ValueStorage.h" // Forward declarations. -class IndicatorBase; +class IndicatorData; template class ValueStorage; @@ -54,7 +55,7 @@ class HistoryValueStorage : public ValueStorage { /** * Constructor. */ - HistoryValueStorage(IndicatorBase* _indi_candle, bool _is_series = false) + HistoryValueStorage(IndicatorData* _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.price_median.h b/Storage/ValueStorage.price_median.h index 6ba406e46..24b9c1a1a 100644 --- a/Storage/ValueStorage.price_median.h +++ b/Storage/ValueStorage.price_median.h @@ -24,6 +24,9 @@ * Median price version of ValueStorage. */ +// Forward declarations. +class IndicatorBase; + // Includes. #include "ObjectsCache.h" #include "ValueStorage.history.h" diff --git a/Strategy.mqh b/Strategy.mqh index 24fab7aa9..e68fa8334 100644 --- a/Strategy.mqh +++ b/Strategy.mqh @@ -30,7 +30,7 @@ class Trade; // Includes. #include "Data.struct.h" #include "Dict.mqh" -#include "Indicator.mqh" +#include "Indicator/Indicator.h" #include "Market.mqh" #include "Object.mqh" #include "Strategy.enum.h" diff --git a/SymbolInfo.mqh b/SymbolInfo.mqh index f043b7dec..1ee351e9a 100644 --- a/SymbolInfo.mqh +++ b/SymbolInfo.mqh @@ -24,9 +24,6 @@ #ifndef SYMBOLINFO_MQH #define SYMBOLINFO_MQH -// Forward declaration. -class SymbolInfo; - // Includes symbol defines, enums and structs. #include "SymbolInfo.define.h" #include "SymbolInfo.enum.h" @@ -35,6 +32,10 @@ class SymbolInfo; #include "SymbolInfo.struct.h" #include "SymbolInfo.struct.static.h" +// Forward declaration. +class Log; +class SymbolInfo; + // Includes. #include "Log.mqh" #include "Serializer.mqh" @@ -230,9 +231,7 @@ class SymbolInfo : public Object { * Get number of points per pip. * */ - unsigned int GetPointsPerPip() { - return sprops.pts_per_pip; - } + unsigned int GetPointsPerPip() { return sprops.pts_per_pip; } /** * Get the point size in the quote currency. diff --git a/Terminal.enum.h b/Terminal.enum.h index 6c12c13cc..574615a23 100644 --- a/Terminal.enum.h +++ b/Terminal.enum.h @@ -31,7 +31,7 @@ #endif // Includes. -#include "Indicator.define.h" +#include "Indicator/Indicator.define.h" // Defines user error enumeration. enum ENUM_USER_ERR { USER_ERR_INVALID_ARGUMENT }; diff --git a/Tests.mqh b/Tests.mqh index 55c549aa8..d4a3d3463 100644 --- a/Tests.mqh +++ b/Tests.mqh @@ -21,7 +21,7 @@ */ // Includes. -#include "Indicator.mqh" +#include "Indicator/Indicator.h" #include "Market.mqh" /** diff --git a/Trade.mqh b/Trade.mqh index 513ebf695..f6eea3136 100644 --- a/Trade.mqh +++ b/Trade.mqh @@ -34,7 +34,7 @@ class Trade; #include "Chart.mqh" #include "Convert.mqh" #include "DictStruct.mqh" -#include "IndicatorData.mqh" +#include "Indicator/IndicatorData.h" #include "Math.h" #include "Object.mqh" #include "Order.mqh" @@ -1398,7 +1398,7 @@ HistorySelect(0, TimeCurrent()); // Select history for access. && Terminal::CheckPermissionToTrade() // Check if auto trading is enabled. && (Terminal::IsRealtime() && !Terminal::IsExpertEnabled())); - /* Chart checks */ +/* Chart checks */ #ifdef __debug__ Print("Trade: Bars in data source: ", GetSource() PTR_DEREF GetBars(), ", minimum required bars: ", tparams.GetBarsMin()); diff --git a/tests/CompileTest.mq5 b/tests/CompileTest.mq5 index d8666aac8..fc9193df9 100644 --- a/tests/CompileTest.mq5 +++ b/tests/CompileTest.mq5 @@ -63,10 +63,6 @@ struct IndicatorParams; #include "../EA.mqh" #include "../File.mqh" #include "../ISerializable.h" -#include "../Indicator.define.h" -#include "../Indicator.mqh" -#include "../IndicatorBase.h" -#include "../IndicatorData.mqh" // #include "../Inet.mqh" #include "../Log.mqh" #include "../MD5.mqh" @@ -133,6 +129,10 @@ struct IndicatorParams; #include "../Web.mqh" // Includes indicator files. +#include "../Indicator/Indicator.define.h" +#include "../Indicator/Indicator.h" +#include "../Indicator/IndicatorBase.h" +//#include "../Indicator/IndicatorData.h" #include "../Indicators/indicators.h" /** diff --git a/tests/DrawIndicatorTest.mq5 b/tests/DrawIndicatorTest.mq5 index 69779aecc..499634840 100644 --- a/tests/DrawIndicatorTest.mq5 +++ b/tests/DrawIndicatorTest.mq5 @@ -30,7 +30,7 @@ // Includes. #include "../DictStruct.mqh" #include "../DrawIndicator.mqh" -#include "../Indicator.struct.serialize.h" +#include "../Indicator/Indicator.struct.serialize.h" #include "../Indicators/Indi_Bands.mqh" #include "../Indicators/Indi_Demo.mqh" #include "../Indicators/Indi_MA.mqh" diff --git a/tests/IndicatorsTest.mq5 b/tests/IndicatorsTest.mq5 index 4aca8c09e..6ef5efc18 100644 --- a/tests/IndicatorsTest.mq5 +++ b/tests/IndicatorsTest.mq5 @@ -35,7 +35,7 @@ struct DataParamEntry; //#include "../ChartMt.h" #include "../Dict.mqh" #include "../DictObject.mqh" -#include "../Indicator.mqh" +#include "../Indicator/Indicator.h" #include "../Indicator/tests/classes/IndicatorTfDummy.h" #include "../Indicators/Bitwise/indicators.h" #include "../Indicators/Tick/Indi_TickMt.mqh" diff --git a/tests/LogTest.mq5 b/tests/LogTest.mq5 index 049cc0e20..e28e8fe4c 100644 --- a/tests/LogTest.mq5 +++ b/tests/LogTest.mq5 @@ -27,6 +27,7 @@ // Includes. #include "../DictStruct.mqh" #include "../Log.mqh" +#include "../Refs.struct.h" #include "../Test.mqh" // Variables. diff --git a/tests/SerializerTest.mq5 b/tests/SerializerTest.mq5 index fb619c193..68ef491b4 100644 --- a/tests/SerializerTest.mq5 +++ b/tests/SerializerTest.mq5 @@ -30,6 +30,7 @@ #include "../BufferStruct.mqh" #include "../Chart.mqh" #include "../Config.mqh" +#include "../Data.define.h" #include "../Data.struct.h" #include "../DictStruct.mqh" #include "../Serializer.mqh" From 8b9072d5e289511269504ab2f7000a23ac70b114 Mon Sep 17 00:00:00 2001 From: kenorb Date: Fri, 19 Aug 2022 23:07:03 +0100 Subject: [PATCH 2/3] Moves Tick.struct.h to Tick/ --- Buffer/BufferTick.h | 2 +- Indicator/tests/classes/IndicatorTickDummy.h | 2 +- SymbolInfo.extern.h | 2 +- SymbolInfo.struct.h | 2 +- SymbolInfo.struct.static.h | 2 +- Tick.struct.h => Tick/Tick.struct.h | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) rename Tick.struct.h => Tick/Tick.struct.h (98%) diff --git a/Buffer/BufferTick.h b/Buffer/BufferTick.h index 4eed02d69..7ed484dc0 100644 --- a/Buffer/BufferTick.h +++ b/Buffer/BufferTick.h @@ -28,7 +28,7 @@ #include "../BufferStruct.mqh" #include "../Chart.enum.h" #include "../Storage/IValueStorage.h" -#include "../Tick.struct.h" +#include "../Tick/Tick.struct.h" // TV = Type of price stored by BufferTick. RV = Type of property to be retrieved from BufferTick. template diff --git a/Indicator/tests/classes/IndicatorTickDummy.h b/Indicator/tests/classes/IndicatorTickDummy.h index dfd59e9a3..3b5e58a22 100644 --- a/Indicator/tests/classes/IndicatorTickDummy.h +++ b/Indicator/tests/classes/IndicatorTickDummy.h @@ -30,7 +30,7 @@ #endif // Includes. -#include "../../../Tick.struct.h" +#include "../../../Tick/Tick.struct.h" #include "../../IndicatorTick.h" // Params for dummy tick-based indicator. diff --git a/SymbolInfo.extern.h b/SymbolInfo.extern.h index 801c47fb1..60b085d5b 100644 --- a/SymbolInfo.extern.h +++ b/SymbolInfo.extern.h @@ -23,7 +23,7 @@ // Includes. #include "Order.enum.h" #include "SymbolInfo.enum.h" -#include "Tick.struct.h" +#include "Tick/Tick.struct.h" // Define external global functions. #ifndef __MQL__ diff --git a/SymbolInfo.struct.h b/SymbolInfo.struct.h index 85b6f19e7..7b41c2bba 100644 --- a/SymbolInfo.struct.h +++ b/SymbolInfo.struct.h @@ -34,7 +34,7 @@ #include "ISerializable.h" #include "Std.h" #include "SymbolInfo.struct.static.h" -#include "Tick.struct.h" +#include "Tick/Tick.struct.h" // Defines struct to store symbol data. struct SymbolInfoEntry diff --git a/SymbolInfo.struct.static.h b/SymbolInfo.struct.static.h index a33431610..a82d49f40 100644 --- a/SymbolInfo.struct.static.h +++ b/SymbolInfo.struct.static.h @@ -28,7 +28,7 @@ #include "MQL5.mqh" #include "Order.enum.h" #include "Std.h" -#include "Tick.struct.h" +#include "Tick/Tick.struct.h" /** * Struct to provide symbol information. diff --git a/Tick.struct.h b/Tick/Tick.struct.h similarity index 98% rename from Tick.struct.h rename to Tick/Tick.struct.h index dbb226a4f..c128f9818 100644 --- a/Tick.struct.h +++ b/Tick/Tick.struct.h @@ -30,7 +30,7 @@ #endif // Includes. -#include "DateTime.extern.h" +#include "../DateTime.extern.h" #ifndef __MQL__ /** From 943f662acef5e8696e43563b02ad3787dbab0ec1 Mon Sep 17 00:00:00 2001 From: kenorb Date: Fri, 19 Aug 2022 23:36:09 +0100 Subject: [PATCH 3/3] Moves Serializer files to Serializer/ Serializer: Renames .mqh to .h --- .github/workflows/test-serializer.yml | 65 +++++++++++++++++++ .github/workflows/test.yml | 1 - 3D/Chart3D.h | 4 +- Account/Account.h | 2 +- Account/Account.struct.h | 2 +- Account/AccountBase.h | 1 - Account/AccountBase.struct.h | 2 +- Account/AccountForex.h | 2 +- Account/AccountForex.struct.h | 2 +- Account/AccountMt.h | 2 +- Bar.struct.h | 11 ++-- BufferStruct.mqh | 2 +- Candle.struct.h | 11 ++-- Chart.mqh | 2 +- Chart.struct.h | 4 +- Chart.struct.serialize.h | 4 +- Chart.struct.tf.h | 5 +- Config.mqh | 2 +- Data.struct.h | 7 +- Dict.mqh | 4 +- DictIteratorBase.mqh | 2 +- DictObject.mqh | 4 +- DictStruct.mqh | 4 +- EA.mqh | 8 +-- Indicator/Indicator.h | 6 +- Indicator/Indicator.struct.h | 2 +- Indicator/Indicator.struct.serialize.h | 4 +- Indicator/IndicatorBase.h | 6 +- Indicator/IndicatorData.struct.h | 2 +- Indicator/IndicatorData.struct.serialize.h | 2 +- Indicators/Bitwise/Indi_Candle.mqh | 2 +- Indicators/Bitwise/Indi_Pattern.mqh | 2 +- Indicators/Indi_Drawer.struct.h | 2 +- Indicators/Indi_Pivot.mqh | 2 +- Market.mqh | 2 +- Market.struct.h | 2 +- Order.mqh | 8 +-- Order.struct.h | 2 +- Redis.mqh | 6 +- Redis.struct.h | 2 +- ISerializable.h => Serializer/Serializable.h | 2 +- .../Serializer.define.h | 0 .../Serializer.enum.h | 0 Serializer.mqh => Serializer/Serializer.h | 10 +-- .../SerializerBinary.h | 8 +-- .../SerializerConversions.h | 8 +-- .../SerializerConverter.h | 8 +-- .../SerializerCsv.h | 16 ++--- .../SerializerDict.h | 2 +- .../SerializerJson.h | 10 +-- .../SerializerNode.enum.h | 0 .../SerializerNode.h | 12 ++-- .../SerializerNodeIterator.h | 8 +-- .../SerializerNodeParam.h | 9 ++- .../SerializerObject.h | 10 +-- .../SerializerSqlite.h | 6 +- .../tests/Serializer.test.mq4 | 2 +- .../tests/Serializer.test.mq5 | 28 ++++---- Storage/ValueStorage.h | 2 +- Strategy.struct.h | 2 +- SymbolInfo.mqh | 4 +- SymbolInfo.struct.h | 7 +- Task/TaskManager.h | 4 +- Trade/TradeSignal.struct.h | 4 +- Util.h | 2 +- tests/3DTest.mq5 | 2 +- tests/BufferStructTest.mq5 | 4 +- tests/CompileTest.mq5 | 32 ++++----- tests/ConfigTest.mq5 | 6 +- tests/DictTest.mq5 | 6 +- tests/IndicatorsTest.mq5 | 4 +- tests/OrderTest.mq5 | 4 +- tests/ValueStorageTest.mq5 | 4 +- 73 files changed, 245 insertions(+), 186 deletions(-) create mode 100644 .github/workflows/test-serializer.yml rename ISerializable.h => Serializer/Serializable.h (98%) rename Serializer.define.h => Serializer/Serializer.define.h (100%) rename Serializer.enum.h => Serializer/Serializer.enum.h (100%) rename Serializer.mqh => Serializer/Serializer.h (98%) rename SerializerBinary.mqh => Serializer/SerializerBinary.h (97%) rename SerializerConversions.h => Serializer/SerializerConversions.h (97%) rename SerializerConverter.mqh => Serializer/SerializerConverter.h (98%) rename SerializerCsv.mqh => Serializer/SerializerCsv.h (97%) rename SerializerDict.mqh => Serializer/SerializerDict.h (98%) rename SerializerJson.mqh => Serializer/SerializerJson.h (98%) rename SerializerNode.enum.h => Serializer/SerializerNode.enum.h (100%) rename SerializerNode.mqh => Serializer/SerializerNode.h (98%) rename SerializerNodeIterator.mqh => Serializer/SerializerNodeIterator.h (96%) rename SerializerNodeParam.mqh => Serializer/SerializerNodeParam.h (99%) rename SerializerObject.mqh => Serializer/SerializerObject.h (90%) rename SerializerSqlite.mqh => Serializer/SerializerSqlite.h (97%) rename tests/SerializerTest.mq4 => Serializer/tests/Serializer.test.mq4 (97%) rename tests/SerializerTest.mq5 => Serializer/tests/Serializer.test.mq5 (96%) diff --git a/.github/workflows/test-serializer.yml b/.github/workflows/test-serializer.yml new file mode 100644 index 000000000..e4617d002 --- /dev/null +++ b/.github/workflows/test-serializer.yml @@ -0,0 +1,65 @@ +--- +name: Test Serializer + +# yamllint disable-line rule:truthy +on: + pull_request: + paths: + - 'Serializer/**' + - '.github/workflows/test-serializer.yml' + push: + paths: + - 'Serializer/**' + - '.github/workflows/test-serializer.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: 'serializer/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' + + Serializer-Tests-MQL4: + defaults: + run: + shell: bash + working-directory: serializer/tests + needs: Compile + runs-on: ubuntu-latest + strategy: + matrix: + test: + - Serializer.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.yml b/.github/workflows/test.yml index f4802e889..516d1a9b4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -110,7 +110,6 @@ jobs: - OrderQuery - ProfilerTest - RefsTest - - SerializerTest - TerminalTest - TimerTest - ValueStorageTest diff --git a/3D/Chart3D.h b/3D/Chart3D.h index 1fd4fbdb7..6dc5e3c42 100644 --- a/3D/Chart3D.h +++ b/3D/Chart3D.h @@ -30,8 +30,8 @@ #include "../Indicators/Indi_MA.mqh" #include "../Instances.h" #include "../Refs.mqh" -#include "../SerializerConverter.mqh" -#include "../SerializerJson.mqh" +#include "../Serializer/SerializerConverter.h" +#include "../Serializer/SerializerJson.h" #include "Chart3DCandles.h" #include "Chart3DType.h" #include "Cube.h" diff --git a/Account/Account.h b/Account/Account.h index 5e50510d5..bb435596c 100644 --- a/Account/Account.h +++ b/Account/Account.h @@ -26,7 +26,7 @@ // Includes. #include "../BufferStruct.mqh" -#include "../Serializer.mqh" +#include "../Serializer/Serializer.h" #include "AccountBase.h" /** diff --git a/Account/Account.struct.h b/Account/Account.struct.h index 1b2a97517..2ae613e55 100644 --- a/Account/Account.struct.h +++ b/Account/Account.struct.h @@ -35,7 +35,7 @@ class Serializer; // Includes. -#include "../Serializer.mqh" +#include "../Serializer/Serializer.h" #include "../Terminal.define.h" // Struct for account entries. diff --git a/Account/AccountBase.h b/Account/AccountBase.h index 9d3ae7253..d74fd72a3 100644 --- a/Account/AccountBase.h +++ b/Account/AccountBase.h @@ -25,7 +25,6 @@ #define ACCOUNTBASE_H // Includes. -//#include "../Serializer.mqh" #include "../Refs.mqh" #include "AccountBase.struct.h" diff --git a/Account/AccountBase.struct.h b/Account/AccountBase.struct.h index 0f808c590..ab237c6b7 100644 --- a/Account/AccountBase.struct.h +++ b/Account/AccountBase.struct.h @@ -35,7 +35,7 @@ class Serializer; // Includes. -#include "../Serializer.mqh" +#include "../Serializer/Serializer.h" #include "../Terminal.define.h" // Struct for account entries. diff --git a/Account/AccountForex.h b/Account/AccountForex.h index 3d73b7bb8..03b3be121 100644 --- a/Account/AccountForex.h +++ b/Account/AccountForex.h @@ -25,7 +25,7 @@ #define ACCOUNTFOREX_H // Includes. -#include "../Serializer.mqh" +#include "../Serializer/Serializer.h" #include "Account.h" #include "AccountForex.struct.h" diff --git a/Account/AccountForex.struct.h b/Account/AccountForex.struct.h index 64aacffa3..c40a4e79d 100644 --- a/Account/AccountForex.struct.h +++ b/Account/AccountForex.struct.h @@ -35,7 +35,7 @@ class Serializer; // Includes. -#include "../Serializer.mqh" +#include "../Serializer/Serializer.h" #include "../Terminal.define.h" // Struct for account entries. diff --git a/Account/AccountMt.h b/Account/AccountMt.h index 11cb4c654..9e1713692 100644 --- a/Account/AccountMt.h +++ b/Account/AccountMt.h @@ -35,7 +35,7 @@ class AccountMt; #include "../Indicator/Indicator.struct.h" #include "../Order.struct.h" #include "../Orders.mqh" -#include "../Serializer.mqh" +#include "../Serializer/Serializer.h" #include "../SymbolInfo.mqh" #include "../Trade.struct.h" #include "Account.define.h" diff --git a/Bar.struct.h b/Bar.struct.h index 800a5f939..dffae6ba2 100644 --- a/Bar.struct.h +++ b/Bar.struct.h @@ -36,15 +36,16 @@ class Serializer; // Includes. #include "Bar.enum.h" #include "Chart.enum.h" -#include "ISerializable.h" -#include "Serializer.enum.h" -#include "SerializerNode.enum.h" +#include "Serializer/Serializable.h" +#include "Serializer/Serializer.enum.h" +#include "Serializer/SerializerNode.enum.h" #include "Std.h" +#include "Serializer/Serializer.h" /* Struct for storing OHLC values. */ struct BarOHLC #ifndef __MQL__ - : public ISerializable + : public Serializable #endif { datetime time; @@ -230,8 +231,6 @@ struct BarOHLC string ToCSV() { return StringFormat("%d,%g,%g,%g,%g", time, open, high, low, close); } }; -#include "Serializer.mqh" - /* Method to serialize BarOHLC structure. */ SerializerNodeType BarOHLC::Serialize(Serializer &s) { // s.Pass(THIS_REF, "time", TimeToString(time)); diff --git a/BufferStruct.mqh b/BufferStruct.mqh index c02eba371..af8459874 100644 --- a/BufferStruct.mqh +++ b/BufferStruct.mqh @@ -27,7 +27,7 @@ // Includes. #include "DictBase.mqh" #include "DictStruct.mqh" -#include "Serializer.mqh" +#include "Serializer/Serializer.h" /** * Implements BufferStruct's Overflow Listener. diff --git a/Candle.struct.h b/Candle.struct.h index 7e351ff17..b776f4ac9 100644 --- a/Candle.struct.h +++ b/Candle.struct.h @@ -36,16 +36,17 @@ class Serializer; // Includes. #include "Bar.enum.h" #include "Chart.enum.h" -#include "ISerializable.h" -#include "Serializer.enum.h" -#include "SerializerNode.enum.h" +#include "Serializer/Serializable.h" +#include "Serializer/Serializer.enum.h" +#include "Serializer/SerializerNode.enum.h" #include "Std.h" +#include "Serializer/Serializer.h" /* Structure for storing OHLC values. */ template struct CandleOHLC #ifndef __MQL__ - : public ISerializable + : public Serializable #endif { T open, high, low, close; @@ -276,8 +277,6 @@ struct CandleTOHLC : CandleOHLC { string ToCSV() { return StringFormat("%d,%g,%g,%g,%g", time, open, high, low, close); } }; -#include "Serializer.mqh" - /* Method to serialize CandleEntry structure. */ template SerializerNodeType CandleOHLC::Serialize(Serializer &s) { diff --git a/Chart.mqh b/Chart.mqh index e751a6bb9..ef20cd5f8 100644 --- a/Chart.mqh +++ b/Chart.mqh @@ -40,7 +40,7 @@ #include "Chart.struct.serialize.h" #include "Convert.mqh" #include "Market.mqh" -#include "Serializer.mqh" +#include "Serializer/Serializer.h" #include "Task/TaskCondition.enum.h" // Forward class declaration. diff --git a/Chart.struct.h b/Chart.struct.h index 9d5b75266..a4100f935 100644 --- a/Chart.struct.h +++ b/Chart.struct.h @@ -41,8 +41,8 @@ struct ChartTf; #include "Chart.enum.h" #include "Chart.struct.static.h" #include "Chart.struct.tf.h" -#include "Serializer.mqh" -#include "SerializerNode.enum.h" +#include "Serializer/Serializer.h" +#include "Serializer/SerializerNode.enum.h" #include "Terminal.define.h" /* Defines struct to store bar entries. */ diff --git a/Chart.struct.serialize.h b/Chart.struct.serialize.h index b33092843..99c8ecfaa 100644 --- a/Chart.struct.serialize.h +++ b/Chart.struct.serialize.h @@ -29,8 +29,8 @@ class Serializer; // Includes. -#include "Serializer.mqh" -#include "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.tf.h b/Chart.struct.tf.h index 3a0dfed6e..4e2c2f037 100644 --- a/Chart.struct.tf.h +++ b/Chart.struct.tf.h @@ -35,8 +35,9 @@ class Serializer; // Includes. #include "Chart.enum.h" -#include "SerializerNode.enum.h" +#include "Serializer/SerializerNode.enum.h" #include "Terminal.define.h" +#include "Serializer/Serializer.h" /* Defines struct for chart timeframe. */ struct ChartTf { @@ -351,8 +352,6 @@ struct ChartTf { SerializerNodeType Serialize(Serializer& s); }; -#include "Serializer.mqh" - /* Method to serialize ChartTf structure. */ SerializerNodeType ChartTf::Serialize(Serializer& s) { s.PassEnum(THIS_REF, "tf", tf); diff --git a/Config.mqh b/Config.mqh index 331243fee..840e27495 100644 --- a/Config.mqh +++ b/Config.mqh @@ -33,7 +33,7 @@ #include "DictStruct.mqh" #include "File.mqh" #include "Object.mqh" -#include "Serializer.mqh" +#include "Serializer/Serializer.h" enum CONFIG_FORMAT { CONFIG_FORMAT_JSON, CONFIG_FORMAT_JSON_NO_WHITESPACES, CONFIG_FORMAT_INI }; diff --git a/Data.struct.h b/Data.struct.h index 9ee4ee34f..e174e6456 100644 --- a/Data.struct.h +++ b/Data.struct.h @@ -38,9 +38,10 @@ struct MqlRates; // Includes. #include "Data.enum.h" #include "DateTime.mqh" -#include "Serializer.enum.h" -#include "SerializerNode.enum.h" +#include "Serializer/Serializer.enum.h" +#include "Serializer/SerializerNode.enum.h" #include "Std.h" +#include "Serializer/Serializer.h" #ifndef __MQL__ /** @@ -330,8 +331,6 @@ struct DataParamEntry : public MqlParam { SerializerNodeType Serialize(Serializer &s); }; -#include "Serializer.mqh" - /* Method to serialize DataParamEntry struct. */ SerializerNodeType DataParamEntry::Serialize(Serializer &s) { s.PassEnum(THIS_REF, "type", type, SERIALIZER_FIELD_FLAG_HIDDEN); diff --git a/Dict.mqh b/Dict.mqh index 743cc92d1..69a6a275a 100644 --- a/Dict.mqh +++ b/Dict.mqh @@ -27,8 +27,8 @@ #include "Convert.mqh" #include "DictBase.mqh" #include "Matrix.mqh" -#include "Serializer.mqh" -#include "SerializerNodeIterator.mqh" +#include "Serializer/Serializer.h" +#include "Serializer/SerializerNodeIterator.h" template class DictIterator : public DictIteratorBase { diff --git a/DictIteratorBase.mqh b/DictIteratorBase.mqh index 5a529c0cf..a3c955558 100644 --- a/DictIteratorBase.mqh +++ b/DictIteratorBase.mqh @@ -31,7 +31,7 @@ class DictBase; #include "DictBase.mqh" #include "DictSlotsRef.h" -#include "SerializerConversions.h" +#include "Serializer/SerializerConversions.h" template class DictIteratorBase { diff --git a/DictObject.mqh b/DictObject.mqh index 6f7519766..755ee14fe 100644 --- a/DictObject.mqh +++ b/DictObject.mqh @@ -26,8 +26,8 @@ #include "Convert.mqh" #include "DictBase.mqh" -#include "Serializer.mqh" -#include "SerializerNodeIterator.mqh" +#include "Serializer/Serializer.h" +#include "Serializer/SerializerNodeIterator.h" template class DictObjectIterator : public DictIteratorBase { diff --git a/DictStruct.mqh b/DictStruct.mqh index 9b362c1a1..fd64ef91d 100644 --- a/DictStruct.mqh +++ b/DictStruct.mqh @@ -26,8 +26,8 @@ #include "DictBase.mqh" #include "DictIteratorBase.mqh" -#include "Serializer.mqh" -#include "SerializerNodeIterator.mqh" +#include "Serializer/Serializer.h" +#include "Serializer/SerializerNodeIterator.h" // DictIterator could be used as DictStruct iterator. #define DictStructIterator DictIteratorBase diff --git a/EA.mqh b/EA.mqh index e51cffb55..dbf04c0ff 100644 --- a/EA.mqh +++ b/EA.mqh @@ -39,10 +39,10 @@ #include "Market.mqh" #include "Platform.h" #include "Refs.struct.h" -#include "SerializerConverter.mqh" -#include "SerializerCsv.mqh" -#include "SerializerJson.mqh" -#include "SerializerSqlite.mqh" +#include "Serializer/SerializerConverter.h" +#include "Serializer/SerializerCsv.h" +#include "Serializer/SerializerJson.h" +#include "Serializer/SerializerSqlite.h" #include "Strategy.mqh" #include "SummaryReport.mqh" #include "Task/TaskManager.h" diff --git a/Indicator/Indicator.h b/Indicator/Indicator.h index f7aa36f4d..a7b1da4c4 100644 --- a/Indicator/Indicator.h +++ b/Indicator/Indicator.h @@ -42,9 +42,9 @@ struct IndicatorParams; #include "../Math.h" #include "../Object.mqh" #include "../Refs.mqh" -#include "../Serializer.mqh" -#include "../SerializerCsv.mqh" -#include "../SerializerJson.mqh" +#include "../Serializer/Serializer.h" +#include "../Serializer/SerializerCsv.h" +#include "../Serializer/SerializerJson.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 4e1a220de..90d45fea2 100644 --- a/Indicator/Indicator.struct.h +++ b/Indicator/Indicator.struct.h @@ -40,7 +40,7 @@ struct ChartParams; #include "../Chart.struct.tf.h" #include "../Data.struct.h" #include "../DateTime.struct.h" -#include "../SerializerNode.enum.h" +#include "../Serializer/SerializerNode.enum.h" #include "Indicator.enum.h" #include "IndicatorData.struct.cache.h" //#include "Indicator.struct.serialize.h" diff --git a/Indicator/Indicator.struct.serialize.h b/Indicator/Indicator.struct.serialize.h index 512af9718..8855aa9f3 100644 --- a/Indicator/Indicator.struct.serialize.h +++ b/Indicator/Indicator.struct.serialize.h @@ -25,8 +25,8 @@ * Includes Indicator's struct serializers. */ -#include "../Serializer.mqh" -#include "../SerializerNode.enum.h" +#include "../Serializer/Serializer.h" +#include "../Serializer/SerializerNode.enum.h" #include "Indicator.struct.h" /* Method to serialize IndicatorParams structure. */ diff --git a/Indicator/IndicatorBase.h b/Indicator/IndicatorBase.h index f2738dcd4..ff1327cb2 100644 --- a/Indicator/IndicatorBase.h +++ b/Indicator/IndicatorBase.h @@ -40,9 +40,9 @@ #include "../Log.mqh" #include "../Object.mqh" #include "../Refs.mqh" -#include "../Serializer.mqh" -#include "../SerializerCsv.mqh" -#include "../SerializerJson.mqh" +#include "../Serializer/Serializer.h" +#include "../Serializer/SerializerCsv.h" +#include "../Serializer/SerializerJson.h" #include "../Util.h" /** diff --git a/Indicator/IndicatorData.struct.h b/Indicator/IndicatorData.struct.h index 27eaa124b..3e49d5902 100644 --- a/Indicator/IndicatorData.struct.h +++ b/Indicator/IndicatorData.struct.h @@ -30,7 +30,7 @@ #define STRUCT_ENUM_INDICATOR_STATE_PROP STRUCT_ENUM(IndicatorState, ENUM_INDICATOR_STATE_PROP) // Includes. -#include "../SerializerNode.enum.h" +#include "../Serializer/SerializerNode.enum.h" #include "IndicatorData.enum.h" // Type-less value for IndicatorDataEntryValue structure. diff --git a/Indicator/IndicatorData.struct.serialize.h b/Indicator/IndicatorData.struct.serialize.h index 7655450bd..c6b97399e 100644 --- a/Indicator/IndicatorData.struct.serialize.h +++ b/Indicator/IndicatorData.struct.serialize.h @@ -25,7 +25,7 @@ * Includes IndicatorData's struct serializers. */ -#include "../Serializer.mqh" +#include "../Serializer/Serializer.h" // Forward class declaration. class Serializer; diff --git a/Indicators/Bitwise/Indi_Candle.mqh b/Indicators/Bitwise/Indi_Candle.mqh index 61e7f3d56..b6397384a 100644 --- a/Indicators/Bitwise/Indi_Candle.mqh +++ b/Indicators/Bitwise/Indi_Candle.mqh @@ -25,7 +25,7 @@ #include "../../BufferStruct.mqh" #include "../../Indicator/Indicator.h" #include "../../Pattern.struct.h" -#include "../../Serializer.mqh" +#include "../../Serializer/Serializer.h" #include "../Price/Indi_Price.mqh" #include "../Special/Indi_Math.mqh" diff --git a/Indicators/Bitwise/Indi_Pattern.mqh b/Indicators/Bitwise/Indi_Pattern.mqh index 229faf261..6fb005d61 100644 --- a/Indicators/Bitwise/Indi_Pattern.mqh +++ b/Indicators/Bitwise/Indi_Pattern.mqh @@ -25,7 +25,7 @@ #include "../../BufferStruct.mqh" #include "../../Indicator/Indicator.h" #include "../../Pattern.struct.h" -#include "../../Serializer.mqh" +#include "../../Serializer/Serializer.h" #include "../Price/Indi_Price.mqh" #include "../Special/Indi_Math.mqh" diff --git a/Indicators/Indi_Drawer.struct.h b/Indicators/Indi_Drawer.struct.h index b1957e566..2014e8894 100644 --- a/Indicators/Indi_Drawer.struct.h +++ b/Indicators/Indi_Drawer.struct.h @@ -27,7 +27,7 @@ // Includes. #include "../Indicator/Indicator.struct.h" -#include "../SerializerNode.enum.h" +#include "../Serializer/SerializerNode.enum.h" // Structs. diff --git a/Indicators/Indi_Pivot.mqh b/Indicators/Indi_Pivot.mqh index bb90f9e96..986d07a62 100644 --- a/Indicators/Indi_Pivot.mqh +++ b/Indicators/Indi_Pivot.mqh @@ -23,7 +23,7 @@ // Includes. #include "../Bar.struct.h" #include "../Indicator/Indicator.struct.h" -#include "../Serializer.mqh" +#include "../Serializer/Serializer.h" #include "Special/Indi_Math.mqh" // Structs. diff --git a/Market.mqh b/Market.mqh index 157eb4c3d..996c83456 100644 --- a/Market.mqh +++ b/Market.mqh @@ -27,7 +27,7 @@ // Includes. #include "Market.struct.h" #include "Math.h" -#include "Serializer.mqh" +#include "Serializer/Serializer.h" #include "SymbolInfo.mqh" #include "SymbolInfo.struct.static.h" #include "Task/TaskCondition.enum.h" diff --git a/Market.struct.h b/Market.struct.h index 0937823ae..1283ce193 100644 --- a/Market.struct.h +++ b/Market.struct.h @@ -30,7 +30,7 @@ class Serializer; // Includes. #include "DateTime.struct.h" -#include "SerializerNode.enum.h" +#include "Serializer/SerializerNode.enum.h" #include "Std.h" // Market info. diff --git a/Order.mqh b/Order.mqh index d277a03c2..b0092bee5 100644 --- a/Order.mqh +++ b/Order.mqh @@ -41,10 +41,10 @@ class SymbolInfo; #include "Order.define.h" #include "Order.enum.h" #include "Order.struct.h" -#include "Serializer.define.h" -#include "Serializer.mqh" -#include "SerializerConverter.mqh" -#include "SerializerJson.mqh" +#include "Serializer/Serializer.define.h" +#include "Serializer/Serializer.h" +#include "Serializer/SerializerConverter.h" +#include "Serializer/SerializerJson.h" #include "Std.h" #include "String.mqh" #include "SymbolInfo.mqh" diff --git a/Order.struct.h b/Order.struct.h index bb1beb6b6..fff61929c 100644 --- a/Order.struct.h +++ b/Order.struct.h @@ -33,7 +33,7 @@ // Includes. #include "Data.struct.h" #include "Order.enum.h" -#include "Serializer.mqh" +#include "Serializer/Serializer.h" #include "SymbolInfo.struct.static.h" #include "Terminal.mqh" diff --git a/Redis.mqh b/Redis.mqh index 081f23a72..69be06ca8 100644 --- a/Redis.mqh +++ b/Redis.mqh @@ -27,9 +27,9 @@ #include "Dict.mqh" #include "Object.mqh" #include "Redis.struct.h" -#include "Serializer.mqh" -#include "SerializerConversions.h" -#include "SerializerJson.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/Redis.struct.h index 2a68a8cb9..19d9d7663 100644 --- a/Redis.struct.h +++ b/Redis.struct.h @@ -31,7 +31,7 @@ #endif // Includes. -#include "SerializerConversions.h" +#include "Serializer/SerializerConversions.h" // Forward declaration. class Serializer; diff --git a/ISerializable.h b/Serializer/Serializable.h similarity index 98% rename from ISerializable.h rename to Serializer/Serializable.h index 8a66d50e1..b845f22c9 100644 --- a/ISerializable.h +++ b/Serializer/Serializable.h @@ -34,7 +34,7 @@ class Serializer; -class ISerializable { +class Serializable { public: virtual SerializerNodeType Serialize(Serializer &s) = 0; }; diff --git a/Serializer.define.h b/Serializer/Serializer.define.h similarity index 100% rename from Serializer.define.h rename to Serializer/Serializer.define.h diff --git a/Serializer.enum.h b/Serializer/Serializer.enum.h similarity index 100% rename from Serializer.enum.h rename to Serializer/Serializer.enum.h diff --git a/Serializer.mqh b/Serializer/Serializer.h similarity index 98% rename from Serializer.mqh rename to Serializer/Serializer.h index d76c001b2..ce544cf1a 100644 --- a/Serializer.mqh +++ b/Serializer/Serializer.h @@ -25,13 +25,13 @@ #define SERIALIZER_MQH // Includes. -#include "Convert.mqh" +#include "../Convert.mqh" +#include "../Terminal.define.h" #include "Serializer.define.h" #include "Serializer.enum.h" -#include "SerializerNode.mqh" -#include "SerializerNodeIterator.mqh" -#include "SerializerNodeParam.mqh" -#include "Terminal.define.h" +#include "SerializerNode.h" +#include "SerializerNodeIterator.h" +#include "SerializerNodeParam.h" #define SERIALIZER_DEFAULT_FP_PRECISION 8 diff --git a/SerializerBinary.mqh b/Serializer/SerializerBinary.h similarity index 97% rename from SerializerBinary.mqh rename to Serializer/SerializerBinary.h index 51995a411..a009dcc2e 100644 --- a/SerializerBinary.mqh +++ b/Serializer/SerializerBinary.h @@ -25,10 +25,10 @@ #define SERIALIZER_BINARY_MQH // Includes. -#include "DictBase.mqh" -#include "Object.mqh" -#include "Serializer.mqh" -#include "SerializerNode.mqh" +#include "../DictBase.mqh" +#include "../Object.mqh" +#include "Serializer.h" +#include "SerializerNode.h" class Log; diff --git a/SerializerConversions.h b/Serializer/SerializerConversions.h similarity index 97% rename from SerializerConversions.h rename to Serializer/SerializerConversions.h index 4f5454a5e..1a2cae9d8 100644 --- a/SerializerConversions.h +++ b/Serializer/SerializerConversions.h @@ -30,10 +30,10 @@ #pragma once #endif -#include "Convert.extern.h" -#include "DateTime.extern.h" -#include "Object.mqh" -#include "Refs.struct.h" +#include "../Convert.extern.h" +#include "../DateTime.extern.h" +#include "../Object.mqh" +#include "../Refs.struct.h" class SerializerConversions { public: diff --git a/SerializerConverter.mqh b/Serializer/SerializerConverter.h similarity index 98% rename from SerializerConverter.mqh rename to Serializer/SerializerConverter.h index 4ce3d5f28..7e9490239 100644 --- a/SerializerConverter.mqh +++ b/Serializer/SerializerConverter.h @@ -33,11 +33,11 @@ class SerializerNode; // Includes. -#include "File.mqh" +#include "../File.mqh" #include "Serializer.enum.h" -#include "Serializer.mqh" -#include "SerializerDict.mqh" -#include "SerializerNode.mqh" +#include "Serializer.h" +#include "SerializerDict.h" +#include "SerializerNode.h" class SerializerConverter { public: diff --git a/SerializerCsv.mqh b/Serializer/SerializerCsv.h similarity index 97% rename from SerializerCsv.mqh rename to Serializer/SerializerCsv.h index 7b219aaca..85992b779 100644 --- a/SerializerCsv.mqh +++ b/Serializer/SerializerCsv.h @@ -25,14 +25,14 @@ #define SERIALIZER_CSV_MQH // Includes. -#include "Dict.mqh" -#include "DictObject.mqh" -#include "DictStruct.mqh" -#include "Matrix.mqh" -#include "MiniMatrix.h" -#include "Object.mqh" -#include "SerializerConverter.mqh" -#include "SerializerNode.mqh" +#include "../Dict.mqh" +#include "../DictObject.mqh" +#include "../DictStruct.mqh" +#include "../Matrix.mqh" +#include "../MiniMatrix.h" +#include "../Object.mqh" +#include "SerializerConverter.h" +#include "SerializerNode.h" struct CsvTitle { int column_index; diff --git a/SerializerDict.mqh b/Serializer/SerializerDict.h similarity index 98% rename from SerializerDict.mqh rename to Serializer/SerializerDict.h index ddef3e957..098ade629 100644 --- a/SerializerDict.mqh +++ b/Serializer/SerializerDict.h @@ -25,7 +25,7 @@ #define SERIALIZER_DICT_MQH // Includes. -#include "SerializerNode.mqh" +#include "SerializerNode.h" enum ENUM_SERIALIZER_DICT_FLAGS {}; diff --git a/SerializerJson.mqh b/Serializer/SerializerJson.h similarity index 98% rename from SerializerJson.mqh rename to Serializer/SerializerJson.h index a0dc2f4c6..fd3ed5fed 100644 --- a/SerializerJson.mqh +++ b/Serializer/SerializerJson.h @@ -25,12 +25,12 @@ #define SERIALIZER_JSON_MQH // Includes. -#include "DictBase.mqh" -#include "Object.mqh" +#include "../DictBase.mqh" +#include "../Object.mqh" +#include "../String.extern.h" #include "Serializer.enum.h" -#include "Serializer.mqh" -#include "SerializerNode.mqh" -#include "String.extern.h" +#include "Serializer.h" +#include "SerializerNode.h" class Log; diff --git a/SerializerNode.enum.h b/Serializer/SerializerNode.enum.h similarity index 100% rename from SerializerNode.enum.h rename to Serializer/SerializerNode.enum.h diff --git a/SerializerNode.mqh b/Serializer/SerializerNode.h similarity index 98% rename from SerializerNode.mqh rename to Serializer/SerializerNode.h index c5143a9de..5f071e87b 100644 --- a/SerializerNode.mqh +++ b/Serializer/SerializerNode.h @@ -21,14 +21,14 @@ */ // Prevents processing this includes file for the second time. -#ifndef JSON_NODE_MQH -#define JSON_NODE_MQH +#ifndef SERIALIZER_NODE_H +#define SERIALIZER_NODE_H // Includes. -#include "Math.extern.h" +#include "../Math.extern.h" +#include "../Terminal.define.h" #include "SerializerNode.enum.h" -#include "SerializerNodeParam.mqh" -#include "Terminal.define.h" +#include "SerializerNodeParam.h" class SerializerNode { protected: @@ -368,4 +368,4 @@ class SerializerNode { } }; -#endif +#endif // SERIALIZER_NODE_H diff --git a/SerializerNodeIterator.mqh b/Serializer/SerializerNodeIterator.h similarity index 96% rename from SerializerNodeIterator.mqh rename to Serializer/SerializerNodeIterator.h index a821bacaf..2be711439 100644 --- a/SerializerNodeIterator.mqh +++ b/Serializer/SerializerNodeIterator.h @@ -21,11 +21,11 @@ */ // Prevents processing this includes file for the second time. -#ifndef JSON_ITERATOR_MQH -#define JSON_ITERATOR_MQH +#ifndef SERIALIZER_NODE_ITERATOR_H +#define SERIALIZER_NODE_ITERATOR_H -#include "Serializer.mqh" -#include "SerializerNode.mqh" +#include "Serializer.h" +#include "SerializerNode.h" class SerializerNode; class Serializer; diff --git a/SerializerNodeParam.mqh b/Serializer/SerializerNodeParam.h similarity index 99% rename from SerializerNodeParam.mqh rename to Serializer/SerializerNodeParam.h index 0ef237931..b37d68c63 100644 --- a/SerializerNodeParam.mqh +++ b/Serializer/SerializerNodeParam.h @@ -22,8 +22,9 @@ // Prevents processing this includes file for the second time. #include "SerializerConversions.h" -#ifndef JSON_PARAM_MQH -#define JSON_PARAM_MQH + +#ifndef SERIALIZER_NODE_PARAM_H +#define SERIALIZER_NODE_PARAM_H /** * Enumeration. @@ -333,6 +334,4 @@ SerializerNodeParam* SerializerNodeParam::FromString(string& value) { return param; } - - -#endif +#endif // SERIALIZER_NODE_PARAM_H diff --git a/SerializerObject.mqh b/Serializer/SerializerObject.h similarity index 90% rename from SerializerObject.mqh rename to Serializer/SerializerObject.h index fddd54ac0..c8894ae98 100644 --- a/SerializerObject.mqh +++ b/Serializer/SerializerObject.h @@ -25,11 +25,11 @@ #define SERIALIZER_OBJECT_MQH // Includes. -#include "DictBase.mqh" -#include "Object.mqh" -#include "Serializer.mqh" -#include "SerializerConverter.mqh" -#include "SerializerNode.mqh" +#include "../DictBase.mqh" +#include "../Object.mqh" +#include "Serializer.h" +#include "SerializerConverter.h" +#include "SerializerNode.h" class Log; diff --git a/SerializerSqlite.mqh b/Serializer/SerializerSqlite.h similarity index 97% rename from SerializerSqlite.mqh rename to Serializer/SerializerSqlite.h index df86d747e..ec2b18abc 100644 --- a/SerializerSqlite.mqh +++ b/Serializer/SerializerSqlite.h @@ -25,9 +25,9 @@ #define SERIALIZER_SQL_MQH // Includes. -#include "Database.mqh" -#include "SerializerConverter.mqh" -#include "SerializerCsv.mqh" +#include "../Database.mqh" +#include "SerializerConverter.h" +#include "SerializerCsv.h" class SerializerSqlite { public: diff --git a/tests/SerializerTest.mq4 b/Serializer/tests/Serializer.test.mq4 similarity index 97% rename from tests/SerializerTest.mq4 rename to Serializer/tests/Serializer.test.mq4 index 8411f0c76..1117647d4 100644 --- a/tests/SerializerTest.mq4 +++ b/Serializer/tests/Serializer.test.mq4 @@ -25,4 +25,4 @@ */ // Includes. -#include "SerializerTest.mq5" +#include "Serializer.test.mq5" diff --git a/tests/SerializerTest.mq5 b/Serializer/tests/Serializer.test.mq5 similarity index 96% rename from tests/SerializerTest.mq5 rename to Serializer/tests/Serializer.test.mq5 index 68ef491b4..dd895f13e 100644 --- a/tests/SerializerTest.mq5 +++ b/Serializer/tests/Serializer.test.mq5 @@ -27,20 +27,20 @@ */ // Includes. -#include "../BufferStruct.mqh" -#include "../Chart.mqh" -#include "../Config.mqh" -#include "../Data.define.h" -#include "../Data.struct.h" -#include "../DictStruct.mqh" -#include "../Serializer.mqh" -#include "../SerializerBinary.mqh" -#include "../SerializerCsv.mqh" -#include "../SerializerDict.mqh" -#include "../SerializerJson.mqh" -#include "../SerializerNode.mqh" -#include "../SerializerObject.mqh" -#include "../Test.mqh" +#include "../../BufferStruct.mqh" +#include "../../Chart.mqh" +#include "../../Config.mqh" +#include "../../Data.define.h" +#include "../../Data.struct.h" +#include "../../DictStruct.mqh" +#include "../../Test.mqh" +#include "../Serializer.h" +#include "../SerializerBinary.h" +#include "../SerializerCsv.h" +#include "../SerializerDict.h" +#include "../SerializerJson.h" +#include "../SerializerNode.h" +#include "../SerializerObject.h" struct SerializableSubEntry { public: diff --git a/Storage/ValueStorage.h b/Storage/ValueStorage.h index 6c7979ba0..bbe358b36 100644 --- a/Storage/ValueStorage.h +++ b/Storage/ValueStorage.h @@ -34,7 +34,7 @@ #define VALUE_STORAGE_H // Includes. -#include "../SerializerConversions.h" +#include "../Serializer/SerializerConversions.h" #include "../Util.h" #include "Objects.h" diff --git a/Strategy.struct.h b/Strategy.struct.h index 4f0d8fce8..cea4c81bb 100644 --- a/Strategy.struct.h +++ b/Strategy.struct.h @@ -31,7 +31,7 @@ #endif // Includes. -#include "Serializer.mqh" +#include "Serializer/Serializer.h" #include "Strategy.enum.h" #include "Strategy.struct.pricestop.h" #include "Task/Task.struct.h" diff --git a/SymbolInfo.mqh b/SymbolInfo.mqh index 1ee351e9a..50d21311e 100644 --- a/SymbolInfo.mqh +++ b/SymbolInfo.mqh @@ -38,8 +38,8 @@ class SymbolInfo; // Includes. #include "Log.mqh" -#include "Serializer.mqh" -#include "SerializerNode.enum.h" +#include "Serializer/Serializer.h" +#include "Serializer/SerializerNode.enum.h" /** * Class to provide symbol information. diff --git a/SymbolInfo.struct.h b/SymbolInfo.struct.h index 7b41c2bba..ea08ee9af 100644 --- a/SymbolInfo.struct.h +++ b/SymbolInfo.struct.h @@ -31,15 +31,16 @@ #endif // Includes. -#include "ISerializable.h" +#include "Serializer/Serializable.h" #include "Std.h" #include "SymbolInfo.struct.static.h" #include "Tick/Tick.struct.h" +#include "Serializer/Serializer.h" // Defines struct to store symbol data. struct SymbolInfoEntry #ifndef __MQL__ - : public ISerializable + : public Serializable #endif { double bid; // Current Bid price. @@ -152,8 +153,6 @@ struct SymbolInfoProp { SerializerNodeType Serialize(Serializer& _s); }; -#include "Serializer.mqh" - SerializerNodeType SymbolInfoEntry::Serialize(Serializer& _s) { _s.Pass(THIS_REF, "ask", ask); _s.Pass(THIS_REF, "bid", bid); diff --git a/Task/TaskManager.h b/Task/TaskManager.h index dfa28c10c..7cd985fde 100644 --- a/Task/TaskManager.h +++ b/Task/TaskManager.h @@ -36,8 +36,8 @@ // Includes. #include "../DictObject.mqh" -#include "../SerializerConverter.mqh" -#include "../SerializerJson.mqh" +#include "../Serializer/SerializerConverter.h" +#include "../Serializer/SerializerJson.h" #include "Task.struct.h" #include "TaskObject.h" diff --git a/Trade/TradeSignal.struct.h b/Trade/TradeSignal.struct.h index 5b8221cce..e3b63a535 100644 --- a/Trade/TradeSignal.struct.h +++ b/Trade/TradeSignal.struct.h @@ -27,8 +27,8 @@ // Includes. #include "../Chart.enum.h" -#include "../SerializerConverter.mqh" -#include "../SerializerJson.mqh" +#include "../Serializer/SerializerConverter.h" +#include "../Serializer/SerializerJson.h" // Defines. #define SIGNAL_CLOSE_BUY_FILTER STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_FLAG_CLOSE_BUY_FILTER) diff --git a/Util.h b/Util.h index 10ae2079c..143f0d11a 100644 --- a/Util.h +++ b/Util.h @@ -30,7 +30,7 @@ #endif // Includes. -#include "SerializerConversions.h" +#include "Serializer/SerializerConversions.h" /** * Utility methods. diff --git a/tests/3DTest.mq5 b/tests/3DTest.mq5 index 2c5e013e8..35b329fd5 100644 --- a/tests/3DTest.mq5 +++ b/tests/3DTest.mq5 @@ -43,7 +43,7 @@ #include "../BufferStruct.mqh" #include "../Chart.mqh" #include "../Platform.h" -#include "../Serializer.mqh" +#include "../Serializer/Serializer.h" #include "../Test.mqh" /** diff --git a/tests/BufferStructTest.mq5 b/tests/BufferStructTest.mq5 index f5881fb70..8e5b7cc6e 100644 --- a/tests/BufferStructTest.mq5 +++ b/tests/BufferStructTest.mq5 @@ -28,8 +28,8 @@ #include "../BufferStruct.mqh" #include "../Data.define.h" #include "../Data.struct.h" -#include "../SerializerConverter.mqh" -#include "../SerializerJSON.mqh" +#include "../Serializer/SerializerConverter.h" +#include "../Serializer/SerializerJSON.h" #include "../Std.h" #include "../Test.mqh" diff --git a/tests/CompileTest.mq5 b/tests/CompileTest.mq5 index fc9193df9..eac4ac6b9 100644 --- a/tests/CompileTest.mq5 +++ b/tests/CompileTest.mq5 @@ -62,7 +62,6 @@ struct IndicatorParams; #include "../DrawIndicator.mqh" #include "../EA.mqh" #include "../File.mqh" -#include "../ISerializable.h" // #include "../Inet.mqh" #include "../Log.mqh" #include "../MD5.mqh" @@ -89,18 +88,6 @@ struct IndicatorParams; #include "../Storage/Objects.h" #include "../Storage/ObjectsCache.h" // #include "../SVG.mqh" // @removeme -#include "../Serializer.mqh" -#include "../SerializerBinary.mqh" -#include "../SerializerConversions.h" -#include "../SerializerConverter.mqh" -#include "../SerializerCsv.mqh" -#include "../SerializerDict.mqh" -#include "../SerializerJson.mqh" -#include "../SerializerNode.mqh" -#include "../SerializerNodeIterator.mqh" -#include "../SerializerNodeParam.mqh" -#include "../SerializerObject.mqh" -#include "../SerializerSqlite.mqh" #include "../Session.mqh" #include "../SetFile.mqh" #include "../Socket.mqh" @@ -128,13 +115,28 @@ struct IndicatorParams; #include "../Util.h" #include "../Web.mqh" -// Includes indicator files. +// Includes Indicator files. #include "../Indicator/Indicator.define.h" #include "../Indicator/Indicator.h" #include "../Indicator/IndicatorBase.h" -//#include "../Indicator/IndicatorData.h" +#include "../Indicator/IndicatorData.h" #include "../Indicators/indicators.h" +// Includes Serializer files. +#include "../Serializer/Serializable.h" +#include "../Serializer/Serializer.h" +#include "../Serializer/SerializerBinary.h" +#include "../Serializer/SerializerConversions.h" +#include "../Serializer/SerializerConverter.h" +#include "../Serializer/SerializerCsv.h" +#include "../Serializer/SerializerDict.h" +#include "../Serializer/SerializerJson.h" +#include "../Serializer/SerializerNode.h" +#include "../Serializer/SerializerNodeIterator.h" +#include "../Serializer/SerializerNodeParam.h" +#include "../Serializer/SerializerObject.h" +#include "../Serializer/SerializerSqlite.h" + /** * Implements Init event handler. */ diff --git a/tests/ConfigTest.mq5 b/tests/ConfigTest.mq5 index 2477a62f6..bbed5cd13 100644 --- a/tests/ConfigTest.mq5 +++ b/tests/ConfigTest.mq5 @@ -29,9 +29,9 @@ #include "../Data.define.h" #include "../Dict.mqh" #include "../DictObject.mqh" -#include "../SerializerConverter.mqh" -#include "../SerializerCsv.mqh" -#include "../SerializerJson.mqh" +#include "../Serializer/SerializerConverter.h" +#include "../Serializer/SerializerCsv.h" +#include "../Serializer/SerializerJson.h" #include "../Test.mqh" class Test { diff --git a/tests/DictTest.mq5 b/tests/DictTest.mq5 index 619dcc90f..cda693a4c 100644 --- a/tests/DictTest.mq5 +++ b/tests/DictTest.mq5 @@ -29,9 +29,9 @@ #include "../DictObject.mqh" #include "../DictStruct.mqh" #include "../Object.mqh" -#include "../Serializer.mqh" -#include "../SerializerConverter.mqh" -#include "../SerializerJson.mqh" +#include "../Serializer/Serializer.h" +#include "../Serializer/SerializerConverter.h" +#include "../Serializer/SerializerJson.h" #include "../Test.mqh" class DictTestClass { diff --git a/tests/IndicatorsTest.mq5 b/tests/IndicatorsTest.mq5 index 6ef5efc18..37c82ad28 100644 --- a/tests/IndicatorsTest.mq5 +++ b/tests/IndicatorsTest.mq5 @@ -41,8 +41,8 @@ struct DataParamEntry; #include "../Indicators/Tick/Indi_TickMt.mqh" #include "../Indicators/indicators.h" #include "../Platform.h" -#include "../SerializerConverter.mqh" -#include "../SerializerJson.mqh" +#include "../Serializer/SerializerConverter.h" +#include "../Serializer/SerializerJson.h" #include "../Std.h" #include "../Test.mqh" diff --git a/tests/OrderTest.mq5 b/tests/OrderTest.mq5 index 2418b855e..343adc249 100644 --- a/tests/OrderTest.mq5 +++ b/tests/OrderTest.mq5 @@ -28,8 +28,8 @@ #include "../Chart.mqh" #include "../Order.mqh" #include "../Platform.h" -#include "../SerializerConverter.mqh" -#include "../SerializerJson.mqh" +#include "../Serializer/SerializerConverter.h" +#include "../Serializer/SerializerJson.h" #include "../Test.mqh" // Global defines. diff --git a/tests/ValueStorageTest.mq5 b/tests/ValueStorageTest.mq5 index f7ed555fa..ddc3b3c52 100644 --- a/tests/ValueStorageTest.mq5 +++ b/tests/ValueStorageTest.mq5 @@ -30,8 +30,8 @@ // Includes. #include "../Indicators/Indi_MA.mqh" #include "../Indicators/Price/Indi_Price.mqh" -#include "../SerializerConverter.mqh" -#include "../SerializerJson.mqh" +#include "../Serializer/SerializerConverter.h" +#include "../Serializer/SerializerJson.h" #include "../Storage/ValueStorage.h" #include "../Test.mqh"