add some parser templates ...
This commit is contained in:
@@ -5529,6 +5529,24 @@ struct XSymbolParser
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
bool IsDowJones(string symbol)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
string symbolIdentifiers[] = {
|
||||||
|
"DowJoens30" //
|
||||||
|
};
|
||||||
|
|
||||||
|
//
|
||||||
|
bool result = Contains(
|
||||||
|
symbolIdentifiers,
|
||||||
|
symbol //
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Symbol Finder ...
|
// Symbol Finder ...
|
||||||
string GetEURUSDSymbol()
|
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;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
//
|
||||||
@@ -25,6 +25,8 @@
|
|||||||
#include "../Strategies/x-saherelm.xch.strategy.mq5"
|
#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.long.parser.mq5"
|
||||||
#include "../Parsers/x-saherelm.xch.eurusd.short.parser.mq5"
|
#include "../Parsers/x-saherelm.xch.eurusd.short.parser.mq5"
|
||||||
#include "../Parsers/x-saherelm.xch.usdjpy.long.parser.mq5"
|
#include "../Parsers/x-saherelm.xch.usdjpy.long.parser.mq5"
|
||||||
@@ -69,6 +71,10 @@ struct XCHStartegyConditionsParser
|
|||||||
XCHStartegyXAUUSDLongConditionsParser _xauusdLongParser;
|
XCHStartegyXAUUSDLongConditionsParser _xauusdLongParser;
|
||||||
XCHStartegyXAUUSDShortConditionsParser _xauusdShortParser;
|
XCHStartegyXAUUSDShortConditionsParser _xauusdShortParser;
|
||||||
|
|
||||||
|
//
|
||||||
|
XCHStartegyDOWJONESLongConditionsParser _dowjonesLongParser;
|
||||||
|
XCHStartegyDOWJONESShortConditionsParser _dowjonesShortParser;
|
||||||
|
|
||||||
//
|
//
|
||||||
string GenerateSignalConditions(XCHStrategyConditions &conditions)
|
string GenerateSignalConditions(XCHStrategyConditions &conditions)
|
||||||
{
|
{
|
||||||
@@ -828,6 +834,7 @@ struct XCHStartegyConditionsParser
|
|||||||
bool isXAUUSD = _symbolParser.IsXAUUSD(signal.symbol);
|
bool isXAUUSD = _symbolParser.IsXAUUSD(signal.symbol);
|
||||||
bool isUSDJPY = _symbolParser.IsUSDJPY(signal.symbol);
|
bool isUSDJPY = _symbolParser.IsUSDJPY(signal.symbol);
|
||||||
bool isUSDCHF = _symbolParser.IsUSDCHF(signal.symbol);
|
bool isUSDCHF = _symbolParser.IsUSDCHF(signal.symbol);
|
||||||
|
bool isDowJones = _symbolParser.IsDownJones(signal.symbol);
|
||||||
|
|
||||||
//
|
//
|
||||||
if (!force)
|
if (!force)
|
||||||
@@ -863,6 +870,12 @@ struct XCHStartegyConditionsParser
|
|||||||
result =
|
result =
|
||||||
_xauusdLongParser.IsFiltered(conditions);
|
_xauusdLongParser.IsFiltered(conditions);
|
||||||
}
|
}
|
||||||
|
else if (isDowJones)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
result =
|
||||||
|
_dowjonesLongParser.IsFiltered(conditions);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -887,6 +900,10 @@ struct XCHStartegyConditionsParser
|
|||||||
//
|
//
|
||||||
_xauusdLongParser.IsFiltered(conditions)
|
_xauusdLongParser.IsFiltered(conditions)
|
||||||
//
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
_dowjonesLongParser.IsFiltered(conditions)
|
||||||
|
//
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -911,6 +928,7 @@ struct XCHStartegyConditionsParser
|
|||||||
bool isXAUUSD = _symbolParser.IsXAUUSD(signal.symbol);
|
bool isXAUUSD = _symbolParser.IsXAUUSD(signal.symbol);
|
||||||
bool isUSDJPY = _symbolParser.IsUSDJPY(signal.symbol);
|
bool isUSDJPY = _symbolParser.IsUSDJPY(signal.symbol);
|
||||||
bool isUSDCHF = _symbolParser.IsUSDCHF(signal.symbol);
|
bool isUSDCHF = _symbolParser.IsUSDCHF(signal.symbol);
|
||||||
|
bool isDowJones = _symbolParser.IsDownJones(signal.symbol);
|
||||||
|
|
||||||
//
|
//
|
||||||
if (!force)
|
if (!force)
|
||||||
@@ -946,6 +964,12 @@ struct XCHStartegyConditionsParser
|
|||||||
result =
|
result =
|
||||||
_xauusdShortParser.IsFiltered(conditions);
|
_xauusdShortParser.IsFiltered(conditions);
|
||||||
}
|
}
|
||||||
|
else if (isDowJones)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
result =
|
||||||
|
_dowjonesShortParser.IsFiltered(conditions);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -970,6 +994,10 @@ struct XCHStartegyConditionsParser
|
|||||||
//
|
//
|
||||||
_xauusdShortParser.IsFiltered(conditions)
|
_xauusdShortParser.IsFiltered(conditions)
|
||||||
//
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
_dowjonesShortParser.IsFiltered(conditions)
|
||||||
|
//
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user