diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5944ed304..35d1d4e1e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,7 +27,7 @@ jobs: - name: Compile uses: fx31337/mql-compile-action@master with: - mt-version: 4.0.0.1349 + mt-version: 4.0.0.1359 verbose: true - name: Print compiled files run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname' @@ -85,7 +85,7 @@ jobs: BtDays: 1-8 BtMonths: 1 BtYears: 2020 - MtVersion: 4.0.0.1349 + MtVersion: 4.0.0.1359 TestExpert: ${{ matrix.test }} timeout-minutes: 10 diff --git a/3D/Chart3D.h b/3D/Chart3D.h index aedfdbe05..00dc95049 100644 --- a/3D/Chart3D.h +++ b/3D/Chart3D.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/3D/Chart3DCandles.h b/3D/Chart3DCandles.h index 1340d9be5..d46abb4d3 100644 --- a/3D/Chart3DCandles.h +++ b/3D/Chart3DCandles.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/3D/Chart3DType.h b/3D/Chart3DType.h index 9e49737f7..51e6b66d3 100644 --- a/3D/Chart3DType.h +++ b/3D/Chart3DType.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/3D/Cube.h b/3D/Cube.h index 0bc9038ff..bc8f8f7c0 100644 --- a/3D/Cube.h +++ b/3D/Cube.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/3D/Device.h b/3D/Device.h index d7b64f94f..8b664373b 100644 --- a/3D/Device.h +++ b/3D/Device.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/3D/Devices/MTDX/MTDXDevice.h b/3D/Devices/MTDX/MTDXDevice.h index 7bb1c93b8..16e637673 100644 --- a/3D/Devices/MTDX/MTDXDevice.h +++ b/3D/Devices/MTDX/MTDXDevice.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/3D/Devices/MTDX/MTDXIndexBuffer.h b/3D/Devices/MTDX/MTDXIndexBuffer.h index 6662aacab..057f3306c 100644 --- a/3D/Devices/MTDX/MTDXIndexBuffer.h +++ b/3D/Devices/MTDX/MTDXIndexBuffer.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/3D/Devices/MTDX/MTDXShader.h b/3D/Devices/MTDX/MTDXShader.h index c3dad254a..2cf97f95b 100644 --- a/3D/Devices/MTDX/MTDXShader.h +++ b/3D/Devices/MTDX/MTDXShader.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/3D/Devices/MTDX/MTDXVertexBuffer.h b/3D/Devices/MTDX/MTDXVertexBuffer.h index e96b9c7b7..9b9332962 100644 --- a/3D/Devices/MTDX/MTDXVertexBuffer.h +++ b/3D/Devices/MTDX/MTDXVertexBuffer.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/3D/Face.h b/3D/Face.h index 558c0bc4e..9bd841b76 100644 --- a/3D/Face.h +++ b/3D/Face.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/3D/Frontend.h b/3D/Frontend.h index 8080c65d4..173a26c87 100644 --- a/3D/Frontend.h +++ b/3D/Frontend.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/3D/Frontends/MT5Frontend.h b/3D/Frontends/MT5Frontend.h index 9bcec9e73..39962aaad 100644 --- a/3D/Frontends/MT5Frontend.h +++ b/3D/Frontends/MT5Frontend.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/3D/IndexBuffer.h b/3D/IndexBuffer.h index fdd83d91e..3c0153802 100644 --- a/3D/IndexBuffer.h +++ b/3D/IndexBuffer.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/3D/Interface.h b/3D/Interface.h index 87015f3a4..df041a9d8 100644 --- a/3D/Interface.h +++ b/3D/Interface.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/3D/Mesh.h b/3D/Mesh.h index 0ee82c0dc..3af638d76 100644 --- a/3D/Mesh.h +++ b/3D/Mesh.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/3D/Shader.h b/3D/Shader.h index 51ae50504..104bc0c85 100644 --- a/3D/Shader.h +++ b/3D/Shader.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/3D/TSR.h b/3D/TSR.h index ee015a01f..61ab08371 100644 --- a/3D/TSR.h +++ b/3D/TSR.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/3D/VertexBuffer.h b/3D/VertexBuffer.h index 822c33fb2..a892fc4a4 100644 --- a/3D/VertexBuffer.h +++ b/3D/VertexBuffer.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Account/Account.define.h b/Account/Account.define.h index 3f04e50b1..08d727a18 100644 --- a/Account/Account.define.h +++ b/Account/Account.define.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Account/Account.enum.h b/Account/Account.enum.h index db5c77592..4e48eeca6 100644 --- a/Account/Account.enum.h +++ b/Account/Account.enum.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -60,20 +60,20 @@ enum ENUM_ACC_STAT_INDEX { ACC_VALUE_CURR = 0, ACC_VALUE_PREV = 1, FINAL_ENUM_AC * https://www.mql5.com/en/docs/constants/environment_state/accountinformation */ enum ENUM_ACCOUNT_INFO_DOUBLE { + ACCOUNT_ASSETS, // The current assets of an account (double). ACCOUNT_BALANCE, // Account balance in the deposit currency (double). + ACCOUNT_COMMISSION_BLOCKED, // The current blocked commission amount on an account (double). ACCOUNT_CREDIT, // Account credit in the deposit currency (double). - ACCOUNT_PROFIT, // Current profit of an account in the deposit currency (double). ACCOUNT_EQUITY, // Account equity in the deposit currency (double). + ACCOUNT_LIABILITIES, // The current liabilities on an account (double). ACCOUNT_MARGIN, // Account margin used in the deposit currency (double). ACCOUNT_MARGIN_FREE, // Free margin of an account in the deposit currency (double). + ACCOUNT_MARGIN_INITIAL, // Initial margin reserved on an account to cover all pending orders (double). ACCOUNT_MARGIN_LEVEL, // Account margin level in percents (double). - ACCOUNT_MARGIN_SO_CALL, // Margin call level (double). - ACCOUNT_MARGIN_SO_SO, // Margin stop out level (double). - ACCOUNT_MARGIN_INITIAL, // Initial margin (double). - ACCOUNT_MARGIN_MAINTENANCE, // Maintenance margin (double). - ACCOUNT_ASSETS, // The current assets of an account (double). - ACCOUNT_LIABILITIES, // The current liabilities on an account (double). - ACCOUNT_COMMISSION_BLOCKED, // The current blocked commission amount on an account (double). + ACCOUNT_MARGIN_MAINTENANCE, // Maintenance margin reserved to cover minimum amount of open positions (double). + ACCOUNT_MARGIN_SO_CALL, // Margin call level (double). Depends on ACCOUNT_MARGIN_SO_MODE. + ACCOUNT_MARGIN_SO_SO, // Margin stop out level (double). Depends on ACCOUNT_MARGIN_SO_MODE. + ACCOUNT_PROFIT, // Current profit of an account in the deposit currency (double). }; /** @@ -85,16 +85,16 @@ enum ENUM_ACCOUNT_INFO_DOUBLE { * https://www.mql5.com/en/docs/constants/environment_state/accountinformation */ enum ENUM_ACCOUNT_INFO_INTEGER { - ACCOUNT_LOGIN, // Account number (long). - ACCOUNT_TRADE_MODE, // Account trade mode (ENUM_ACCOUNT_TRADE_MODE). + ACCOUNT_CURRENCY_DIGITS, // The number of decimal places in the account currency (int). + ACCOUNT_FIFO_CLOSE, // Whether positions can only be closed by FIFO rule (bool). ACCOUNT_LEVERAGE, // Account leverage (long). ACCOUNT_LIMIT_ORDERS, // Maximum allowed number of active pending orders (int). + ACCOUNT_LOGIN, // Account number (long). + ACCOUNT_MARGIN_MODE, // Margin calculation mode (ENUM_ACCOUNT_MARGIN_MODE). ACCOUNT_MARGIN_SO_MODE, // Mode for setting the minimal allowed margin (ENUM_ACCOUNT_STOPOUT_MODE). ACCOUNT_TRADE_ALLOWED, // Allowed trade for the current account (bool). ACCOUNT_TRADE_EXPERT, // Allowed trade for an Expert Advisor (bool). - ACCOUNT_MARGIN_MODE, // Margin calculation mode (ENUM_ACCOUNT_MARGIN_MODE). - ACCOUNT_CURRENCY_DIGITS, // The number of decimal places in the account currency (int). - ACCOUNT_FIFO_CLOSE, // An indication showing that positions can only be closed by FIFO rule (bool). + ACCOUNT_TRADE_MODE, // Account trade mode (ENUM_ACCOUNT_TRADE_MODE). }; /** @@ -106,10 +106,10 @@ enum ENUM_ACCOUNT_INFO_INTEGER { * https://www.mql5.com/en/docs/constants/environment_state/accountinformation */ enum ENUM_ACCOUNT_INFO_STRING { - ACCOUNT_NAME, // Client name (string). - ACCOUNT_SERVER, // Trade server name (string). - ACCOUNT_CURRENCY, // Account currency (string). ACCOUNT_COMPANY, // Name of a company that serves the account (string). + ACCOUNT_CURRENCY, // Account currency (string). + ACCOUNT_NAME, // Client name (string). + ACCOUNT_SERVER // Trade server name (string). }; /** @@ -119,9 +119,9 @@ enum ENUM_ACCOUNT_INFO_STRING { * https://www.mql5.com/en/docs/constants/environment_state/accountinformation */ enum ENUM_ACCOUNT_MARGIN_MODE { - ACCOUNT_MARGIN_MODE_RETAIL_NETTING, // Used for the OTC markets to interpret positions in the "netting" mode. - ACCOUNT_MARGIN_MODE_EXCHANGE, // Used for the exchange markets. + ACCOUNT_MARGIN_MODE_EXCHANGE, // Margin is calculated based on the discounts. ACCOUNT_MARGIN_MODE_RETAIL_HEDGING, // Used for the exchange markets where individual positions are possible. + ACCOUNT_MARGIN_MODE_RETAIL_NETTING, // Used for the OTC markets to interpret positions in the "netting" mode. }; /** diff --git a/Account/Account.extern.h b/Account/Account.extern.h index e3378c4c4..4e84eb30c 100644 --- a/Account/Account.extern.h +++ b/Account/Account.extern.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Account/Account.h b/Account/Account.h index 5e50510d5..7a2bd0c87 100644 --- a/Account/Account.h +++ b/Account/Account.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Account/Account.struct.h b/Account/Account.struct.h index 1b2a97517..601a9c787 100644 --- a/Account/Account.struct.h +++ b/Account/Account.struct.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Account/AccountBase.h b/Account/AccountBase.h index 9b0e10018..097aabb01 100644 --- a/Account/AccountBase.h +++ b/Account/AccountBase.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Account/AccountBase.struct.h b/Account/AccountBase.struct.h index 0f808c590..ca60b056d 100644 --- a/Account/AccountBase.struct.h +++ b/Account/AccountBase.struct.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Account/AccountForex.h b/Account/AccountForex.h index 3d73b7bb8..6dccd7c21 100644 --- a/Account/AccountForex.h +++ b/Account/AccountForex.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Account/AccountForex.struct.h b/Account/AccountForex.struct.h index 64aacffa3..85394f650 100644 --- a/Account/AccountForex.struct.h +++ b/Account/AccountForex.struct.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Account/AccountMt.h b/Account/AccountMt.h index f04d35e13..03aac2844 100644 --- a/Account/AccountMt.h +++ b/Account/AccountMt.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Account/tests/Account.test.mq4 b/Account/tests/Account.test.mq4 index 98597aef7..0ef0d6c3f 100644 --- a/Account/tests/Account.test.mq4 +++ b/Account/tests/Account.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Account/tests/Account.test.mq5 b/Account/tests/Account.test.mq5 index a52e8c076..67b1ca128 100644 --- a/Account/tests/Account.test.mq5 +++ b/Account/tests/Account.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Account/tests/AccountForex.test.mq4 b/Account/tests/AccountForex.test.mq4 index 21bbbae72..ad049cb6f 100644 --- a/Account/tests/AccountForex.test.mq4 +++ b/Account/tests/AccountForex.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Account/tests/AccountForex.test.mq5 b/Account/tests/AccountForex.test.mq5 index fb10957ea..350526aea 100644 --- a/Account/tests/AccountForex.test.mq5 +++ b/Account/tests/AccountForex.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Account/tests/AccountMt.test.mq4 b/Account/tests/AccountMt.test.mq4 index 8720ac436..6aa260b2d 100644 --- a/Account/tests/AccountMt.test.mq4 +++ b/Account/tests/AccountMt.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Account/tests/AccountMt.test.mq5 b/Account/tests/AccountMt.test.mq5 index 2bc637fb5..cc7398f40 100644 --- a/Account/tests/AccountMt.test.mq5 +++ b/Account/tests/AccountMt.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Array.extern.h b/Array.extern.h index 4b6580d4d..bfdaf7f2f 100644 --- a/Array.extern.h +++ b/Array.extern.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Array.mqh b/Array.mqh index d71b044d0..015ea0fa6 100644 --- a/Array.mqh +++ b/Array.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -71,101 +71,101 @@ class Array { */ template static T Sum(ARRAY_REF(T, _arr)) { - int i; - int _size = ArraySize(_arr); - if (_size > 0) { - T _sum = _arr[0]; - for (i = 1; i < _size; i++) { - _sum += _arr[i]; - } - return _sum; - } else { - return 0; + int i; + int _size = ArraySize(_arr); + if (_size > 0) { + T _sum = _arr[0]; + for (i = 1; i < _size; i++) { + _sum += _arr[i]; } + return _sum; + } else { + return 0; } +} - /** - * Finds the highest value in the array of any numeric type. - */ - template - static T Max(ARRAY_REF(T, _arr)) { - int i; - int _size = ArraySize(_arr); - if (_size > 0) { - T _max = _arr[0]; - for (i = 1; i < _size; i++) { - _max = _max < _arr[i] ? _arr[i] : _max; - } - return _max; - } else { - return 0; +/** + * Finds the highest value in the array of any numeric type. + */ +template +static T Max(ARRAY_REF(T, _arr)) { + int i; + int _size = ArraySize(_arr); + if (_size > 0) { + T _max = _arr[0]; + for (i = 1; i < _size; i++) { + _max = _max < _arr[i] ? _arr[i] : _max; } + return _max; + } else { + return 0; } +} - template - static int ArrayCopy(ARRAY_REF(T, dst_array), const ARRAY_REF(T, src_array), const int dst_start = 0, - const int src_start = 0, const int count = WHOLE_ARRAY) { - throw NotImplementedException(); - } +template +static int ArrayCopy(ARRAY_REF(T, dst_array), const ARRAY_REF(T, src_array), const int dst_start = 0, + const int src_start = 0, const int count = WHOLE_ARRAY) { + throw NotImplementedException(); +} - /** - * Return plain text of array values separated by the delimiter. - * - * @param - * int arr[] - array to look for the values - * string sep - delimiter to separate array values - */ - static string GetArrayValues(ARRAY_REF(int, arr), string sep = ", ") { - int i; - string result = ""; - for (i = 0; i < ArraySize(arr); i++) { - result += StringFormat("%d:%d%s", i, arr[i], sep); - } - // Return text without last separator. - return StringSubstr(result, 0, StringLen(result) - StringLen(sep)); - } +/** + * Return plain text of array values separated by the delimiter. + * + * @param + * int arr[] - array to look for the values + * string sep - delimiter to separate array values + */ +static string GetArrayValues(ARRAY_REF(int, arr), string sep = ", ") { + int i; + string result = ""; + for (i = 0; i < ArraySize(arr); i++) { + result += StringFormat("%d:%d%s", i, arr[i], sep); + } + // Return text without last separator. + return StringSubstr(result, 0, StringLen(result) - StringLen(sep)); +} - /** - * Return plain text of array values separated by the delimiter. - * - * @param - * double arr[] - array to look for the values - * string sep - delimiter to separate array values - */ - static string GetArrayValues(ARRAY_REF(double, arr), string sep = ", ") { - int i; - string result = ""; - for (i = 0; i < ArraySize(arr); i++) { - result += StringFormat("%d:%g%s", i, arr[i], sep); - } - // Return text without last separator. - return StringSubstr(result, 0, StringLen(result) - StringLen(sep)); - } +/** + * Return plain text of array values separated by the delimiter. + * + * @param + * double arr[] - array to look for the values + * string sep - delimiter to separate array values + */ +static string GetArrayValues(ARRAY_REF(double, arr), string sep = ", ") { + int i; + string result = ""; + for (i = 0; i < ArraySize(arr); i++) { + result += StringFormat("%d:%g%s", i, arr[i], sep); + } + // Return text without last separator. + return StringSubstr(result, 0, StringLen(result) - StringLen(sep)); +} - /** - * Find lower value within the 1-dim array of floats. - */ - static double LowestArrValue(ARRAY_REF(double, arr)) { return (arr[ArrayMinimum(arr)]); } +/** + * Find lower value within the 1-dim array of floats. + */ +static double LowestArrValue(ARRAY_REF(double, arr)) { return (arr[ArrayMinimum(arr)]); } - /** - * Find higher value within the 1-dim array of floats. - */ - static double HighestArrValue(ARRAY_REF(double, arr)) { return (arr[ArrayMaximum(arr)]); } +/** + * Find higher value within the 1-dim array of floats. + */ +static double HighestArrValue(ARRAY_REF(double, arr)) { return (arr[ArrayMaximum(arr)]); } /** * Find lower value within the 2-dim array of floats by the key. */ #ifdef __MQL4__ - static double LowestArrValue2(double& arr[][], int key1) { - int i; - double lowest = 999; - for (i = 0; i < ArrayRange(arr, 1); i++) { - if (arr[key1][i] < lowest) { - lowest = arr[key1][i]; - } +static double LowestArrValue2(double& arr[][], int key1) { + int i; + double lowest = 999; + for (i = 0; i < ArrayRange(arr, 1); i++) { + if (arr[key1][i] < lowest) { + lowest = arr[key1][i]; } - return lowest; } + return lowest; +} #else // @todo #endif @@ -174,16 +174,16 @@ class Array { * Find higher value within the 2-dim array of floats by the key. */ #ifdef __MQL4__ - static double HighestArrValue2(double& arr[][], int key1) { - double highest = -1; - int i; - for (i = 0; i < ArrayRange(arr, 1); i++) { - if (arr[key1][i] > highest) { - highest = arr[key1][i]; - } +static double HighestArrValue2(double& arr[][], int key1) { + double highest = -1; + int i; + for (i = 0; i < ArrayRange(arr, 1); i++) { + if (arr[key1][i] > highest) { + highest = arr[key1][i]; } - return highest; } + return highest; +} #else // @todo #endif @@ -192,16 +192,16 @@ class Array { * Find highest value in 2-dim array of integers by the key. */ #ifdef __MQL4__ - static int HighestValueByKey(int& arr[][], int key) { - int highest = -1; - int i; - for (i = 0; i < ArrayRange(arr, 1); i++) { - if (arr[key][i] > highest) { - highest = arr[key][i]; - } +static int HighestValueByKey(int& arr[][], int key) { + int highest = -1; + int i; + for (i = 0; i < ArrayRange(arr, 1); i++) { + if (arr[key][i] > highest) { + highest = arr[key][i]; } - return highest; } + return highest; +} #else // @todo #endif @@ -210,16 +210,16 @@ class Array { * Find lowest value in 2-dim array of integers by the key. */ #ifdef __MQL4__ - static int LowestValueByKey(int& arr[][], int key) { - int i; - int lowest = 999; - for (i = 0; i < ArrayRange(arr, 1); i++) { - if (arr[key][i] < lowest) { - lowest = arr[key][i]; - } +static int LowestValueByKey(int& arr[][], int key) { + int i; + int lowest = 999; + for (i = 0; i < ArrayRange(arr, 1); i++) { + if (arr[key][i] < lowest) { + lowest = arr[key][i]; } - return lowest; } + return lowest; +} #else // @todo #endif @@ -247,18 +247,18 @@ static int GetLowestArrDoubleValue(double& arr[][], int key) { * Find key in array of integers with the highest value. */ #ifdef __MQL4__ - static int GetArrKey1ByHighestKey2Value(int& arr[][], int key2) { - int i; - int key1 = EMPTY; - int highest = 0; - for (i = 0; i < ArrayRange(arr, 0); i++) { - if (arr[i][key2] > highest) { - highest = arr[i][key2]; - key1 = i; - } +static int GetArrKey1ByHighestKey2Value(int& arr[][], int key2) { + int i; + int key1 = EMPTY; + int highest = 0; + for (i = 0; i < ArrayRange(arr, 0); i++) { + if (arr[i][key2] > highest) { + highest = arr[i][key2]; + key1 = i; } - return key1; } + return key1; +} #else // @todo #endif @@ -267,18 +267,18 @@ static int GetLowestArrDoubleValue(double& arr[][], int key) { * Find key in array of integers with the lowest value. */ #ifdef __MQL4__ - static int GetArrKey1ByLowestKey2Value(int& arr[][], int key2) { - int i; - int key1 = EMPTY; - int lowest = 999; - for (i = 0; i < ArrayRange(arr, 0); i++) { - if (arr[i][key2] < lowest) { - lowest = arr[i][key2]; - key1 = i; - } +static int GetArrKey1ByLowestKey2Value(int& arr[][], int key2) { + int i; + int key1 = EMPTY; + int lowest = 999; + for (i = 0; i < ArrayRange(arr, 0); i++) { + if (arr[i][key2] < lowest) { + lowest = arr[i][key2]; + key1 = i; } - return key1; } + return key1; +} #else // @todo #endif @@ -287,18 +287,18 @@ static int GetLowestArrDoubleValue(double& arr[][], int key) { * Find key in array of doubles with the highest value. */ #ifdef __MQL4__ - static int GetArrKey1ByHighestKey2ValueD(double& arr[][], int key2) { - int i; - int key1 = EMPTY; - double highest = -1; - for (i = 0; i < ArrayRange(arr, 0); i++) { - if (arr[i][key2] > highest) { - highest = arr[i][key2]; - key1 = i; - } +static int GetArrKey1ByHighestKey2ValueD(double& arr[][], int key2) { + int i; + int key1 = EMPTY; + double highest = -1; + for (i = 0; i < ArrayRange(arr, 0); i++) { + if (arr[i][key2] > highest) { + highest = arr[i][key2]; + key1 = i; } - return key1; } + return key1; +} #else // @todo #endif @@ -307,18 +307,18 @@ static int GetLowestArrDoubleValue(double& arr[][], int key) { * Find key in array of doubles with the lowest value. */ #ifdef __MQL4__ - static int GetArrKey1ByLowestKey2ValueD(double& arr[][], int key2) { - int i; - int key1 = EMPTY; - double lowest = 999; - for (i = 0; i < ArrayRange(arr, 0); i++) { - if (arr[i][key2] < lowest) { - lowest = arr[i][key2]; - key1 = i; - } +static int GetArrKey1ByLowestKey2ValueD(double& arr[][], int key2) { + int i; + int key1 = EMPTY; + double lowest = 999; + for (i = 0; i < ArrayRange(arr, 0); i++) { + if (arr[i][key2] < lowest) { + lowest = arr[i][key2]; + key1 = i; } - return key1; } + return key1; +} #else // @todo #endif @@ -327,12 +327,12 @@ static int GetLowestArrDoubleValue(double& arr[][], int key) { * Set array value for double items with specific keys. */ #ifdef __MQL4__ - static void ArrSetValueD(double& arr[][], int key, double value) { - int i; - for (i = 0; i < ArrayRange(arr, 0); i++) { - arr[i][key] = value; - } +static void ArrSetValueD(double& arr[][], int key, double value) { + int i; + for (i = 0; i < ArrayRange(arr, 0); i++) { + arr[i][key] = value; } +} #else // @todo #endif @@ -341,12 +341,12 @@ static int GetLowestArrDoubleValue(double& arr[][], int key) { * Set array value for integer items with specific keys. */ #ifdef __MQL4__ - static void ArrSetValueI(int& arr[][], int key, int value) { - int i; - for (i = 0; i < ArrayRange(arr, 0); i++) { - arr[i][key] = value; - } +static void ArrSetValueI(int& arr[][], int key, int value) { + int i; + for (i = 0; i < ArrayRange(arr, 0); i++) { + arr[i][key] = value; } +} #else // @todo #endif @@ -355,80 +355,80 @@ static int GetLowestArrDoubleValue(double& arr[][], int key) { * Calculate sum of 2 dimentional array based on given key. */ #ifdef __MQL4__ - static double GetArrSumKey1(double& arr[][], int key1, int offset = 0) { - int i; - double sum = 0; - offset = MathMin(offset, ArrayRange(arr, 1) - 1); - for (i = offset; i < ArrayRange(arr, 1); i++) { - sum += arr[key1][i]; - } - return sum; - } +static double GetArrSumKey1(double& arr[][], int key1, int offset = 0) { + int i; + double sum = 0; + offset = MathMin(offset, ArrayRange(arr, 1) - 1); + for (i = offset; i < ArrayRange(arr, 1); i++) { + sum += arr[key1][i]; + } + return sum; +} #else // @todo #endif - /** - * Print a one-dimensional array. - * - * @param int arr - * The one dimensional array of integers. - * @param string dlm - * Delimiter to separate the items. - * - * @return string - * String representation of array. - */ - static string ArrToString(ARRAY_REF(int, arr), string dlm = ",") { - int i; - string res = ""; - for (i = 0; i < ArraySize(arr); i++) { - res += IntegerToString(arr[i]) + dlm; - } - res = StringSubstr(res, 0, StringLen(res) - StringLen(dlm)); - return res; - } +/** + * Print a one-dimensional array. + * + * @param int arr + * The one dimensional array of integers. + * @param string dlm + * Delimiter to separate the items. + * + * @return string + * String representation of array. + */ +static string ArrToString(ARRAY_REF(int, arr), string dlm = ",") { + int i; + string res = ""; + for (i = 0; i < ArraySize(arr); i++) { + res += IntegerToString(arr[i]) + dlm; + } + res = StringSubstr(res, 0, StringLen(res) - StringLen(dlm)); + return res; +} - /** - * Print a one-dimensional array. - * - * @param double arr - * The one dimensional array of doubles. - * @param string dlm - * Delimiter to separate the items. - * - * @return string - * String representation of array. - */ - static string ArrToString(ARRAY_REF(double, arr), string dlm = ",", int digits = 2) { - int i; - string res = ""; - for (i = 0; i < ArraySize(arr); i++) { - res += StringFormat("%g%s", NormalizeDouble(arr[i], digits), dlm); - } - res = StringSubstr(res, 0, StringLen(res) - StringLen(dlm)); - return res; - } +/** + * Print a one-dimensional array. + * + * @param double arr + * The one dimensional array of doubles. + * @param string dlm + * Delimiter to separate the items. + * + * @return string + * String representation of array. + */ +static string ArrToString(ARRAY_REF(double, arr), string dlm = ",", int digits = 2) { + int i; + string res = ""; + for (i = 0; i < ArraySize(arr); i++) { + res += StringFormat("%g%s", NormalizeDouble(arr[i], digits), dlm); + } + res = StringSubstr(res, 0, StringLen(res) - StringLen(dlm)); + return res; +} - /** - * Print a one-dimensional array in hex format. - * - * @param double unsigned char[] - * The one dimensional array of characters. - * @param int count - * If specified, limit the number of printed characters. - * - * @return string - * String representation of array in hexadecimal format. - */ - static string ArrToHex(ARRAY_REF(unsigned char, arr), int count = -1) { - int i; - string res; - for (i = 0; i < (count > 0 ? count : ArraySize(arr)); i++) { - res += StringFormat("%.2X", arr[i]); - } - return res; +/** + * Print a one-dimensional array in hex format. + * + * @param double unsigned char[] + * The one dimensional array of characters. + * @param int count + * If specified, limit the number of printed characters. + * + * @return string + * String representation of array in hexadecimal format. + */ +static string ArrToHex(ARRAY_REF(unsigned char, arr), int count = -1) { + int i; + string res; + for (i = 0; i < (count > 0 ? count : ArraySize(arr)); i++) { + res += StringFormat("%.2X", arr[i]); } + return res; +} /** * Print a two-dimensional array. @@ -444,20 +444,20 @@ static int GetLowestArrDoubleValue(double& arr[][], int key) { * String representation of array. */ #ifdef __MQL4__ - static string ArrToString2D(double& arr[][], string dlm = ",", int digits = 2) { - string res = ""; - int i, j; - for (i = 0; i < ArrayRange(arr, 0); i++) { - res += "["; - for (j = 0; j < ArrayRange(arr, 1); j++) { - res += StringFormat("%g%s", NormalizeDouble(arr[i][j], digits), dlm); - } - res = StringSubstr(res, 0, StringLen(res) - StringLen(dlm)); - res += "]" + dlm; +static string ArrToString2D(double& arr[][], string dlm = ",", int digits = 2) { + string res = ""; + int i, j; + for (i = 0; i < ArrayRange(arr, 0); i++) { + res += "["; + for (j = 0; j < ArrayRange(arr, 1); j++) { + res += StringFormat("%g%s", NormalizeDouble(arr[i][j], digits), dlm); } res = StringSubstr(res, 0, StringLen(res) - StringLen(dlm)); - return res; + res += "]" + dlm; } + res = StringSubstr(res, 0, StringLen(res) - StringLen(dlm)); + return res; +} #else // @todo #endif @@ -476,71 +476,71 @@ static int GetLowestArrDoubleValue(double& arr[][], int key) { * String representation of array. */ #ifdef __MQL4__ - static string ArrToString3D(double& arr[][][], string dlm = ",", int digits = 2) { - string res = ""; - int i, j, k; - for (i = 0; i < ArrayRange(arr, 0); i++) { +static string ArrToString3D(double& arr[][][], string dlm = ",", int digits = 2) { + string res = ""; + int i, j, k; + for (i = 0; i < ArrayRange(arr, 0); i++) { + res += "["; + for (j = 0; j < ArrayRange(arr, 1); j++) { res += "["; - for (j = 0; j < ArrayRange(arr, 1); j++) { - res += "["; - for (k = 0; k < ArrayRange(arr, 2); k++) { - res += StringFormat("%g%s", NormalizeDouble(arr[i][j][k], digits), dlm); - } - res = StringSubstr(res, 0, StringLen(res) - StringLen(dlm)); - res += "]" + dlm; + for (k = 0; k < ArrayRange(arr, 2); k++) { + res += StringFormat("%g%s", NormalizeDouble(arr[i][j][k], digits), dlm); } res = StringSubstr(res, 0, StringLen(res) - StringLen(dlm)); res += "]" + dlm; } res = StringSubstr(res, 0, StringLen(res) - StringLen(dlm)); - return res; + res += "]" + dlm; } + res = StringSubstr(res, 0, StringLen(res) - StringLen(dlm)); + return res; +} #else // @todo #endif - /** - * Print a one-dimensional array. - * - * @param string arr - * The one dimensional array of strings. - * @param string dlm - * Delimiter to separate the items. - * @param string prefix - * Prefix to add if array is non-empty. - * @param string suffix - * Suffix to add if array is non-empty. - * - * @return string - * String representation of array. - */ - static string ArrToString(ARRAY_REF(string, arr), string dlm = ",", string prefix = "", string suffix = "") { - int i; - string output = ""; - if (ArraySize(arr) > 0) output += prefix; - for (i = 0; i < ArraySize(arr); i++) { - output += (string)arr[i] + dlm; - } - output = StringSubstr(output, 0, StringLen(output) - StringLen(dlm)); - if (ArraySize(arr) > 0) output += suffix; - return output; - } +/** + * Print a one-dimensional array. + * + * @param string arr + * The one dimensional array of strings. + * @param string dlm + * Delimiter to separate the items. + * @param string prefix + * Prefix to add if array is non-empty. + * @param string suffix + * Suffix to add if array is non-empty. + * + * @return string + * String representation of array. + */ +static string ArrToString(ARRAY_REF(string, arr), string dlm = ",", string prefix = "", string suffix = "") { + int i; + string output = ""; + if (ArraySize(arr) > 0) output += prefix; + for (i = 0; i < ArraySize(arr); i++) { + output += (string)arr[i] + dlm; + } + output = StringSubstr(output, 0, StringLen(output) - StringLen(dlm)); + if (ArraySize(arr) > 0) output += suffix; + return output; +} - /** - * Prints an array of a simple type. - * - * @docs: - * - https://www.mql5.com/en/docs/array/arrayprint - */ - template - void ArrayPrint(ARRAY_REF(T, _arr), // Printed array. +/** + * Prints an array of a simple type. + * + * @docs: + * - https://www.mql5.com/en/docs/array/arrayprint + */ +template +void ArrayPrint(ARRAY_REF(T, _arr), // Printed array. int _digits = 0, // Number of decimal places. - const string _dlm = NULL, // Separator of the structure field values. - long _start = 0, // First printed element index. - long _count = WHOLE_ARRAY, // Number of printed elements. - long _flags = NULL) { + const string _dlm = NULL, // Separator of the structure field values. + long _start = 0, // First printed element index. + long _count = WHOLE_ARRAY, // Number of printed elements. + long _flags = NULL) { #ifdef __MQL5__ - ::ArrayPrint(_arr, _digits, _dlm, _start, _count, _flags); + ::ArrayPrint(_arr, _digits, _dlm, _start, _count, _flags); #else int i; string output = ""; @@ -549,54 +549,54 @@ static int GetLowestArrDoubleValue(double& arr[][], int key) { } Print(output); #endif - } +} - /** - * Resize array from the left. - * - * @param string arr - * The one dimensional array of doubles. - * @param int _new_size - * New size of array. - * - * @return bool - * Returns count of all elements contained in the array after resizing, - * otherwise returns -1 without resizing array. - * - * @see: http://www.forexfactory.com/showthread.php?p=2878455#post2878455 - */ - static int ArrayResizeLeft(ARRAY_REF(double, arr), int _new_size, int _reserve_size = 0) { - ArraySetAsSeries(arr, true); - int _res = ArrayResize(arr, _new_size, _reserve_size); - ArraySetAsSeries(arr, false); - return _res; - } +/** + * Resize array from the left. + * + * @param string arr + * The one dimensional array of doubles. + * @param int _new_size + * New size of array. + * + * @return bool + * Returns count of all elements contained in the array after resizing, + * otherwise returns -1 without resizing array. + * + * @see: http://www.forexfactory.com/showthread.php?p=2878455#post2878455 + */ +static int ArrayResizeLeft(ARRAY_REF(double, arr), int _new_size, int _reserve_size = 0) { + ArraySetAsSeries(arr, true); + int _res = ArrayResize(arr, _new_size, _reserve_size); + ArraySetAsSeries(arr, false); + return _res; +} - /** - * Sorts numeric arrays by first dimension. - * - * @param &array[] arr - * Numeric array for sorting. - * @param int count - * Count of elements to sort. By default, it sorts the whole array (WHOLE_ARRAY). - * @param int start - * Starting index to sort. By default, the sort starts at the first element. - * @param int direction - * Sort direction. It can be any of the following values: MODE_ASCEND or MODE_DESCEND. - * - * @return bool - * The function returns true on success, otherwise false. - * - * @docs: - * - https://docs.mql4.com/array/arraysort - * - https://www.mql5.com/en/docs/array/arraysort - * - https://www.mql5.com/en/docs/array/array_reverse - */ - // One dimensional array. - template - static bool ArraySort(ARRAY_REF(T, arr), int count = WHOLE_ARRAY, int start = 0, int direction = MODE_ASCEND) { +/** + * Sorts numeric arrays by first dimension. + * + * @param &array[] arr + * Numeric array for sorting. + * @param int count + * Count of elements to sort. By default, it sorts the whole array (WHOLE_ARRAY). + * @param int start + * Starting index to sort. By default, the sort starts at the first element. + * @param int direction + * Sort direction. It can be any of the following values: MODE_ASCEND or MODE_DESCEND. + * + * @return bool + * The function returns true on success, otherwise false. + * + * @docs: + * - https://docs.mql4.com/array/arraysort + * - https://www.mql5.com/en/docs/array/arraysort + * - https://www.mql5.com/en/docs/array/array_reverse + */ +// One dimensional array. +template +static bool ArraySort(ARRAY_REF(T, arr), int count = WHOLE_ARRAY, int start = 0, int direction = MODE_ASCEND) { #ifdef __MQL4__ - return ::ArraySort(arr, count, start, direction); + return ::ArraySort(arr, count, start, direction); #else if (direction == MODE_DESCEND) { return ::ArrayReverse(arr, start, count); @@ -605,93 +605,93 @@ static int GetLowestArrDoubleValue(double& arr[][], int key) { return ::ArraySort(arr); } #endif - } +} // Two dimensional array. #ifdef __MQL4__ - template - static bool ArraySort2D(T& arr[][], int count = WHOLE_ARRAY, int start = 0, int direction = MODE_ASCEND) { +template +static bool ArraySort2D(T& arr[][], int count = WHOLE_ARRAY, int start = 0, int direction = MODE_ASCEND) { #ifdef __MQL4__ - return (bool)::ArraySort(arr, count, start, direction); + return (bool)::ArraySort(arr, count, start, direction); #else - if (direction == MODE_DESCEND) { - return ::ArrayReverse(arr, start, count); - } else { - // @fixme: Add support for _count amd _start. - return ::ArraySort(arr); - } -#endif + if (direction == MODE_DESCEND) { + return ::ArrayReverse(arr, start, count); + } else { + // @fixme: Add support for _count amd _start. + return ::ArraySort(arr); } #endif +} +#endif - /** - * Resizes array and fills allocated slots with given value. - * - * @param &array[] array - * Single dimensonal array. For multi-dimensional array consider: template int - * ArrayResizeFill(X &array[][2], int new_size, int reserve_size = 0, Y fill_value = EMPTY) { ... } - * @param int new_size - * New array size. - * @param reserve_size - * Reserve size value (excess). - * @param fill_value - * Value to be used as filler for allocated slots. - * @return int - * Returns the same value as ArrayResize function (count of all elements contained in the array after resizing or -1 - * if error occured). - */ - template +/** + * Resizes array and fills allocated slots with given value. + * + * @param &array[] array + * Single dimensonal array. For multi-dimensional array consider: template int + * ArrayResizeFill(X &array[][2], int new_size, int reserve_size = 0, Y fill_value = EMPTY) { ... } + * @param int new_size + * New array size. + * @param reserve_size + * Reserve size value (excess). + * @param fill_value + * Value to be used as filler for allocated slots. + * @return int + * Returns the same value as ArrayResize function (count of all elements contained in the array after resizing or -1 + * if error occured). + */ +template static int ArrayResizeFill(ARRAY_REF(X, array), int new_size, int reserve_size = 0, Y fill_value = NULL) { - const int old_size = ArrayRange(array, 0); + const int old_size = ArrayRange(array, 0); if (new_size <= old_size) return old_size; - // We want to fill all allocated slots (the whole allocated memory). - const int allocated_size = MathMax(new_size, reserve_size); + // We want to fill all allocated slots (the whole allocated memory). + const int allocated_size = MathMax(new_size, reserve_size); - int result = ArrayResize(array, new_size, reserve_size); + int result = ArrayResize(array, new_size, reserve_size); - ArrayFill(array, old_size, allocated_size - old_size, fill_value); + ArrayFill(array, old_size, allocated_size - old_size, fill_value); - return result; - } + return result; +} - /** - * Initializes a numeric array by a preset value. - * - * @param array[] - * Numeric array that should be initialized. - * @param char value - * New value that should be set to all array elements. - * @return int - * Number of initialized elements. - * - * @docs - * - https://docs.mql4.com/array/arrayinitialize - * - https://www.mql5.com/en/docs/array/arrayinitialize - */ - template - static int ArrayInitialize(ARRAY_REF(X, array), char value) { - return ::ArrayInitialize(array, value); - } +/** + * Initializes a numeric array by a preset value. + * + * @param array[] + * Numeric array that should be initialized. + * @param char value + * New value that should be set to all array elements. + * @return int + * Number of initialized elements. + * + * @docs + * - https://docs.mql4.com/array/arrayinitialize + * - https://www.mql5.com/en/docs/array/arrayinitialize + */ +template +static int ArrayInitialize(ARRAY_REF(X, array), char value) { + return ::ArrayInitialize(array, value); +} - /** - * Searches for the lowest element in the first dimension of a multidimensional numeric array. - * - * @param void &array[] - * A numeric array, in which search is made. - * @param int start - * Index to start checking with. - * @param int count - * Number of elements for search. By default, searches in the entire array. - * @return int - * The function returns an index of a found element. - * - * @docs - * - https://docs.mql4.com/array/arraymaximum - * - https://www.mql5.com/en/docs/array/arraymaximum - */ - template - static int ArrayMinimum(const ARRAY_REF(X, _array), int _start = 0, int _count = WHOLE_ARRAY) { +/** + * Searches for the lowest element in the first dimension of a multidimensional numeric array. + * + * @param void &array[] + * A numeric array, in which search is made. + * @param int start + * Index to start checking with. + * @param int count + * Number of elements for search. By default, searches in the entire array. + * @return int + * The function returns an index of a found element. + * + * @docs + * - https://docs.mql4.com/array/arraymaximum + * - https://www.mql5.com/en/docs/array/arraymaximum + */ +template + static int ArrayMinimum(ARRAY_REF(X, _array), int _start = 0, int _count = WHOLE_ARRAY) { #ifdef __MQL__ return ::ArrayMinimum(_array); #else @@ -705,26 +705,26 @@ static int GetLowestArrDoubleValue(double& arr[][], int key) { return _peak_index; #endif - } +} - /** - * Searches for the largest element in the first dimension of a multidimensional numeric array. - * - * @param void &array[] - * A numeric array, in which search is made. - * @param int start - * Index to start checking with. - * @param int count - * Number of elements for search. By default, searches in the entire array. - * @return int - * The function returns an index of a found element. - * - * @docs - * - https://docs.mql4.com/array/arraymaximum - * - https://www.mql5.com/en/docs/array/arraymaximum - */ - template - static int ArrayMaximum(const ARRAY_REF(X, _array), int start = 0, int count = WHOLE_ARRAY) { +/** + * Searches for the largest element in the first dimension of a multidimensional numeric array. + * + * @param void &array[] + * A numeric array, in which search is made. + * @param int start + * Index to start checking with. + * @param int count + * Number of elements for search. By default, searches in the entire array. + * @return int + * The function returns an index of a found element. + * + * @docs + * - https://docs.mql4.com/array/arraymaximum + * - https://www.mql5.com/en/docs/array/arraymaximum + */ +template + static int ArrayMaximum(ARRAY_REF(X, _array), int start = 0, int count = WHOLE_ARRAY) { #ifdef __MQL__ return ::ArrayMaximum(_array); #else @@ -738,24 +738,24 @@ static int GetLowestArrDoubleValue(double& arr[][], int key) { return _peak_index; #endif - } +} - /** - * Returns the number of elements of a selected array. - * - * @param void &array[] - * Array of any type. - * @return int - * Value of int type. - * - * @docs - * - https://docs.mql4.com/array/arraysize - * - https://www.mql5.com/en/docs/array/arraysize - */ - template - static int ArraySize(const ARRAY_REF(X, array)) { - return ::ArraySize(array); - } +/** + * Returns the number of elements of a selected array. + * + * @param void &array[] + * Array of any type. + * @return int + * Value of int type. + * + * @docs + * - https://docs.mql4.com/array/arraysize + * - https://www.mql5.com/en/docs/array/arraysize + */ +template + static int ArraySize(ARRAY_REF(X, array)) { + return ::ArraySize(array); +} template static void ArrayStore(ARRAY_REF(X, array), int index, X value, int reserve_size = 0) { @@ -769,7 +769,7 @@ static int GetLowestArrDoubleValue(double& arr[][], int key) { template void ArrayPush(ARRAY_REF(X, array), X value) { - ArrayResize(ArraySize(array) + 1); + ArrayResize(Array::ArraySize(array) + 1); array[ArraySize(array) - 1] = value; } template diff --git a/Bar.enum.h b/Bar.enum.h index ac73beba5..cea47aeee 100644 --- a/Bar.enum.h +++ b/Bar.enum.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Bar.struct.h b/Bar.struct.h index 955bbaa2d..3131dcbb1 100644 --- a/Bar.struct.h +++ b/Bar.struct.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/BasicTrade.mqh b/BasicTrade.mqh index 2059a14e6..b59ad5622 100644 --- a/BasicTrade.mqh +++ b/BasicTrade.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Buffer.mqh b/Buffer.mqh index 896e5ca6a..4a764c69c 100644 --- a/Buffer.mqh +++ b/Buffer.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Buffer/BufferCandle.h b/Buffer/BufferCandle.h index 8401ee3f8..0a8df29fc 100644 --- a/Buffer/BufferCandle.h +++ b/Buffer/BufferCandle.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Buffer/BufferTick.h b/Buffer/BufferTick.h index bbbdc2039..cce37f5df 100644 --- a/Buffer/BufferTick.h +++ b/Buffer/BufferTick.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Buffer/tests/BufferCandle.test.mq4 b/Buffer/tests/BufferCandle.test.mq4 index fe6c0a00d..f7795e845 100644 --- a/Buffer/tests/BufferCandle.test.mq4 +++ b/Buffer/tests/BufferCandle.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Buffer/tests/BufferCandle.test.mq5 b/Buffer/tests/BufferCandle.test.mq5 index ab76d8da8..19bc812ca 100644 --- a/Buffer/tests/BufferCandle.test.mq5 +++ b/Buffer/tests/BufferCandle.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Buffer/tests/BufferTick.test.mq4 b/Buffer/tests/BufferTick.test.mq4 index 5a45ef4fa..71958f521 100644 --- a/Buffer/tests/BufferTick.test.mq4 +++ b/Buffer/tests/BufferTick.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Buffer/tests/BufferTick.test.mq5 b/Buffer/tests/BufferTick.test.mq5 index 1daf2ea7b..c284a5f00 100644 --- a/Buffer/tests/BufferTick.test.mq5 +++ b/Buffer/tests/BufferTick.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/BufferFXT.mqh b/BufferFXT.mqh index f48c7c943..2b21fdabd 100644 --- a/BufferFXT.mqh +++ b/BufferFXT.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, 31337 Investments Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -9,12 +9,12 @@ * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ diff --git a/BufferStruct.mqh b/BufferStruct.mqh index c02eba371..3e4de5554 100644 --- a/BufferStruct.mqh +++ b/BufferStruct.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dc3d3847c..33f02d0d0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -34,6 +34,8 @@ To improve code compatibility, please use the following syntax: | MQL | C++ | Syntax to use | |:------------------|:------------------------|:---------------------------| +| `&this` | `this` | `THIS_PTR` | +| `GetPointer(obj)` | `*obj` | `GET_PTR(obj)` | | `T name[]` | `_cpp_array name` | `ARRAY(T, name)` | | `T N[]` | `_cpp_array> N` | `ARRAY(T, N)` | | `obj.Method()` | `obj->Method()` | `obj PTR_DEREF Method()` | diff --git a/Candle.struct.h b/Candle.struct.h index 4d4e03dfb..eb77993c2 100644 --- a/Candle.struct.h +++ b/Candle.struct.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Chart.define.h b/Chart.define.h index 7f06e374a..3d7ae8d32 100644 --- a/Chart.define.h +++ b/Chart.define.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Chart.enum.h b/Chart.enum.h index 5835ba3da..36abcddbd 100644 --- a/Chart.enum.h +++ b/Chart.enum.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Chart.mqh b/Chart.mqh index 740a9ae10..49fc6fd4a 100644 --- a/Chart.mqh +++ b/Chart.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Chart.struct.h b/Chart.struct.h index 555bc32f7..b6d9b91c0 100644 --- a/Chart.struct.h +++ b/Chart.struct.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Chart.struct.serialize.h b/Chart.struct.serialize.h index 7c818167b..36147679d 100644 --- a/Chart.struct.serialize.h +++ b/Chart.struct.serialize.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Chart.struct.static.h b/Chart.struct.static.h index 5a1e91c72..aa81caf23 100644 --- a/Chart.struct.static.h +++ b/Chart.struct.static.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Chart.struct.tf.h b/Chart.struct.tf.h index 3bff64239..796869912 100644 --- a/Chart.struct.tf.h +++ b/Chart.struct.tf.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Common.define.h b/Common.define.h index f95e124ae..f98a475e3 100644 --- a/Common.define.h +++ b/Common.define.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Common.extern.h b/Common.extern.h index 03a90a139..379ec718d 100644 --- a/Common.extern.h +++ b/Common.extern.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Config.mqh b/Config.mqh index 331243fee..ac54499a5 100644 --- a/Config.mqh +++ b/Config.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Convert.extern.h b/Convert.extern.h index 4a5a02ed0..b08e80d86 100644 --- a/Convert.extern.h +++ b/Convert.extern.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Convert.mqh b/Convert.mqh index 507bf4292..4ef5dbeb9 100644 --- a/Convert.mqh +++ b/Convert.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Data.define.h b/Data.define.h index 822fcc323..9fb26ee47 100644 --- a/Data.define.h +++ b/Data.define.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Data.enum.h b/Data.enum.h index 6b76c3732..985f82244 100644 --- a/Data.enum.h +++ b/Data.enum.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Data.struct.h b/Data.struct.h index 9ee4ee34f..05b81533e 100644 --- a/Data.struct.h +++ b/Data.struct.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Database.mqh b/Database.mqh index 078949f49..ed4024489 100644 --- a/Database.mqh +++ b/Database.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/DateTime.enum.h b/DateTime.enum.h index 73e7facbe..6809eaa8b 100644 --- a/DateTime.enum.h +++ b/DateTime.enum.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/DateTime.extern.h b/DateTime.extern.h index e6ebbe21a..ba81ce1fe 100644 --- a/DateTime.extern.h +++ b/DateTime.extern.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/DateTime.mqh b/DateTime.mqh index 8f3e17057..26bf37ded 100644 --- a/DateTime.mqh +++ b/DateTime.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -114,9 +114,8 @@ class DateTime { _result |= DATETIME_SECOND; } - if (dt_curr.GetValue(DATETIME_DAY | DATETIME_WEEK) == 0) { - // It's the first day of the week (Sunday). - // Note that GetValue() for the above flags just returns value of GetDayOfWeek(). + if (dt_curr.GetValue(DATETIME_DAY | DATETIME_WEEK) <= 1) { + // Check if it's a new week (Sunday/Monday). // @see https://docs.mql4.com/dateandtime/dayofweek if (dt_curr.GetValue(DATETIME_DAY | DATETIME_WEEK) != dt_last.GetValue(DATETIME_DAY | DATETIME_WEEK)) { // New week started. diff --git a/DateTime.struct.h b/DateTime.struct.h index c03391a23..bd641db9e 100644 --- a/DateTime.struct.h +++ b/DateTime.struct.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -227,25 +227,75 @@ struct DateTimeStatic { } }; -struct DateTimeEntry : MqlDateTime { +struct DateTimeEntry : public MqlDateTime { int week_of_year; // Struct constructors. DateTimeEntry() { Set(); } DateTimeEntry(datetime _dt) { Set(_dt); } + DateTimeEntry(int _year, int _mon, int _day, int _hour = 0, int _min = 0, int _sec = 0) { + year = _year; + mon = _mon; + day = _day; + hour = _hour; + min = _min; + sec = _sec; + Recalculate(); + } DateTimeEntry(MqlDateTime& _dt) { Set(_dt); + // In MqlDateTime, 1st Jan is assigned the number value of zero. + day_of_year = day_of_year + 1; #ifndef __MQL__ throw NotImplementedException(); #endif } // Getters. int GetDayOfMonth() { return day; } - int GetDayOfWeek() { + int GetDayOfWeek(bool _recalc = true) { // Returns the zero-based day of week. // (0-Sunday, 1-Monday, ... , 6-Saturday). + if (!_recalc) { + return day_of_week; + } + // Calculates day of the week using the Tomohiko Sakamoto Algorithm. + // @see: https://iq.opengenus.org/tomohiko-sakamoto-algorithm/ + // @see: https://stackoverflow.com/a/64923433/55075 + int _days[] = {0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4}; + int _year = mon < 3 ? year - 1 : year; + day_of_week = (_year + _year / 4 - _year / 100 + _year / 400 + _days[mon - 1] + day) % 7; return day_of_week; } - int GetDayOfYear() { return day_of_year + 1; } // Zero-based day of year (1st Jan = 0). + // Gets day of the year. + int GetDayOfYear(bool _recalc = false) { + if (!_recalc) { + return day_of_year; + } + int _days_to_month[2][12] = { + {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334}, + {0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335}, + }; + // @see: https://stackoverflow.com/a/19111202/55075 + day_of_year = _days_to_month[IsLeapYear() ? 1 : 0][mon - 1] + day; + return day_of_year; + } + // Calculates the week of the year based on the day of the year. + // @see: https://stackoverflow.com/a/274913/55075 + int GetWeekOfYear(bool _recalc = false) { + if (!_recalc) { + return week_of_year; + } + if (day == 1 && mon == 1) { + return 1; + } + int doy = GetDayOfYear(); + int dow = GetDayOfWeek(); + DateTimeEntry _dte(year, 1, 1); + int dow1j = _dte.GetDayOfWeek(); + week_of_year = (doy + 6) / 7; + // Adjust for being after Saturday of 1st week. + week_of_year = dow < dow1j ? week_of_year + 1 : week_of_year; + return week_of_year; + } int GetHour() { return hour; } int GetMinute() { return min; } int GetMonth() { return mon; } @@ -280,29 +330,38 @@ struct DateTimeEntry : MqlDateTime { return GetDayOfMonth(); } else if ((_unit & (DATETIME_DAY | DATETIME_YEAR)) != 0) { return GetDayOfYear(); + } else if ((_unit & (DATETIME_WEEK | DATETIME_YEAR)) != 0) { + return GetWeekOfYear(); } return GetValue((ENUM_DATETIME_UNIT)_unit); } int GetYear() { return year; } datetime GetTimestamp() { return StructToTime(THIS_REF); } + bool IsLeapYear() { return year % 4 == 0 && (year % 100 != 0 || year % 400 == 0); } + // Recalculate + void Recalculate() { + day_of_week = GetDayOfWeek(true); + day_of_year = GetDayOfYear(true); + week_of_year = GetWeekOfYear(true); + } // Setters. void Set() { TimeToStruct(::TimeCurrent(), THIS_REF); - // @fixit Should also set day of week. + Recalculate(); } void SetGMT() { TimeToStruct(::TimeGMT(), THIS_REF); - // @fixit Should also set day of week. + Recalculate(); } // Set date and time. void Set(datetime _time) { TimeToStruct(_time, THIS_REF); - // @fixit Should also set day of week. + Recalculate(); } // Set date and time. void Set(MqlDateTime& _time) { THIS_REF = _time; - // @fixit Should also set day of week. + Recalculate(); } void SetDayOfMonth(int _value) { day = _value; diff --git a/Deal.enum.h b/Deal.enum.h index ceef21a7f..a94fbb415 100644 --- a/Deal.enum.h +++ b/Deal.enum.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Dict.enum.h b/Dict.enum.h index 080a50271..380b9f1eb 100644 --- a/Dict.enum.h +++ b/Dict.enum.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Dict.mqh b/Dict.mqh index 76eb3cd53..122f8c0be 100644 --- a/Dict.mqh +++ b/Dict.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/DictBase.mqh b/DictBase.mqh index e7f0b8a75..a2191bc44 100644 --- a/DictBase.mqh +++ b/DictBase.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/DictIteratorBase.mqh b/DictIteratorBase.mqh index 8d11899fa..600b41936 100644 --- a/DictIteratorBase.mqh +++ b/DictIteratorBase.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/DictObject.mqh b/DictObject.mqh index bcf0512ef..260f62994 100644 --- a/DictObject.mqh +++ b/DictObject.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/DictSlot.mqh b/DictSlot.mqh index 3c1fe29e1..cfd0632f7 100644 --- a/DictSlot.mqh +++ b/DictSlot.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/DictSlotsRef.h b/DictSlotsRef.h index 1164261cd..ec487ec0c 100644 --- a/DictSlotsRef.h +++ b/DictSlotsRef.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/DictStruct.mqh b/DictStruct.mqh index cce7f9e31..9f01a15a6 100644 --- a/DictStruct.mqh +++ b/DictStruct.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Draw.mqh b/Draw.mqh index 350f89bf6..2ca8961ac 100644 --- a/Draw.mqh +++ b/Draw.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/DrawIndicator.mqh b/DrawIndicator.mqh index 2888b77cf..042dfa3c0 100644 --- a/DrawIndicator.mqh +++ b/DrawIndicator.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/EA.enum.h b/EA.enum.h index 717f9b21f..e2ba9ea47 100644 --- a/EA.enum.h +++ b/EA.enum.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/EA.mqh b/EA.mqh index 9d27f1280..3f3068756 100644 --- a/EA.mqh +++ b/EA.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -104,12 +104,12 @@ class EA : public Taskable { Init(); // Initialize a trade instance for the current chart and symbol. ChartParams _cparams((ENUM_TIMEFRAMES)_Period, _Symbol); - TradeParams _tparams; + TradeParams _tparams(0, 1.0f, 0, eparams.Get(STRUCT_ENUM(EAParams, EA_PARAM_PROP_LOG_LEVEL))); Trade _trade(_tparams, _cparams); trade.Set(_Symbol, _trade); logger.Link(_trade.GetLogger()); logger.SetLevel(eparams.Get(STRUCT_ENUM(EAParams, EA_PARAM_PROP_LOG_LEVEL))); - _trade.GetLogger().SetLevel(eparams.Get(STRUCT_ENUM(EAParams, EA_PARAM_PROP_LOG_LEVEL))); + //_trade.GetLogger().SetLevel(eparams.Get(STRUCT_ENUM(EAParams, EA_PARAM_PROP_LOG_LEVEL))); } /** @@ -269,59 +269,68 @@ class EA : public Taskable { Trade *_trade = trade.GetByKey(_Symbol); Strategy *_strat = strats.GetByKey(_signal.Get(STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_PROP_MAGIC_ID))).Ptr(); + _trade_allowed &= _trade.IsTradeAllowed(); if (_trade.Get(TRADE_STATE_ORDERS_ACTIVE)) { float _sig_close = _signal.GetSignalClose(); string _comment_close = _strat != NULL && _sig_close != 0.0f ? _strat.GetOrderCloseComment() : __FUNCTION_LINE__; // Check if we should close the orders. - if (_sig_close >= 0.5f) { - // Close signal for buy order. - _trade.OrdersCloseViaProp2( - ORDER_MAGIC, _signal.Get(STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_PROP_MAGIC_ID)), ORDER_TYPE, - ORDER_TYPE_BUY, MATH_COND_EQ, ORDER_REASON_CLOSED_BY_SIGNAL, _comment_close); - // Buy orders closed. - _strat.OnOrderClose(ORDER_TYPE_BUY); - } - if (_sig_close <= -0.5f) { - // Close signal for sell order. - _trade.OrdersCloseViaProp2( - ORDER_MAGIC, _signal.Get(STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_PROP_MAGIC_ID)), ORDER_TYPE, - ORDER_TYPE_SELL, MATH_COND_EQ, ORDER_REASON_CLOSED_BY_SIGNAL, _comment_close); - // Sell orders closed. - _strat.OnOrderClose(ORDER_TYPE_SELL); + _trade_allowed &= _strat.GetTrade().IsTradeAllowed(_sig_close != 0.0f); + if (_sig_close != 0.0f && _trade_allowed) { + if (_sig_close >= 0.5f) { + // Close signal for buy order. + _trade.OrdersCloseViaProp2( + ORDER_MAGIC, _signal.Get(STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_PROP_MAGIC_ID)), ORDER_TYPE, + ORDER_TYPE_BUY, MATH_COND_EQ, ORDER_REASON_CLOSED_BY_SIGNAL, _comment_close); + // Buy orders closed. + _strat.OnOrderClose(ORDER_TYPE_BUY); + } + if (_sig_close <= -0.5f) { + // Close signal for sell order. + _trade.OrdersCloseViaProp2( + ORDER_MAGIC, _signal.Get(STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_PROP_MAGIC_ID)), ORDER_TYPE, + ORDER_TYPE_SELL, MATH_COND_EQ, ORDER_REASON_CLOSED_BY_SIGNAL, _comment_close); + // Sell orders closed. + _strat.OnOrderClose(ORDER_TYPE_SELL); + } } } - _trade_allowed &= _trade.IsTradeAllowed(); - _trade_allowed &= _strat.GetTrade().IsTradeAllowed(true); _trade_allowed &= !_strat.IsSuspended(); if (_trade_allowed) { float _sig_open = _signal.GetSignalOpen(); unsigned int _sig_f = eparams.Get(STRUCT_ENUM(EAParams, EA_PARAM_PROP_SIGNAL_FILTER)); string _comment_open = _strat != NULL && _sig_open != 0.0f ? _strat.GetOrderOpenComment() : __FUNCTION_LINE__; // Open orders on signals. - if (_sig_open >= 0.5f) { - // Open signal for buy. - // When H1 or H4 signal filter is enabled, do not open minute-based orders on opposite or neutral signals. - if (_sig_f == 0) { // @fixme: || GetSignalOpenFiltered(_signal, _sig_f) >= 0.5f) { - _strat.Set(TRADE_PARAM_ORDER_COMMENT, _comment_open); - // Buy order open. - _result_local &= TradeRequest(ORDER_TYPE_BUY, _Symbol, _strat); - if (_result_local && eparams.CheckSignalFilter(STRUCT_ENUM(EAParams, EA_PARAM_SIGNAL_FILTER_FIRST))) { - _signal.Set(STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_FLAG_PROCESSED), true); - break; + _trade_allowed &= _strat.GetTrade().IsTradeAllowed(_sig_open != 0.0f); + if (_sig_open != 0.0f && _trade_allowed) { + if (_sig_open >= 0.5f) { + // Open signal for buy. + // When H1 or H4 signal filter is enabled, do not open minute-based orders on opposite or neutral signals. + if (GetSignalOpenFiltered(_signal, _sig_f) >= 0.5f) { + _strat.Set(TRADE_PARAM_ORDER_COMMENT, _comment_open); + // Buy order open. + _result_local &= TradeRequest(ORDER_TYPE_BUY, _Symbol, _strat); + if (_result_local && eparams.CheckSignalFilter(STRUCT_ENUM(EAParams, EA_PARAM_SIGNAL_FILTER_FIRST))) { + _signal.Set(STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_FLAG_PROCESSED), true); + break; + } + } else { + // Signal filtered. } } - } - if (_sig_open <= -0.5f) { - // Open signal for sell. - // When H1 or H4 signal filter is enabled, do not open minute-based orders on opposite or neutral signals. - if (_sig_f == 0) { // @fixme: || GetSignalOpenFiltered(_signal, _sig_f) <= -0.5f) { - _strat.Set(TRADE_PARAM_ORDER_COMMENT, _comment_open); - // Sell order open. - _result_local &= TradeRequest(ORDER_TYPE_SELL, _Symbol, _strat); - if (_result_local && eparams.CheckSignalFilter(STRUCT_ENUM(EAParams, EA_PARAM_SIGNAL_FILTER_FIRST))) { - _signal.Set(STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_FLAG_PROCESSED), true); - break; + if (_sig_open <= -0.5f) { + // Open signal for sell. + // When H1 or H4 signal filter is enabled, do not open minute-based orders on opposite or neutral signals. + if (GetSignalOpenFiltered(_signal, _sig_f) <= -0.5f) { + _strat.Set(TRADE_PARAM_ORDER_COMMENT, _comment_open); + // Sell order open. + _result_local &= TradeRequest(ORDER_TYPE_SELL, _Symbol, _strat); + if (_result_local && eparams.CheckSignalFilter(STRUCT_ENUM(EAParams, EA_PARAM_SIGNAL_FILTER_FIRST))) { + _signal.Set(STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_FLAG_PROCESSED), true); + break; + } + } else { + // Signal filtered. } } } @@ -331,6 +340,9 @@ class EA : public Taskable { _last_error = GetLastError(); if (_last_error > 0) { logger.Warning(StringFormat("Error: %d", _last_error), __FUNCTION_LINE__, _strat.GetName()); +#ifdef __debug_ea__ + Print(__FUNCTION_LINE__ + "(): " + SerializerConverter::FromObject(_signal).ToString()); +#endif ResetLastError(); } if (_trade.Get(TRADE_STATE_MONEY_NOT_ENOUGH)) { @@ -370,10 +382,19 @@ class EA : public Taskable { // Check strategy's trade states. switch (_request.action) { case TRADE_ACTION_DEAL: - if (!_strade.IsTradeRecommended()) { - logger.Debug( - StringFormat("Trade not opened due to strategy trading states (%d).", _strade.GetStates().GetStates()), - __FUNCTION_LINE__); + if (!_etrade.IsTradeRecommended()) { + if (logger.GetLevel() > V_INFO) { + logger.Debug( + StringFormat("Trade not opened due to EA trading states (%d).", _strade.GetStates().GetStates()), + __FUNCTION_LINE__); + } + return _result; + } else if (!_strade.IsTradeRecommended()) { + if (logger.GetLevel() > V_INFO) { + logger.Debug( + StringFormat("Trade not opened due to strategy trading states (%d).", _strade.GetStates().GetStates()), + __FUNCTION_LINE__); + } return _result; } break; @@ -383,11 +404,20 @@ class EA : public Taskable { _strat.OnOrderOpen(_oparams); // Send the request. _result = _etrade.RequestSend(_request, _oparams); - if (!_result) { - logger.Debug( - StringFormat("Error while sending a trade request! Entry: %s", - SerializerConverter::FromObject(MqlTradeRequestProxy(_request)).ToString()), - __FUNCTION_LINE__, StringFormat("Code: %d, Msg: %s", _LastError, Terminal::GetErrorText(_LastError))); + if (!_result) { // && _strade.IsTradeRecommended( + logger.Debug( + StringFormat("Error while sending a trade request! Entry: %s", + SerializerConverter::FromObject(MqlTradeRequestProxy(_request)).ToString()), + __FUNCTION_LINE__, StringFormat("Code: %d, Msg: %s", _LastError, Terminal::GetErrorText(_LastError))); + if (_etrade.IsTradeRecommended() && _strade.IsTradeRecommended()) { + logger.Debug( + StringFormat("Error while sending a trade request! Entry: %s", + SerializerConverter::FromObject(MqlTradeRequestProxy(_request)).ToString()), + __FUNCTION_LINE__, StringFormat("Code: %d, Msg: %s", _LastError, Terminal::GetErrorText(_LastError))); + } +#ifdef __debug_ea__ + Print(__FUNCTION_LINE__ + "(): " + SerializerConverter::FromObject(MqlTradeRequestProxy(_request)).ToString()); +#endif } return _result; } @@ -408,7 +438,6 @@ class EA : public Taskable { ProcessPeriods(); // Process all enabled strategies and retrieve their signals. for (DictStructIterator> iter = strats.Begin(); iter.IsValid(); ++iter) { - bool _can_trade = true; Strategy *_strat = iter.Value().Ptr(); Trade *_trade = _strat.GetTrade(); if (_strat.IsEnabled()) { @@ -420,6 +449,7 @@ class EA : public Taskable { eresults.stg_processed_periods++; } if (_strat.TickFilter(_tick)) { + bool _can_trade = !_trade.HasState(TRADE_STATE_MODE_DISABLED); _can_trade &= !_strat.IsSuspended(); TradeSignalEntry _sentry = GetStrategySignalEntry(_strat, _can_trade, _strat.Get(STRAT_PARAM_SHIFT)); if (_sentry.Get(STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_PROP_SIGNALS)) > 0) { @@ -670,36 +700,44 @@ class EA : public Taskable { * Returns signal open value after filtering. * * @return - * Returns 1 when buy signal exists, -1 for sell, otherwise 0 for neutral signal. + * Returns positive for buy signal, negative for sell, otherwise 0 for neutral signal. */ - /* @fixme: Convert into TradeSignal format. - float GetSignalOpenFiltered(StrategySignal &_signal, unsigned int _sf) { - float _result = _signal.GetSignalOpen(); - ENUM_TIMEFRAMES _sig_tf = _signal.Get(STRUCT_ENUM(StrategySignal, STRATEGY_SIGNAL_PROP_TF)); + float GetSignalOpenFiltered(TradeSignal &_signal, unsigned int _sf) { + bool _res_sig = false; + float _sig_open = _signal.GetSignalOpen(); + ENUM_TIMEFRAMES _sig_tf = _signal.Get(STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_PROP_TF)); if (ChartTf::TfToHours(_sig_tf) < 1 && bool(_sf & STRUCT_ENUM(EAParams, EA_PARAM_SIGNAL_FILTER_OPEN_M_IF_H))) { - _result = 0; - long _tfts[4]; - _tfts[0] = ChartStatic::iTime(_Symbol, PERIOD_H1); - _tfts[1] = ChartStatic::iTime(_Symbol, PERIOD_H4); - _tfts[2] = ChartStatic::iTime(_Symbol, PERIOD_H1, 1); - _tfts[3] = ChartStatic::iTime(_Symbol, PERIOD_H4, 1); - for (int i = 0; i < ArraySize(_tfts); i++) { - DictStruct _ds = strat_signals.GetByKey(_tfts[i]); - for (DictStructIterator _dsi = _ds.Begin(); _dsi.IsValid(); ++_dsi) { - StrategySignal _dsss = _dsi.Value(); - ENUM_TIMEFRAMES _dsss_tf = _dsss.Get(STRUCT_ENUM(StrategySignal, STRATEGY_SIGNAL_PROP_TF)); - if (ChartTf::TfToHours(_dsss_tf) >= 1) { - _result = _dsss.GetSignalOpen(); - if (_result != 0) { - return _result; - } + for (DictStructIterator> _iter = GetStrategies().Begin(); _iter.IsValid(); ++_iter) { + Strategy *_strat = _iter.Value().Ptr(); + ENUM_TIMEFRAMES _stf = _strat.Get(STRAT_PARAM_TF); + if (ChartTf::TfToHours(_stf) >= 1) { + TradeSignal *_hsignal0 = + tsm.GetSignalByCid(_strat.Get(STRAT_PARAM_ID), (int)_stf, (int)ChartStatic::iTime(_Symbol, _stf)); + TradeSignal *_hsignal1 = + tsm.GetSignalByCid(_strat.Get(STRAT_PARAM_ID), (int)_stf, (int)ChartStatic::iTime(_Symbol, _stf, 1)); + TradeSignal *_hsignal2 = + tsm.GetSignalByCid(_strat.Get(STRAT_PARAM_ID), (int)_stf, (int)ChartStatic::iTime(_Symbol, _stf, 2)); + // Increase signal if confirmed by hourly signal. + if (_hsignal0 != NULL && _hsignal0.Get(STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_PROP_TIME)) > 0) { + _sig_open += ((_sig_open > 0) == (_hsignal0.GetSignalOpen() > 0)) ? 1.0f : -1.0f; + _sig_open -= ((_sig_open < 0) == (_hsignal0.GetSignalOpen() < 0)) ? 1.0f : -1.0f; + } else if (_hsignal1 != NULL && + _hsignal1.Get(STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_PROP_TIME)) > 0) { + _sig_open += ((_sig_open > 0) == (_hsignal1.GetSignalOpen() > 0)) ? 0.5f : -0.5f; + _sig_open -= ((_sig_open < 0) == (_hsignal1.GetSignalOpen() < 0)) ? 0.5f : -0.5f; + } else if (_hsignal2 != NULL && + _hsignal2.Get(STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_PROP_TIME)) > 0) { + _sig_open += ((_sig_open > 0) == (_hsignal2.GetSignalOpen() > 0)) ? 0.2f : -0.2f; + _sig_open -= ((_sig_open < 0) == (_hsignal2.GetSignalOpen() < 0)) ? 0.2f : -0.2f; + } else { + // Decrease signal by 0.1 if no hourly signal is found. + _sig_open -= 0.1f; } } } } - return _result; + return _sig_open; } - */ /* Strategy methods */ @@ -719,6 +757,7 @@ class EA : public Taskable { _magic_no = _magic_no > 0 ? _magic_no : rand(); Ref _strat = ((SClass *)NULL).Init(_tf); _strat.Ptr().Set(STRAT_PARAM_ID, _magic_no); + _strat.Ptr().Set(TRADE_PARAM_MAGIC_NO, _magic_no); _strat.Ptr().Set(STRAT_PARAM_LOG_LEVEL, eparams.Get(STRUCT_ENUM(EAParams, EA_PARAM_PROP_LOG_LEVEL))); _strat.Ptr().Set(STRAT_PARAM_TF, _tf); @@ -782,7 +821,7 @@ class EA : public Taskable { ResetLastError(); for (DictObjectIterator titer = trade.Begin(); titer.IsValid(); ++titer) { Trade *_trade = titer.Value(); - if (_trade.Get(TRADE_STATE_ORDERS_ACTIVE)) { + if (_trade.Get(TRADE_STATE_ORDERS_ACTIVE) && !_trade.Get(TRADE_STATE_MARKET_CLOSED)) { for (DictStructIterator> oiter = _trade.GetOrdersActive().Begin(); oiter.IsValid(); ++oiter) { bool _sl_valid = false, _tp_valid = false; double _sl_new = 0, _tp_new = 0; @@ -827,6 +866,8 @@ class EA : public Taskable { _result &= _order.OrderModify(_sl_new, _tp_new); if (_result) { _order.Set(ORDER_PROP_TIME_LAST_UPDATE, TimeCurrent()); + } else { + _trade.UpdateStates(true); } } } @@ -1049,7 +1090,7 @@ class EA : public Taskable { /** * Returns pointer to Market object. */ - Terminal *GetTerminal() { return GetPointer(terminal); } + Terminal *GetTerminal() { return GET_PTR(terminal); } /** * Gets EA's name. @@ -1059,7 +1100,7 @@ class EA : public Taskable { /** * Gets DictStruct reference to strategies. */ - DictStruct> *GetStrategies() { return GetPointer(strats); } + DictStruct> *GetStrategies() { return GET_PTR(strats); } /** * Gets EA state. @@ -1076,7 +1117,7 @@ class EA : public Taskable { /** * Gets pointer to log instance. */ - Log *GetLogger() { return GetPointer(logger); } + Log *GetLogger() { return GET_PTR(logger); } /** * Gets reference to strategies. diff --git a/EA.struct.h b/EA.struct.h index 5bed4845d..6378f65c7 100644 --- a/EA.struct.h +++ b/EA.struct.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -217,6 +217,17 @@ struct EAProcessResult { ResetLastError(); last_error = ERR_NO_ERROR; } + // Serializers. + SERIALIZER_EMPTY_STUB; + SerializerNodeType Serialize(Serializer &_s) { + _s.Pass(THIS_REF, "last_error", last_error); + _s.Pass(THIS_REF, "stg_errored", stg_errored); + _s.Pass(THIS_REF, "stg_processed", stg_processed); + _s.Pass(THIS_REF, "stg_processed_periods", stg_processed_periods); + _s.Pass(THIS_REF, "stg_suspended", stg_suspended); + _s.Pass(THIS_REF, "tasks_processed", tasks_processed); + return SerializerNodeObject; + } string ToString() { return StringFormat("%d", last_error); } }; diff --git a/Exchange/Exchange.h b/Exchange/Exchange.h index db7923c65..8c32f9fe3 100644 --- a/Exchange/Exchange.h +++ b/Exchange/Exchange.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Exchange/Exchange.struct.h b/Exchange/Exchange.struct.h index d63290d4f..ace6b30a9 100644 --- a/Exchange/Exchange.struct.h +++ b/Exchange/Exchange.struct.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Exchange/tests/Exchange.test.mq4 b/Exchange/tests/Exchange.test.mq4 index 2b3fdf2da..d7b0b8f3b 100644 --- a/Exchange/tests/Exchange.test.mq4 +++ b/Exchange/tests/Exchange.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Exchange/tests/Exchange.test.mq5 b/Exchange/tests/Exchange.test.mq5 index d31b3b5ae..8a259676e 100644 --- a/Exchange/tests/Exchange.test.mq5 +++ b/Exchange/tests/Exchange.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/File.define.h b/File.define.h index e932ab836..95ce7939d 100644 --- a/File.define.h +++ b/File.define.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/File.extern.h b/File.extern.h index cc1c63cf6..fcb89a897 100644 --- a/File.extern.h +++ b/File.extern.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/File.mqh b/File.mqh index 56c33bd57..03a57aec5 100644 --- a/File.mqh +++ b/File.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/ISerializable.h b/ISerializable.h index 8a66d50e1..2d35ac4b6 100644 --- a/ISerializable.h +++ b/ISerializable.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicator.define.h b/Indicator.define.h index ab51a433d..9c432d5ca 100644 --- a/Indicator.define.h +++ b/Indicator.define.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicator.enum.h b/Indicator.enum.h index ed2e8fd7d..6a5f88794 100644 --- a/Indicator.enum.h +++ b/Indicator.enum.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicator.mqh b/Indicator.mqh index a6b9e121e..9b42320b9 100644 --- a/Indicator.mqh +++ b/Indicator.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -752,7 +752,7 @@ class Indicator : public IndicatorData { if (_bar_time > 0 && !_entry.IsValid() && !_entry.CheckFlag(INDI_ENTRY_FLAG_INSUFFICIENT_DATA)) { int _max_modes = Get(STRUCT_ENUM(IndicatorDataParams, IDATA_PARAM_MAX_MODES)); _entry.Resize(_max_modes); - _entry.timestamp = GetBarTime(_ishift); + _entry.timestamp = _bar_time; #ifndef __MQL4__ if (IndicatorBase::Get(STRUCT_ENUM(IndicatorState, INDICATOR_STATE_PROP_IS_CHANGED))) { // Resets the handle on any parameter changes. diff --git a/Indicator.struct.cache.h b/Indicator.struct.cache.h index 2c4df7097..39d6d0219 100644 --- a/Indicator.struct.cache.h +++ b/Indicator.struct.cache.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicator.struct.h b/Indicator.struct.h index d696f66c9..83da13b7e 100644 --- a/Indicator.struct.h +++ b/Indicator.struct.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicator.struct.serialize.h b/Indicator.struct.serialize.h index e9a68a534..c97c69d9d 100644 --- a/Indicator.struct.serialize.h +++ b/Indicator.struct.serialize.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicator/IndicatorCandle.h b/Indicator/IndicatorCandle.h index b5036d67e..ee4e045c2 100644 --- a/Indicator/IndicatorCandle.h +++ b/Indicator/IndicatorCandle.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicator/IndicatorCandleSource.h b/Indicator/IndicatorCandleSource.h index 2d721fb8a..084c0d1d4 100644 --- a/Indicator/IndicatorCandleSource.h +++ b/Indicator/IndicatorCandleSource.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicator/IndicatorTf.h b/Indicator/IndicatorTf.h index beec0f0bd..d0597b7ee 100644 --- a/Indicator/IndicatorTf.h +++ b/Indicator/IndicatorTf.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicator/IndicatorTf.struct.h b/Indicator/IndicatorTf.struct.h index e1d6aa114..727766bbf 100644 --- a/Indicator/IndicatorTf.struct.h +++ b/Indicator/IndicatorTf.struct.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicator/IndicatorTick.h b/Indicator/IndicatorTick.h index 12652072d..3026e289b 100644 --- a/Indicator/IndicatorTick.h +++ b/Indicator/IndicatorTick.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicator/IndicatorTickOrCandleSource.h b/Indicator/IndicatorTickOrCandleSource.h index 491766979..defe2c019 100644 --- a/Indicator/IndicatorTickOrCandleSource.h +++ b/Indicator/IndicatorTickOrCandleSource.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicator/IndicatorTickSource.h b/Indicator/IndicatorTickSource.h index 8b47180a5..adc3d17f4 100644 --- a/Indicator/IndicatorTickSource.h +++ b/Indicator/IndicatorTickSource.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicator/tests/IndicatorCandle.test.mq4 b/Indicator/tests/IndicatorCandle.test.mq4 index 93a0098bb..abfdd62e5 100644 --- a/Indicator/tests/IndicatorCandle.test.mq4 +++ b/Indicator/tests/IndicatorCandle.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicator/tests/IndicatorCandle.test.mq5 b/Indicator/tests/IndicatorCandle.test.mq5 index 1d3f5c0d5..9611788d0 100644 --- a/Indicator/tests/IndicatorCandle.test.mq5 +++ b/Indicator/tests/IndicatorCandle.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicator/tests/IndicatorTf.test.mq4 b/Indicator/tests/IndicatorTf.test.mq4 index 360408073..e1641b942 100644 --- a/Indicator/tests/IndicatorTf.test.mq4 +++ b/Indicator/tests/IndicatorTf.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicator/tests/IndicatorTf.test.mq5 b/Indicator/tests/IndicatorTf.test.mq5 index d09b77905..3bc42ca32 100644 --- a/Indicator/tests/IndicatorTf.test.mq5 +++ b/Indicator/tests/IndicatorTf.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicator/tests/IndicatorTick.test.mq4 b/Indicator/tests/IndicatorTick.test.mq4 index 430e9d0e3..8800317fb 100644 --- a/Indicator/tests/IndicatorTick.test.mq4 +++ b/Indicator/tests/IndicatorTick.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicator/tests/IndicatorTick.test.mq5 b/Indicator/tests/IndicatorTick.test.mq5 index 67400dc41..00845ae9f 100644 --- a/Indicator/tests/IndicatorTick.test.mq5 +++ b/Indicator/tests/IndicatorTick.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicator/tests/classes/IndicatorTfDummy.h b/Indicator/tests/classes/IndicatorTfDummy.h index 019b800d8..c0b312daf 100644 --- a/Indicator/tests/classes/IndicatorTfDummy.h +++ b/Indicator/tests/classes/IndicatorTfDummy.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicator/tests/classes/IndicatorTickDummy.h b/Indicator/tests/classes/IndicatorTickDummy.h index dcc473b88..b6c75949b 100644 --- a/Indicator/tests/classes/IndicatorTickDummy.h +++ b/Indicator/tests/classes/IndicatorTickDummy.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicator/tests/classes/IndicatorTickReal.h b/Indicator/tests/classes/IndicatorTickReal.h index fc20d98c5..143abb45d 100644 --- a/Indicator/tests/classes/IndicatorTickReal.h +++ b/Indicator/tests/classes/IndicatorTickReal.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicator/tests/classes/Indicators.h b/Indicator/tests/classes/Indicators.h index 1d1da2066..ee19f59bc 100644 --- a/Indicator/tests/classes/Indicators.h +++ b/Indicator/tests/classes/Indicators.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/IndicatorBase.h b/IndicatorBase.h index 94b662314..c12383fbe 100644 --- a/IndicatorBase.h +++ b/IndicatorBase.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/IndicatorData.enum.h b/IndicatorData.enum.h index 12193a557..cadbeaba1 100644 --- a/IndicatorData.enum.h +++ b/IndicatorData.enum.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/IndicatorData.mqh b/IndicatorData.mqh index 48c2c372c..2405b8051 100644 --- a/IndicatorData.mqh +++ b/IndicatorData.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -518,7 +518,7 @@ class IndicatorData : public IndicatorBase { /** * Get pointer to data of indicator. */ - BufferStruct* GetData() { return GetPointer(idata); } + BufferStruct* GetData() { return GET_PTR(idata); } /** * Returns given data source type. Used by i*OnIndicator methods if indicator's Calculate() uses other indicators. diff --git a/IndicatorData.struct.h b/IndicatorData.struct.h index 9d3b1e0a1..04616e9b9 100644 --- a/IndicatorData.struct.h +++ b/IndicatorData.struct.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -127,6 +127,7 @@ struct IndicatorDataEntryValue { Get(_v); return _v; } + void Get(datetime &_out) { _out = (datetime)value.vlong; } void Get(double &_out) { _out = value.vdbl; } void Get(float &_out) { _out = value.vflt; } void Get(int &_out) { _out = value.vint; } diff --git a/IndicatorData.struct.serialize.h b/IndicatorData.struct.serialize.h index 87020224e..aeac18748 100644 --- a/IndicatorData.struct.serialize.h +++ b/IndicatorData.struct.serialize.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/IndicatorData.struct.signal.h b/IndicatorData.struct.signal.h index d865e4129..b75e22b13 100644 --- a/IndicatorData.struct.signal.h +++ b/IndicatorData.struct.signal.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -63,6 +63,7 @@ struct IndicatorSignal { : signals(0) { CalcSignals(_data, _idp, _cp, _m1, _m2); } + // Main methods. // Calculate signal values. void CalcSignals(ARRAY_REF(IndicatorDataEntry, _data), IndicatorDataParams &_idp, ChartParams &_cp, int _m1 = 0, @@ -119,6 +120,7 @@ struct IndicatorSignal { } SetSignal(INDICATOR_SIGNAL_VOLATILE, _is_vola); } + // Signal methods for bitwise operations. /* Getters */ bool CheckSignals(unsigned int _flags) { return (signals & _flags) != 0; } diff --git a/Indicators/Bitwise/Indi_Candle.mqh b/Indicators/Bitwise/Indi_Candle.mqh index 7e4a4f5d3..8f24465b0 100644 --- a/Indicators/Bitwise/Indi_Candle.mqh +++ b/Indicators/Bitwise/Indi_Candle.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Bitwise/Indi_Pattern.mqh b/Indicators/Bitwise/Indi_Pattern.mqh index cc223770c..f86b811af 100644 --- a/Indicators/Bitwise/Indi_Pattern.mqh +++ b/Indicators/Bitwise/Indi_Pattern.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Bitwise/indicators.h b/Indicators/Bitwise/indicators.h index 2cb3bb23c..26bfb4e5a 100644 --- a/Indicators/Bitwise/indicators.h +++ b/Indicators/Bitwise/indicators.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_AC.mqh b/Indicators/Indi_AC.mqh index 2d9e905f8..4fe2c24d7 100644 --- a/Indicators/Indi_AC.mqh +++ b/Indicators/Indi_AC.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_AD.mqh b/Indicators/Indi_AD.mqh index 279f380c4..1240760c9 100644 --- a/Indicators/Indi_AD.mqh +++ b/Indicators/Indi_AD.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_ADX.mqh b/Indicators/Indi_ADX.mqh index 527749bc7..e1516d4df 100644 --- a/Indicators/Indi_ADX.mqh +++ b/Indicators/Indi_ADX.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_ADXW.mqh b/Indicators/Indi_ADXW.mqh index 74f1c1f89..4d61bd5d4 100644 --- a/Indicators/Indi_ADXW.mqh +++ b/Indicators/Indi_ADXW.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -40,7 +40,7 @@ struct IndiADXWParams : IndiADXParams { ENUM_TIMEFRAMES _tf = PERIOD_CURRENT) : IndiADXParams(_period, _ap, _shift, _tf) { itype = itype == INDI_NONE || itype == INDI_ADX ? INDI_ADXW : itype; - if (custom_indi_name == "") { + if (custom_indi_name == "" || custom_indi_name == "Examples\\ADX") { SetCustomIndicatorName("Examples\\ADXW"); } }; @@ -119,32 +119,31 @@ class Indi_ADXW : public IndicatorTickOrCandleSource { /** * OnCalculate() method for ADXW indicator. */ - static int Calculate(INDICATOR_CALCULATE_METHOD_PARAMS_LONG, ValueStorage &ExtADXWBuffer, - ValueStorage &ExtPDIBuffer, ValueStorage &ExtNDIBuffer, - ValueStorage &ExtPDSBuffer, ValueStorage &ExtNDSBuffer, - ValueStorage &ExtPDBuffer, ValueStorage &ExtNDBuffer, - ValueStorage &ExtTRBuffer, ValueStorage &ExtATRBuffer, - ValueStorage &ExtDXBuffer, int ExtADXWPeriod) { + static int Calculate(INDICATOR_CALCULATE_METHOD_PARAMS_LONG, ValueStorage &_adxw_buff, + ValueStorage &_pdi_buff, ValueStorage &_ndi_buff, + ValueStorage &_pds_buff, ValueStorage &_nds_buff, + ValueStorage &_pdb_buff, ValueStorage &_nd_buff, ValueStorage &_tr_buff, + ValueStorage &_atr_buff, ValueStorage &_dx_buff, int _adxw_period) { int i; // Checking for bars count. - if (rates_total < ExtADXWPeriod) return (0); + if (rates_total < _adxw_period) return (0); // Detect start position. int start; if (prev_calculated > 1) start = prev_calculated - 1; else { start = 1; - for (i = 0; i < ExtADXWPeriod; i++) { - ExtADXWBuffer[i] = 0; - ExtPDIBuffer[i] = 0; - ExtNDIBuffer[i] = 0; - ExtPDSBuffer[i] = 0; - ExtNDSBuffer[i] = 0; - ExtPDBuffer[i] = 0; - ExtNDBuffer[i] = 0; - ExtTRBuffer[i] = 0; - ExtATRBuffer[i] = 0; - ExtDXBuffer[i] = 0; + for (i = 0; i < _adxw_period; i++) { + _adxw_buff[i] = 0; + _pdi_buff[i] = 0; + _ndi_buff[i] = 0; + _pds_buff[i] = 0; + _nds_buff[i] = 0; + _pdb_buff[i] = 0; + _nd_buff[i] = 0; + _tr_buff[i] = 0; + _atr_buff[i] = 0; + _dx_buff[i] = 0; } } for (i = start; i < rates_total && !IsStopped(); i++) { @@ -168,40 +167,40 @@ class Indi_ADXW : public IndicatorTickOrCandleSource { else tmp_neg = 0.0; } - ExtPDBuffer[i] = tmp_pos; - ExtNDBuffer[i] = tmp_neg; + _pdb_buff[i] = tmp_pos; + _nd_buff[i] = tmp_neg; // Define TR. double tr = MathMax(MathMax(MathAbs(high_price - low_price), MathAbs(high_price - prev_close)), MathAbs(low_price - prev_close)); // Write down TR to TR buffer. - ExtTRBuffer[i] = tr; + _tr_buff[i] = tr; // Fill smoothed positive and negative buffers and TR buffer. - if (i < ExtADXWPeriod) { - ExtATRBuffer[i] = 0.0; - ExtPDIBuffer[i] = 0.0; - ExtNDIBuffer[i] = 0.0; + if (i < _adxw_period) { + _atr_buff[i] = 0.0; + _pdi_buff[i] = 0.0; + _ndi_buff[i] = 0.0; } else { - ExtATRBuffer[i] = SmoothedMA(i, ExtADXWPeriod, ExtATRBuffer[i - 1].Get(), ExtTRBuffer); - ExtPDSBuffer[i] = SmoothedMA(i, ExtADXWPeriod, ExtPDSBuffer[i - 1].Get(), ExtPDBuffer); - ExtNDSBuffer[i] = SmoothedMA(i, ExtADXWPeriod, ExtNDSBuffer[i - 1].Get(), ExtNDBuffer); + _atr_buff[i] = SmoothedMA(i, _adxw_period, _atr_buff[i - 1].Get(), _tr_buff); + _pds_buff[i] = SmoothedMA(i, _adxw_period, _pds_buff[i - 1].Get(), _pdb_buff); + _nds_buff[i] = SmoothedMA(i, _adxw_period, _nds_buff[i - 1].Get(), _nd_buff); } // Calculate PDI and NDI buffers. - if (ExtATRBuffer[i] != 0.0) { - ExtPDIBuffer[i] = 100.0 * ExtPDSBuffer[i].Get() / ExtATRBuffer[i].Get(); - ExtNDIBuffer[i] = 100.0 * ExtNDSBuffer[i].Get() / ExtATRBuffer[i].Get(); + if (_atr_buff[i] != 0.0) { + _pdi_buff[i] = 100.0 * _pds_buff[i].Get() / _atr_buff[i].Get(); + _ndi_buff[i] = 100.0 * _nds_buff[i].Get() / _atr_buff[i].Get(); } else { - ExtPDIBuffer[i] = 0.0; - ExtNDIBuffer[i] = 0.0; + _pdi_buff[i] = 0.0; + _ndi_buff[i] = 0.0; } // Calculate DX buffer. - double dTmp = ExtPDIBuffer[i] + ExtNDIBuffer[i]; + double dTmp = _pdi_buff[i] + _ndi_buff[i]; if (dTmp != 0.0) - dTmp = 100.0 * MathAbs((ExtPDIBuffer[i] - ExtNDIBuffer[i]) / dTmp); + dTmp = 100.0 * MathAbs((_pdi_buff[i] - _ndi_buff[i]) / dTmp); else dTmp = 0.0; - ExtDXBuffer[i] = dTmp; + _dx_buff[i] = dTmp; // Fill ADXW buffer as smoothed DX buffer. - ExtADXWBuffer[i] = SmoothedMA(i, ExtADXWPeriod, ExtADXWBuffer[i - 1].Get(), ExtDXBuffer); + _adxw_buff[i] = SmoothedMA(i, _adxw_period, _adxw_buff[i - 1].Get(), _dx_buff); } // OnCalculate done. Return new prev_calculated. return (rates_total); diff --git a/Indicators/Indi_AMA.mqh b/Indicators/Indi_AMA.mqh index 44151e55e..d8f686c9d 100644 --- a/Indicators/Indi_AMA.mqh +++ b/Indicators/Indi_AMA.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_AO.mqh b/Indicators/Indi_AO.mqh index 783e48562..c7d9671eb 100644 --- a/Indicators/Indi_AO.mqh +++ b/Indicators/Indi_AO.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -152,5 +152,7 @@ class Indi_AO : public IndicatorTickOrCandleSource { /** * Checks if indicator entry values are valid. */ - virtual bool IsValidEntry(IndicatorDataEntry &_entry) { return _entry.values[0].Get() != EMPTY_VALUE; } + virtual bool IsValidEntry(IndicatorDataEntry &_entry) { + return _entry.values[0].Get() != EMPTY_VALUE; + } }; diff --git a/Indicators/Indi_ASI.mqh b/Indicators/Indi_ASI.mqh index d520cfb5d..4c138f997 100644 --- a/Indicators/Indi_ASI.mqh +++ b/Indicators/Indi_ASI.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_ATR.mqh b/Indicators/Indi_ATR.mqh index 37641e945..56f509842 100644 --- a/Indicators/Indi_ATR.mqh +++ b/Indicators/Indi_ATR.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_Alligator.mqh b/Indicators/Indi_Alligator.mqh index c2f1b7532..5631250c0 100644 --- a/Indicators/Indi_Alligator.mqh +++ b/Indicators/Indi_Alligator.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_AppliedPrice.mqh b/Indicators/Indi_AppliedPrice.mqh index 82a8399a9..30c0169a8 100644 --- a/Indicators/Indi_AppliedPrice.mqh +++ b/Indicators/Indi_AppliedPrice.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_BWMFI.mqh b/Indicators/Indi_BWMFI.mqh index a0c71f4f7..c9a058e1b 100644 --- a/Indicators/Indi_BWMFI.mqh +++ b/Indicators/Indi_BWMFI.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_BWZT.mqh b/Indicators/Indi_BWZT.mqh index 34a3f0df9..8164b5f5b 100644 --- a/Indicators/Indi_BWZT.mqh +++ b/Indicators/Indi_BWZT.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_Bands.mqh b/Indicators/Indi_Bands.mqh index 440158315..b9ba9f938 100644 --- a/Indicators/Indi_Bands.mqh +++ b/Indicators/Indi_Bands.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_BearsPower.mqh b/Indicators/Indi_BearsPower.mqh index edaa5cdd6..ce01fd901 100644 --- a/Indicators/Indi_BearsPower.mqh +++ b/Indicators/Indi_BearsPower.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_BullsPower.mqh b/Indicators/Indi_BullsPower.mqh index dfbc27119..d9a624724 100644 --- a/Indicators/Indi_BullsPower.mqh +++ b/Indicators/Indi_BullsPower.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_CCI.mqh b/Indicators/Indi_CCI.mqh index 57775a615..eeba6f603 100644 --- a/Indicators/Indi_CCI.mqh +++ b/Indicators/Indi_CCI.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_CHO.mqh b/Indicators/Indi_CHO.mqh index 1e05734b0..b6e6127f3 100644 --- a/Indicators/Indi_CHO.mqh +++ b/Indicators/Indi_CHO.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_CHV.mqh b/Indicators/Indi_CHV.mqh index 9d514d3f7..678df5af0 100644 --- a/Indicators/Indi_CHV.mqh +++ b/Indicators/Indi_CHV.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_ColorBars.mqh b/Indicators/Indi_ColorBars.mqh index cb920a588..1fcdc3584 100644 --- a/Indicators/Indi_ColorBars.mqh +++ b/Indicators/Indi_ColorBars.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_ColorCandlesDaily.mqh b/Indicators/Indi_ColorCandlesDaily.mqh index e848eb6f0..ac97914ef 100644 --- a/Indicators/Indi_ColorCandlesDaily.mqh +++ b/Indicators/Indi_ColorCandlesDaily.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_ColorLine.mqh b/Indicators/Indi_ColorLine.mqh index a8f2b30bd..8645ceefb 100644 --- a/Indicators/Indi_ColorLine.mqh +++ b/Indicators/Indi_ColorLine.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_CustomMovingAverage.mqh b/Indicators/Indi_CustomMovingAverage.mqh index 8e4b16e43..06b061ac6 100644 --- a/Indicators/Indi_CustomMovingAverage.mqh +++ b/Indicators/Indi_CustomMovingAverage.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_DEMA.mqh b/Indicators/Indi_DEMA.mqh index 75101e981..74d44fdba 100644 --- a/Indicators/Indi_DEMA.mqh +++ b/Indicators/Indi_DEMA.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_DeMarker.mqh b/Indicators/Indi_DeMarker.mqh index d20b21dab..0b0aad7c0 100644 --- a/Indicators/Indi_DeMarker.mqh +++ b/Indicators/Indi_DeMarker.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_Demo.mqh b/Indicators/Indi_Demo.mqh index 7adc7080e..a58f0a682 100644 --- a/Indicators/Indi_Demo.mqh +++ b/Indicators/Indi_Demo.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_DetrendedPrice.mqh b/Indicators/Indi_DetrendedPrice.mqh index ab3195936..738aa54f4 100644 --- a/Indicators/Indi_DetrendedPrice.mqh +++ b/Indicators/Indi_DetrendedPrice.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_Drawer.mqh b/Indicators/Indi_Drawer.mqh index f5cba6a3f..0ecf06a8f 100644 --- a/Indicators/Indi_Drawer.mqh +++ b/Indicators/Indi_Drawer.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2020, 31337 Investments Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_Drawer.struct.h b/Indicators/Indi_Drawer.struct.h index 90d317ef7..9a245acd8 100644 --- a/Indicators/Indi_Drawer.struct.h +++ b/Indicators/Indi_Drawer.struct.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2020, 31337 Investments Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_Envelopes.mqh b/Indicators/Indi_Envelopes.mqh index 431598d19..fa5aa8954 100644 --- a/Indicators/Indi_Envelopes.mqh +++ b/Indicators/Indi_Envelopes.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_Force.mqh b/Indicators/Indi_Force.mqh index 0880d6ee3..36e8c50a0 100644 --- a/Indicators/Indi_Force.mqh +++ b/Indicators/Indi_Force.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_FractalAdaptiveMA.mqh b/Indicators/Indi_FractalAdaptiveMA.mqh index 33a72fb83..5948a8142 100644 --- a/Indicators/Indi_FractalAdaptiveMA.mqh +++ b/Indicators/Indi_FractalAdaptiveMA.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_Fractals.mqh b/Indicators/Indi_Fractals.mqh index fecd71daf..5690b3e1c 100644 --- a/Indicators/Indi_Fractals.mqh +++ b/Indicators/Indi_Fractals.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_Gator.mqh b/Indicators/Indi_Gator.mqh index dd0b06b7a..7822fa257 100644 --- a/Indicators/Indi_Gator.mqh +++ b/Indicators/Indi_Gator.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_HeikenAshi.mqh b/Indicators/Indi_HeikenAshi.mqh index 637efb682..3d6e13726 100644 --- a/Indicators/Indi_HeikenAshi.mqh +++ b/Indicators/Indi_HeikenAshi.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_Ichimoku.mqh b/Indicators/Indi_Ichimoku.mqh index 16ceaab94..64c0588c0 100644 --- a/Indicators/Indi_Ichimoku.mqh +++ b/Indicators/Indi_Ichimoku.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -183,7 +183,9 @@ class Indi_Ichimoku : public IndicatorTickOrCandleSource { // so we are duplicating it. _entry.values[0] = GetEntryValue(LINE_TENKANSEN, _shift); #endif - _entry.values[(int)LINE_CHIKOUSPAN] = GetEntryValue(LINE_CHIKOUSPAN, _shift + 26); + _entry.values[LINE_SENKOUSPANA] = GetEntryValue(LINE_SENKOUSPANA, _shift + GetKijunSen()); + _entry.values[LINE_SENKOUSPANB] = GetEntryValue(LINE_SENKOUSPANB, _shift + GetKijunSen()); + _entry.values[LINE_CHIKOUSPAN] = GetEntryValue(LINE_CHIKOUSPAN, _shift + GetKijunSen()); } /** diff --git a/Indicators/Indi_Killzones.mqh b/Indicators/Indi_Killzones.mqh index 68cbbfb28..dfc03c4dc 100644 --- a/Indicators/Indi_Killzones.mqh +++ b/Indicators/Indi_Killzones.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_MA.mqh b/Indicators/Indi_MA.mqh index c52ef1332..01f594732 100644 --- a/Indicators/Indi_MA.mqh +++ b/Indicators/Indi_MA.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_MACD.mqh b/Indicators/Indi_MACD.mqh index 4d9518d64..e590f3f7f 100644 --- a/Indicators/Indi_MACD.mqh +++ b/Indicators/Indi_MACD.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -141,7 +141,9 @@ class Indi_MACD : public IndicatorTickOrCandleSource { /** * Checks if indicator entry values are valid. */ - virtual bool IsValidEntry(IndicatorDataEntry &_entry) { return !_entry.HasValue(DBL_MAX); } + virtual bool IsValidEntry(IndicatorDataEntry &_entry) { + return !_entry.HasValue(DBL_MAX); + } /* Getters */ diff --git a/Indicators/Indi_MFI.mqh b/Indicators/Indi_MFI.mqh index 2d8b4a800..475683850 100644 --- a/Indicators/Indi_MFI.mqh +++ b/Indicators/Indi_MFI.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_MassIndex.mqh b/Indicators/Indi_MassIndex.mqh index dbd06b000..9a20d087c 100644 --- a/Indicators/Indi_MassIndex.mqh +++ b/Indicators/Indi_MassIndex.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_Momentum.mqh b/Indicators/Indi_Momentum.mqh index e228e8224..06c137242 100644 --- a/Indicators/Indi_Momentum.mqh +++ b/Indicators/Indi_Momentum.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_OBV.mqh b/Indicators/Indi_OBV.mqh index 7410d831a..933d47ca7 100644 --- a/Indicators/Indi_OBV.mqh +++ b/Indicators/Indi_OBV.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_OsMA.mqh b/Indicators/Indi_OsMA.mqh index 0a81f2308..8c53a3bf6 100644 --- a/Indicators/Indi_OsMA.mqh +++ b/Indicators/Indi_OsMA.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_Pivot.mqh b/Indicators/Indi_Pivot.mqh index e9f98d642..76e1a7d7f 100644 --- a/Indicators/Indi_Pivot.mqh +++ b/Indicators/Indi_Pivot.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_PriceChannel.mqh b/Indicators/Indi_PriceChannel.mqh index 4d9729599..b02bb2c98 100644 --- a/Indicators/Indi_PriceChannel.mqh +++ b/Indicators/Indi_PriceChannel.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_PriceFeeder.mqh b/Indicators/Indi_PriceFeeder.mqh index 0f0677de9..1e1cf8bab 100644 --- a/Indicators/Indi_PriceFeeder.mqh +++ b/Indicators/Indi_PriceFeeder.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_PriceVolumeTrend.mqh b/Indicators/Indi_PriceVolumeTrend.mqh index 41e642607..fcd22323d 100644 --- a/Indicators/Indi_PriceVolumeTrend.mqh +++ b/Indicators/Indi_PriceVolumeTrend.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_RS.mqh b/Indicators/Indi_RS.mqh index c564e6e6a..c8a657138 100644 --- a/Indicators/Indi_RS.mqh +++ b/Indicators/Indi_RS.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_RSI.mqh b/Indicators/Indi_RSI.mqh index 431d95470..280f5f60f 100644 --- a/Indicators/Indi_RSI.mqh +++ b/Indicators/Indi_RSI.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_RVI.mqh b/Indicators/Indi_RVI.mqh index 4b1458276..a9b041c45 100644 --- a/Indicators/Indi_RVI.mqh +++ b/Indicators/Indi_RVI.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_RateOfChange.mqh b/Indicators/Indi_RateOfChange.mqh index a6c37dd26..a5fba4459 100644 --- a/Indicators/Indi_RateOfChange.mqh +++ b/Indicators/Indi_RateOfChange.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_SAR.mqh b/Indicators/Indi_SAR.mqh index c8a36e4c9..53461fbeb 100644 --- a/Indicators/Indi_SAR.mqh +++ b/Indicators/Indi_SAR.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_StdDev.mqh b/Indicators/Indi_StdDev.mqh index 17a7f250e..9d0d7ec84 100644 --- a/Indicators/Indi_StdDev.mqh +++ b/Indicators/Indi_StdDev.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_Stochastic.mqh b/Indicators/Indi_Stochastic.mqh index 3a5ec7444..9aba9ec05 100644 --- a/Indicators/Indi_Stochastic.mqh +++ b/Indicators/Indi_Stochastic.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -145,7 +145,9 @@ class Indi_Stochastic : public IndicatorTickOrCandleSource { /** * Checks if indicator entry values are valid. */ - virtual bool IsValidEntry(IndicatorDataEntry &_entry) { return _entry.IsWithinRange(0, 101); } + virtual bool IsValidEntry(IndicatorDataEntry &_entry) { + return _entry.IsWithinRange(0, 101); + } /* Getters */ diff --git a/Indicators/Indi_TEMA.mqh b/Indicators/Indi_TEMA.mqh index 73c71241c..d69d90ffc 100644 --- a/Indicators/Indi_TEMA.mqh +++ b/Indicators/Indi_TEMA.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_TRIX.mqh b/Indicators/Indi_TRIX.mqh index c8be21d65..1b3bf67c2 100644 --- a/Indicators/Indi_TRIX.mqh +++ b/Indicators/Indi_TRIX.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_UltimateOscillator.mqh b/Indicators/Indi_UltimateOscillator.mqh index 906a79de3..0272f2d80 100644 --- a/Indicators/Indi_UltimateOscillator.mqh +++ b/Indicators/Indi_UltimateOscillator.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_VIDYA.mqh b/Indicators/Indi_VIDYA.mqh index cf799aa28..24025c1b0 100644 --- a/Indicators/Indi_VIDYA.mqh +++ b/Indicators/Indi_VIDYA.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_VROC.mqh b/Indicators/Indi_VROC.mqh index 98433c611..0ee27980b 100644 --- a/Indicators/Indi_VROC.mqh +++ b/Indicators/Indi_VROC.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_Volumes.mqh b/Indicators/Indi_Volumes.mqh index 46a12532c..d0632aeda 100644 --- a/Indicators/Indi_Volumes.mqh +++ b/Indicators/Indi_Volumes.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_WPR.mqh b/Indicators/Indi_WPR.mqh index f53c655ec..a04c6cd8f 100644 --- a/Indicators/Indi_WPR.mqh +++ b/Indicators/Indi_WPR.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_WilliamsAD.mqh b/Indicators/Indi_WilliamsAD.mqh index 5a09d153c..87bfb5b01 100644 --- a/Indicators/Indi_WilliamsAD.mqh +++ b/Indicators/Indi_WilliamsAD.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Indi_ZigZag.mqh b/Indicators/Indi_ZigZag.mqh index ad6effa22..281664f9a 100644 --- a/Indicators/Indi_ZigZag.mqh +++ b/Indicators/Indi_ZigZag.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -374,7 +374,9 @@ class Indi_ZigZag : public IndicatorTickOrCandleSource { /** * Checks if indicator entry values are valid. */ - virtual bool IsValidEntry(IndicatorDataEntry &_entry) { return !_entry.HasValue(EMPTY_VALUE); } + virtual bool IsValidEntry(IndicatorDataEntry &_entry) { + return !_entry.HasValue(EMPTY_VALUE); + } /* Getters */ diff --git a/Indicators/Indi_ZigZagColor.mqh b/Indicators/Indi_ZigZagColor.mqh index 4dd0303a4..63a569429 100644 --- a/Indicators/Indi_ZigZagColor.mqh +++ b/Indicators/Indi_ZigZagColor.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -311,7 +311,9 @@ class Indi_ZigZagColor : public IndicatorTickOrCandleSource() != EMPTY_VALUE; } + virtual bool IsValidEntry(IndicatorDataEntry &_entry) { + return _entry.values[0].Get() != EMPTY_VALUE; + } /* Getters */ diff --git a/Indicators/OHLC/Indi_OHLC.mqh b/Indicators/OHLC/Indi_OHLC.mqh index 21fa2319d..e1018bfc6 100644 --- a/Indicators/OHLC/Indi_OHLC.mqh +++ b/Indicators/OHLC/Indi_OHLC.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/OHLC/indicators.h b/Indicators/OHLC/indicators.h index be9752c28..9505d5926 100644 --- a/Indicators/OHLC/indicators.h +++ b/Indicators/OHLC/indicators.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Price/Indi_Price.mqh b/Indicators/Price/Indi_Price.mqh index e8a97a0c6..87073dc81 100644 --- a/Indicators/Price/Indi_Price.mqh +++ b/Indicators/Price/Indi_Price.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Price/indicators.h b/Indicators/Price/indicators.h index 2186dee41..9d03bab40 100644 --- a/Indicators/Price/indicators.h +++ b/Indicators/Price/indicators.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Special/Indi_Custom.mqh b/Indicators/Special/Indi_Custom.mqh index c23a3c19f..7820b98b5 100644 --- a/Indicators/Special/Indi_Custom.mqh +++ b/Indicators/Special/Indi_Custom.mqh @@ -1,5 +1,5 @@ //+------------------------------------------------------------------+ -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Special/Indi_Math.mqh b/Indicators/Special/Indi_Math.mqh index dcf43f01b..6cf694d13 100644 --- a/Indicators/Special/Indi_Math.mqh +++ b/Indicators/Special/Indi_Math.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Special/indicators.h b/Indicators/Special/indicators.h index a99faecca..c93850078 100644 --- a/Indicators/Special/indicators.h +++ b/Indicators/Special/indicators.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Special/tests/Indi_Custom.test.mq4 b/Indicators/Special/tests/Indi_Custom.test.mq4 index bb3fffd61..99489217c 100644 --- a/Indicators/Special/tests/Indi_Custom.test.mq4 +++ b/Indicators/Special/tests/Indi_Custom.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Special/tests/Indi_Custom.test.mq5 b/Indicators/Special/tests/Indi_Custom.test.mq5 index 9806b1ef0..1a95c5c96 100644 --- a/Indicators/Special/tests/Indi_Custom.test.mq5 +++ b/Indicators/Special/tests/Indi_Custom.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Tick/Indi_TickMt.mqh b/Indicators/Tick/Indi_TickMt.mqh index 8b1b39d4a..be6ac8008 100644 --- a/Indicators/Tick/Indi_TickMt.mqh +++ b/Indicators/Tick/Indi_TickMt.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Tick/tests/Indi_TickMt.test.mq4 b/Indicators/Tick/tests/Indi_TickMt.test.mq4 index 091a1ba01..0ed26d3f7 100644 --- a/Indicators/Tick/tests/Indi_TickMt.test.mq4 +++ b/Indicators/Tick/tests/Indi_TickMt.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/Tick/tests/Indi_TickMt.test.mq5 b/Indicators/Tick/tests/Indi_TickMt.test.mq5 index e77d1ee23..81e330ca3 100644 --- a/Indicators/Tick/tests/Indi_TickMt.test.mq5 +++ b/Indicators/Tick/tests/Indi_TickMt.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/indicators.h b/Indicators/indicators.h index 027140284..4d4e1821b 100644 --- a/Indicators/indicators.h +++ b/Indicators/indicators.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_AC.test.mq4 b/Indicators/tests/Indi_AC.test.mq4 index 8356c50b5..f454573e4 100644 --- a/Indicators/tests/Indi_AC.test.mq4 +++ b/Indicators/tests/Indi_AC.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_AC.test.mq5 b/Indicators/tests/Indi_AC.test.mq5 index 4dc40b4ae..e400f050a 100644 --- a/Indicators/tests/Indi_AC.test.mq5 +++ b/Indicators/tests/Indi_AC.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_AD.test.mq4 b/Indicators/tests/Indi_AD.test.mq4 index ed7ed321f..45e1076ae 100644 --- a/Indicators/tests/Indi_AD.test.mq4 +++ b/Indicators/tests/Indi_AD.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_AD.test.mq5 b/Indicators/tests/Indi_AD.test.mq5 index 1c39ee934..a615bc208 100644 --- a/Indicators/tests/Indi_AD.test.mq5 +++ b/Indicators/tests/Indi_AD.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_ADX.test.mq4 b/Indicators/tests/Indi_ADX.test.mq4 index 15561c2ed..4565cd9be 100644 --- a/Indicators/tests/Indi_ADX.test.mq4 +++ b/Indicators/tests/Indi_ADX.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_ADX.test.mq5 b/Indicators/tests/Indi_ADX.test.mq5 index c9c51c96e..d08879ec0 100644 --- a/Indicators/tests/Indi_ADX.test.mq5 +++ b/Indicators/tests/Indi_ADX.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_ADXW.test.mq4 b/Indicators/tests/Indi_ADXW.test.mq4 index 5ec7cd7b8..dc2497c9a 100644 --- a/Indicators/tests/Indi_ADXW.test.mq4 +++ b/Indicators/tests/Indi_ADXW.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_ADXW.test.mq5 b/Indicators/tests/Indi_ADXW.test.mq5 index ceeefe30d..ddd35413e 100644 --- a/Indicators/tests/Indi_ADXW.test.mq5 +++ b/Indicators/tests/Indi_ADXW.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_AMA.test.mq4 b/Indicators/tests/Indi_AMA.test.mq4 index 3e63b0cff..6398df899 100644 --- a/Indicators/tests/Indi_AMA.test.mq4 +++ b/Indicators/tests/Indi_AMA.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_AMA.test.mq5 b/Indicators/tests/Indi_AMA.test.mq5 index 75f32c733..90ea46f07 100644 --- a/Indicators/tests/Indi_AMA.test.mq5 +++ b/Indicators/tests/Indi_AMA.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_AO.test.mq4 b/Indicators/tests/Indi_AO.test.mq4 index 4465f02af..bcd4c9c74 100644 --- a/Indicators/tests/Indi_AO.test.mq4 +++ b/Indicators/tests/Indi_AO.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_AO.test.mq5 b/Indicators/tests/Indi_AO.test.mq5 index 7abd96291..f02e27df3 100644 --- a/Indicators/tests/Indi_AO.test.mq5 +++ b/Indicators/tests/Indi_AO.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_ASI.test.mq4 b/Indicators/tests/Indi_ASI.test.mq4 index cb752b7b5..78d2a40cc 100644 --- a/Indicators/tests/Indi_ASI.test.mq4 +++ b/Indicators/tests/Indi_ASI.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_ASI.test.mq5 b/Indicators/tests/Indi_ASI.test.mq5 index 0c59eb783..ce94445c2 100644 --- a/Indicators/tests/Indi_ASI.test.mq5 +++ b/Indicators/tests/Indi_ASI.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_ATR.test.mq4 b/Indicators/tests/Indi_ATR.test.mq4 index 40b9b1c95..e499dc3a7 100644 --- a/Indicators/tests/Indi_ATR.test.mq4 +++ b/Indicators/tests/Indi_ATR.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_ATR.test.mq5 b/Indicators/tests/Indi_ATR.test.mq5 index ca5cb5b82..203da7ccc 100644 --- a/Indicators/tests/Indi_ATR.test.mq5 +++ b/Indicators/tests/Indi_ATR.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_Alligator.test.mq4 b/Indicators/tests/Indi_Alligator.test.mq4 index 06855e38d..38a1166ec 100644 --- a/Indicators/tests/Indi_Alligator.test.mq4 +++ b/Indicators/tests/Indi_Alligator.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_Alligator.test.mq5 b/Indicators/tests/Indi_Alligator.test.mq5 index 958355e9e..d85cea75b 100644 --- a/Indicators/tests/Indi_Alligator.test.mq5 +++ b/Indicators/tests/Indi_Alligator.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_AppliedPrice.test.mq4 b/Indicators/tests/Indi_AppliedPrice.test.mq4 index b0ce7cd3d..a159a8e6d 100644 --- a/Indicators/tests/Indi_AppliedPrice.test.mq4 +++ b/Indicators/tests/Indi_AppliedPrice.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_AppliedPrice.test.mq5 b/Indicators/tests/Indi_AppliedPrice.test.mq5 index 24b162c0e..e1b643be8 100644 --- a/Indicators/tests/Indi_AppliedPrice.test.mq5 +++ b/Indicators/tests/Indi_AppliedPrice.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_BWMFI.test.mq4 b/Indicators/tests/Indi_BWMFI.test.mq4 index 3db17f482..aa966dfe6 100644 --- a/Indicators/tests/Indi_BWMFI.test.mq4 +++ b/Indicators/tests/Indi_BWMFI.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_BWMFI.test.mq5 b/Indicators/tests/Indi_BWMFI.test.mq5 index 475a37837..ed6955ed1 100644 --- a/Indicators/tests/Indi_BWMFI.test.mq5 +++ b/Indicators/tests/Indi_BWMFI.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_BWZT.test.mq4 b/Indicators/tests/Indi_BWZT.test.mq4 index 63b312f58..5aabf1566 100644 --- a/Indicators/tests/Indi_BWZT.test.mq4 +++ b/Indicators/tests/Indi_BWZT.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_BWZT.test.mq5 b/Indicators/tests/Indi_BWZT.test.mq5 index 89ff8662a..2dca14f35 100644 --- a/Indicators/tests/Indi_BWZT.test.mq5 +++ b/Indicators/tests/Indi_BWZT.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_Bands.test.mq4 b/Indicators/tests/Indi_Bands.test.mq4 index 78e550018..a5de70288 100644 --- a/Indicators/tests/Indi_Bands.test.mq4 +++ b/Indicators/tests/Indi_Bands.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_Bands.test.mq5 b/Indicators/tests/Indi_Bands.test.mq5 index 2dfdc7769..26c1bd4b5 100644 --- a/Indicators/tests/Indi_Bands.test.mq5 +++ b/Indicators/tests/Indi_Bands.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_BearsPower.test.mq4 b/Indicators/tests/Indi_BearsPower.test.mq4 index 8d43b3c60..05afff998 100644 --- a/Indicators/tests/Indi_BearsPower.test.mq4 +++ b/Indicators/tests/Indi_BearsPower.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_BearsPower.test.mq5 b/Indicators/tests/Indi_BearsPower.test.mq5 index 4ddb266f7..817e6476c 100644 --- a/Indicators/tests/Indi_BearsPower.test.mq5 +++ b/Indicators/tests/Indi_BearsPower.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_BullsPower.test.mq4 b/Indicators/tests/Indi_BullsPower.test.mq4 index d9fc05869..c44d4d96b 100644 --- a/Indicators/tests/Indi_BullsPower.test.mq4 +++ b/Indicators/tests/Indi_BullsPower.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_BullsPower.test.mq5 b/Indicators/tests/Indi_BullsPower.test.mq5 index 0bed158b0..8b840d95d 100644 --- a/Indicators/tests/Indi_BullsPower.test.mq5 +++ b/Indicators/tests/Indi_BullsPower.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_CCI.test.mq4 b/Indicators/tests/Indi_CCI.test.mq4 index 309271938..41d4ba5c8 100644 --- a/Indicators/tests/Indi_CCI.test.mq4 +++ b/Indicators/tests/Indi_CCI.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_CCI.test.mq5 b/Indicators/tests/Indi_CCI.test.mq5 index 881e5e410..bc0e12b8c 100644 --- a/Indicators/tests/Indi_CCI.test.mq5 +++ b/Indicators/tests/Indi_CCI.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_CHO.test.mq4 b/Indicators/tests/Indi_CHO.test.mq4 index 11acc3005..5ab3e7a46 100644 --- a/Indicators/tests/Indi_CHO.test.mq4 +++ b/Indicators/tests/Indi_CHO.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_CHO.test.mq5 b/Indicators/tests/Indi_CHO.test.mq5 index a03564d75..bff8bdcef 100644 --- a/Indicators/tests/Indi_CHO.test.mq5 +++ b/Indicators/tests/Indi_CHO.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_CHV.test.mq4 b/Indicators/tests/Indi_CHV.test.mq4 index e190dc77d..b3cdf4a59 100644 --- a/Indicators/tests/Indi_CHV.test.mq4 +++ b/Indicators/tests/Indi_CHV.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_CHV.test.mq5 b/Indicators/tests/Indi_CHV.test.mq5 index 6069a1785..27c3ae17f 100644 --- a/Indicators/tests/Indi_CHV.test.mq5 +++ b/Indicators/tests/Indi_CHV.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_ColorBars.test.mq4 b/Indicators/tests/Indi_ColorBars.test.mq4 index 0858213d2..cd735e9bd 100644 --- a/Indicators/tests/Indi_ColorBars.test.mq4 +++ b/Indicators/tests/Indi_ColorBars.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_ColorBars.test.mq5 b/Indicators/tests/Indi_ColorBars.test.mq5 index 834c4cc0b..c684a8a1e 100644 --- a/Indicators/tests/Indi_ColorBars.test.mq5 +++ b/Indicators/tests/Indi_ColorBars.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_ColorCandlesDaily.test.mq4 b/Indicators/tests/Indi_ColorCandlesDaily.test.mq4 index d77adc574..984c0a9c4 100644 --- a/Indicators/tests/Indi_ColorCandlesDaily.test.mq4 +++ b/Indicators/tests/Indi_ColorCandlesDaily.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_ColorCandlesDaily.test.mq5 b/Indicators/tests/Indi_ColorCandlesDaily.test.mq5 index 8c64498aa..22a5fdca0 100644 --- a/Indicators/tests/Indi_ColorCandlesDaily.test.mq5 +++ b/Indicators/tests/Indi_ColorCandlesDaily.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_ColorLine.test.mq4 b/Indicators/tests/Indi_ColorLine.test.mq4 index 0199b7560..c99cca1f4 100644 --- a/Indicators/tests/Indi_ColorLine.test.mq4 +++ b/Indicators/tests/Indi_ColorLine.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_ColorLine.test.mq5 b/Indicators/tests/Indi_ColorLine.test.mq5 index 87263fa3b..8e8f93004 100644 --- a/Indicators/tests/Indi_ColorLine.test.mq5 +++ b/Indicators/tests/Indi_ColorLine.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_CustomMovingAverage.test.mq4 b/Indicators/tests/Indi_CustomMovingAverage.test.mq4 index b42e19e49..33e0589c0 100644 --- a/Indicators/tests/Indi_CustomMovingAverage.test.mq4 +++ b/Indicators/tests/Indi_CustomMovingAverage.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_CustomMovingAverage.test.mq5 b/Indicators/tests/Indi_CustomMovingAverage.test.mq5 index 6fb79b217..8ea1924b6 100644 --- a/Indicators/tests/Indi_CustomMovingAverage.test.mq5 +++ b/Indicators/tests/Indi_CustomMovingAverage.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_DEMA.test.mq4 b/Indicators/tests/Indi_DEMA.test.mq4 index c2a168889..cd0dd96d3 100644 --- a/Indicators/tests/Indi_DEMA.test.mq4 +++ b/Indicators/tests/Indi_DEMA.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_DEMA.test.mq5 b/Indicators/tests/Indi_DEMA.test.mq5 index 56adc5e7a..03f7f50e1 100644 --- a/Indicators/tests/Indi_DEMA.test.mq5 +++ b/Indicators/tests/Indi_DEMA.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_DeMarker.test.mq4 b/Indicators/tests/Indi_DeMarker.test.mq4 index cc63b04c8..9f2e28a4f 100644 --- a/Indicators/tests/Indi_DeMarker.test.mq4 +++ b/Indicators/tests/Indi_DeMarker.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_DeMarker.test.mq5 b/Indicators/tests/Indi_DeMarker.test.mq5 index 3f9463fdf..aba5a71f0 100644 --- a/Indicators/tests/Indi_DeMarker.test.mq5 +++ b/Indicators/tests/Indi_DeMarker.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_Demo.test.mq4 b/Indicators/tests/Indi_Demo.test.mq4 index d5056995e..f7bb53956 100644 --- a/Indicators/tests/Indi_Demo.test.mq4 +++ b/Indicators/tests/Indi_Demo.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_Demo.test.mq5 b/Indicators/tests/Indi_Demo.test.mq5 index e9e57915b..e709567b8 100644 --- a/Indicators/tests/Indi_Demo.test.mq5 +++ b/Indicators/tests/Indi_Demo.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_DetrendedPrice.test.mq4 b/Indicators/tests/Indi_DetrendedPrice.test.mq4 index 297f2c81a..e2cf12d52 100644 --- a/Indicators/tests/Indi_DetrendedPrice.test.mq4 +++ b/Indicators/tests/Indi_DetrendedPrice.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_DetrendedPrice.test.mq5 b/Indicators/tests/Indi_DetrendedPrice.test.mq5 index 649acff12..afaa2a1a4 100644 --- a/Indicators/tests/Indi_DetrendedPrice.test.mq5 +++ b/Indicators/tests/Indi_DetrendedPrice.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_Drawer.test.mq4 b/Indicators/tests/Indi_Drawer.test.mq4 index 32cf4a1e2..19086fd54 100644 --- a/Indicators/tests/Indi_Drawer.test.mq4 +++ b/Indicators/tests/Indi_Drawer.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_Drawer.test.mq5 b/Indicators/tests/Indi_Drawer.test.mq5 index 2974fdd18..93011f0d4 100644 --- a/Indicators/tests/Indi_Drawer.test.mq5 +++ b/Indicators/tests/Indi_Drawer.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_Envelopes.test.mq4 b/Indicators/tests/Indi_Envelopes.test.mq4 index af9885c8e..ef5521653 100644 --- a/Indicators/tests/Indi_Envelopes.test.mq4 +++ b/Indicators/tests/Indi_Envelopes.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_Envelopes.test.mq5 b/Indicators/tests/Indi_Envelopes.test.mq5 index 7228f7173..edd27781b 100644 --- a/Indicators/tests/Indi_Envelopes.test.mq5 +++ b/Indicators/tests/Indi_Envelopes.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_Force.test.mq4 b/Indicators/tests/Indi_Force.test.mq4 index aefa93e28..ccc628469 100644 --- a/Indicators/tests/Indi_Force.test.mq4 +++ b/Indicators/tests/Indi_Force.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_Force.test.mq5 b/Indicators/tests/Indi_Force.test.mq5 index 5786defee..7162e74dc 100644 --- a/Indicators/tests/Indi_Force.test.mq5 +++ b/Indicators/tests/Indi_Force.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_FractalAdaptiveMA.test.mq4 b/Indicators/tests/Indi_FractalAdaptiveMA.test.mq4 index 1073b537d..ac209b061 100644 --- a/Indicators/tests/Indi_FractalAdaptiveMA.test.mq4 +++ b/Indicators/tests/Indi_FractalAdaptiveMA.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_FractalAdaptiveMA.test.mq5 b/Indicators/tests/Indi_FractalAdaptiveMA.test.mq5 index 764fcd0a5..2c4383374 100644 --- a/Indicators/tests/Indi_FractalAdaptiveMA.test.mq5 +++ b/Indicators/tests/Indi_FractalAdaptiveMA.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_Fractals.test.mq4 b/Indicators/tests/Indi_Fractals.test.mq4 index 74575bfef..fb5ab315b 100644 --- a/Indicators/tests/Indi_Fractals.test.mq4 +++ b/Indicators/tests/Indi_Fractals.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_Fractals.test.mq5 b/Indicators/tests/Indi_Fractals.test.mq5 index 29ad57f99..fd2846139 100644 --- a/Indicators/tests/Indi_Fractals.test.mq5 +++ b/Indicators/tests/Indi_Fractals.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_Gator.test.mq4 b/Indicators/tests/Indi_Gator.test.mq4 index 017e97229..946003c00 100644 --- a/Indicators/tests/Indi_Gator.test.mq4 +++ b/Indicators/tests/Indi_Gator.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_Gator.test.mq5 b/Indicators/tests/Indi_Gator.test.mq5 index 8fe178124..20e2df7fc 100644 --- a/Indicators/tests/Indi_Gator.test.mq5 +++ b/Indicators/tests/Indi_Gator.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_HeikenAshi.test.mq4 b/Indicators/tests/Indi_HeikenAshi.test.mq4 index 7412e5399..028ca0ba3 100644 --- a/Indicators/tests/Indi_HeikenAshi.test.mq4 +++ b/Indicators/tests/Indi_HeikenAshi.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_HeikenAshi.test.mq5 b/Indicators/tests/Indi_HeikenAshi.test.mq5 index f4c8d3998..fcc580a47 100644 --- a/Indicators/tests/Indi_HeikenAshi.test.mq5 +++ b/Indicators/tests/Indi_HeikenAshi.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_Ichimoku.test.mq4 b/Indicators/tests/Indi_Ichimoku.test.mq4 index 942b84bd7..da6024286 100644 --- a/Indicators/tests/Indi_Ichimoku.test.mq4 +++ b/Indicators/tests/Indi_Ichimoku.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_Ichimoku.test.mq5 b/Indicators/tests/Indi_Ichimoku.test.mq5 index 709247069..8b999b69b 100644 --- a/Indicators/tests/Indi_Ichimoku.test.mq5 +++ b/Indicators/tests/Indi_Ichimoku.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_Killzones.test.mq4 b/Indicators/tests/Indi_Killzones.test.mq4 index 12f792f2c..bf0bf3b9b 100644 --- a/Indicators/tests/Indi_Killzones.test.mq4 +++ b/Indicators/tests/Indi_Killzones.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_Killzones.test.mq5 b/Indicators/tests/Indi_Killzones.test.mq5 index 4f549f104..4dbc7668c 100644 --- a/Indicators/tests/Indi_Killzones.test.mq5 +++ b/Indicators/tests/Indi_Killzones.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_MA.test.mq4 b/Indicators/tests/Indi_MA.test.mq4 index 89d4ee4b4..c221c8ab1 100644 --- a/Indicators/tests/Indi_MA.test.mq4 +++ b/Indicators/tests/Indi_MA.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_MA.test.mq5 b/Indicators/tests/Indi_MA.test.mq5 index 37cf4f59e..fdb9c393a 100644 --- a/Indicators/tests/Indi_MA.test.mq5 +++ b/Indicators/tests/Indi_MA.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_MACD.test.mq4 b/Indicators/tests/Indi_MACD.test.mq4 index e03f0a44b..b04cfc9e7 100644 --- a/Indicators/tests/Indi_MACD.test.mq4 +++ b/Indicators/tests/Indi_MACD.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_MACD.test.mq5 b/Indicators/tests/Indi_MACD.test.mq5 index 97d3d53f1..52cacd0ca 100644 --- a/Indicators/tests/Indi_MACD.test.mq5 +++ b/Indicators/tests/Indi_MACD.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_MFI.test.mq4 b/Indicators/tests/Indi_MFI.test.mq4 index d6e3a1c9e..59e118b94 100644 --- a/Indicators/tests/Indi_MFI.test.mq4 +++ b/Indicators/tests/Indi_MFI.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_MFI.test.mq5 b/Indicators/tests/Indi_MFI.test.mq5 index 0fa0b720d..6666488a1 100644 --- a/Indicators/tests/Indi_MFI.test.mq5 +++ b/Indicators/tests/Indi_MFI.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_MassIndex.test.mq4 b/Indicators/tests/Indi_MassIndex.test.mq4 index 9a53fa65f..9584d00a0 100644 --- a/Indicators/tests/Indi_MassIndex.test.mq4 +++ b/Indicators/tests/Indi_MassIndex.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_MassIndex.test.mq5 b/Indicators/tests/Indi_MassIndex.test.mq5 index 8fb2c6743..5360b3ad3 100644 --- a/Indicators/tests/Indi_MassIndex.test.mq5 +++ b/Indicators/tests/Indi_MassIndex.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_Momentum.test.mq4 b/Indicators/tests/Indi_Momentum.test.mq4 index 31fb68c33..5da496ca7 100644 --- a/Indicators/tests/Indi_Momentum.test.mq4 +++ b/Indicators/tests/Indi_Momentum.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_Momentum.test.mq5 b/Indicators/tests/Indi_Momentum.test.mq5 index 51342715e..33b154e9d 100644 --- a/Indicators/tests/Indi_Momentum.test.mq5 +++ b/Indicators/tests/Indi_Momentum.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_OBV.test.mq4 b/Indicators/tests/Indi_OBV.test.mq4 index 372045b77..223d82439 100644 --- a/Indicators/tests/Indi_OBV.test.mq4 +++ b/Indicators/tests/Indi_OBV.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_OBV.test.mq5 b/Indicators/tests/Indi_OBV.test.mq5 index 7e328a763..8fdfacefe 100644 --- a/Indicators/tests/Indi_OBV.test.mq5 +++ b/Indicators/tests/Indi_OBV.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_OHLC.test.mq4 b/Indicators/tests/Indi_OHLC.test.mq4 index 86c9f2cdf..841830833 100644 --- a/Indicators/tests/Indi_OHLC.test.mq4 +++ b/Indicators/tests/Indi_OHLC.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_OHLC.test.mq5 b/Indicators/tests/Indi_OHLC.test.mq5 index 533f3c7f5..802449028 100644 --- a/Indicators/tests/Indi_OHLC.test.mq5 +++ b/Indicators/tests/Indi_OHLC.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_OsMA.test.mq4 b/Indicators/tests/Indi_OsMA.test.mq4 index 476dfe415..4867ee3c1 100644 --- a/Indicators/tests/Indi_OsMA.test.mq4 +++ b/Indicators/tests/Indi_OsMA.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_OsMA.test.mq5 b/Indicators/tests/Indi_OsMA.test.mq5 index 4a6450c5d..0c00d4075 100644 --- a/Indicators/tests/Indi_OsMA.test.mq5 +++ b/Indicators/tests/Indi_OsMA.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_Pattern.test.mq4 b/Indicators/tests/Indi_Pattern.test.mq4 index 155c7b60a..450365f04 100644 --- a/Indicators/tests/Indi_Pattern.test.mq4 +++ b/Indicators/tests/Indi_Pattern.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_Pattern.test.mq5 b/Indicators/tests/Indi_Pattern.test.mq5 index 329c12ee4..09c978a9e 100644 --- a/Indicators/tests/Indi_Pattern.test.mq5 +++ b/Indicators/tests/Indi_Pattern.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_Pivot.test.mq4 b/Indicators/tests/Indi_Pivot.test.mq4 index b1d3c5773..3cf7213c9 100644 --- a/Indicators/tests/Indi_Pivot.test.mq4 +++ b/Indicators/tests/Indi_Pivot.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_Pivot.test.mq5 b/Indicators/tests/Indi_Pivot.test.mq5 index 0a634f945..d179212e7 100644 --- a/Indicators/tests/Indi_Pivot.test.mq5 +++ b/Indicators/tests/Indi_Pivot.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_Price.test.mq4 b/Indicators/tests/Indi_Price.test.mq4 index 5f07803bc..eeaf181ab 100644 --- a/Indicators/tests/Indi_Price.test.mq4 +++ b/Indicators/tests/Indi_Price.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_Price.test.mq5 b/Indicators/tests/Indi_Price.test.mq5 index e0853220f..ab22fd38e 100644 --- a/Indicators/tests/Indi_Price.test.mq5 +++ b/Indicators/tests/Indi_Price.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_PriceChannel.test.mq4 b/Indicators/tests/Indi_PriceChannel.test.mq4 index 23b54fa5e..52ab4fc26 100644 --- a/Indicators/tests/Indi_PriceChannel.test.mq4 +++ b/Indicators/tests/Indi_PriceChannel.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_PriceChannel.test.mq5 b/Indicators/tests/Indi_PriceChannel.test.mq5 index 1fc980565..56238d6d8 100644 --- a/Indicators/tests/Indi_PriceChannel.test.mq5 +++ b/Indicators/tests/Indi_PriceChannel.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_PriceFeeder.test.mq4 b/Indicators/tests/Indi_PriceFeeder.test.mq4 index 6976c01ec..b5158d9cd 100644 --- a/Indicators/tests/Indi_PriceFeeder.test.mq4 +++ b/Indicators/tests/Indi_PriceFeeder.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_PriceFeeder.test.mq5 b/Indicators/tests/Indi_PriceFeeder.test.mq5 index b2d6afdca..119d633b6 100644 --- a/Indicators/tests/Indi_PriceFeeder.test.mq5 +++ b/Indicators/tests/Indi_PriceFeeder.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_PriceVolumeTrend.test.mq4 b/Indicators/tests/Indi_PriceVolumeTrend.test.mq4 index 45a6e2c09..81517df61 100644 --- a/Indicators/tests/Indi_PriceVolumeTrend.test.mq4 +++ b/Indicators/tests/Indi_PriceVolumeTrend.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_PriceVolumeTrend.test.mq5 b/Indicators/tests/Indi_PriceVolumeTrend.test.mq5 index b2f09c527..bb875c550 100644 --- a/Indicators/tests/Indi_PriceVolumeTrend.test.mq5 +++ b/Indicators/tests/Indi_PriceVolumeTrend.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_RS.test.mq4 b/Indicators/tests/Indi_RS.test.mq4 index 5f191c9ea..ea3865532 100644 --- a/Indicators/tests/Indi_RS.test.mq4 +++ b/Indicators/tests/Indi_RS.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_RS.test.mq5 b/Indicators/tests/Indi_RS.test.mq5 index f68c14045..490dba47b 100644 --- a/Indicators/tests/Indi_RS.test.mq5 +++ b/Indicators/tests/Indi_RS.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_RSI.test.mq4 b/Indicators/tests/Indi_RSI.test.mq4 index b7f5e55d3..e8812ff2e 100644 --- a/Indicators/tests/Indi_RSI.test.mq4 +++ b/Indicators/tests/Indi_RSI.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_RSI.test.mq5 b/Indicators/tests/Indi_RSI.test.mq5 index cd98a97ba..f069228f5 100644 --- a/Indicators/tests/Indi_RSI.test.mq5 +++ b/Indicators/tests/Indi_RSI.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_RVI.test.mq4 b/Indicators/tests/Indi_RVI.test.mq4 index cfd5e372f..80e7bfa4b 100644 --- a/Indicators/tests/Indi_RVI.test.mq4 +++ b/Indicators/tests/Indi_RVI.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_RVI.test.mq5 b/Indicators/tests/Indi_RVI.test.mq5 index 6324c7e87..05f2f6f8a 100644 --- a/Indicators/tests/Indi_RVI.test.mq5 +++ b/Indicators/tests/Indi_RVI.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_RateOfChange.test.mq4 b/Indicators/tests/Indi_RateOfChange.test.mq4 index 6ca89fbef..3842b5ae7 100644 --- a/Indicators/tests/Indi_RateOfChange.test.mq4 +++ b/Indicators/tests/Indi_RateOfChange.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_RateOfChange.test.mq5 b/Indicators/tests/Indi_RateOfChange.test.mq5 index 1f70f4f7d..260b7ab27 100644 --- a/Indicators/tests/Indi_RateOfChange.test.mq5 +++ b/Indicators/tests/Indi_RateOfChange.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_SAR.test.mq4 b/Indicators/tests/Indi_SAR.test.mq4 index cb64f79b4..a054079d6 100644 --- a/Indicators/tests/Indi_SAR.test.mq4 +++ b/Indicators/tests/Indi_SAR.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_SAR.test.mq5 b/Indicators/tests/Indi_SAR.test.mq5 index afe3d9797..09ca28513 100644 --- a/Indicators/tests/Indi_SAR.test.mq5 +++ b/Indicators/tests/Indi_SAR.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_StdDev.test.mq4 b/Indicators/tests/Indi_StdDev.test.mq4 index e36c47034..e0d32737d 100644 --- a/Indicators/tests/Indi_StdDev.test.mq4 +++ b/Indicators/tests/Indi_StdDev.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_StdDev.test.mq5 b/Indicators/tests/Indi_StdDev.test.mq5 index d504ceb9f..53dc3720a 100644 --- a/Indicators/tests/Indi_StdDev.test.mq5 +++ b/Indicators/tests/Indi_StdDev.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_Stochastic.test.mq4 b/Indicators/tests/Indi_Stochastic.test.mq4 index 54658083e..d6b18b510 100644 --- a/Indicators/tests/Indi_Stochastic.test.mq4 +++ b/Indicators/tests/Indi_Stochastic.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_Stochastic.test.mq5 b/Indicators/tests/Indi_Stochastic.test.mq5 index cfa651611..08cefb694 100644 --- a/Indicators/tests/Indi_Stochastic.test.mq5 +++ b/Indicators/tests/Indi_Stochastic.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_TEMA.test.mq4 b/Indicators/tests/Indi_TEMA.test.mq4 index 41332b6a6..005f7d617 100644 --- a/Indicators/tests/Indi_TEMA.test.mq4 +++ b/Indicators/tests/Indi_TEMA.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_TEMA.test.mq5 b/Indicators/tests/Indi_TEMA.test.mq5 index 9c6a2d630..3d03b442d 100644 --- a/Indicators/tests/Indi_TEMA.test.mq5 +++ b/Indicators/tests/Indi_TEMA.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_TRIX.test.mq4 b/Indicators/tests/Indi_TRIX.test.mq4 index be5579c93..6d118bdd0 100644 --- a/Indicators/tests/Indi_TRIX.test.mq4 +++ b/Indicators/tests/Indi_TRIX.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_TRIX.test.mq5 b/Indicators/tests/Indi_TRIX.test.mq5 index 1c3e1ef82..69d9b855f 100644 --- a/Indicators/tests/Indi_TRIX.test.mq5 +++ b/Indicators/tests/Indi_TRIX.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_UltimateOscillator.test.mq4 b/Indicators/tests/Indi_UltimateOscillator.test.mq4 index ec6d67e78..355bae804 100644 --- a/Indicators/tests/Indi_UltimateOscillator.test.mq4 +++ b/Indicators/tests/Indi_UltimateOscillator.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_UltimateOscillator.test.mq5 b/Indicators/tests/Indi_UltimateOscillator.test.mq5 index 3d0c5fdb7..419662594 100644 --- a/Indicators/tests/Indi_UltimateOscillator.test.mq5 +++ b/Indicators/tests/Indi_UltimateOscillator.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_VIDYA.test.mq4 b/Indicators/tests/Indi_VIDYA.test.mq4 index a222007f1..569fac9ef 100644 --- a/Indicators/tests/Indi_VIDYA.test.mq4 +++ b/Indicators/tests/Indi_VIDYA.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_VIDYA.test.mq5 b/Indicators/tests/Indi_VIDYA.test.mq5 index 80ffba097..2fa0eed1d 100644 --- a/Indicators/tests/Indi_VIDYA.test.mq5 +++ b/Indicators/tests/Indi_VIDYA.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_VROC.test.mq4 b/Indicators/tests/Indi_VROC.test.mq4 index 307567add..d5e9eaa55 100644 --- a/Indicators/tests/Indi_VROC.test.mq4 +++ b/Indicators/tests/Indi_VROC.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_VROC.test.mq5 b/Indicators/tests/Indi_VROC.test.mq5 index 1a61e307a..b8a897a70 100644 --- a/Indicators/tests/Indi_VROC.test.mq5 +++ b/Indicators/tests/Indi_VROC.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_Volumes.test.mq4 b/Indicators/tests/Indi_Volumes.test.mq4 index 3b85b25ff..bc13b7199 100644 --- a/Indicators/tests/Indi_Volumes.test.mq4 +++ b/Indicators/tests/Indi_Volumes.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_Volumes.test.mq5 b/Indicators/tests/Indi_Volumes.test.mq5 index b653f8dcb..5c54e41a7 100644 --- a/Indicators/tests/Indi_Volumes.test.mq5 +++ b/Indicators/tests/Indi_Volumes.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_WPR.test.mq4 b/Indicators/tests/Indi_WPR.test.mq4 index 7e3e27097..2db21beba 100644 --- a/Indicators/tests/Indi_WPR.test.mq4 +++ b/Indicators/tests/Indi_WPR.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_WPR.test.mq5 b/Indicators/tests/Indi_WPR.test.mq5 index ff2a919de..9b96369b8 100644 --- a/Indicators/tests/Indi_WPR.test.mq5 +++ b/Indicators/tests/Indi_WPR.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_WilliamsAD.test.mq4 b/Indicators/tests/Indi_WilliamsAD.test.mq4 index c3aa0468a..c4498a22c 100644 --- a/Indicators/tests/Indi_WilliamsAD.test.mq4 +++ b/Indicators/tests/Indi_WilliamsAD.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_WilliamsAD.test.mq5 b/Indicators/tests/Indi_WilliamsAD.test.mq5 index 79a1b25c5..9474ad7ec 100644 --- a/Indicators/tests/Indi_WilliamsAD.test.mq5 +++ b/Indicators/tests/Indi_WilliamsAD.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_ZigZag.test.mq4 b/Indicators/tests/Indi_ZigZag.test.mq4 index dfe9dc22a..759590e9a 100644 --- a/Indicators/tests/Indi_ZigZag.test.mq4 +++ b/Indicators/tests/Indi_ZigZag.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_ZigZag.test.mq5 b/Indicators/tests/Indi_ZigZag.test.mq5 index a1ac03254..d3f49631c 100644 --- a/Indicators/tests/Indi_ZigZag.test.mq5 +++ b/Indicators/tests/Indi_ZigZag.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_ZigZagColor.test.mq4 b/Indicators/tests/Indi_ZigZagColor.test.mq4 index 750d34430..502937586 100644 --- a/Indicators/tests/Indi_ZigZagColor.test.mq4 +++ b/Indicators/tests/Indi_ZigZagColor.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Indicators/tests/Indi_ZigZagColor.test.mq5 b/Indicators/tests/Indi_ZigZagColor.test.mq5 index 933cebcba..cc53687e4 100644 --- a/Indicators/tests/Indi_ZigZagColor.test.mq5 +++ b/Indicators/tests/Indi_ZigZagColor.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Inet.mqh b/Inet.mqh index 18b40307a..59020473c 100644 --- a/Inet.mqh +++ b/Inet.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Instances.h b/Instances.h index fee38cb80..4f82a2f66 100644 --- a/Instances.h +++ b/Instances.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Log.mqh b/Log.mqh index 2fe4d9719..a87959f00 100644 --- a/Log.mqh +++ b/Log.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -69,6 +69,12 @@ class Log : public Object { Log(ENUM_LOG_LEVEL _log_level = V_INFO, string new_filename = "") : last_entry(-1), last_flush(0), log_level(_log_level), filename(new_filename != "" ? new_filename : "Log.txt") {} + /** + * Class copy constructor. + */ + Log(const Log &_log) : filename(_log.filename), last_entry(_log.last_entry), log_level(_log.log_level) { + } + /** * Class deconstructor. */ diff --git a/MQL4.mqh b/MQL4.mqh index b4a0c5398..972bd3d16 100644 --- a/MQL4.mqh +++ b/MQL4.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/MQL5.mqh b/MQL5.mqh index 584a74fd2..9bbf582a3 100644 --- a/MQL5.mqh +++ b/MQL5.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Mail.mqh b/Mail.mqh index dc22ffac2..f94c30382 100644 --- a/Mail.mqh +++ b/Mail.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Market.mqh b/Market.mqh index 7f99b2646..8f9c4876f 100644 --- a/Market.mqh +++ b/Market.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Market.struct.h b/Market.struct.h index bf9315527..c1e4797d8 100644 --- a/Market.struct.h +++ b/Market.struct.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Math.define.h b/Math.define.h index 6a69aad1d..b1f2e4e50 100644 --- a/Math.define.h +++ b/Math.define.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Math.enum.h b/Math.enum.h index 1b2d3a250..1f324d917 100644 --- a/Math.enum.h +++ b/Math.enum.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Math.extern.h b/Math.extern.h index 4dce9bfe7..948bd1058 100644 --- a/Math.extern.h +++ b/Math.extern.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Math.h b/Math.h index 691837b31..24663c28c 100644 --- a/Math.h +++ b/Math.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -77,12 +77,12 @@ class Math { */ static double ChangeInPct(double _v1, double _v2, bool _hundreds = false) { double _result = 0; - if (_v1 != 0 && _v2 != 0) { - // If values are non-zero, use the standard formula. - _result = (_v2 / _v1) - 1; - } else if (_v1 == 0 || _v2 == 0) { + if (_v1 == 0 || _v2 == 0) { // Change is zero when both values are zeros, otherwise it's 1 (100%). _result = _v1 == 0 && _v2 == 0 ? 0 : 1; + } else { + // If values are non-zero, use the standard formula. + _result = (_v2 / _v1) - 1; } _result = _v2 > _v1 ? fabs(_result) : -fabs(_result); return _hundreds ? _result * 100 : _result; diff --git a/Math.struct.h b/Math.struct.h index c49fdb3a0..8b2b0009c 100644 --- a/Math.struct.h +++ b/Math.struct.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Matrix.mqh b/Matrix.mqh index 59f3eef39..52d3ec533 100644 --- a/Matrix.mqh +++ b/Matrix.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/MiniMatrix.h b/MiniMatrix.h index 3ceaaa5ab..f566500d3 100644 --- a/MiniMatrix.h +++ b/MiniMatrix.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Msg.mqh b/Msg.mqh index 34e7f985f..fb11fcb2c 100644 --- a/Msg.mqh +++ b/Msg.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Object.enum.h b/Object.enum.h index 68d22f513..5e280a4c3 100644 --- a/Object.enum.h +++ b/Object.enum.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 - multi-strategy advanced trading robot. | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Object.extern.h b/Object.extern.h index f8b97dbd8..47ec7734b 100644 --- a/Object.extern.h +++ b/Object.extern.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Object.mqh b/Object.mqh index d0dd1fadb..e34558b45 100644 --- a/Object.mqh +++ b/Object.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 - multi-strategy advanced trading robot. | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -35,11 +35,14 @@ * Class to deal with objects. */ class Object : public Dynamic { + protected: + void *obj; long id; public: + /** * Class constructor. */ @@ -100,7 +103,7 @@ class Object : public Dynamic { /** * Returns text representation of the object. */ - virtual const string ToString() { return StringFormat("[Object #%04x]", GetPointer(this)); } + virtual const string ToString() { return StringFormat("[Object #%04x]", THIS_PTR); } /** * Returns text representation of the object. diff --git a/Order.define.h b/Order.define.h index 930fac47e..0e1ec61ee 100644 --- a/Order.define.h +++ b/Order.define.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 | +//| Copyright 2016-2023, EA31337 | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Order.enum.h b/Order.enum.h index c6489a73d..db1ecbc5a 100644 --- a/Order.enum.h +++ b/Order.enum.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -93,6 +93,7 @@ enum ENUM_ORDER_PROPERTY_CUSTOM { enum ENUM_ORDER_REASON_CLOSE { ORDER_REASON_CLOSED_ALL = 0, // Closed all ORDER_REASON_CLOSED_BY_ACTION, // Closed by action + ORDER_REASON_CLOSED_BY_CONDITION, // Closed by condition ORDER_REASON_CLOSED_BY_EXPIRE, // Closed by expiration ORDER_REASON_CLOSED_BY_OPPOSITE, // Closed by opposite order ORDER_REASON_CLOSED_BY_SIGNAL, // Closed by signal @@ -266,7 +267,7 @@ enum ENUM_POSITION_PROPERTY_DOUBLE { POSITION_VOLUME, // Position volume (double). }; -//#define POSITION_TICKET +// #define POSITION_TICKET /** * Returns integer type of the position property. diff --git a/Order.mqh b/Order.mqh index 5c14f26ae..10c994441 100644 --- a/Order.mqh +++ b/Order.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -167,7 +167,7 @@ class Order : public SymbolInfo { */ ~Order() {} - Log *GetLogger() { return GetPointer(ologger); } + Log *GetLogger() { return GET_PTR(ologger); } /* Getters */ @@ -900,9 +900,11 @@ class Order : public SymbolInfo { MqlTradeCheckResult _result_check = {0}; MqlTradeResult _result = {0}; _request.action = TRADE_ACTION_DEAL; + _request.magic = ::PositionGetInteger(POSITION_MAGIC); _request.position = ::PositionGetInteger(POSITION_TICKET); _request.symbol = ::PositionGetString(POSITION_SYMBOL); _request.type = NegateOrderType((ENUM_POSITION_TYPE)::PositionGetInteger(POSITION_TYPE)); + _request.type_filling = GetOrderFilling(_request.symbol); _request.volume = _lots; _request.price = _price; _request.deviation = _deviation; @@ -920,33 +922,48 @@ class Order : public SymbolInfo { return false; } } + Refresh(ORDER_PRICE_CURRENT); MqlTradeRequest _request = {(ENUM_TRADE_REQUEST_ACTIONS)0}; MqlTradeResult _result = {0}; _request.action = TRADE_ACTION_DEAL; - _request.comment = _comment != "" ? _comment : odata.GetReasonCloseText(); - _request.deviation = orequest.deviation; - _request.type = NegateOrderType(orequest.type); + _request.comment = _comment + ":" + odata.GetCloseComment(); + _request.deviation = orequest.deviation > 0 ? orequest.deviation : 40; + _request.magic = odata.Get(ORDER_MAGIC); + _request.symbol = odata.Get(ORDER_SYMBOL); + _request.type = NegateOrderType(odata.Get(ORDER_TYPE)); + _request.type_filling = GetOrderFilling(odata.Get(ORDER_SYMBOL)); _request.position = oresult.deal; - _request.price = SymbolInfo::GetCloseOffer(orequest.type); - _request.symbol = orequest.symbol; - _request.volume = orequest.volume; + _request.price = SymbolInfo::GetCloseOffer(odata.Get(ORDER_TYPE)); + _request.volume = odata.Get(ORDER_VOLUME_CURRENT); Order::OrderSend(_request, oresult, oresult_check); - if (oresult.retcode == TRADE_RETCODE_DONE) { - // For now, sets the current time. - odata.Set(ORDER_PROP_TIME_CLOSED, DateTimeStatic::TimeTradeServer()); - // For now, sets using the actual close price. - odata.Set(ORDER_PROP_PRICE_CLOSE, SymbolInfo::GetCloseOffer(odata.Get(ORDER_TYPE))); - odata.Set(ORDER_PROP_LAST_ERROR, ERR_NO_ERROR); - odata.Set(ORDER_PROP_REASON_CLOSE, _reason); - Refresh(); - return true; - } else { - odata.Set(ORDER_PROP_LAST_ERROR, oresult.retcode); - if (OrderSelect()) { - if (IsClosed()) { - Refresh(); + switch (oresult.retcode) { + case TRADE_RETCODE_DONE: + // For now, sets the current time. + odata.Set(ORDER_PROP_TIME_CLOSED, DateTimeStatic::TimeTradeServer()); + // For now, sets using the actual close price. + odata.Set(ORDER_PROP_PRICE_CLOSE, SymbolInfo::GetCloseOffer(odata.Get(ORDER_TYPE))); + odata.Set(ORDER_PROP_LAST_ERROR, ERR_NO_ERROR); + odata.Set(ORDER_PROP_REASON_CLOSE, _reason); + Refresh(true); + return true; + case TRADE_RETCODE_MARKET_CLOSED: + // Market is closed. + // @todo: Re-try closing. + // break; + case TRADE_RETCODE_INVALID: + default: + odata.Set(ORDER_PROP_LAST_ERROR, fmax(oresult.retcode, oresult_check.retcode)); + if (OrderSelect()) { + Refresh(true); + if (!IsClosed()) { + ologger.Error(StringFormat("Failed to send order request %d! Error: %d (%s)", oresult.deal, + oresult_check.retcode, oresult_check.comment), + __FUNCTION_LINE__); + if (logger.GetLevel() >= V_DEBUG) { + ologger.Debug(StringFormat("Failed request: %s", ToString()), __FUNCTION_LINE__); + } + } } - } } return false; } @@ -1049,7 +1066,8 @@ class Order : public SymbolInfo { MqlTradeCheckResult _result_check = {0}; MqlTradeResult _result = {0}; _request.action = TRADE_ACTION_SLTP; - //_request.type = PositionTypeToOrderType(); + _request.comment = ::PositionGetString(POSITION_COMMENT); // StringFormat("mn=%d", GetMagicNumber()); + _request.magic = ::PositionGetInteger(POSITION_MAGIC); _request.position = _ticket; // Position ticket. _request.symbol = ::PositionGetString(POSITION_SYMBOL); _request.sl = _stoploss; @@ -1085,6 +1103,7 @@ class Order : public SymbolInfo { GetLogger().Warning(StringFormat("Failed to modify order (#%d/p:%g/sl:%g/tp:%g/code:%d).", odata.Get(ORDER_PROP_TICKET), _price, _sl, _tp, _last_error), __FUNCTION_LINE__, ToCSV()); + Refresh(ORDER_PRICE_CURRENT); Refresh(ORDER_SL); Refresh(ORDER_TP); // TODO: Refresh(ORDER_PRI) @@ -1100,6 +1119,7 @@ class Order : public SymbolInfo { __FUNCTION_LINE__, ToCSV()); } } + Refresh(); return _result; } @@ -1305,6 +1325,9 @@ class Order : public SymbolInfo { // @see: https://www.mql5.com/en/docs/constants/errorswarnings/enum_trade_return_codes // In order to obtain information about the error, call the GetLastError() function. odata.Set(ORDER_PROP_LAST_ERROR, oresult.retcode); +#ifdef __debug_order__ + Print(__FUNCTION_LINE__ + "(): " + SerializerConverter::FromObject(orequest).ToString()); +#endif _result = -1; } } else { @@ -1575,6 +1598,7 @@ class Order : public SymbolInfo { #endif // Update double values. _result &= Refresh(ORDER_PRICE_OPEN); + _result &= Refresh(ORDER_VOLUME_INITIAL); // Update string values. _result &= Refresh(ORDER_SYMBOL); _result &= Refresh(ORDER_COMMENT); @@ -1586,9 +1610,6 @@ class Order : public SymbolInfo { // _result &= Refresh(ORDER_STATE); // @fixme: Error 69539 // _result &= Refresh(ORDER_TYPE_TIME); // @fixme: Error 69539 // _result &= Refresh(ORDER_TYPE_FILLING); // @fixme: Error 69539 - // Update double values. - // _result &= Refresh(ORDER_VOLUME_INITIAL); // @fixme: false - // _result &= Refresh(ORDER_VOLUME_CURRENT); // @fixme: Error 69539 } // Updates whether order is open or closed. @@ -1602,6 +1623,7 @@ class Order : public SymbolInfo { _result &= Refresh(ORDER_PRICE_CURRENT); _result &= Refresh(ORDER_SL); _result &= Refresh(ORDER_TP); + _result &= Refresh(ORDER_VOLUME_CURRENT); } //} else if (IsPending()) // _result &= Refresh(ORDER_PRICE_STOPLIMIT); // @fixme: Error 69539 @@ -1615,8 +1637,8 @@ class Order : public SymbolInfo { // order.position = OrderGetPositionID(); // Position ticket. // order.position_by = OrderGetPositionBy(); // The ticket of an opposite position. - // Process conditions. - if (!_is_init) { + if (!_is_init && !_refresh) { + // Process conditions. ProcessConditions(); } @@ -1657,8 +1679,6 @@ class Order : public SymbolInfo { RefreshDummy(ORDER_PRICE_CURRENT); } - odata.Set(ORDER_PROP_PROFIT, oresult.bid - oresult.ask); - // @todo: More RefreshDummy(XXX); odata.ResetError(); @@ -1791,6 +1811,9 @@ class Order : public SymbolInfo { case ORDER_VOLUME_CURRENT: _result = Order::OrderGetDouble(ORDER_VOLUME_CURRENT, _value); break; + case ORDER_VOLUME_INITIAL: + _result = Order::OrderGetDouble(ORDER_VOLUME_INITIAL, _value); + break; default: return false; } @@ -2132,10 +2155,10 @@ class Order : public SymbolInfo { #endif switch (property_id) { case ORDER_VOLUME_INITIAL: - _result = ::OrderLots(); // @fixit Are we sure? + _result = ::OrderLots(); break; case ORDER_VOLUME_CURRENT: - _result = ::OrderLots(); // @fixit Are we sure? + _result = ::OrderLots(); break; case ORDER_PRICE_OPEN: _result = ::OrderOpenPrice(); @@ -2147,7 +2170,7 @@ class Order : public SymbolInfo { _result = ::OrderTakeProfit(); break; case ORDER_PRICE_CURRENT: - _result = SymbolInfoStatic::GetBid(Order::OrderSymbol()); + _result = SymbolInfoStatic::GetCloseOffer(OrderSymbol(), (ENUM_ORDER_TYPE)OrderStatic::Type()); break; case ORDER_PRICE_STOPLIMIT: SetUserError(ERR_INVALID_PARAMETER); @@ -2539,9 +2562,7 @@ class Order : public SymbolInfo { case ORDER_VOLUME_INITIAL: return OrderGetValue(POSITION_VOLUME, _type, _out); case ORDER_VOLUME_CURRENT: - // @fixme - SetUserError(ERR_INVALID_PARAMETER); - return NULL; + return OrderGetValue(POSITION_VOLUME, _type, _out); case ORDER_PRICE_OPEN: return OrderGetValue(POSITION_PRICE_OPEN, _type, _out); case ORDER_SL: @@ -2586,12 +2607,11 @@ class Order : public SymbolInfo { bool ProcessConditions(bool _refresh = false) { bool _result = true; if (IsOpen(_refresh) && ShouldCloseOrder()) { - string _reason = "Close condition"; #ifdef __MQL__ // _reason += StringFormat(": %s", EnumToString(oparams.cond_close)); #endif ARRAY(DataParamEntry, _args); - DataParamEntry _cond = _reason; + DataParamEntry _cond = ORDER_REASON_CLOSED_BY_CONDITION; ArrayPushObject(_args, _cond); _result &= Order::ExecuteAction(ORDER_ACTION_CLOSE, _args); } @@ -2698,13 +2718,16 @@ class Order : public SymbolInfo { * Returns true when the condition is met. */ bool ExecuteAction(ENUM_ORDER_ACTION _action, ARRAY_REF(DataParamEntry, _args)) { + bool _result = true; switch (_action) { case ORDER_ACTION_CLOSE: switch (oparams.dummy) { case false: - return OrderClose(ORDER_REASON_CLOSED_BY_ACTION); + return ArraySize(_args) > 0 ? OrderClose((ENUM_ORDER_REASON_CLOSE)_args[0].integer_value) + : OrderClose(ORDER_REASON_CLOSED_BY_ACTION); case true: - return OrderCloseDummy(ORDER_REASON_CLOSED_BY_ACTION); + return ArraySize(_args) > 0 ? OrderCloseDummy((ENUM_ORDER_REASON_CLOSE)_args[0].integer_value) + : OrderCloseDummy(ORDER_REASON_CLOSED_BY_ACTION); } case ORDER_ACTION_OPEN: return !oparams.dummy ? OrderSend() >= 0 : OrderSendDummy() >= 0; @@ -2720,10 +2743,12 @@ class Order : public SymbolInfo { } oparams.AddConditionClose((ENUM_ORDER_CONDITION)_args[0].integer_value, _sargs); } + break; default: ologger.Error(StringFormat("Invalid order action: %s!", EnumToString(_action), __FUNCTION_LINE__)); return false; } + return _result; } bool ExecuteAction(ENUM_ORDER_ACTION _action) { ARRAY(DataParamEntry, _args); diff --git a/Order.struct.h b/Order.struct.h index bb1beb6b6..38b94e8ba 100644 --- a/Order.struct.h +++ b/Order.struct.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -450,30 +450,52 @@ struct OrderData { return Get((ENUM_ORDER_PROPERTY_INTEGER)_prop_name); } */ + /* + * Gets a final comment for closing the order. + * + * @param + * _type ENUM_ORDER_TYPE Order operation type of the order. + * + * @return + * Returns a comment with reason + */ + string GetCloseComment() { + string _result = StringFormat("%s (mn=%d,pips=%d)", GetReasonCloseText(), magic, Get(ORDER_PROP_PROFIT_PIPS)); + return _result; + } + + /* + * Gets a comment with reason to close the order based on enum value. + * + * @return + * Returns a comment with reason. + */ string GetReasonCloseText() { switch (reason_close) { case ORDER_REASON_CLOSED_ALL: - return "Closed all"; + return "CALL"; case ORDER_REASON_CLOSED_BY_ACTION: - return "Closed by action"; + return "CBA"; + case ORDER_REASON_CLOSED_BY_CONDITION: + return "CBC"; case ORDER_REASON_CLOSED_BY_EXPIRE: - return "Expired"; + return "EXP"; case ORDER_REASON_CLOSED_BY_OPPOSITE: - return "Closed by opposite trade"; + return "CBOPP"; case ORDER_REASON_CLOSED_BY_SIGNAL: - return "Closed by signal"; + return "CBSIG"; case ORDER_REASON_CLOSED_BY_SL: - return "Closed by stop loss"; + return "CBSL"; case ORDER_REASON_CLOSED_BY_TEST: - return "Closed by test"; + return "CBTEST"; case ORDER_REASON_CLOSED_BY_TP: - return "Closed by take profit"; + return "CBTP"; case ORDER_REASON_CLOSED_BY_USER: - return "Closed by user"; + return "CBU"; case ORDER_REASON_CLOSED_UNKNOWN: - return "Unknown"; + return "???"; } - return "Unknown"; + return "???"; } // Setters. template @@ -531,6 +553,7 @@ struct OrderData { return; case ORDER_PRICE_OPEN: price_open = _value; + RefreshProfit(); return; case ORDER_SL: sl = _value; @@ -625,7 +648,9 @@ struct OrderData { ResetLastError(); last_error = ERR_NO_ERROR; } - void RefreshProfit() { profit = (price_current - price_open) * GetTypeValue(); } + void RefreshProfit() { + profit = (price_current > 0 && price_open > 0) ? (price_current - price_open) * GetTypeValue() : 0; + } // Serializers. SerializerNodeType Serialize(Serializer &s) { s.Pass(THIS_REF, "magic", magic); diff --git a/OrderQuery.h b/OrderQuery.h index aede72e81..8dfa8c22c 100644 --- a/OrderQuery.h +++ b/OrderQuery.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -48,7 +48,7 @@ class OrderQuery : public Dynamic { }; OrderQuery() {} - OrderQuery(DictStruct> &_orders) : orders(GetPointer(_orders)) {} + OrderQuery(DictStruct> &_orders) : orders(GET_PTR(_orders)) {} /** * Calculates sum of order's value based on the property's enum. diff --git a/Orders.mqh b/Orders.mqh index 2b5ca4057..0767fdc44 100644 --- a/Orders.mqh +++ b/Orders.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Pattern.enum.h b/Pattern.enum.h index 8448472f3..0a35cb5e1 100644 --- a/Pattern.enum.h +++ b/Pattern.enum.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Pattern.mqh b/Pattern.mqh index 477d401bf..60935d6b8 100644 --- a/Pattern.mqh +++ b/Pattern.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Pattern.struct.h b/Pattern.struct.h index 83422f4a6..fae8dd84e 100644 --- a/Pattern.struct.h +++ b/Pattern.struct.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Profiler.mqh b/Profiler.mqh index 18a7f9998..6d21201fd 100644 --- a/Profiler.mqh +++ b/Profiler.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Redis.mqh b/Redis.mqh index 081f23a72..0cd498ec5 100644 --- a/Redis.mqh +++ b/Redis.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Redis.struct.h b/Redis.struct.h index 2a68a8cb9..82f9dc91b 100644 --- a/Redis.struct.h +++ b/Redis.struct.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Refs.mqh b/Refs.mqh index 6d55078d8..a99e79405 100644 --- a/Refs.mqh +++ b/Refs.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -81,7 +81,7 @@ class Dynamic { */ Dynamic() { #ifdef __MQL__ - if (CheckPointer(GetPointer(this)) == POINTER_DYNAMIC) { + if (CheckPointer(THIS_PTR) == POINTER_DYNAMIC) { #else // For other languages we just assume that user knows what he does and creates all Dynamic instances on the heap. if (true) { diff --git a/Refs.rc.h b/Refs.rc.h index baf2a9153..5d82edddc 100644 --- a/Refs.rc.h +++ b/Refs.rc.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Refs.struct.h b/Refs.struct.h index adea3f206..329d861ed 100644 --- a/Refs.struct.h +++ b/Refs.struct.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Registry.mqh b/Registry.mqh index 377636124..b446a384c 100644 --- a/Registry.mqh +++ b/Registry.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/RegistryBinary.mqh b/RegistryBinary.mqh index 3597d375a..29b89eb13 100644 --- a/RegistryBinary.mqh +++ b/RegistryBinary.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Report.mqh b/Report.mqh index eed5ea22e..a1a61d1a2 100644 --- a/Report.mqh +++ b/Report.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/SVG.mqh b/SVG.mqh index 3239e1420..d209ec40f 100644 --- a/SVG.mqh +++ b/SVG.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Serializer.define.h b/Serializer.define.h index 651192781..f44b3f694 100644 --- a/Serializer.define.h +++ b/Serializer.define.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Serializer.enum.h b/Serializer.enum.h index bf5c12d3f..beab26fc0 100644 --- a/Serializer.enum.h +++ b/Serializer.enum.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Serializer.mqh b/Serializer.mqh index f3a3e6856..dab56351b 100644 --- a/Serializer.mqh +++ b/Serializer.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/SerializerBinary.mqh b/SerializerBinary.mqh index 51995a411..ab9eb4a32 100644 --- a/SerializerBinary.mqh +++ b/SerializerBinary.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/SerializerConversions.h b/SerializerConversions.h index 4f5454a5e..d61862a51 100644 --- a/SerializerConversions.h +++ b/SerializerConversions.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/SerializerConverter.mqh b/SerializerConverter.mqh index 985845dd8..db79059f1 100644 --- a/SerializerConverter.mqh +++ b/SerializerConverter.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/SerializerCsv.mqh b/SerializerCsv.mqh index 7b219aaca..ffb17fefb 100644 --- a/SerializerCsv.mqh +++ b/SerializerCsv.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/SerializerDict.mqh b/SerializerDict.mqh index ddef3e957..279a068ef 100644 --- a/SerializerDict.mqh +++ b/SerializerDict.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/SerializerJson.mqh b/SerializerJson.mqh index a0dc2f4c6..7fb65761e 100644 --- a/SerializerJson.mqh +++ b/SerializerJson.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/SerializerNode.enum.h b/SerializerNode.enum.h index efc9a4d28..a33b4c74b 100644 --- a/SerializerNode.enum.h +++ b/SerializerNode.enum.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/SerializerNode.mqh b/SerializerNode.mqh index 27fbd2307..7053feaa3 100644 --- a/SerializerNode.mqh +++ b/SerializerNode.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/SerializerNodeIterator.mqh b/SerializerNodeIterator.mqh index a821bacaf..331e5ab93 100644 --- a/SerializerNodeIterator.mqh +++ b/SerializerNodeIterator.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/SerializerNodeParam.mqh b/SerializerNodeParam.mqh index 0ef237931..820a440c2 100644 --- a/SerializerNodeParam.mqh +++ b/SerializerNodeParam.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -156,7 +156,8 @@ class SerializerNodeParam { * Returns stringified version of the value. Note "forceQuotesOnString" flag. */ string AsString(bool includeQuotes = false, bool forceQuotesOnString = true, bool escapeString = true, - int _fp_precision = 8) { + int _fp_precision = -1) { + _fp_precision = _fp_precision >= 0 ? _fp_precision : GetFloatingPointPrecision(); switch (_type) { case SerializerNodeParamBool: return SerializerConversions::ValueToString(_integral._bool, includeQuotes, escapeString, _fp_precision); diff --git a/SerializerObject.mqh b/SerializerObject.mqh index fddd54ac0..2a98b583d 100644 --- a/SerializerObject.mqh +++ b/SerializerObject.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/SerializerSqlite.mqh b/SerializerSqlite.mqh index df86d747e..db722442a 100644 --- a/SerializerSqlite.mqh +++ b/SerializerSqlite.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Session.mqh b/Session.mqh index c52d9c718..971e680d7 100644 --- a/Session.mqh +++ b/Session.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/SetFile.mqh b/SetFile.mqh index b5255dc3b..ea70d4086 100644 --- a/SetFile.mqh +++ b/SetFile.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Socket.mqh b/Socket.mqh index be44e54f6..cadcf5897 100644 --- a/Socket.mqh +++ b/Socket.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Stats.mqh b/Stats.mqh index 23845bded..d0315ca48 100644 --- a/Stats.mqh +++ b/Stats.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -21,86 +21,76 @@ */ // Includes. -#include "Chart.mqh" +#include "Dict.mqh" + +// Enums. +enum ENUM_STATS_TYPE { STATS_CALC_AVG, STATS_CALC_MIN, STATS_CALC_MED, STATS_CALC_MAX }; /** - * Class to collect ticks, bars and other data for statistical purposes. + * Class to calculate minimum, average and maximum values. */ +template class Stats { public: - unsigned long total_bars; - unsigned long total_ticks; - int curr_period; - // int custom_int[]; - // double custom_dbl[]; + double data[]; + double avg, min, max; + datetime period_start, period_end; + int max_buff; /** * Implements class constructor. + * + * @param long _periods Flags to determine periods to calculate. */ - Stats(void) { Reset(); } + Stats(int _max_buff = 1000) : max_buff(_max_buff) {} /** * Implements class destructor. */ - ~Stats(void) {} - - void Reset() { - curr_period = Period(); - total_bars = 0; - total_ticks = 0; - } + ~Stats() {} /** - * Update stats on tick. + * Parse the new value. */ - void OnTick() { - static long _last_bar_time = 0; - total_ticks++; - if (_last_bar_time != ChartStatic::iTime(_Symbol, 0, 0)) { - _last_bar_time = ChartStatic::iTime(_Symbol, 0, 0); - total_bars++; - } + void Add(double _value, datetime _dt = 0) { + period_start = fmin(_dt, period_start); + period_end = fmax(_dt, period_end); + _dt = _dt > 0 ? _dt : TimeCurrent(); + // avg = (_value + last) / 2; } /** - * Update stats on deinit. - */ - void OnDeinit() {} - - /* Getters */ - - /** - * Get number of counted bars. - */ - unsigned long GetTotalBars() { return (total_bars); } - - /** - * Get number of counted ticks. - */ - unsigned long GetTotalTicks() { return (total_ticks); } - - /** - * Get number of ticks per bar. - */ - unsigned long GetTicksPerBar() { return (total_bars > 0 ? (total_ticks / total_bars) : 0); } - - /** - * Get number of ticks per minute. + * Get statistics per period. + * + * @param ENUM_STATS_TYPE _type Specify type of calculation. */ - unsigned long GetTicksPerMin() { return (total_bars > 0 ? (total_ticks / total_bars / curr_period) : 0); } - - /** - * Get number of ticks per second. - */ - double GetTicksPerSec() { return round(total_bars > 0 ? (total_ticks / total_bars / curr_period) / 60 : 0); } + double GetStats(ENUM_STATS_TYPE _type = STATS_CALC_AVG) { + // @todo + return WRONG_VALUE; + } /** - * Get number of ticks per given time period. + * Gets total count. + * + * @return + * Returns total count of all values. */ - unsigned long GetTicksPerPeriod(int period = PERIOD_H1) { return (GetTicksPerMin() * period); } + int GetCount() { + // return data.GetCount(); + return WRONG_VALUE; + } /** - * Get number of bars per given time period. + * Get average count per period. + * + * @param ENUM_TIMEFRAMES _period Specify type of calculation. + * + * @return + * Returns average count per period. When PERIOD_CURRENT, returns total number. */ - unsigned long GetBarsPerPeriod(int period = PERIOD_H1) { return (total_bars / period); } + int GetCount(ENUM_TIMEFRAMES _period) { + double _psecs = PeriodSeconds(_period); + // ...data + return WRONG_VALUE; + } }; diff --git a/Std.h b/Std.h index 500b5f34f..4fd18eb3b 100644 --- a/Std.h +++ b/Std.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -42,6 +42,7 @@ // Pointers. #ifdef __MQL__ +#define GET_PTR(obj) GetPointer(obj) #define THIS_ATTR #define THIS_PTR (&this) #define THIS_REF this @@ -52,6 +53,7 @@ #define MAKE_REF_FROM_PTR(TYPE, NAME, PTR) TYPE* NAME = PTR #define nullptr NULL #else +#define GET_PTR(obj) (*obj) #define THIS_ATTR this-> #define THIS_PTR (this) #define THIS_REF (*this) @@ -85,7 +87,9 @@ * @usage * ARRAY_REF(, ) */ +#define ARRAY_TYPE(T) T[] #define ARRAY_REF(T, N) REF(T) N ARRAY_DECLARATION_BRACKETS +#define FIXED_ARRAY_REF(T, N, S) ARRAY_REF(T, N) #define CONST_ARRAY_REF(T, N) const N ARRAY_DECLARATION_BRACKETS @@ -100,13 +104,14 @@ #else /** - * Reference to the array. * * @usage * ARRAY_REF(, ) */ -#define ARRAY_REF(T, N) _cpp_array& N +#define ARRAY_TYPE(T) _cpp_array +#define ARRAY_REF(T, N) ARRAY_TYPE(T)& N +#define FIXED_ARRAY_REF(T, N, S) T(&N)[S] #define CONST_ARRAY_REF(T, N) const _cpp_array& N diff --git a/Storage/Collection.mqh b/Storage/Collection.mqh index 691331bb9..7ccd8f6fa 100644 --- a/Storage/Collection.mqh +++ b/Storage/Collection.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Storage/IValueStorage.h b/Storage/IValueStorage.h index 4533b5fa8..512a2e640 100644 --- a/Storage/IValueStorage.h +++ b/Storage/IValueStorage.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Storage/Objects.h b/Storage/Objects.h index 9a312608e..feaadc371 100644 --- a/Storage/Objects.h +++ b/Storage/Objects.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Storage/ObjectsCache.h b/Storage/ObjectsCache.h index 0ca816fba..70a5172bb 100644 --- a/Storage/ObjectsCache.h +++ b/Storage/ObjectsCache.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Storage/Singleton.h b/Storage/Singleton.h index 713d73bf0..0a75e7f48 100644 --- a/Storage/Singleton.h +++ b/Storage/Singleton.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Storage/ValueStorage.accessor.h b/Storage/ValueStorage.accessor.h index 8d0a95112..4115a4247 100644 --- a/Storage/ValueStorage.accessor.h +++ b/Storage/ValueStorage.accessor.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Storage/ValueStorage.all.h b/Storage/ValueStorage.all.h index 048dcae78..136755612 100644 --- a/Storage/ValueStorage.all.h +++ b/Storage/ValueStorage.all.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Storage/ValueStorage.h b/Storage/ValueStorage.h index 3b019ba0e..410a47726 100644 --- a/Storage/ValueStorage.h +++ b/Storage/ValueStorage.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Storage/ValueStorage.history.h b/Storage/ValueStorage.history.h index 98f90b93f..342ad7ce9 100644 --- a/Storage/ValueStorage.history.h +++ b/Storage/ValueStorage.history.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Storage/ValueStorage.indicator.h b/Storage/ValueStorage.indicator.h index 6744660e6..0e008f924 100644 --- a/Storage/ValueStorage.indicator.h +++ b/Storage/ValueStorage.indicator.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Storage/ValueStorage.native.h b/Storage/ValueStorage.native.h index ea7ebb4ab..73aa21296 100644 --- a/Storage/ValueStorage.native.h +++ b/Storage/ValueStorage.native.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Storage/ValueStorage.price.h b/Storage/ValueStorage.price.h index 0f954e32a..da5c69537 100644 --- a/Storage/ValueStorage.price.h +++ b/Storage/ValueStorage.price.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Storage/ValueStorage.spread.h b/Storage/ValueStorage.spread.h index 0cbaf32d5..1a8ef74a0 100644 --- a/Storage/ValueStorage.spread.h +++ b/Storage/ValueStorage.spread.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Storage/ValueStorage.tick_volume.h b/Storage/ValueStorage.tick_volume.h index aa3b3f891..1799c92d9 100644 --- a/Storage/ValueStorage.tick_volume.h +++ b/Storage/ValueStorage.tick_volume.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Storage/ValueStorage.time.h b/Storage/ValueStorage.time.h index f95b17101..fdcf22504 100644 --- a/Storage/ValueStorage.time.h +++ b/Storage/ValueStorage.time.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Storage/ValueStorage.volume.h b/Storage/ValueStorage.volume.h index 4eb51f188..240987405 100644 --- a/Storage/ValueStorage.volume.h +++ b/Storage/ValueStorage.volume.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Storage/tests/Collection.test.mq4 b/Storage/tests/Collection.test.mq4 index a382bdff0..98c475183 100644 --- a/Storage/tests/Collection.test.mq4 +++ b/Storage/tests/Collection.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Storage/tests/Collection.test.mq5 b/Storage/tests/Collection.test.mq5 index eb515ba64..3289f8f2b 100644 --- a/Storage/tests/Collection.test.mq5 +++ b/Storage/tests/Collection.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Strategy.enum.h b/Strategy.enum.h index ae77ab83a..f00b54e55 100644 --- a/Strategy.enum.h +++ b/Strategy.enum.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Strategy.mqh b/Strategy.mqh index 3fcede656..1203e32df 100644 --- a/Strategy.mqh +++ b/Strategy.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -129,6 +129,9 @@ class Strategy : public Taskable { MqlTick _tick = {0}; last_tick = _tick; + // Link log instances. + logger.Link(trade.GetLogger()); + // Statistics variables. // UpdateOrderStats(EA_STATS_DAILY); // UpdateOrderStats(EA_STATS_WEEKLY); @@ -139,7 +142,7 @@ class Strategy : public Taskable { Strategy::OnInit(); } - Log *GetLogger() { return GetPointer(logger); } + Log *GetLogger() { return GET_PTR(logger); } /** * Class deconstructor. @@ -663,7 +666,7 @@ class Strategy : public Taskable { logger.Link(trade.GetLogger()); trade.GetLogger().SetLevel(sparams.Get(STRAT_PARAM_LOG_LEVEL)); // Sets strategy stops. - SetStops(GetPointer(this), GetPointer(this)); + SetStops(THIS_PTR, THIS_PTR); // trade.SetStrategy(&this); // @fixme // Sets strategy's trade spread limit. trade.Set(TRADE_PARAM_MAX_SPREAD, sparams.Get(STRAT_PARAM_MAX_SPREAD)); @@ -794,7 +797,7 @@ class Strategy : public Taskable { } if (METHOD(_method_abs, 5)) { // 32 // Process bar open price ticks. - _val = last_tick.time < trade.GetChart().GetBarTime(); + _val = last_tick.time < trade.GetChart().GetBarTime(); // @todo: Improve performance. _res = _method > 0 ? _res & _val : _res | _val; } if (METHOD(_method_abs, 6)) { // 64 @@ -860,17 +863,14 @@ class Strategy : public Taskable { virtual bool SignalOpenFilterMethod(ENUM_ORDER_TYPE _cmd, int _method = 0) { bool _result = true; if (_method != 0) { - if (METHOD(_method, 0)) _result &= !trade.HasBarOrder(_cmd); // 1 - if (METHOD(_method, 1)) _result &= IsTrend(_cmd); // 2 - if (METHOD(_method, 2)) _result &= trade.IsPivot(_cmd); // 4 - if (METHOD(_method, 3)) _result &= !trade.HasOrderOppositeType(_cmd); // 8 - if (METHOD(_method, 4)) _result &= trade.IsPeak(_cmd); // 16 - if (METHOD(_method, 5)) _result &= !trade.HasOrderBetter(_cmd); // 32 - /* - if (METHOD(_method, 6)) - _result &= !trade.Check( - TRADE_COND_ACCOUNT, _method > 0 ? ACCOUNT_COND_EQUITY_01PC_LOW : ACCOUNT_COND_EQUITY_01PC_HIGH); // 64 - */ + int _shift = _method / 64; + if (METHOD(_method, 0)) _result &= !trade.HasBarOrder(_cmd, _shift); // 1 + if (METHOD(_method, 1)) _result &= IsTrend(_cmd); // 2 + if (METHOD(_method, 2)) _result &= trade.IsPivot(_cmd, _shift); // 4 + if (METHOD(_method, 3)) _result &= !trade.HasOrderOppositeType(_cmd); // 8 + if (METHOD(_method, 4)) _result &= trade.IsPeak(_cmd, _shift); // 16 + if (METHOD(_method, 5)) _result &= !trade.HasOrderBetter(_cmd); // 32 + if (METHOD(_method, 6)) _result &= trade.CalcActiveProfitInValue() <= 0.0f; // 64 // if (METHOD(_method, 5)) _result &= Trade().IsRoundNumber(_cmd); // if (METHOD(_method, 6)) _result &= Trade().IsHedging(_cmd); _method = _method > 0 ? _method : !_method; @@ -928,14 +928,27 @@ class Strategy : public Taskable { * Range: between 0.0 and (max_risk * 2). */ virtual float SignalOpenBoost(ENUM_ORDER_TYPE _cmd, int _method = 0) { - float _result = 1.0; + float _result = 1.0f; if (_method != 0) { - // if (METHOD(_method, 0)) if (Trade().IsTrend(_cmd)) _result *= 1.1; - // if (METHOD(_method, 1)) if (Trade().IsPivot(_cmd)) _result *= 1.1; - // if (METHOD(_method, 2)) if (Trade().IsPeakHours(_cmd)) _result *= 1.1; - // if (METHOD(_method, 3)) if (Trade().IsRoundNumber(_cmd)) _result *= 1.1; - // if (METHOD(_method, 4)) if (Trade().IsHedging(_cmd)) _result *= 1.1; - // if (METHOD(_method, 5)) if (Trade().IsPeakBar(_cmd)) _result *= 1.1; + int _shift = _method / 64; + ENUM_TIMEFRAMES _stf = Get(STRAT_PARAM_TF); + if (METHOD(_method, 0)) + if (IsTrend(_cmd)) _result *= 1.1f; + if (METHOD(_method, 1)) + if (trade.GetTrendOp(18, _stf)) _result *= 1.1f; + if (METHOD(_method, 2)) + if (!trade.HasOrderBetter(_cmd)) _result *= 1.1f; + if (METHOD(_method, 3)) + if (trade.IsPeak(_cmd, _shift)) _result *= 1.1f; + if (METHOD(_method, 4)) + if (trade.IsPivot(_cmd, _shift)) _result *= 1.1f; + if (METHOD(_method, 5)) + if (trade.HasOrderOppositeType(_cmd)) _result *= 1.1f; + if (METHOD(_method, 6)) + if (trade.HasBarOrder(_cmd, _shift)) _result *= 1.1f; + // if (METHOD(_method, 7)) if (trade.IsRoundNumber(_cmd)) _result *= 1.1f; + // if (METHOD(_method, 8)) if (trade.IsHedging(_cmd)) _result *= 1.1f; + // if (METHOD(_method, 9)) if (trade.IsPeakBar(_cmd)) _result *= 1.1f; } return _result; } @@ -968,19 +981,14 @@ class Strategy : public Taskable { virtual bool SignalCloseFilter(ENUM_ORDER_TYPE _cmd, int _method = 0, int _shift = 0) { bool _result = _method == 0; if (_method != 0) { - if (METHOD(_method, 0)) _result |= _result || !trade.HasBarOrder(_cmd); // 1 - if (METHOD(_method, 1)) _result |= _result || !IsTrend(_cmd); // 2 - if (METHOD(_method, 2)) _result |= _result || !trade.IsPivot(_cmd); // 4 + if (METHOD(_method, 0)) _result |= _result || !trade.HasBarOrder(_cmd, _shift); // 1 + if (METHOD(_method, 1)) _result |= _result || !IsTrend(_cmd); // 2 + if (METHOD(_method, 2)) _result |= _result || !trade.IsPivot(_cmd, _shift); // 4 if (METHOD(_method, 3)) _result |= _result || Open[_shift] > High[_shift + 1] || Open[_shift] < Low[_shift + 1]; // 8 - if (METHOD(_method, 4)) _result |= _result || trade.IsPeak(_cmd); // 16 + if (METHOD(_method, 4)) _result |= _result || trade.IsPeak(_cmd, _shift); // 16 if (METHOD(_method, 5)) _result |= _result || trade.HasOrderBetter(_cmd); // 32 - /* - if (METHOD(_method, 6)) - _result |= - _result || trade.Check(TRADE_COND_ACCOUNT, _method > 0 ? ACCOUNT_COND_EQUITY_01PC_HIGH - : ACCOUNT_COND_EQUITY_01PC_LOW); // 64 - */ + if (METHOD(_method, 6)) _result |= _result || trade.CalcActiveProfitInValue() > 0.0f; // 64 // if (METHOD(_method, 7)) _result |= _result || Trade().IsRoundNumber(_cmd); // if (METHOD(_method, 8)) _result |= _result || Trade().IsHedging(_cmd); _method = _method > 0 ? _method : !_method; diff --git a/Strategy.struct.h b/Strategy.struct.h index 79fb394cd..693733d88 100644 --- a/Strategy.struct.h +++ b/Strategy.struct.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Strategy.struct.pricestop.h b/Strategy.struct.pricestop.h index f018bfce9..3bf94364c 100644 --- a/Strategy.struct.pricestop.h +++ b/Strategy.struct.pricestop.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -32,7 +32,6 @@ // Forward declaration. struct ChartParams; -struct IndicatorDataEntry; struct IndicatorParams; // Includes. diff --git a/String.extern.h b/String.extern.h index b59fb5a0d..cb052e4a1 100644 --- a/String.extern.h +++ b/String.extern.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/String.mqh b/String.mqh index e29d40c7b..1c64ef5f7 100644 --- a/String.mqh +++ b/String.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/SummaryReport.mqh b/SummaryReport.mqh index df7ac43ac..a2deb6b37 100644 --- a/SummaryReport.mqh +++ b/SummaryReport.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/SymbolInfo.define.h b/SymbolInfo.define.h index 960369f2d..f0475b166 100644 --- a/SymbolInfo.define.h +++ b/SymbolInfo.define.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/SymbolInfo.enum.h b/SymbolInfo.enum.h index 43b625853..b2f05e249 100644 --- a/SymbolInfo.enum.h +++ b/SymbolInfo.enum.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -60,6 +60,7 @@ enum ENUM_SYMBOL_SWAP_MODE { * For function SymbolInfoDouble(). * * @docs + * https://docs.mql4.com/constants/environment_state/marketinfoconstants * https://www.mql5.com/en/docs/constants/environment_state/marketinfoconstants */ enum ENUM_SYMBOL_INFO_DOUBLE { @@ -122,6 +123,7 @@ enum ENUM_SYMBOL_INFO_DOUBLE { * For function SymbolInfoInteger(). * * @docs + * https://docs.mql4.com/constants/environment_state/marketinfoconstants * https://www.mql5.com/en/docs/constants/environment_state/marketinfoconstants */ enum ENUM_SYMBOL_INFO_INTEGER { @@ -169,6 +171,7 @@ enum ENUM_SYMBOL_INFO_INTEGER { * For function SymbolInfoString(). * * @docs + * https://docs.mql4.com/constants/environment_state/marketinfoconstants * https://www.mql5.com/en/docs/constants/environment_state/marketinfoconstants */ enum ENUM_SYMBOL_INFO_STRING { @@ -193,6 +196,7 @@ enum ENUM_SYMBOL_INFO_STRING { * Enumeration for the current market modes. * * @docs + * https://docs.mql4.com/constants/environment_state/marketinfoconstants * https://www.mql5.com/en/docs/constants/environment_state/marketinfoconstants */ enum ENUM_SYMBOL_CHART_MODE { @@ -216,6 +220,7 @@ enum ENUM_SYMBOL_ORDER_GTC_MODE { * Enumeration for the margin calculation modes. * * @docs + * https://docs.mql4.com/constants/environment_state/marketinfoconstants * https://www.mql5.com/en/docs/constants/environment_state/marketinfoconstants */ enum ENUM_SYMBOL_CALC_MODE { @@ -237,7 +242,11 @@ enum ENUM_SYMBOL_CALC_MODE { /** * Enumeration for the trading modes. * + * Possible deal execution modes for a certain symbol + * are defined in enumeration ENUM_SYMBOL_TRADE_EXECUTION. + * * @docs + * https://docs.mql4.com/constants/environment_state/marketinfoconstants * https://www.mql5.com/en/docs/constants/environment_state/marketinfoconstants */ enum ENUM_SYMBOL_TRADE_MODE { @@ -252,6 +261,7 @@ enum ENUM_SYMBOL_TRADE_MODE { * Enumeration for the possible deal execution modes. * * @docs + * https://docs.mql4.com/constants/environment_state/marketinfoconstants * https://www.mql5.com/en/docs/constants/environment_state/marketinfoconstants */ enum ENUM_SYMBOL_TRADE_EXECUTION { @@ -265,6 +275,7 @@ enum ENUM_SYMBOL_TRADE_EXECUTION { * Enumeration for the option right modes. * * @docs + * https://docs.mql4.com/constants/environment_state/marketinfoconstants * https://www.mql5.com/en/docs/constants/environment_state/marketinfoconstants */ enum ENUM_SYMBOL_OPTION_RIGHT { @@ -276,6 +287,7 @@ enum ENUM_SYMBOL_OPTION_RIGHT { * Enumeration for the symbol option modes. * * @docs + * https://docs.mql4.com/constants/environment_state/marketinfoconstants * https://www.mql5.com/en/docs/constants/environment_state/marketinfoconstants */ enum ENUM_SYMBOL_OPTION_MODE { @@ -287,6 +299,7 @@ enum ENUM_SYMBOL_OPTION_MODE { * Enumeration for the type of financial instruments. * * @docs + * https://docs.mql4.com/constants/environment_state/marketinfoconstants * https://www.mql5.com/en/docs/constants/environment_state/marketinfoconstants */ enum ENUM_SYMBOL_SECTOR { @@ -310,6 +323,7 @@ enum ENUM_SYMBOL_SECTOR { * Enumeration for each type of industry or economy branch. * * @docs + * https://docs.mql4.com/constants/environment_state/marketinfoconstants * https://www.mql5.com/en/docs/constants/environment_state/marketinfoconstants */ enum ENUM_SYMBOL_INDUSTRY { diff --git a/SymbolInfo.enum.symbols.h b/SymbolInfo.enum.symbols.h index fb9c39dc1..575210219 100644 --- a/SymbolInfo.enum.symbols.h +++ b/SymbolInfo.enum.symbols.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/SymbolInfo.extern.h b/SymbolInfo.extern.h index 801c47fb1..92f4a1ce8 100644 --- a/SymbolInfo.extern.h +++ b/SymbolInfo.extern.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/SymbolInfo.mqh b/SymbolInfo.mqh index 3f8f69c41..bbe6b78b8 100644 --- a/SymbolInfo.mqh +++ b/SymbolInfo.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -338,6 +338,11 @@ class SymbolInfo : public Object { */ unsigned int GetRealSpread() { return SymbolInfoStatic::GetRealSpread(symbol); } + /** + * Get a trade mode for the current symbol. + */ + ENUM_SYMBOL_TRADE_MODE GetTradeMode() { return SymbolInfoStatic::GetTradeMode(symbol); } + /** * Minimal indention in points from the current close price to place Stop orders. * @@ -559,6 +564,6 @@ class SymbolInfo : public Object { /** * Returns Log handler. */ - Log *GetLogger() { return GetPointer(logger); } + Log *GetLogger() { return GET_PTR(logger); } }; #endif // SYMBOLINFO_MQH diff --git a/SymbolInfo.struct.h b/SymbolInfo.struct.h index 731a2562a..72cc8e8d4 100644 --- a/SymbolInfo.struct.h +++ b/SymbolInfo.struct.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/SymbolInfo.struct.static.h b/SymbolInfo.struct.static.h index 92bccaca6..b689d055b 100644 --- a/SymbolInfo.struct.static.h +++ b/SymbolInfo.struct.static.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -193,6 +193,18 @@ struct SymbolInfoStatic { return (float)SymbolInfoStatic::SymbolInfoDouble(_symbol, SYMBOL_TRADE_TICK_SIZE); } + /** + * Get a trade mode for the symbol. + * + * Order execution type. + * + * @docs: https://www.mql5.com/en/docs/constants/environment_state/marketinfoconstants#enum_symbol_info_integer + * @see: ENUM_SYMBOL_TRADE_MODE + */ + static ENUM_SYMBOL_TRADE_MODE GetTradeMode(string _symbol) { + return (ENUM_SYMBOL_TRADE_MODE)SymbolInfoStatic::SymbolInfoInteger(_symbol, SYMBOL_TRADE_MODE); + } + /** * Get a tick size in points. * diff --git a/Task/Task.enum.h b/Task/Task.enum.h index 66b180b1f..6c3e1b6dc 100644 --- a/Task/Task.enum.h +++ b/Task/Task.enum.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/Task.h b/Task/Task.h index 0854b9d18..6bd44278a 100644 --- a/Task/Task.h +++ b/Task/Task.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/Task.struct.h b/Task/Task.struct.h index 391eebc9c..98ffe2375 100644 --- a/Task/Task.struct.h +++ b/Task/Task.struct.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/TaskAction.enum.h b/Task/TaskAction.enum.h index 3756722ea..76843f15a 100644 --- a/Task/TaskAction.enum.h +++ b/Task/TaskAction.enum.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/TaskAction.h b/Task/TaskAction.h index 56d053b99..88b35bbed 100644 --- a/Task/TaskAction.h +++ b/Task/TaskAction.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -102,7 +102,7 @@ class TaskAction : public TaskActionBase { /** * Gets s reference to the object. */ - TO *GetObject() { return GetPointer(obj); } + TO *GetObject() { return PTR_TO_REF(obj); } /* Setters */ diff --git a/Task/TaskAction.struct.h b/Task/TaskAction.struct.h index 173ae3bef..02345ad6e 100644 --- a/Task/TaskAction.struct.h +++ b/Task/TaskAction.struct.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/TaskActionBase.h b/Task/TaskActionBase.h index 805105160..b02b07a62 100644 --- a/Task/TaskActionBase.h +++ b/Task/TaskActionBase.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/TaskCondition.enum.h b/Task/TaskCondition.enum.h index 3a8a9fbee..30e74d1d7 100644 --- a/Task/TaskCondition.enum.h +++ b/Task/TaskCondition.enum.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/TaskCondition.h b/Task/TaskCondition.h index 4ccbdbf04..12d1338f1 100644 --- a/Task/TaskCondition.h +++ b/Task/TaskCondition.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -104,7 +104,7 @@ class TaskCondition : public TaskConditionBase { /** * Gets a reference to the object. */ - TO *GetObject() { return GetPointer(obj); } + TO *GetObject() { return PTR_TO_REF(obj); } /* Setters */ diff --git a/Task/TaskCondition.struct.h b/Task/TaskCondition.struct.h index 494e8bf3e..6b5318d73 100644 --- a/Task/TaskCondition.struct.h +++ b/Task/TaskCondition.struct.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/TaskConditionBase.h b/Task/TaskConditionBase.h index 831cdfef6..b2414e10e 100644 --- a/Task/TaskConditionBase.h +++ b/Task/TaskConditionBase.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/TaskGetter.h b/Task/TaskGetter.h index a7cddb16c..8c7f2fddd 100644 --- a/Task/TaskGetter.h +++ b/Task/TaskGetter.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/TaskGetter.struct.h b/Task/TaskGetter.struct.h index 8177d8e04..ac35a6ee1 100644 --- a/Task/TaskGetter.struct.h +++ b/Task/TaskGetter.struct.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/TaskGetterBase.h b/Task/TaskGetterBase.h index 249670822..c12c3975d 100644 --- a/Task/TaskGetterBase.h +++ b/Task/TaskGetterBase.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/TaskManager.h b/Task/TaskManager.h index 7ab9df3e8..f559a15d3 100644 --- a/Task/TaskManager.h +++ b/Task/TaskManager.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/TaskObject.h b/Task/TaskObject.h index a26876edf..6a5ac7cdc 100644 --- a/Task/TaskObject.h +++ b/Task/TaskObject.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/TaskSetter.h b/Task/TaskSetter.h index a08f01957..ee2a28884 100644 --- a/Task/TaskSetter.h +++ b/Task/TaskSetter.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -92,7 +92,7 @@ class TaskSetter : protected TaskSetterBase { /** * Gets a reference to the object. */ - TO *GetObject() { return GetPointer(obj); } + TO *GetObject() { return PTR_TO_REF(obj); } /* Setters */ diff --git a/Task/TaskSetter.struct.h b/Task/TaskSetter.struct.h index 35ac5db24..b1759e927 100644 --- a/Task/TaskSetter.struct.h +++ b/Task/TaskSetter.struct.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/TaskSetterBase.h b/Task/TaskSetterBase.h index 06023dd80..3c36919a8 100644 --- a/Task/TaskSetterBase.h +++ b/Task/TaskSetterBase.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/Taskable.h b/Task/Taskable.h index b4c733abd..ec8ce47c6 100644 --- a/Task/Taskable.h +++ b/Task/Taskable.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -52,7 +52,7 @@ class Taskable : public Object { /** * Class constructor with default arguments. */ - Taskable() : Object(GetPointer(this), __LINE__) {} + Taskable() : Object(THIS_PTR, __LINE__) {} /* Virtual methods */ diff --git a/Task/tests/Task.test.cpp b/Task/tests/Task.test.cpp index 9b12549aa..6696a00a6 100644 --- a/Task/tests/Task.test.cpp +++ b/Task/tests/Task.test.cpp @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/tests/Task.test.mq4 b/Task/tests/Task.test.mq4 index 3ab46d4b9..7ef9313ea 100644 --- a/Task/tests/Task.test.mq4 +++ b/Task/tests/Task.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/tests/Task.test.mq5 b/Task/tests/Task.test.mq5 index 8c37998b7..b7ab9ec83 100644 --- a/Task/tests/Task.test.mq5 +++ b/Task/tests/Task.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/tests/TaskAction.test.cpp b/Task/tests/TaskAction.test.cpp index 79a16e95e..46595e496 100644 --- a/Task/tests/TaskAction.test.cpp +++ b/Task/tests/TaskAction.test.cpp @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/tests/TaskAction.test.mq4 b/Task/tests/TaskAction.test.mq4 index 080ea3c49..09ea8bb11 100644 --- a/Task/tests/TaskAction.test.mq4 +++ b/Task/tests/TaskAction.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/tests/TaskAction.test.mq5 b/Task/tests/TaskAction.test.mq5 index 84177251a..b1e2a26cf 100644 --- a/Task/tests/TaskAction.test.mq5 +++ b/Task/tests/TaskAction.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/tests/TaskActionBase.test.cpp b/Task/tests/TaskActionBase.test.cpp index 8bddd771e..2833dcad5 100644 --- a/Task/tests/TaskActionBase.test.cpp +++ b/Task/tests/TaskActionBase.test.cpp @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/tests/TaskCondition.test.cpp b/Task/tests/TaskCondition.test.cpp index 6689d9e2b..2271640cb 100644 --- a/Task/tests/TaskCondition.test.cpp +++ b/Task/tests/TaskCondition.test.cpp @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/tests/TaskCondition.test.mq4 b/Task/tests/TaskCondition.test.mq4 index 961feb86a..792991e6e 100644 --- a/Task/tests/TaskCondition.test.mq4 +++ b/Task/tests/TaskCondition.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/tests/TaskCondition.test.mq5 b/Task/tests/TaskCondition.test.mq5 index a8a1f7e44..9f84a33a0 100644 --- a/Task/tests/TaskCondition.test.mq5 +++ b/Task/tests/TaskCondition.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/tests/TaskConditionBase.test.cpp b/Task/tests/TaskConditionBase.test.cpp index 12bc9c618..98536265a 100644 --- a/Task/tests/TaskConditionBase.test.cpp +++ b/Task/tests/TaskConditionBase.test.cpp @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/tests/TaskGetter.test.cpp b/Task/tests/TaskGetter.test.cpp index e34c6dc56..43d1c2f65 100644 --- a/Task/tests/TaskGetter.test.cpp +++ b/Task/tests/TaskGetter.test.cpp @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/tests/TaskGetter.test.mq4 b/Task/tests/TaskGetter.test.mq4 index 688c4942e..d2bd22562 100644 --- a/Task/tests/TaskGetter.test.mq4 +++ b/Task/tests/TaskGetter.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/tests/TaskGetter.test.mq5 b/Task/tests/TaskGetter.test.mq5 index 77fd0e12d..03be663d0 100644 --- a/Task/tests/TaskGetter.test.mq5 +++ b/Task/tests/TaskGetter.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/tests/TaskGetterBase.test.cpp b/Task/tests/TaskGetterBase.test.cpp index 7d47abf1c..709722087 100644 --- a/Task/tests/TaskGetterBase.test.cpp +++ b/Task/tests/TaskGetterBase.test.cpp @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/tests/TaskManager.test.cpp b/Task/tests/TaskManager.test.cpp index c92dbf5ba..a26370b87 100644 --- a/Task/tests/TaskManager.test.cpp +++ b/Task/tests/TaskManager.test.cpp @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/tests/TaskManager.test.mq4 b/Task/tests/TaskManager.test.mq4 index 1092ba332..10e20035e 100644 --- a/Task/tests/TaskManager.test.mq4 +++ b/Task/tests/TaskManager.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/tests/TaskManager.test.mq5 b/Task/tests/TaskManager.test.mq5 index 4ade617b8..58d371ecd 100644 --- a/Task/tests/TaskManager.test.mq5 +++ b/Task/tests/TaskManager.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/tests/TaskObject.test.cpp b/Task/tests/TaskObject.test.cpp index c4d09897b..236a7be82 100644 --- a/Task/tests/TaskObject.test.cpp +++ b/Task/tests/TaskObject.test.cpp @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/tests/TaskObject.test.mq4 b/Task/tests/TaskObject.test.mq4 index a6d856946..08705d1bf 100644 --- a/Task/tests/TaskObject.test.mq4 +++ b/Task/tests/TaskObject.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/tests/TaskObject.test.mq5 b/Task/tests/TaskObject.test.mq5 index 4d8ebcc0a..4db435d23 100644 --- a/Task/tests/TaskObject.test.mq5 +++ b/Task/tests/TaskObject.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/tests/TaskSetter.test.cpp b/Task/tests/TaskSetter.test.cpp index c422842f2..7df0708a3 100644 --- a/Task/tests/TaskSetter.test.cpp +++ b/Task/tests/TaskSetter.test.cpp @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/tests/TaskSetter.test.mq4 b/Task/tests/TaskSetter.test.mq4 index 8c3ebc2c1..2aa87950d 100644 --- a/Task/tests/TaskSetter.test.mq4 +++ b/Task/tests/TaskSetter.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/tests/TaskSetter.test.mq5 b/Task/tests/TaskSetter.test.mq5 index a7963993c..6831c460f 100644 --- a/Task/tests/TaskSetter.test.mq5 +++ b/Task/tests/TaskSetter.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/tests/Taskable.car.test.mq4 b/Task/tests/Taskable.car.test.mq4 index ad723ca6d..0beae428a 100644 --- a/Task/tests/Taskable.car.test.mq4 +++ b/Task/tests/Taskable.car.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/tests/Taskable.car.test.mq5 b/Task/tests/Taskable.car.test.mq5 index 9deda3072..75b701973 100644 --- a/Task/tests/Taskable.car.test.mq5 +++ b/Task/tests/Taskable.car.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/tests/Taskable.test.cpp b/Task/tests/Taskable.test.cpp index c0063e7a8..d86116b03 100644 --- a/Task/tests/Taskable.test.cpp +++ b/Task/tests/Taskable.test.cpp @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/tests/Taskable.test.mq4 b/Task/tests/Taskable.test.mq4 index 47e309712..5748fe7c8 100644 --- a/Task/tests/Taskable.test.mq4 +++ b/Task/tests/Taskable.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Task/tests/Taskable.test.mq5 b/Task/tests/Taskable.test.mq5 index 69ea94626..e6d4b022c 100644 --- a/Task/tests/Taskable.test.mq5 +++ b/Task/tests/Taskable.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Terminal.define.h b/Terminal.define.h index 129089236..f11a1de11 100644 --- a/Terminal.define.h +++ b/Terminal.define.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Terminal.enum.h b/Terminal.enum.h index 6c12c13cc..7cc7e5b47 100644 --- a/Terminal.enum.h +++ b/Terminal.enum.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Terminal.extern.h b/Terminal.extern.h index 65582439f..d20fa5b93 100644 --- a/Terminal.extern.h +++ b/Terminal.extern.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Terminal.mqh b/Terminal.mqh index 77aa28d13..806aca7e9 100644 --- a/Terminal.mqh +++ b/Terminal.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -738,6 +738,126 @@ class Terminal : public Object { break; /* Return Codes of the Trade Server */ // @docs: https://www.mql5.com/en/docs/constants/errorswarnings/enum_trade_return_codes + case 10004: // TRADE_RETCODE_REQUOTE + text = "Requote"; + break; + case 10006: // TRADE_RETCODE_REJECT + text = "Request rejected"; + break; + case 10007: // TRADE_RETCODE_CANCEL + text = "Request canceled by trader"; + break; + case 10008: // TRADE_RETCODE_PLACED + text = "Order placed"; + break; + case 10009: // TRADE_RETCODE_DONE + text = "Request completed"; + break; + case 10010: // TRADE_RETCODE_DONE_PARTIAL + text = "Only part of the request was completed"; + break; + case 10011: // TRADE_RETCODE_ERROR + text = "Request processing error"; + break; + case 10012: // TRADE_RETCODE_TIMEOUT + text = "Request canceled by timeout"; + break; + case 10013: // TRADE_RETCODE_INVALID + text = "Invalid request"; + break; + case 10014: // TRADE_RETCODE_INVALID_VOLUME + text = "Invalid volume in the request"; + break; + case 10015: // TRADE_RETCODE_INVALID_PRICE + text = "Invalid price in the request"; + break; + case 10016: // TRADE_RETCODE_INVALID_STOPS + text = "Invalid stops in the request"; + break; + case 10017: // TRADE_RETCODE_TRADE_DISABLED + text = "Trade is disabled"; + break; + case 10018: // TRADE_RETCODE_MARKET_CLOSED + text = "Market is closed"; + break; + case 10019: // TRADE_RETCODE_NO_MONEY + text = "There is not enough money to complete the request"; + break; + case 10020: // TRADE_RETCODE_PRICE_CHANGED + text = "Prices changed"; + break; + case 10021: // TRADE_RETCODE_PRICE_OFF + text = "There are no quotes to process the request"; + break; + case 10022: // TRADE_RETCODE_INVALID_EXPIRATION + text = "Invalid order expiration date in the request"; + break; + case 10023: // TRADE_RETCODE_ORDER_CHANGED + text = "Order state changed"; + break; + case 10024: // TRADE_RETCODE_TOO_MANY_REQUESTS + text = "Too frequent requests"; + break; + case 10025: // TRADE_RETCODE_NO_CHANGES + text = "No changes in request"; + break; + case 10026: // TRADE_RETCODE_SERVER_DISABLES_AT + text = "Autotrading disabled by server"; + break; + case 10027: // TRADE_RETCODE_CLIENT_DISABLES_AT + text = "Autotrading disabled by client terminal"; + break; + case 10028: // TRADE_RETCODE_LOCKED + text = "Request locked for processing"; + break; + case 10029: // TRADE_RETCODE_FROZEN + text = "Order or position frozen"; + break; + case 10030: // TRADE_RETCODE_INVALID_FILL + text = "Invalid order filling type"; + break; + case 10031: // TRADE_RETCODE_CONNECTION + text = "No connection with the trade server"; + break; + case 10032: // TRADE_RETCODE_ONLY_REAL + text = "Operation is allowed only for live accounts"; + break; + case 10033: // TRADE_RETCODE_LIMIT_ORDERS + text = "The number of pending orders has reached the limit"; + break; + case 10034: // TRADE_RETCODE_LIMIT_VOLUME + text = "The volume of orders and positions for the symbol has reached the limit"; + break; + case 10035: // TRADE_RETCODE_INVALID_ORDER + text = "Incorrect or prohibited order type"; + break; + case 10036: // TRADE_RETCODE_POSITION_CLOSED + text = "Position with the specified POSITION_IDENTIFIER has already been closed"; + break; + case 10039: // TRADE_RETCODE_CLOSE_ORDER_EXIST + text = "A close order already exists for a specified position"; + break; + case 10040: // TRADE_RETCODE_LIMIT_POSITIONS + text = "The number of open positions simultaneously present on an account can be limited by the server settings"; + break; + case 10041: // TRADE_RETCODE_REJECT_CANCEL + text = "The pending order activation request is rejected, the order is canceled"; + break; + case 10042: // TRADE_RETCODE_LONG_ONLY + text = "The request is rejected because only long positions are allowed"; + break; + case 10043: // TRADE_RETCODE_SHORT_ONLY + text = "The request is rejected because only short positions are allowed"; + break; + case 10044: // TRADE_RETCODE_CLOSE_ONLY + text = "The request is rejected because only position closing is allowed"; + break; + case 10045: // TRADE_RETCODE_FIFO_CLOSE + text = "The request is rejected because position closing is allowed only by FIFO rule"; + break; + case 10046: // TRADE_RETCODE_HEDGE_PROHIBITED + text = "The request is rejected because opposite positions on a single symbol are disabled"; + break; default: text = "Unknown error."; } @@ -960,7 +1080,7 @@ class Terminal : public Object { StringFormat("Terminal company: %s", GetCompany()) + _sep + StringFormat("Terminal connected: %s", IsConnected() ? "Yes" : "No") + _sep + StringFormat("Terminal language: %s", GetLanguage()) + _sep + StringFormat("Terminal name: %s", GetName()) + - _sep + StringFormat("Termnal max bars: %d", GetMaxBars()) + _sep + + _sep + StringFormat("Terminal max bars: %d", GetMaxBars()) + _sep + StringFormat("Trade allowed: %s", IsTradeAllowed() ? "Yes" : "No") + _sep + StringFormat("Trade context busy: %s", IsTradeContextBusy() ? "Yes" : "No") + _sep + StringFormat("Trade perm: %s", CheckPermissionToTrade() ? "Yes" : "No") + _sep + diff --git a/Terminal.struct.h b/Terminal.struct.h index cb4e58da7..3dd90148c 100644 --- a/Terminal.struct.h +++ b/Terminal.struct.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Test.mqh b/Test.mqh index fd280471d..19fc67e75 100644 --- a/Test.mqh +++ b/Test.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Tester.mqh b/Tester.mqh index e2984c2b2..cea7241a4 100644 --- a/Tester.mqh +++ b/Tester.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Tests.mqh b/Tests.mqh index 55c549aa8..95ec460f0 100644 --- a/Tests.mqh +++ b/Tests.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Tick.struct.h b/Tick.struct.h index dbb226a4f..ddc8a4f31 100644 --- a/Tick.struct.h +++ b/Tick.struct.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Tick/TickManager.h b/Tick/TickManager.h index befa1d4a9..d04f04546 100644 --- a/Tick/TickManager.h +++ b/Tick/TickManager.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Tick/tests/TickManager.test.mq4 b/Tick/tests/TickManager.test.mq4 index 0956d46bf..5ed2a0b2a 100644 --- a/Tick/tests/TickManager.test.mq4 +++ b/Tick/tests/TickManager.test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Tick/tests/TickManager.test.mq5 b/Tick/tests/TickManager.test.mq5 index 1c54f9b2a..e507b43d9 100644 --- a/Tick/tests/TickManager.test.mq5 +++ b/Tick/tests/TickManager.test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Ticker.mqh b/Ticker.mqh index 75aee7c71..51a36c26a 100644 --- a/Ticker.mqh +++ b/Ticker.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Timer.mqh b/Timer.mqh index 59f291ca3..ba3d069b8 100644 --- a/Timer.mqh +++ b/Timer.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Trade.enum.h b/Trade.enum.h index 5f0e59c52..74c5ed02b 100644 --- a/Trade.enum.h +++ b/Trade.enum.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -53,22 +53,27 @@ enum ENUM_TRADE_ACTION { // Trade conditions. enum ENUM_TRADE_CONDITION { - TRADE_COND_ACCOUNT = 1, // Account condition (1 arg) - TRADE_COND_ALLOWED_NOT, // When trade is not allowed - TRADE_COND_HAS_STATE, // Trade as specific state (1 arg) - TRADE_COND_IS_ORDER_LIMIT, // Trade has reached order limits - TRADE_COND_IS_PEAK, // Market is at peak level - TRADE_COND_IS_PIVOT, // Market is in pivot levels - TRADE_COND_ORDERS_PROFIT_GT_01PC, // Equity > 1% - TRADE_COND_ORDERS_PROFIT_LT_01PC, // Equity < 1% - TRADE_COND_ORDERS_PROFIT_GT_02PC, // Equity > 2% - TRADE_COND_ORDERS_PROFIT_LT_02PC, // Equity < 2% - TRADE_COND_ORDERS_PROFIT_GT_05PC, // Equity > 5% - TRADE_COND_ORDERS_PROFIT_LT_05PC, // Equity < 5% - TRADE_COND_ORDERS_PROFIT_GT_10PC, // Equity > 10% - TRADE_COND_ORDERS_PROFIT_LT_10PC, // Equity < 10% - // TRADE_ORDER_CONDS_IN_TREND = 2, // Open orders with trend - // TRADE_ORDER_CONDS_IN_TREND_NOT = 3, // Open orders against trend + TRADE_COND_ACCOUNT = 1, // Account condition (1 arg) + TRADE_COND_ALLOWED_NOT, // When trade is not allowed + TRADE_COND_HAS_STATE, // Trade as specific state (1 arg) + TRADE_COND_IS_ORDER_LIMIT, // Trade has reached order limits + TRADE_COND_IS_PEAK, // Market is at peak level + TRADE_COND_IS_PIVOT, // Market is in pivot levels + TRADE_COND_ORDERS_IN_TREND, // Open orders with trend + TRADE_COND_ORDERS_IN_TREND_NOT, // Open orders against trend + TRADE_COND_ORDERS_PROFIT_DBL_LOSS, // Orders' profit doubles losses + TRADE_COND_ORDERS_PROFIT_GT_01PC, // Equity >= 1% + TRADE_COND_ORDERS_PROFIT_LT_01PC, // Equity <= 1% + TRADE_COND_ORDERS_PROFIT_GT_02PC, // Equity >= 2% + TRADE_COND_ORDERS_PROFIT_LT_02PC, // Equity <= 2% + TRADE_COND_ORDERS_PROFIT_GT_05PC, // Equity >= 5% + TRADE_COND_ORDERS_PROFIT_LT_05PC, // Equity <= 5% + TRADE_COND_ORDERS_PROFIT_GT_10PC, // Equity >= 10% + TRADE_COND_ORDERS_PROFIT_LT_10PC, // Equity <= 10% + TRADE_COND_ORDERS_PROFIT_GT_ARG, // Equity <= (arg) + TRADE_COND_ORDERS_PROFIT_LT_ARG, // Equity >= (arg) + TRADE_COND_ORDERS_PROFIT_GT_RISK_MARGIN, // Equity >= Risk Margin + TRADE_COND_ORDERS_PROFIT_LT_RISK_MARGIN, // Equity <= Risk Margin FINAL_ENUM_TRADE_CONDITION_ENTRY = 4 }; @@ -116,20 +121,25 @@ enum ENUM_TRADE_STATE { TRADE_STATE_MARGIN_MAX_HARD = 1 << 2, // Hard limit of trade margin reached TRADE_STATE_MARGIN_MAX_SOFT = 1 << 3, // Soft limit of trade margin reached TRADE_STATE_MARKET_CLOSED = 1 << 4, // Trade market closed - TRADE_STATE_MONEY_NOT_ENOUGH = 1 << 5, // Not enough money to trade - TRADE_STATE_ORDERS_ACTIVE = 1 << 6, // There are active orders - TRADE_STATE_ORDERS_MAX_HARD = 1 << 7, // Soft limit of maximum orders reached - TRADE_STATE_ORDERS_MAX_SOFT = 1 << 8, // Hard limit of maximum orders reached - TRADE_STATE_PERIOD_LIMIT_REACHED = 1 << 9, // Per period limit reached - TRADE_STATE_SPREAD_TOO_HIGH = 1 << 10, // Spread too high - TRADE_STATE_TRADE_NOT_ALLOWED = 1 << 11, // Trade not allowed - TRADE_STATE_TRADE_NOT_POSSIBLE = 1 << 12, // Trade not possible - TRADE_STATE_TRADE_TERMINAL_BUSY = 1 << 13, // Terminal context busy - TRADE_STATE_TRADE_TERMINAL_OFFLINE = 1 << 14, // Terminal offline - TRADE_STATE_TRADE_TERMINAL_SHUTDOWN = 1 << 15, // Terminal is shutting down + TRADE_STATE_MODE_DISABLED = 1 << 5, // Trade is disabled for the symbol + TRADE_STATE_MODE_LONGONLY = 1 << 6, // Allowed only long positions + TRADE_STATE_MODE_SHORTONLY = 1 << 7, // Allowed only short positions + TRADE_STATE_MODE_CLOSEONLY = 1 << 8, // Allowed only position close operations + TRADE_STATE_MODE_FULL = 1 << 9, // No trade restrictions + TRADE_STATE_MONEY_NOT_ENOUGH = 1 << 10, // Not enough money to trade + TRADE_STATE_ORDERS_ACTIVE = 1 << 11, // There are active orders + TRADE_STATE_ORDERS_MAX_HARD = 1 << 12, // Soft limit of maximum orders reached + TRADE_STATE_ORDERS_MAX_SOFT = 1 << 13, // Hard limit of maximum orders reached + TRADE_STATE_PERIOD_LIMIT_REACHED = 1 << 14, // Per period limit reached + TRADE_STATE_SPREAD_TOO_HIGH = 1 << 15, // Spread too high + TRADE_STATE_TRADE_NOT_ALLOWED = 1 << 16, // Trade not allowed + TRADE_STATE_TRADE_NOT_POSSIBLE = 1 << 17, // Trade not possible + TRADE_STATE_TRADE_TERMINAL_BUSY = 1 << 18, // Terminal context busy + TRADE_STATE_TRADE_TERMINAL_OFFLINE = 1 << 19, // Terminal offline + TRADE_STATE_TRADE_TERMINAL_SHUTDOWN = 1 << 20, // Terminal is shutting down // Pre-defined trade state enumerations. TRADE_STATE_TRADE_CANNOT = TRADE_STATE_MARGIN_MAX_HARD | TRADE_STATE_ORDERS_MAX_HARD | TRADE_STATE_MARKET_CLOSED | - TRADE_STATE_MONEY_NOT_ENOUGH | TRADE_STATE_TRADE_NOT_ALLOWED | + TRADE_STATE_MODE_DISABLED | TRADE_STATE_MONEY_NOT_ENOUGH | TRADE_STATE_TRADE_NOT_ALLOWED | TRADE_STATE_TRADE_NOT_POSSIBLE | TRADE_STATE_TRADE_TERMINAL_BUSY | TRADE_STATE_TRADE_TERMINAL_OFFLINE | TRADE_STATE_TRADE_TERMINAL_SHUTDOWN, TRADE_STATE_TRADE_SHOULDNT = TRADE_STATE_BARS_NOT_ENOUGH | TRADE_STATE_MARGIN_MAX_SOFT | TRADE_STATE_ORDERS_MAX_SOFT | @@ -138,3 +148,21 @@ enum ENUM_TRADE_STATE { TRADE_STATE_TRADE_CAN = ~TRADE_STATE_TRADE_CANNOT, FINAL_ENUM_TRADE_STATE, }; + +#ifndef __MQL__ +// Defines enumeration for trade transaction types. +// @docs: https://www.mql5.com/en/docs/constants/tradingconstants/enum_trade_transaction_type +enum ENUM_TRADE_TRANSACTION_TYPE { + TRADE_TRANSACTION_ORDER_ADD, // Adding a new active order + TRADE_TRANSACTION_ORDER_UPDATE, // Changing an existing order + TRADE_TRANSACTION_ORDER_DELETE, // Deleting an order from the list of active ones + TRADE_TRANSACTION_DEAL_ADD, // Adding a deal to history + TRADE_TRANSACTION_DEAL_UPDATE, // Changing a deal in history + TRADE_TRANSACTION_DEAL_DELETE, // Deleting a deal from history + TRADE_TRANSACTION_HISTORY_ADD, // Adding an order to history as a result of execution or cancellation + TRADE_TRANSACTION_HISTORY_UPDATE, // Changing an order in the order history + TRADE_TRANSACTION_HISTORY_DELETE, // Deleting an order from the order history + TRADE_TRANSACTION_POSITION, // Position change not related to a trade execution + TRADE_TRANSACTION_REQUEST // Notification that a trade request has been processed by the server +}; +#endif diff --git a/Trade.mqh b/Trade.mqh index c560ef898..02dbff020 100644 --- a/Trade.mqh +++ b/Trade.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -61,27 +61,40 @@ class Trade : public Taskable { Ref order_last; // Strategy *strategy; // Optional pointer to Strategy class. + /** + * Initialize class instance. + */ + void Init() { + if (!chart.IsSet()) { + chart = new Chart(PERIOD_CURRENT, _Symbol); + } + SetName(); + if (tparams.magic_no > 0) { + OrdersLoadByMagic(tparams.magic_no); + } + UpdateStates(); + } + public: /** * Class constructor. */ - Trade() : chart(new Chart()), order_last(NULL) { - SetName(); - OrdersLoadByMagic(tparams.magic_no); - }; + Trade() : order_last(NULL) { Init(); }; Trade(TradeParams &_tparams, ChartParams &_cparams) : chart(new Chart(_cparams)), tparams(_tparams), order_last(NULL) { - SetName(); - OrdersLoadByMagic(tparams.magic_no); + Init(); }; /** * Class copy constructor. */ Trade(const Trade &_trade) { + // logger = _trade.GetLogger(); + tasks = _trade.tasks; tparams = _trade.tparams; tstats = _trade.tstats; tstates = _trade.tstates; + Init(); } /** @@ -671,6 +684,9 @@ HistorySelect(0, TimeCurrent()); // Select history for access. break; } UpdateStates(_result); + if (logger.GetLevel() >= V_DEBUG) { + logger.Debug(_order.ToString(), __FUNCTION_LINE__, StringFormat("Code: %d", _last_error)); + } return _result; } @@ -837,7 +853,7 @@ HistorySelect(0, TimeCurrent()); // Select history for access. int OrdersCloseAll(ENUM_ORDER_REASON_CLOSE _reason = ORDER_REASON_CLOSED_ALL, string _comment = "") { int _oid = 0, _closed = 0; Ref _order; - _comment = _comment != "" ? _comment : __FUNCTION__; + _comment = _comment != "" ? _comment : "TOCA:"; for (DictStructIterator> iter = orders_active.Begin(); iter.IsValid(); ++iter) { _order = iter.Value(); if (_order.Ptr().IsOpen(true)) { @@ -867,7 +883,7 @@ HistorySelect(0, TimeCurrent()); // Select history for access. string _comment = "") { int _oid = 0, _closed = 0; Ref _order; - _comment = _comment != "" ? _comment : __FUNCTION__; + _comment = _comment != "" ? _comment : "TOCVC:"; for (DictStructIterator> iter = orders_active.Begin(); iter.IsValid(); ++iter) { _order = iter.Value(); if (_order.Ptr().IsOpen(true)) { @@ -905,7 +921,7 @@ HistorySelect(0, TimeCurrent()); // Select history for access. ENUM_ORDER_REASON_CLOSE _reason = ORDER_REASON_CLOSED_UNKNOWN, string _comment = "") { int _oid = 0, _closed = 0; Ref _order; - _comment = _comment != "" ? _comment : __FUNCTION__; + _comment = _comment != "" ? _comment : "TOCVP:"; for (DictStructIterator> iter = orders_active.Begin(); iter.IsValid(); ++iter) { _order = iter.Value(); if (_order.Ptr().IsOpen(true)) { @@ -941,7 +957,7 @@ HistorySelect(0, TimeCurrent()); // Select history for access. ENUM_ORDER_REASON_CLOSE _reason = ORDER_REASON_CLOSED_UNKNOWN, string _comment = "") { int _oid = 0, _closed = 0; Ref _order; - _comment = _comment != "" ? _comment : __FUNCTION__; + _comment = _comment != "" ? _comment : "TOCVP2:"; for (DictStructIterator> iter = orders_active.Begin(); iter.IsValid(); ++iter) { _order = iter.Value(); if (_order.Ptr().IsOpen(true)) { @@ -1348,9 +1364,8 @@ HistorySelect(0, TimeCurrent()); // Select history for access. * */ void UpdateStates(bool _force = false) { - static datetime _last_check = 0; // @fixme: Do not use static variable. - if (_force || _last_check + 60 < TimeCurrent()) { - static unsigned int _states_prev = tstates.GetStates(); + if (_force || tstates.GetLastCheckDiff() > 60) { + unsigned int _states_prev = tstates.GetStates(); // Infrequent checks (each minute). /* Limit checks */ tstates.SetState(TRADE_STATE_PERIOD_LIMIT_REACHED, tparams.IsLimitGe(tstats)); @@ -1380,6 +1395,13 @@ HistorySelect(0, TimeCurrent()); // Select history for access. && (Terminal::IsRealtime() && !Terminal::IsExpertEnabled())); /* Chart checks */ tstates.SetState(TRADE_STATE_BARS_NOT_ENOUGH, GetChart().GetBars() < tparams.GetBarsMin()); + /* Symbol trade modes */ + ENUM_SYMBOL_TRADE_MODE _trade_mode = GetChart().GetTradeMode(); + tstates.SetState(TRADE_STATE_MODE_DISABLED, _trade_mode == SYMBOL_TRADE_MODE_DISABLED); + tstates.SetState(TRADE_STATE_MODE_LONGONLY, _trade_mode == SYMBOL_TRADE_MODE_LONGONLY); + tstates.SetState(TRADE_STATE_MODE_SHORTONLY, _trade_mode == SYMBOL_TRADE_MODE_SHORTONLY); + tstates.SetState(TRADE_STATE_MODE_CLOSEONLY, _trade_mode == SYMBOL_TRADE_MODE_CLOSEONLY); + tstates.SetState(TRADE_STATE_MODE_FULL, _trade_mode == SYMBOL_TRADE_MODE_FULL); /* Terminal checks */ tstates.SetState(TRADE_STATE_TRADE_NOT_ALLOWED, // Check if real trading is allowed. @@ -1387,7 +1409,6 @@ HistorySelect(0, TimeCurrent()); // Select history for access. // Check the permission to trade for the current account. && !AccountMt::IsTradeAllowed()); tstates.SetState(TRADE_STATE_TRADE_TERMINAL_BUSY, Terminal::IsTradeContextBusy()); - _last_check = TimeCurrent(); /* Terminal checks */ // Check if terminal is connected. tstates.SetState(TRADE_STATE_TRADE_TERMINAL_OFFLINE, Terminal::IsRealtime() && !Terminal::IsConnected()); @@ -1706,7 +1727,7 @@ HistorySelect(0, TimeCurrent()); // Select history for access. } if ((_periods & DATETIME_HOUR) != 0) { // New hour started. - UpdateStates(); + UpdateStates(true); } if ((_periods & DATETIME_DAY) != 0) { // New day started. @@ -1772,9 +1793,57 @@ HistorySelect(0, TimeCurrent()); // Select history for access. case TRADE_COND_IS_ORDER_LIMIT: return tparams.IsLimitGe(tstats); case TRADE_COND_IS_PEAK: - return IsPeak(_entry.GetArg(0).ToValue(), _entry.GetArg(1).ToValue()); + if (Get(TRADE_STATE_ORDERS_ACTIVE) && orders_active.Size() > 0) { + ENUM_ORDER_TYPE _order_types1[] = {ORDER_TYPE_BUY, ORDER_TYPE_SELL}; + ENUM_ORDER_TYPE _order_type_profitable1 = + _oquery_ref.Ptr() + .FindPropBySum( + _order_types1, ORDER_PROP_PROFIT, ORDER_TYPE); + return IsPeak(_order_type_profitable1); + } case TRADE_COND_IS_PIVOT: - return IsPivot(_entry.GetArg(0).ToValue(), _entry.GetArg(1).ToValue()); + if (Get(TRADE_STATE_ORDERS_ACTIVE) && orders_active.Size() > 0) { + ENUM_ORDER_TYPE _order_types2[] = {ORDER_TYPE_BUY, ORDER_TYPE_SELL}; + ENUM_ORDER_TYPE _order_type_profitable2 = + _oquery_ref.Ptr() + .FindPropBySum( + _order_types2, ORDER_PROP_PROFIT, ORDER_TYPE); + return IsPivot(_order_type_profitable2); + } + case TRADE_COND_ORDERS_PROFIT_DBL_LOSS: + if (Get(TRADE_STATE_ORDERS_ACTIVE) && orders_active.Size() > 1) { + float _profit_buys = + _oquery_ref.Ptr() + .CalcSumByPropWithCond(ORDER_PROP_PROFIT_PIPS, ORDER_TYPE, ORDER_TYPE_BUY); + float _profit_sells = + _oquery_ref.Ptr() + .CalcSumByPropWithCond(ORDER_PROP_PROFIT_PIPS, ORDER_TYPE, ORDER_TYPE_SELL); + return (((_profit_buys > 1) && (_profit_sells < -1) && (_profit_buys > -(_profit_sells * 2))) || + ((_profit_sells > 1) && (_profit_buys < -1) && (_profit_sells > -(_profit_buys * 2)))); + } + break; + case TRADE_COND_ORDERS_IN_TREND: + if (Get(TRADE_STATE_ORDERS_ACTIVE)) { + ENUM_ORDER_TYPE _order_types3[] = {ORDER_TYPE_BUY, ORDER_TYPE_SELL}; + ENUM_ORDER_TYPE _order_type_profit1 = + _oquery_ref.Ptr() + .FindPropBySum( + _order_types3, ORDER_PROP_PROFIT, ORDER_TYPE); + return _order_type_profit1 == GetTrendOp(18, PERIOD_D1); + } + break; + case TRADE_COND_ORDERS_IN_TREND_NOT: + if (Get(TRADE_STATE_ORDERS_ACTIVE)) { + ENUM_ORDER_TYPE _order_types4[] = {ORDER_TYPE_BUY, ORDER_TYPE_SELL}; + ENUM_ORDER_TYPE _order_type_profit2 = + _oquery_ref.Ptr() + .FindPropBySum( + _order_types4, ORDER_PROP_PROFIT, ORDER_TYPE); + return _order_type_profit2 != GetTrendOp(18, PERIOD_D1); + } + break; case TRADE_COND_ORDERS_PROFIT_GT_01PC: if (Get(TRADE_STATE_ORDERS_ACTIVE)) { return CalcActiveEquityInPct() >= 1; @@ -1815,8 +1884,26 @@ HistorySelect(0, TimeCurrent()); // Select history for access. return CalcActiveEquityInPct() <= -10; } break; - // case TRADE_ORDER_CONDS_IN_TREND: - // case TRADE_ORDER_CONDS_IN_TREND_NOT: + case TRADE_COND_ORDERS_PROFIT_GT_ARG: + if (Get(TRADE_STATE_ORDERS_ACTIVE)) { + return CalcActiveEquityInPct() >= _entry.GetArg(0).ToValue(); + } + break; + case TRADE_COND_ORDERS_PROFIT_LT_ARG: + if (Get(TRADE_STATE_ORDERS_ACTIVE)) { + return CalcActiveEquityInPct() <= _entry.GetArg(0).ToValue(); + } + break; + case TRADE_COND_ORDERS_PROFIT_GT_RISK_MARGIN: + if (Get(TRADE_STATE_ORDERS_ACTIVE)) { + return CalcActiveEquityInPct() >= tparams.Get(TRADE_PARAM_RISK_MARGIN); + } + break; + case TRADE_COND_ORDERS_PROFIT_LT_RISK_MARGIN: + if (Get(TRADE_STATE_ORDERS_ACTIVE)) { + return CalcActiveEquityInPct() <= tparams.Get(TRADE_PARAM_RISK_MARGIN); + } + break; default: GetLogger().Error(StringFormat("Invalid Trade condition: %d!", _entry.GetId(), __FUNCTION_LINE__)); SetUserError(ERR_INVALID_PARAMETER); @@ -1906,13 +1993,14 @@ HistorySelect(0, TimeCurrent()); // Select history for access. break; case TRADE_ACTION_ORDERS_CLOSE_IN_TREND: if (Get(TRADE_STATE_ORDERS_ACTIVE)) { - _result = OrdersCloseViaCmd(GetTrendOp(0), ORDER_REASON_CLOSED_BY_ACTION) >= 0; + _result = OrdersCloseViaCmd(GetTrendOp(18, PERIOD_D1), ORDER_REASON_CLOSED_BY_ACTION) >= 0; RefreshActiveOrders(true); } break; case TRADE_ACTION_ORDERS_CLOSE_IN_TREND_NOT: if (Get(TRADE_STATE_ORDERS_ACTIVE)) { - _result = OrdersCloseViaCmd(Order::NegateOrderType(GetTrendOp(0)), ORDER_REASON_CLOSED_BY_ACTION) >= 0; + _result = + OrdersCloseViaCmd(Order::NegateOrderType(GetTrendOp(18, PERIOD_D1)), ORDER_REASON_CLOSED_BY_ACTION) >= 0; RefreshActiveOrders(true); } break; @@ -1998,7 +2086,7 @@ HistorySelect(0, TimeCurrent()); // Select history for access. /** * Returns pointer to Log class. */ - Log *GetLogger() { return GetPointer(logger); } + Log *GetLogger() { return GET_PTR(logger); } /* Serializers */ diff --git a/Trade.struct.h b/Trade.struct.h index 389297d59..d0e43913f 100644 --- a/Trade.struct.h +++ b/Trade.struct.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -37,6 +37,67 @@ struct TradeStats; #include "DateTime.mqh" #include "Trade.enum.h" +#ifndef __MQL__ + +// Defines Trade Request structure. +// @see: https://www.mql5.com/en/docs/constants/structures/mqltraderequest +struct MqlTradeRequest { + ENUM_TRADE_REQUEST_ACTIONS action; // Trade operation type + ulong magic; // Expert Advisor ID (magic number) + ulong order; // Order ticket + string symbol; // Trade symbol + double volume; // Requested volume for a deal in lots + double price; // Price + double stoplimit; // StopLimit level of the order + double sl; // Stop Loss level of the order + double tp; // Take Profit level of the order + ulong deviation; // Maximal possible deviation from the requested price + ENUM_ORDER_TYPE type; // Order type + ENUM_ORDER_TYPE_FILLING type_filling; // Order execution type + ENUM_ORDER_TYPE_TIME type_time; // Order expiration type + datetime expiration; // Order expiration time (for the orders of ORDER_TIME_SPECIFIED type) + string comment; // Order comment + ulong position; // Position ticket + ulong position_by; // The ticket of an opposite position +}; + +// Defines Trade Request Result structure. +// @see: https://www.mql5.com/en/docs/constants/structures/mqltraderesult +struct MqlTradeResult { + uint retcode; // Operation return code + ulong deal; // Deal ticket, if it is performed + ulong order; // Order ticket, if it is placed + double volume; // Deal volume, confirmed by broker + double price; // Deal price, confirmed by broker + double bid; // Current Bid price + double ask; // Current Ask price + string comment; // Broker comment to operation (by default it is filled by description of trade server return code) + uint request_id; // Request ID set by the terminal during the dispatch + int retcode_external; // Return code of an external trading system +}; + +// Defines Trade Transaction structure. +// @see: https://www.mql5.com/en/docs/constants/structures/mqltradetransaction +struct MqlTradeTransaction { + ulong deal; // Deal ticket + ulong order; // Order ticket + string symbol; // Trade symbol name + ENUM_TRADE_TRANSACTION_TYPE type; // Trade transaction type + ENUM_ORDER_TYPE order_type; // Order type + ENUM_ORDER_STATE order_state; // Order state + ENUM_DEAL_TYPE deal_type; // Deal type + ENUM_ORDER_TYPE_TIME time_type; // Order type by action period + datetime time_expiration; // Order expiration time + double price; // Price + double price_trigger; // Stop limit order activation price + double price_sl; // Stop Loss level + double price_tp; // Take Profit level + double volume; // Volume in lots + ulong position; // Position ticket + ulong position_by; // Ticket of an opposite position +}; +#endif + /* Structure for trade parameters. */ struct TradeParams { float lot_size; // Default lot size. @@ -49,18 +110,24 @@ struct TradeParams { unsigned short bars_min; // Minimum bars to trade. ENUM_LOG_LEVEL log_level; // Log verbosity level. // Constructors. - TradeParams(float _lot_size = 0, float _risk_margin = 1.0, unsigned int _slippage = 0, ENUM_LOG_LEVEL _ll = V_INFO) + TradeParams(float _lot_size = 0, float _risk_margin = 1.0f, unsigned int _slippage = 0, ENUM_LOG_LEVEL _ll = V_INFO) : bars_min(100), order_comment(""), log_level(_ll), lot_size(_lot_size), - magic_no(rand()), + magic_no(0), risk_margin(_risk_margin), slippage(_slippage) { SetLimits(0); } TradeParams(unsigned long _magic_no, ENUM_LOG_LEVEL _ll = V_INFO) - : bars_min(100), lot_size(0), order_comment(""), log_level(_ll), magic_no(_magic_no) {} + : bars_min(100), + lot_size(0), + order_comment(""), + log_level(_ll), + magic_no(_magic_no), + risk_margin(1.0f), + slippage(0) {} TradeParams(TradeParams &_tparams) { this = _tparams; } // Deconstructor. ~TradeParams() {} @@ -112,6 +179,7 @@ struct TradeParams { return limits_stats[(int)_type][(int)_period] > 0 && _value >= limits_stats[(int)_type][(int)_period]; } bool IsLimitGe(TradeStats &_stats) { + // @todo: Improve code performance. for (ENUM_TRADE_STAT_TYPE t = 0; t < FINAL_ENUM_TRADE_STAT_TYPE; t++) { for (ENUM_TRADE_STAT_PERIOD p = 0; p < FINAL_ENUM_TRADE_STAT_PERIOD; p++) { unsigned int _stat_value = _stats.GetOrderStats(t, p); @@ -298,12 +366,22 @@ struct TradeStats { /* Structure for trade states. */ struct TradeStates { protected: - unsigned int states; // @todo: Move to protected. + datetime last_check; + unsigned int states; + + protected: + // Protected methods. + void UpdateCheck() { + // Refresh timestamp for the last access. + last_check = TimeCurrent(); + } + public: // Struct constructor. - TradeStates() : states(0) {} + TradeStates() : last_check(0), states(0) {} // Getters. bool Get(ENUM_TRADE_STATE _prop) { return CheckState(_prop); } + int GetLastCheckDiff() { return (int)(TimeCurrent() - last_check); } static string GetStateMessage(ENUM_TRADE_STATE _state) { switch (_state) { case TRADE_STATE_BARS_NOT_ENOUGH: @@ -316,6 +394,16 @@ struct TradeStates { return "Soft limit of trade margin reached"; case TRADE_STATE_MARKET_CLOSED: return "Trade market closed"; + case TRADE_STATE_MODE_DISABLED: + return "Trade is disabled for the symbol"; + case TRADE_STATE_MODE_LONGONLY: + return "Market only allows long positions"; + case TRADE_STATE_MODE_SHORTONLY: + return "Market only allows short positions"; + case TRADE_STATE_MODE_CLOSEONLY: + return "Only close operations are allowed"; + case TRADE_STATE_MODE_FULL: + return "No trade restrictions"; case TRADE_STATE_MONEY_NOT_ENOUGH: return "Not enough money to trade"; case TRADE_STATE_ORDERS_ACTIVE: @@ -341,7 +429,10 @@ struct TradeStates { } return "Unknown!"; } - unsigned int GetStates() { return states; } + unsigned int GetStates() { + UpdateCheck(); + return states; + } // Struct methods for bitwise operations. bool CheckState(unsigned int _states) { return (states & _states) != 0 || states == _states; } bool CheckStatesAll(unsigned int _states) { return (states & _states) == _states; } diff --git a/Trade/TradeSignal.h b/Trade/TradeSignal.h index 7a48524f5..129cc2775 100644 --- a/Trade/TradeSignal.h +++ b/Trade/TradeSignal.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Trade/TradeSignal.struct.h b/Trade/TradeSignal.struct.h index 5b8221cce..8906592bb 100644 --- a/Trade/TradeSignal.struct.h +++ b/Trade/TradeSignal.struct.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Trade/TradeSignalManager.h b/Trade/TradeSignalManager.h index 87dd5c017..0b644e677 100644 --- a/Trade/TradeSignalManager.h +++ b/Trade/TradeSignalManager.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -45,8 +45,11 @@ class TradeSignalManager : Dynamic { */ void Init() { signals_active.AddFlags(DICT_FLAG_FILL_HOLES_UNSORTED); + signals_active.SetOverflowListener(SignalOverflowCallback, 10); signals_expired.AddFlags(DICT_FLAG_FILL_HOLES_UNSORTED); + signals_expired.SetOverflowListener(SignalOverflowCallback, 10); signals_processed.AddFlags(DICT_FLAG_FILL_HOLES_UNSORTED); + signals_processed.SetOverflowListener(SignalOverflowCallback, 10); } public: @@ -70,6 +73,43 @@ class TradeSignalManager : Dynamic { return params.Get(_prop); } + /** + * Gets a signal struct based on cache ID value. + * + * @param + * _cid Cache ID. + */ + TradeSignal *GetSignalByCid(int _cid) { + unsigned int _pos = 0; + if (signals_active.KeyExists(_cid, _pos)) { + return signals_active.GetByPos(_pos); + } else if (signals_processed.KeyExists(_cid, _pos)) { + return signals_processed.GetByPos(_pos); + } + return NULL; + } + + /** + * Checks if signal exists based on provided values. + * + * @param + * _magic_no Magic Number. + * _tf Timeframe value. + * _timestamp Timestamp. + */ + TradeSignal *GetSignalByCid(int _magic_no, int _tf, int _timestamp) { + return GetSignalByCid(_magic_no + _tf + _timestamp); + } + + /** + * Gets a cache ID based on the signal. + */ + int GetCid(TradeSignal &_signal) { + return _signal.Get(STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_PROP_MAGIC_ID)) + + _signal.Get(STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_PROP_TF)) + + _signal.Get(STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_PROP_TIME)); + } + /** * Gets an iterator instance. * @@ -113,7 +153,7 @@ class TradeSignalManager : Dynamic { * Adds new signal. * */ - void SignalAdd(TradeSignal &_signal) { signals_active.Push(_signal); } + void SignalAdd(TradeSignal &_signal) { signals_active.Set(GetCid(_signal), _signal); } /** * Refresh signals. @@ -126,12 +166,12 @@ class TradeSignalManager : Dynamic { TradeSignal *_signal = iter.Value(); if (_signal PTR_DEREF Get(STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_FLAG_PROCESSED))) { signals_active.Unset(iter); - signals_processed.Push(PTR_TO_REF(_signal)); + signals_processed.Set(GetCid(PTR_TO_REF(_signal)), PTR_TO_REF(_signal)); continue; } if (_signal PTR_DEREF Get(STRUCT_ENUM(TradeSignalEntry, TRADE_SIGNAL_FLAG_EXPIRED))) { signals_active.Unset(iter); - signals_expired.Push(PTR_TO_REF(_signal)); + signals_expired.Set(GetCid(PTR_TO_REF(_signal)), PTR_TO_REF(_signal)); continue; } } @@ -147,13 +187,32 @@ class TradeSignalManager : Dynamic { * _update Update last check timestamp when true. */ bool IsReady(bool _update = true) { - bool _res = Get(TSM_PROP_LAST_CHECK) + Get(TSM_PROP_FREQ) >= ::TimeGMT(); + bool _res = Get(TSM_PROP_LAST_CHECK) <= ::TimeGMT() - Get(TSM_PROP_FREQ); if (_res) { Set(TSM_PROP_LAST_CHECK, ::TimeGMT()); } return _res; } + /* Callback methods */ + + /** + * Function should return true if resize can be made, or false to overwrite current slot. + */ + static bool SignalOverflowCallback(ENUM_DICT_OVERFLOW_REASON _reason, int _size, int _num_conflicts) { + static int cache_limit = 1000; + switch (_reason) { + case DICT_OVERFLOW_REASON_FULL: + // We allow resize if dictionary size is less than 86400 slots. + return _size < cache_limit; + case DICT_OVERFLOW_REASON_TOO_MANY_CONFLICTS: + default: + // When there is too many conflicts, we just reject doing resize, so first conflicting slot will be reused. + break; + } + return false; + } + /* Serializers */ SERIALIZER_EMPTY_STUB; diff --git a/Trade/TradeSignalManager.struct.h b/Trade/TradeSignalManager.struct.h index d4be49393..81415ce02 100644 --- a/Trade/TradeSignalManager.struct.h +++ b/Trade/TradeSignalManager.struct.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Trade/tests/TradeSignal.test.cpp b/Trade/tests/TradeSignal.test.cpp index 696ec4422..998e8129f 100644 --- a/Trade/tests/TradeSignal.test.cpp +++ b/Trade/tests/TradeSignal.test.cpp @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Trade/tests/TradeSignalManager.test.cpp b/Trade/tests/TradeSignalManager.test.cpp index 7ca976d9f..2dbdeefef 100644 --- a/Trade/tests/TradeSignalManager.test.cpp +++ b/Trade/tests/TradeSignalManager.test.cpp @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Trade/tests/TradeSignalManagerTest.mq4 b/Trade/tests/TradeSignalManagerTest.mq4 index c199b1143..4daf84f36 100644 --- a/Trade/tests/TradeSignalManagerTest.mq4 +++ b/Trade/tests/TradeSignalManagerTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Trade/tests/TradeSignalManagerTest.mq5 b/Trade/tests/TradeSignalManagerTest.mq5 index f08fc242f..8cab44e6a 100644 --- a/Trade/tests/TradeSignalManagerTest.mq5 +++ b/Trade/tests/TradeSignalManagerTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -35,7 +35,7 @@ bool TestSignalsExpired() { TradeSignalManager _tsm(_tsm_params); _result &= _tsm.Get(TSM_PROP_FREQ) == 5; for (int i = 0; i < 10; i++) { - TradeSignalEntry _entry(i % 2 == 0 ? SIGNAL_OPEN_BUY_MAIN : SIGNAL_OPEN_SELL_MAIN); + TradeSignalEntry _entry(i % 2 == 0 ? SIGNAL_OPEN_BUY_MAIN : SIGNAL_OPEN_SELL_MAIN, PERIOD_CURRENT, i); TradeSignal _signal(_entry); _tsm.SignalAdd(_signal); } @@ -59,7 +59,7 @@ bool TestSignalsProcessed() { bool _result = true; TradeSignalManager _tsm; for (int i = 0; i < 10; i++) { - TradeSignalEntry _entry(i % 2 == 0 ? SIGNAL_OPEN_BUY_MAIN : SIGNAL_OPEN_SELL_MAIN); + TradeSignalEntry _entry(i % 2 == 0 ? SIGNAL_OPEN_BUY_MAIN : SIGNAL_OPEN_SELL_MAIN, PERIOD_CURRENT, i); TradeSignal _signal(_entry); _tsm.SignalAdd(_signal); } diff --git a/Trade/tests/TradeSignalTest.mq4 b/Trade/tests/TradeSignalTest.mq4 index 8c80fd59a..84a7ee94e 100644 --- a/Trade/tests/TradeSignalTest.mq4 +++ b/Trade/tests/TradeSignalTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Trade/tests/TradeSignalTest.mq5 b/Trade/tests/TradeSignalTest.mq5 index 7514a630a..8bad23661 100644 --- a/Trade/tests/TradeSignalTest.mq5 +++ b/Trade/tests/TradeSignalTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Util.h b/Util.h index 5dc592549..fd8e09a51 100644 --- a/Util.h +++ b/Util.h @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/Web.mqh b/Web.mqh index 75fbe6643..92635b538 100644 --- a/Web.mqh +++ b/Web.mqh @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/3DTest.mq5 b/tests/3DTest.mq5 index 63390f3da..0b9b8b8c9 100644 --- a/tests/3DTest.mq5 +++ b/tests/3DTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, 31337 Investments Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -9,12 +9,12 @@ * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ diff --git a/tests/AccountTest.cpp b/tests/AccountTest.cpp new file mode 100644 index 000000000..64570c48c --- /dev/null +++ b/tests/AccountTest.cpp @@ -0,0 +1,63 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://github.com/EA31337 | +//+------------------------------------------------------------------+ + +/* + * This file is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * @file + * Test functionality of Account class. + */ + +// Includes standard libraries. +#include + +// Defines aliases for data types. +typedef std::string string; +typedef unsigned char uchar; +typedef unsigned int uint; +typedef unsigned long ulong; +typedef unsigned short ushort; + + +// Includes. +#include "../Account.mqh" + +int main(int argc, char **argv) { + + // Initialize class. + Account *acc = new Account(); + + // Defines variables. + double _balance = AccountInfoDouble(ACCOUNT_BALANCE); + double _credit = AccountInfoDouble(ACCOUNT_CREDIT); + double _equity = AccountInfoDouble(ACCOUNT_EQUITY); + + // Dummy calls. + acc.GetAccountName(); + acc.GetCompanyName(); + acc.GetLogin(); + acc.GetServerName(); + + // Print account details. + Print(acc.ToString()); + Print(acc.ToCSV()); + + // Clean up. + delete acc; +} diff --git a/tests/BufferFXTTest.mq4 b/tests/BufferFXTTest.mq4 index 94bbf9cf4..1a30333a2 100644 --- a/tests/BufferFXTTest.mq4 +++ b/tests/BufferFXTTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2020, 31337 Investments Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/BufferFXTTest.mq5 b/tests/BufferFXTTest.mq5 index 207900565..fc721b91f 100644 --- a/tests/BufferFXTTest.mq5 +++ b/tests/BufferFXTTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2020, 31337 Investments Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/BufferStructTest.mq4 b/tests/BufferStructTest.mq4 index 96781a568..3a5dd3d31 100644 --- a/tests/BufferStructTest.mq4 +++ b/tests/BufferStructTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/BufferStructTest.mq5 b/tests/BufferStructTest.mq5 index f5881fb70..42b9e52a9 100644 --- a/tests/BufferStructTest.mq5 +++ b/tests/BufferStructTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/BufferTest.mq4 b/tests/BufferTest.mq4 index 20e88818d..00dae2a4e 100644 --- a/tests/BufferTest.mq4 +++ b/tests/BufferTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/BufferTest.mq5 b/tests/BufferTest.mq5 index 5a97cd837..f4b2d74a7 100644 --- a/tests/BufferTest.mq5 +++ b/tests/BufferTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/ChartTest.mq4 b/tests/ChartTest.mq4 index f6ca3752a..8498ca7c7 100644 --- a/tests/ChartTest.mq4 +++ b/tests/ChartTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/ChartTest.mq5 b/tests/ChartTest.mq5 index 903c084d6..5fd95b1f0 100644 --- a/tests/ChartTest.mq5 +++ b/tests/ChartTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/CompileIndicatorsTest.mq4 b/tests/CompileIndicatorsTest.mq4 index 5eac8e1a5..4be5ffc3d 100644 --- a/tests/CompileIndicatorsTest.mq4 +++ b/tests/CompileIndicatorsTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/CompileIndicatorsTest.mq5 b/tests/CompileIndicatorsTest.mq5 index f39b49c68..62f4b586a 100644 --- a/tests/CompileIndicatorsTest.mq5 +++ b/tests/CompileIndicatorsTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/CompileTest.mq4 b/tests/CompileTest.mq4 index 19320e3f5..b3e891e7a 100644 --- a/tests/CompileTest.mq4 +++ b/tests/CompileTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/CompileTest.mq5 b/tests/CompileTest.mq5 index 8654e9765..b08488613 100644 --- a/tests/CompileTest.mq5 +++ b/tests/CompileTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -26,13 +26,15 @@ // 3D includes (MQL5 only). #ifdef __MQL5__ -#include "../3D/Chart3D.h" +/* @fixme #include "../3D/Cube.h" #include "../3D/Devices/MTDX/MTDXDevice.h" #include "../3D/Devices/MTDX/MTDXIndexBuffer.h" #include "../3D/Devices/MTDX/MTDXShader.h" #include "../3D/Devices/MTDX/MTDXVertexBuffer.h" #include "../3D/Frontends/MT5Frontend.h" +#include "../3D/Chart3D.h" +*/ #endif // Includes. diff --git a/tests/ConfigTest.mq4 b/tests/ConfigTest.mq4 index 77a590a15..4d043b446 100644 --- a/tests/ConfigTest.mq4 +++ b/tests/ConfigTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/ConfigTest.mq5 b/tests/ConfigTest.mq5 index 2477a62f6..71e3b0fdf 100644 --- a/tests/ConfigTest.mq5 +++ b/tests/ConfigTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/ConvertTest.mq4 b/tests/ConvertTest.mq4 index c88dad353..711279063 100644 --- a/tests/ConvertTest.mq4 +++ b/tests/ConvertTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/ConvertTest.mq5 b/tests/ConvertTest.mq5 index fd1313264..901abcc56 100644 --- a/tests/ConvertTest.mq5 +++ b/tests/ConvertTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/DatabaseTest.mq4 b/tests/DatabaseTest.mq4 index eece18a82..2bbe12cee 100644 --- a/tests/DatabaseTest.mq4 +++ b/tests/DatabaseTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/DatabaseTest.mq5 b/tests/DatabaseTest.mq5 index c37b969c9..22d150186 100644 --- a/tests/DatabaseTest.mq5 +++ b/tests/DatabaseTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/DateTimeTest.mq4 b/tests/DateTimeTest.mq4 index 5ab59afd6..a509a6233 100644 --- a/tests/DateTimeTest.mq4 +++ b/tests/DateTimeTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/DateTimeTest.mq5 b/tests/DateTimeTest.mq5 index 6e8cfa6b5..3a524e29e 100644 --- a/tests/DateTimeTest.mq5 +++ b/tests/DateTimeTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/DictTest.mq4 b/tests/DictTest.mq4 index 994aabf5f..1f46ff282 100644 --- a/tests/DictTest.mq4 +++ b/tests/DictTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/DictTest.mq5 b/tests/DictTest.mq5 index 619dcc90f..c46c462ea 100644 --- a/tests/DictTest.mq5 +++ b/tests/DictTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/DrawIndicatorTest.mq4 b/tests/DrawIndicatorTest.mq4 index bbfbd8c25..c4fae6484 100644 --- a/tests/DrawIndicatorTest.mq4 +++ b/tests/DrawIndicatorTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/DrawIndicatorTest.mq5 b/tests/DrawIndicatorTest.mq5 index e93b1d311..1c98147f1 100644 --- a/tests/DrawIndicatorTest.mq5 +++ b/tests/DrawIndicatorTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/EATest.mq4 b/tests/EATest.mq4 index cc4665d32..ff71bd166 100644 --- a/tests/EATest.mq4 +++ b/tests/EATest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/EATest.mq5 b/tests/EATest.mq5 index 96eb8238f..9891ac8c1 100644 --- a/tests/EATest.mq5 +++ b/tests/EATest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/IndicatorBaseTest.mq4 b/tests/IndicatorBaseTest.mq4 index 167dec35e..fa5a9dd80 100644 --- a/tests/IndicatorBaseTest.mq4 +++ b/tests/IndicatorBaseTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/IndicatorBaseTest.mq5 b/tests/IndicatorBaseTest.mq5 index 8ca89f936..9c8877eb9 100644 --- a/tests/IndicatorBaseTest.mq5 +++ b/tests/IndicatorBaseTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/IndicatorDataTest.mq4 b/tests/IndicatorDataTest.mq4 index ec907afe1..b249402d6 100644 --- a/tests/IndicatorDataTest.mq4 +++ b/tests/IndicatorDataTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/IndicatorDataTest.mq5 b/tests/IndicatorDataTest.mq5 index bd6a17c11..601dc9d4a 100644 --- a/tests/IndicatorDataTest.mq5 +++ b/tests/IndicatorDataTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/IndicatorTest.mq4 b/tests/IndicatorTest.mq4 index f1bee4667..eb02d9786 100644 --- a/tests/IndicatorTest.mq4 +++ b/tests/IndicatorTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/IndicatorTest.mq5 b/tests/IndicatorTest.mq5 index e837f8e92..4dc4ae546 100644 --- a/tests/IndicatorTest.mq5 +++ b/tests/IndicatorTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/IndicatorsTest.mq4 b/tests/IndicatorsTest.mq4 index 45083af4a..e6abdbc06 100644 --- a/tests/IndicatorsTest.mq4 +++ b/tests/IndicatorsTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/IndicatorsTest.mq5 b/tests/IndicatorsTest.mq5 index a81afec09..a4184ae5b 100644 --- a/tests/IndicatorsTest.mq5 +++ b/tests/IndicatorsTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2022, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/LogTest.mq4 b/tests/LogTest.mq4 index 873e0a0ef..47bbd4e80 100644 --- a/tests/LogTest.mq4 +++ b/tests/LogTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/LogTest.mq5 b/tests/LogTest.mq5 index 049cc0e20..584468c30 100644 --- a/tests/LogTest.mq5 +++ b/tests/LogTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/MD5Test.mq4 b/tests/MD5Test.mq4 index 2321596e9..3311317e7 100644 --- a/tests/MD5Test.mq4 +++ b/tests/MD5Test.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/MD5Test.mq5 b/tests/MD5Test.mq5 index cceaaf214..8f9183a7f 100644 --- a/tests/MD5Test.mq5 +++ b/tests/MD5Test.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/MailTest.mq4 b/tests/MailTest.mq4 index a170a48d5..16e4fc12f 100644 --- a/tests/MailTest.mq4 +++ b/tests/MailTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/MailTest.mq5 b/tests/MailTest.mq5 index 8f90f1415..261273304 100644 --- a/tests/MailTest.mq5 +++ b/tests/MailTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/MarketTest.mq4 b/tests/MarketTest.mq4 index 2266f4d7c..628815528 100644 --- a/tests/MarketTest.mq4 +++ b/tests/MarketTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/MarketTest.mq5 b/tests/MarketTest.mq5 index 15ff8f639..f3a71ed8a 100644 --- a/tests/MarketTest.mq5 +++ b/tests/MarketTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/MathTest.mq4 b/tests/MathTest.mq4 index 24a8cf2e0..a24c55a36 100644 --- a/tests/MathTest.mq4 +++ b/tests/MathTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/MathTest.mq5 b/tests/MathTest.mq5 index b5f20d260..72027cb4f 100644 --- a/tests/MathTest.mq5 +++ b/tests/MathTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/MatrixTest.mq4 b/tests/MatrixTest.mq4 index 9cdca34a7..93394e04f 100644 --- a/tests/MatrixTest.mq4 +++ b/tests/MatrixTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/MatrixTest.mq5 b/tests/MatrixTest.mq5 index f1d3d679e..1462baec6 100644 --- a/tests/MatrixTest.mq5 +++ b/tests/MatrixTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/ObjectTest.cpp b/tests/ObjectTest.cpp new file mode 100644 index 000000000..bd281a86c --- /dev/null +++ b/tests/ObjectTest.cpp @@ -0,0 +1,46 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://github.com/EA31337 | +//+------------------------------------------------------------------+ + +/* + * This file is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * @file + * Test functionality of Object class. + */ + +// Includes standard libraries. +#include + +// Defines aliases for data types. +typedef std::string string; +typedef unsigned chart uchar; +typedef unsigned int uint; +typedef unsigned long ulong; +typedef unsigned short ushort; + +// Includes. +#include "../Object.mqh" + +// Variables. +Object *obj; + +int main(int argc, char **argv) { + obj = new Object(); + delete obj; +} diff --git a/tests/OrderQueryTest.mq4 b/tests/OrderQueryTest.mq4 index c18fa9667..50f752d0a 100644 --- a/tests/OrderQueryTest.mq4 +++ b/tests/OrderQueryTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/OrderQueryTest.mq5 b/tests/OrderQueryTest.mq5 index 8a4ada61b..dc5df5aeb 100644 --- a/tests/OrderQueryTest.mq5 +++ b/tests/OrderQueryTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/OrderTest.mq4 b/tests/OrderTest.mq4 index 093ac02d1..ff435bfa6 100644 --- a/tests/OrderTest.mq4 +++ b/tests/OrderTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/OrderTest.mq5 b/tests/OrderTest.mq5 index 26b447259..e5ad00135 100644 --- a/tests/OrderTest.mq5 +++ b/tests/OrderTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/OrdersTest.mq4 b/tests/OrdersTest.mq4 index b668077a2..ad295291d 100644 --- a/tests/OrdersTest.mq4 +++ b/tests/OrdersTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/OrdersTest.mq5 b/tests/OrdersTest.mq5 index 7f4d7d13c..e95bcb2f0 100644 --- a/tests/OrdersTest.mq5 +++ b/tests/OrdersTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/ProfilerTest.mq4 b/tests/ProfilerTest.mq4 index 2189d3522..8c5b765d1 100644 --- a/tests/ProfilerTest.mq4 +++ b/tests/ProfilerTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/ProfilerTest.mq5 b/tests/ProfilerTest.mq5 index 81e4cff72..f2f585114 100644 --- a/tests/ProfilerTest.mq5 +++ b/tests/ProfilerTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/RedisTest.mq4 b/tests/RedisTest.mq4 index 914b361f0..3f9b2c3e1 100644 --- a/tests/RedisTest.mq4 +++ b/tests/RedisTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/RedisTest.mq5 b/tests/RedisTest.mq5 index b8e14c4b0..85627167b 100644 --- a/tests/RedisTest.mq5 +++ b/tests/RedisTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/RefsTest.mq4 b/tests/RefsTest.mq4 index 99661abd6..69abbbf5f 100644 --- a/tests/RefsTest.mq4 +++ b/tests/RefsTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/RefsTest.mq5 b/tests/RefsTest.mq5 index c3a38c88b..b1ede0055 100644 --- a/tests/RefsTest.mq5 +++ b/tests/RefsTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/SerializerTest.mq4 b/tests/SerializerTest.mq4 index 8411f0c76..bb9b208a8 100644 --- a/tests/SerializerTest.mq4 +++ b/tests/SerializerTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/SerializerTest.mq5 b/tests/SerializerTest.mq5 index fb619c193..34398c515 100644 --- a/tests/SerializerTest.mq5 +++ b/tests/SerializerTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/StatsTest.mq4 b/tests/StatsTest.mq4 index 761a345d5..233cbd73a 100644 --- a/tests/StatsTest.mq4 +++ b/tests/StatsTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/StatsTest.mq5 b/tests/StatsTest.mq5 index 92ee64500..94080673b 100644 --- a/tests/StatsTest.mq5 +++ b/tests/StatsTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ @@ -28,36 +28,47 @@ #include "../Stats.mqh" // Variables. -Stats *stats; +Stats *stats_price; +Stats *stats_spread; /** * Implements OnInit(). */ int OnInit() { - stats = new Stats(); + stats_price = new Stats(); + stats_spread = new Stats(); return (INIT_SUCCEEDED); } /** * Implements OnTick(). */ -void OnTick() { stats.OnTick(); } - -/** - * Deletes created objects to free allocated memory. - */ -void CleanUp() { delete stats; } +void OnTick() { + stats_price.Add(SymbolInfoDouble(_Symbol, SYMBOL_ASK)); + stats_spread.Add((int) SymbolInfoInteger(_Symbol, SYMBOL_SPREAD)); +} /** * Implements OnDeinit(). */ void OnDeinit(const int reason) { - PrintFormat("Total bars : %d", stats.GetTotalBars()); - PrintFormat("Bars per hour : %d", stats.GetBarsPerPeriod(PERIOD_H1)); - PrintFormat("Total ticks : %d", stats.GetTotalTicks()); - PrintFormat("Ticks per bar : %d", stats.GetTicksPerBar()); - PrintFormat("Ticks per hour: %d", stats.GetTicksPerPeriod(PERIOD_H1)); - PrintFormat("Ticks per min : %d", stats.GetTicksPerMin()); - PrintFormat("Ticks per sec : %.2f", stats.GetTicksPerSec()); + PrintFormat("Total ticks : %d", stats_price.GetCount()); + PrintFormat("Ticks per min : %d", stats_price.GetCount(PERIOD_M1)); + PrintFormat("Ticks per hour : %d", stats_price.GetCount(PERIOD_H1)); + PrintFormat("Price (minimum) : %g", stats_price.GetStats(STATS_CALC_MIN)); + PrintFormat("Price (average) : %g", stats_price.GetStats(STATS_CALC_AVG)); + PrintFormat("Price (median) : %g", stats_price.GetStats(STATS_CALC_MED)); + PrintFormat("Price (maximum) : %g", stats_price.GetStats(STATS_CALC_MAX)); + PrintFormat("Spread (average) : %g", stats_spread.GetStats(STATS_CALC_AVG)); + //PrintFormat("Price (avg/hour) : %g", stats_price.GetStats(STATS_CALC_AVG, OBJ_PERIOD_H1)); // can be removed + //PrintFormat("Price (avg/???) : %g", stats_price.GetStats(STATS_CALC_MIN, OBJ_PERIOD_H1 | OBJ_PERIOD_H4)); // can be removed CleanUp(); } + +/** + * Deletes created objects to free allocated memory. + */ +void CleanUp() { + delete stats_price; + delete stats_spread; +} diff --git a/tests/StrategyTest-RSI.mq4 b/tests/StrategyTest-RSI.mq4 index ecc044edb..19b03e25b 100644 --- a/tests/StrategyTest-RSI.mq4 +++ b/tests/StrategyTest-RSI.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/StrategyTest-RSI.mq5 b/tests/StrategyTest-RSI.mq5 index 66a27b0ba..90a0554fc 100644 --- a/tests/StrategyTest-RSI.mq5 +++ b/tests/StrategyTest-RSI.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/StrategyTest.mq4 b/tests/StrategyTest.mq4 index 52b2c9a07..10ffc14dc 100644 --- a/tests/StrategyTest.mq4 +++ b/tests/StrategyTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/StrategyTest.mq5 b/tests/StrategyTest.mq5 index 140ca5972..9f2c95879 100644 --- a/tests/StrategyTest.mq5 +++ b/tests/StrategyTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/SummaryReportTest.mq4 b/tests/SummaryReportTest.mq4 index bc8d84c45..89b28b84a 100644 --- a/tests/SummaryReportTest.mq4 +++ b/tests/SummaryReportTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/SummaryReportTest.mq5 b/tests/SummaryReportTest.mq5 index d1159b5be..3cd9e607b 100644 --- a/tests/SummaryReportTest.mq5 +++ b/tests/SummaryReportTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/SymbolInfoTest.cpp b/tests/SymbolInfoTest.cpp new file mode 100644 index 000000000..5060f3bed --- /dev/null +++ b/tests/SymbolInfoTest.cpp @@ -0,0 +1,52 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://github.com/EA31337 | +//+------------------------------------------------------------------+ + +/* + * This file is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * @file + * Test functionality of SymbolInfo class. + */ + +// Includes standard libraries. +#include + +// Defines aliases for data types. +typedef std::string string; +typedef unsigned char uchar; +typedef unsigned int uint; +typedef unsigned long ulong; +typedef unsigned short ushort; + +// Includes. +#include "../SymbolInfo.mqh" + +int main(int argc, char **argv) { + SymbolInfo *si = new SymbolInfo(); + + // Test saving ticks. + si.SaveTick(dtick); + si.SaveTick(ltick); + si.ResetTicks(); + // Print. + Print("MARKET: ", si.ToString()); + Print("CSV (Header): ", si.ToCSV(true)); + Print("CSV (Data): ", si.ToCSV()); + delete si; +} diff --git a/tests/SymbolInfoTest.mq4 b/tests/SymbolInfoTest.mq4 index 1d6351fc9..577dd3003 100644 --- a/tests/SymbolInfoTest.mq4 +++ b/tests/SymbolInfoTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/SymbolInfoTest.mq5 b/tests/SymbolInfoTest.mq5 index 812ff341a..569a6f460 100644 --- a/tests/SymbolInfoTest.mq5 +++ b/tests/SymbolInfoTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/TerminalTest.cpp b/tests/TerminalTest.cpp new file mode 100644 index 000000000..f5b3696b2 --- /dev/null +++ b/tests/TerminalTest.cpp @@ -0,0 +1,42 @@ +//+------------------------------------------------------------------+ +//| EA31337 framework | +//| Copyright 2016-2023, EA31337 Ltd | +//| https://github.com/EA31337 | +//+------------------------------------------------------------------+ + +/* + * This file is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * @file + * Test functionality of Terminal class. + */ + +// Includes. +#include "../Terminal.mqh" + +// Variables. +Terminal *terminal; + +long TimeTradeServer() { return 0; } + +datetime TimeCurrent() { return 0; } + +datetime TimeCurrent(MqlDateTime &dt_struct) { return 0; } + +int main(int argc, char **argv) { + terminal = new Terminal(); + delete terminal; +} diff --git a/tests/TerminalTest.mq4 b/tests/TerminalTest.mq4 index 4736c2b6a..d092cd5eb 100644 --- a/tests/TerminalTest.mq4 +++ b/tests/TerminalTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/TerminalTest.mq5 b/tests/TerminalTest.mq5 index 3c9fe2441..27bed3c2f 100644 --- a/tests/TerminalTest.mq5 +++ b/tests/TerminalTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/TickerTest.mq4 b/tests/TickerTest.mq4 index 7b2143ce4..10b8413fd 100644 --- a/tests/TickerTest.mq4 +++ b/tests/TickerTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/TickerTest.mq5 b/tests/TickerTest.mq5 index dce53e832..db13e2964 100644 --- a/tests/TickerTest.mq5 +++ b/tests/TickerTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/TimerTest.mq4 b/tests/TimerTest.mq4 index c09cb1fea..485587ffb 100644 --- a/tests/TimerTest.mq4 +++ b/tests/TimerTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/TimerTest.mq5 b/tests/TimerTest.mq5 index 8ed0f1e83..d3f7a66d2 100644 --- a/tests/TimerTest.mq5 +++ b/tests/TimerTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/TradeTest.mq4 b/tests/TradeTest.mq4 index 211ec8d08..2c338fcbf 100644 --- a/tests/TradeTest.mq4 +++ b/tests/TradeTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/TradeTest.mq5 b/tests/TradeTest.mq5 index 1fe9f1ab6..022203d7f 100644 --- a/tests/TradeTest.mq5 +++ b/tests/TradeTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/ValueStorageTest.mq4 b/tests/ValueStorageTest.mq4 index c6968dc1b..ebbec6704 100644 --- a/tests/ValueStorageTest.mq4 +++ b/tests/ValueStorageTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/ValueStorageTest.mq5 b/tests/ValueStorageTest.mq5 index f7ed555fa..2230fa6c6 100644 --- a/tests/ValueStorageTest.mq5 +++ b/tests/ValueStorageTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/WebTest.mq4 b/tests/WebTest.mq4 index 288d0be6d..470483cde 100644 --- a/tests/WebTest.mq4 +++ b/tests/WebTest.mq4 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+ diff --git a/tests/WebTest.mq5 b/tests/WebTest.mq5 index 61b822e39..e6ca627ac 100644 --- a/tests/WebTest.mq5 +++ b/tests/WebTest.mq5 @@ -1,6 +1,6 @@ //+------------------------------------------------------------------+ //| EA31337 framework | -//| Copyright 2016-2021, EA31337 Ltd | +//| Copyright 2016-2023, EA31337 Ltd | //| https://github.com/EA31337 | //+------------------------------------------------------------------+