add some parser templates ...

This commit is contained in:
2024-08-07 16:22:10 +03:30
parent 5c5bf64118
commit 09e7f7b3dd
6 changed files with 262 additions and 0 deletions
+18
View File
@@ -5529,6 +5529,24 @@ struct XSymbolParser
return result;
}
//
bool IsDowJones(string symbol)
{
//
string symbolIdentifiers[] = {
"DowJoens30" //
};
//
bool result = Contains(
symbolIdentifiers,
symbol //
);
//
return result;
}
//
// Symbol Finder ...
string GetEURUSDSymbol()
@@ -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 XCHStartegyDOWJONESLongConditionsParser
{
//
string _version;
//
bool IsFiltered(
XCHStrategyConditions &conditions //
)
{
//
bool result = false;
//
result =
//
false
//
;
//
return result;
}
};
//
@@ -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 XCHStartegyDOWJONESShortConditionsParser
{
//
string _version;
//
bool IsFiltered(
XCHStrategyConditions &conditions //
)
{
//
bool result = false;
//
result =
//
false
//
;
//
return result;
}
};
//
@@ -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 XCHStartegyEMPTYLongConditionsParser
{
//
string _version;
//
bool IsFiltered(
XCHStrategyConditions &conditions //
)
{
//
bool result = false;
//
result =
//
false
//
;
//
return result;
}
};
//
@@ -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 XCHStartegyEMPTYShortConditionsParser
{
//
string _version;
//
bool IsFiltered(
XCHStrategyConditions &conditions //
)
{
//
bool result = false;
//
result =
//
false
//
;
//
return result;
}
};
//
+28
View File
@@ -25,6 +25,8 @@
#include "../Strategies/x-saherelm.xch.strategy.mq5"
//
#include "../Parsers/x-saherelm.xch.dowj.long.parser.mq5"
#include "../Parsers/x-saherelm.xch.dowj.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"
@@ -69,6 +71,10 @@ struct XCHStartegyConditionsParser
XCHStartegyXAUUSDLongConditionsParser _xauusdLongParser;
XCHStartegyXAUUSDShortConditionsParser _xauusdShortParser;
//
XCHStartegyDOWJONESLongConditionsParser _dowjonesLongParser;
XCHStartegyDOWJONESShortConditionsParser _dowjonesShortParser;
//
string GenerateSignalConditions(XCHStrategyConditions &conditions)
{
@@ -828,6 +834,7 @@ struct XCHStartegyConditionsParser
bool isXAUUSD = _symbolParser.IsXAUUSD(signal.symbol);
bool isUSDJPY = _symbolParser.IsUSDJPY(signal.symbol);
bool isUSDCHF = _symbolParser.IsUSDCHF(signal.symbol);
bool isDowJones = _symbolParser.IsDownJones(signal.symbol);
//
if (!force)
@@ -863,6 +870,12 @@ struct XCHStartegyConditionsParser
result =
_xauusdLongParser.IsFiltered(conditions);
}
else if (isDowJones)
{
//
result =
_dowjonesLongParser.IsFiltered(conditions);
}
}
else
{
@@ -887,6 +900,10 @@ struct XCHStartegyConditionsParser
//
_xauusdLongParser.IsFiltered(conditions)
//
||
//
_dowjonesLongParser.IsFiltered(conditions)
//
;
}
@@ -911,6 +928,7 @@ struct XCHStartegyConditionsParser
bool isXAUUSD = _symbolParser.IsXAUUSD(signal.symbol);
bool isUSDJPY = _symbolParser.IsUSDJPY(signal.symbol);
bool isUSDCHF = _symbolParser.IsUSDCHF(signal.symbol);
bool isDowJones = _symbolParser.IsDownJones(signal.symbol);
//
if (!force)
@@ -946,6 +964,12 @@ struct XCHStartegyConditionsParser
result =
_xauusdShortParser.IsFiltered(conditions);
}
else if (isDowJones)
{
//
result =
_dowjonesShortParser.IsFiltered(conditions);
}
}
else
{
@@ -970,6 +994,10 @@ struct XCHStartegyConditionsParser
//
_xauusdShortParser.IsFiltered(conditions)
//
||
//
_dowjonesShortParser.IsFiltered(conditions)
//
;
}