From d21ed8fc08e294b7e150e8928d6614003096e1dd Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Fri, 9 Aug 2024 19:22:29 +0330 Subject: [PATCH] add support for empty signal filtering for AUDUSD,NZDUSD,USDCAD ... --- Parsers/x-saherelm.xch.audusd.long.parser.mq5 | 54 +++++++++ .../x-saherelm.xch.audusd.short.parser.mq5 | 54 +++++++++ Parsers/x-saherelm.xch.nzdusd.long.parser.mq5 | 54 +++++++++ .../x-saherelm.xch.nzdusd.short.parser.mq5 | 54 +++++++++ Parsers/x-saherelm.xch.parser.mq5 | 104 +++++++++++++++++- Parsers/x-saherelm.xch.usdcad.long.parser.mq5 | 54 +++++++++ .../x-saherelm.xch.usdcad.short.parser.mq5 | 54 +++++++++ 7 files changed, 424 insertions(+), 4 deletions(-) create mode 100644 Parsers/x-saherelm.xch.audusd.long.parser.mq5 create mode 100644 Parsers/x-saherelm.xch.audusd.short.parser.mq5 create mode 100644 Parsers/x-saherelm.xch.nzdusd.long.parser.mq5 create mode 100644 Parsers/x-saherelm.xch.nzdusd.short.parser.mq5 create mode 100644 Parsers/x-saherelm.xch.usdcad.long.parser.mq5 create mode 100644 Parsers/x-saherelm.xch.usdcad.short.parser.mq5 diff --git a/Parsers/x-saherelm.xch.audusd.long.parser.mq5 b/Parsers/x-saherelm.xch.audusd.long.parser.mq5 new file mode 100644 index 00000000..dec9aa4c --- /dev/null +++ b/Parsers/x-saherelm.xch.audusd.long.parser.mq5 @@ -0,0 +1,54 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL5 Strategy Parser Library +// ------------------------------------------------ +// Name: XCHStartegyConditionsParser +// Description: provide all conditions parsing +// for XCH Strategy ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Imports ... +#include "../Strategies/x-saherelm.xch.strategy.mq5" + +// +// Conditions Parser ... +struct XCHStartegyAUDUSDLongConditionsParser +{ + // + string _version; + + // + bool IsFiltered( + XCHStrategyConditions &conditions // + ) + { + // + bool result = false; + + // + result = + // + false + // + ; + + // + return result; + } +}; + +// \ No newline at end of file diff --git a/Parsers/x-saherelm.xch.audusd.short.parser.mq5 b/Parsers/x-saherelm.xch.audusd.short.parser.mq5 new file mode 100644 index 00000000..48896f6b --- /dev/null +++ b/Parsers/x-saherelm.xch.audusd.short.parser.mq5 @@ -0,0 +1,54 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL5 Strategy Parser Library +// ------------------------------------------------ +// Name: XCHStartegyConditionsParser +// Description: provide all conditions parsing +// for XCH Strategy ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Imports ... +#include "../Strategies/x-saherelm.xch.strategy.mq5" + +// +// Conditions Parser ... +struct XCHStartegyAUDUSDShortConditionsParser +{ + // + string _version; + + // + bool IsFiltered( + XCHStrategyConditions &conditions // + ) + { + // + bool result = false; + + // + result = + // + false + // + ; + + // + return result; + } +}; + +// \ No newline at end of file diff --git a/Parsers/x-saherelm.xch.nzdusd.long.parser.mq5 b/Parsers/x-saherelm.xch.nzdusd.long.parser.mq5 new file mode 100644 index 00000000..30d2f2ee --- /dev/null +++ b/Parsers/x-saherelm.xch.nzdusd.long.parser.mq5 @@ -0,0 +1,54 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL5 Strategy Parser Library +// ------------------------------------------------ +// Name: XCHStartegyConditionsParser +// Description: provide all conditions parsing +// for XCH Strategy ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Imports ... +#include "../Strategies/x-saherelm.xch.strategy.mq5" + +// +// Conditions Parser ... +struct XCHStartegyNZDUSDLongConditionsParser +{ + // + string _version; + + // + bool IsFiltered( + XCHStrategyConditions &conditions // + ) + { + // + bool result = false; + + // + result = + // + false + // + ; + + // + return result; + } +}; + +// \ No newline at end of file diff --git a/Parsers/x-saherelm.xch.nzdusd.short.parser.mq5 b/Parsers/x-saherelm.xch.nzdusd.short.parser.mq5 new file mode 100644 index 00000000..fc12a484 --- /dev/null +++ b/Parsers/x-saherelm.xch.nzdusd.short.parser.mq5 @@ -0,0 +1,54 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL5 Strategy Parser Library +// ------------------------------------------------ +// Name: XCHStartegyConditionsParser +// Description: provide all conditions parsing +// for XCH Strategy ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Imports ... +#include "../Strategies/x-saherelm.xch.strategy.mq5" + +// +// Conditions Parser ... +struct XCHStartegyNZDUSDShortConditionsParser +{ + // + string _version; + + // + bool IsFiltered( + XCHStrategyConditions &conditions // + ) + { + // + bool result = false; + + // + result = + // + false + // + ; + + // + return result; + } +}; + +// \ No newline at end of file diff --git a/Parsers/x-saherelm.xch.parser.mq5 b/Parsers/x-saherelm.xch.parser.mq5 index 57007a3f..817f01bb 100644 --- a/Parsers/x-saherelm.xch.parser.mq5 +++ b/Parsers/x-saherelm.xch.parser.mq5 @@ -27,6 +27,12 @@ // #include "../Parsers/x-saherelm.xch.dowj.long.parser.mq5" #include "../Parsers/x-saherelm.xch.dowj.short.parser.mq5" +#include "../Parsers/x-saherelm.xch.audusd.long.parser.mq5" +#include "../Parsers/x-saherelm.xch.audusd.short.parser.mq5" +#include "../Parsers/x-saherelm.xch.nzdusd.long.parser.mq5" +#include "../Parsers/x-saherelm.xch.nzdusd.short.parser.mq5" +#include "../Parsers/x-saherelm.xch.usdcad.long.parser.mq5" +#include "../Parsers/x-saherelm.xch.usdcad.short.parser.mq5" #include "../Parsers/x-saherelm.xch.eurusd.long.parser.mq5" #include "../Parsers/x-saherelm.xch.eurusd.short.parser.mq5" #include "../Parsers/x-saherelm.xch.usdjpy.long.parser.mq5" @@ -52,29 +58,50 @@ struct XCHStartegyConditionsParser XSymbolParser _symbolParser; // + // EURUSD ... XCHStartegyEURUSDLongConditionsParser _eurusdLongParser; XCHStartegyEURUSDShortConditionsParser _eurusdShortParser; // + // GBPUSD ... XCHStartegyGBPUSDLongConditionsParser _gbpusdLongParser; XCHStartegyGBPUSDShortConditionsParser _gbpusdShortParser; // + // USDJPY ... XCHStartegyUSDJPYLongConditionsParser _usdjpyLongParser; XCHStartegyUSDJPYShortConditionsParser _usdjpyShortParser; // + // USDCHF ... XCHStartegyUSDCHFLongConditionsParser _usdchfLongParser; XCHStartegyUSDCHFShortConditionsParser _usdchfShortParser; // + // XAUUSD ... XCHStartegyXAUUSDLongConditionsParser _xauusdLongParser; XCHStartegyXAUUSDShortConditionsParser _xauusdShortParser; // + // DOWJONES ... XCHStartegyDOWJONESLongConditionsParser _dowjonesLongParser; XCHStartegyDOWJONESShortConditionsParser _dowjonesShortParser; + // + // AUDUSD ... + XCHStartegyAUDUSDLongConditionsParser _audusdLongParser; + XCHStartegyAUDUSDShortConditionsParser _audusdShortParser; + + // + // NZDUSD ... + XCHStartegyNZDUSDLongConditionsParser _nzdusdLongParser; + XCHStartegyNZDUSDShortConditionsParser _nzdusdShortParser; + + // + // USDCAD ... + XCHStartegyUSDCADLongConditionsParser _usdcadLongParser; + XCHStartegyUSDCADShortConditionsParser _usdcadShortParser; + // string GenerateSignalConditions( XSignal &signal, @@ -783,8 +810,9 @@ struct XCHStartegyConditionsParser // bool IsFiltered( - XSignal &signal, // Provided Signal - XCHStrategyConditions &conditions // Market Conditions + XSignal &signal, // Provided Signal + XCHStrategyConditions &conditions, // Market Conditions + bool force = false // ) { // @@ -808,11 +836,13 @@ struct XCHStartegyConditionsParser isLong ? IsLongFiltered( signal, - conditions // + conditions, + force // ) : IsShortFiltered( signal, - conditions // + conditions, + force // ) // ; @@ -838,6 +868,9 @@ struct XCHStartegyConditionsParser bool isXAUUSD = _symbolParser.IsXAUUSD(signal.symbol); bool isUSDJPY = _symbolParser.IsUSDJPY(signal.symbol); bool isUSDCHF = _symbolParser.IsUSDCHF(signal.symbol); + bool isAUDUSD = _symbolParser.IsAUDUSD(signal.symbol); + bool isNZDUSD = _symbolParser.IsNZDUSD(signal.symbol); + bool isUSDCAD = _symbolParser.IsUSDCAD(signal.symbol); bool isDowJones = _symbolParser.IsDowJones(signal.symbol); // @@ -874,6 +907,24 @@ struct XCHStartegyConditionsParser result = _xauusdLongParser.IsFiltered(conditions); } + else if (isAUDUSD) + { + // + result = + _audusdLongParser.IsFiltered(conditions); + } + else if (isNZDUSD) + { + // + result = + _nzdusdLongParser.IsFiltered(conditions); + } + else if (isUSDCAD) + { + // + result = + _usdcadLongParser.IsFiltered(conditions); + } else if (isDowJones) { // @@ -906,6 +957,18 @@ struct XCHStartegyConditionsParser // || // + _audusdLongParser.IsFiltered(conditions) + // + || + // + _nzdusdLongParser.IsFiltered(conditions) + // + || + // + _usdcadLongParser.IsFiltered(conditions) + // + || + // _dowjonesLongParser.IsFiltered(conditions) // ; @@ -932,6 +995,9 @@ struct XCHStartegyConditionsParser bool isXAUUSD = _symbolParser.IsXAUUSD(signal.symbol); bool isUSDJPY = _symbolParser.IsUSDJPY(signal.symbol); bool isUSDCHF = _symbolParser.IsUSDCHF(signal.symbol); + bool isAUDUSD = _symbolParser.IsAUDUSD(signal.symbol); + bool isNZDUSD = _symbolParser.IsNZDUSD(signal.symbol); + bool isUSDCAD = _symbolParser.IsUSDCAD(signal.symbol); bool isDowJones = _symbolParser.IsDowJones(signal.symbol); // @@ -968,6 +1034,24 @@ struct XCHStartegyConditionsParser result = _xauusdShortParser.IsFiltered(conditions); } + else if (isAUDUSD) + { + // + result = + _audusdShortParser.IsFiltered(conditions); + } + else if (isNZDUSD) + { + // + result = + _nzdusdShortParser.IsFiltered(conditions); + } + else if (isUSDCAD) + { + // + result = + _usdcadShortParser.IsFiltered(conditions); + } else if (isDowJones) { // @@ -1000,6 +1084,18 @@ struct XCHStartegyConditionsParser // || // + _audusdShortParser.IsFiltered(conditions) + // + || + // + _nzdusdShortParser.IsFiltered(conditions) + // + || + // + _usdcadShortParser.IsFiltered(conditions) + // + || + // _dowjonesShortParser.IsFiltered(conditions) // ; diff --git a/Parsers/x-saherelm.xch.usdcad.long.parser.mq5 b/Parsers/x-saherelm.xch.usdcad.long.parser.mq5 new file mode 100644 index 00000000..b52a641e --- /dev/null +++ b/Parsers/x-saherelm.xch.usdcad.long.parser.mq5 @@ -0,0 +1,54 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL5 Strategy Parser Library +// ------------------------------------------------ +// Name: XCHStartegyConditionsParser +// Description: provide all conditions parsing +// for XCH Strategy ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Imports ... +#include "../Strategies/x-saherelm.xch.strategy.mq5" + +// +// Conditions Parser ... +struct XCHStartegyUSDCADLongConditionsParser +{ + // + string _version; + + // + bool IsFiltered( + XCHStrategyConditions &conditions // + ) + { + // + bool result = false; + + // + result = + // + false + // + ; + + // + return result; + } +}; + +// \ No newline at end of file diff --git a/Parsers/x-saherelm.xch.usdcad.short.parser.mq5 b/Parsers/x-saherelm.xch.usdcad.short.parser.mq5 new file mode 100644 index 00000000..f5085245 --- /dev/null +++ b/Parsers/x-saherelm.xch.usdcad.short.parser.mq5 @@ -0,0 +1,54 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL5 Strategy Parser Library +// ------------------------------------------------ +// Name: XCHStartegyConditionsParser +// Description: provide all conditions parsing +// for XCH Strategy ... +// +// +// Maintainer: +// ------------ +// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) +// +////////////////////////////////////////////////////// +// +// Global Properties ... +#property library +#property copyright "Copyright 2023, SaherElm IT Center" +#property link "https://www.saherelm.ir" +#property version "1.00" +#property strict + +// +// Imports ... +#include "../Strategies/x-saherelm.xch.strategy.mq5" + +// +// Conditions Parser ... +struct XCHStartegyUSDCADShortConditionsParser +{ + // + string _version; + + // + bool IsFiltered( + XCHStrategyConditions &conditions // + ) + { + // + bool result = false; + + // + result = + // + false + // + ; + + // + return result; + } +}; + +// \ No newline at end of file