last ...
This commit is contained in:
@@ -25,32 +25,7 @@
|
||||
#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.eurgbp.long.parser.mq5"
|
||||
#include "../Parsers/x-saherelm.xch.eurgbp.short.parser.mq5"
|
||||
#include "../Parsers/x-saherelm.xch.eurjpy.long.parser.mq5"
|
||||
#include "../Parsers/x-saherelm.xch.eurjpy.short.parser.mq5"
|
||||
#include "../Parsers/x-saherelm.xch.eurchf.long.parser.mq5"
|
||||
#include "../Parsers/x-saherelm.xch.eurchf.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.eurcad.long.parser.mq5"
|
||||
#include "../Parsers/x-saherelm.xch.eurcad.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"
|
||||
#include "../Parsers/x-saherelm.xch.usdjpy.short.parser.mq5"
|
||||
#include "../Parsers/x-saherelm.xch.usdchf.long.parser.mq5"
|
||||
#include "../Parsers/x-saherelm.xch.usdchf.short.parser.mq5"
|
||||
#include "../Parsers/x-saherelm.xch.gbpusd.long.parser.mq5"
|
||||
#include "../Parsers/x-saherelm.xch.gbpusd.short.parser.mq5"
|
||||
#include "../Parsers/x-saherelm.xch.xauusd.long.parser.mq5"
|
||||
#include "../Parsers/x-saherelm.xch.xauusd.short.parser.mq5"
|
||||
#include "./AMarkets/x-saherelm.xch.amarkets.parser.mq5"
|
||||
|
||||
//
|
||||
// Conditions Parser ...
|
||||
@@ -64,73 +39,10 @@ struct XCHStartegyConditionsParser
|
||||
|
||||
//
|
||||
XSCAccount _account;
|
||||
XSymbolParser _symbolParser;
|
||||
XMarketParser _marketParser;
|
||||
|
||||
//
|
||||
// EURUSD ...
|
||||
XCHStartegyEURUSDLongConditionsParser _eurusdLongParser;
|
||||
XCHStartegyEURUSDShortConditionsParser _eurusdShortParser;
|
||||
|
||||
//
|
||||
// GBPUSD ...
|
||||
XCHStartegyGBPUSDLongConditionsParser _gbpusdLongParser;
|
||||
XCHStartegyGBPUSDShortConditionsParser _gbpusdShortParser;
|
||||
|
||||
//
|
||||
// EURGBP ...
|
||||
XCHStartegyEURGBPLongConditionsParser _eurgbpLongParser;
|
||||
XCHStartegyEURGBPShortConditionsParser _eurgbpShortParser;
|
||||
|
||||
//
|
||||
// USDJPY ...
|
||||
XCHStartegyUSDJPYLongConditionsParser _usdjpyLongParser;
|
||||
XCHStartegyUSDJPYShortConditionsParser _usdjpyShortParser;
|
||||
|
||||
//
|
||||
// EURJPY ...
|
||||
XCHStartegyEURJPYLongConditionsParser _eurjpyLongParser;
|
||||
XCHStartegyEURJPYShortConditionsParser _eurjpyShortParser;
|
||||
|
||||
//
|
||||
// USDCHF ...
|
||||
XCHStartegyUSDCHFLongConditionsParser _usdchfLongParser;
|
||||
XCHStartegyUSDCHFShortConditionsParser _usdchfShortParser;
|
||||
|
||||
//
|
||||
// EURCHF ...
|
||||
XCHStartegyEURCHFLongConditionsParser _eurchfLongParser;
|
||||
XCHStartegyEURCHFShortConditionsParser _eurchfShortParser;
|
||||
|
||||
//
|
||||
// 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;
|
||||
|
||||
//
|
||||
// EURCAD ...
|
||||
XCHStartegyEURCADLongConditionsParser _eurcadLongParser;
|
||||
XCHStartegyEURCADShortConditionsParser _eurcadShortParser;
|
||||
XCHStartegyAMarketsConditionsParser _amarketsParser;
|
||||
|
||||
//
|
||||
string GenerateSignalConditions(
|
||||
@@ -857,372 +769,32 @@ struct XCHStartegyConditionsParser
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
bool isLong = IsLong(signal.type);
|
||||
|
||||
//
|
||||
result =
|
||||
//
|
||||
isLong
|
||||
? IsLongFiltered(
|
||||
signal,
|
||||
conditions,
|
||||
force //
|
||||
)
|
||||
: IsShortFiltered(
|
||||
signal,
|
||||
conditions,
|
||||
force //
|
||||
)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Filter Long Signals ...
|
||||
bool IsLongFiltered(
|
||||
XSignal &signal,
|
||||
XCHStrategyConditions &conditions,
|
||||
bool force = false //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
bool isEURUSD = _symbolParser.IsEURUSD(signal.symbol);
|
||||
bool isGBPUSD = _symbolParser.IsGBPUSD(signal.symbol);
|
||||
bool isEURGBP = _symbolParser.IsEURGBP(signal.symbol);
|
||||
bool isXAUUSD = _symbolParser.IsXAUUSD(signal.symbol);
|
||||
bool isUSDJPY = _symbolParser.IsUSDJPY(signal.symbol);
|
||||
bool isEURJPY = _symbolParser.IsEURJPY(signal.symbol);
|
||||
bool isUSDCHF = _symbolParser.IsUSDCHF(signal.symbol);
|
||||
bool isEURCHF = _symbolParser.IsEURCHF(signal.symbol);
|
||||
bool isAUDUSD = _symbolParser.IsAUDUSD(signal.symbol);
|
||||
bool isNZDUSD = _symbolParser.IsNZDUSD(signal.symbol);
|
||||
bool isUSDCAD = _symbolParser.IsUSDCAD(signal.symbol);
|
||||
bool isEURCAD = _symbolParser.IsEURCAD(signal.symbol);
|
||||
bool isDowJones = _symbolParser.IsDowJones(signal.symbol);
|
||||
|
||||
//
|
||||
string market = _account.GetCompany();
|
||||
bool isAMarkets = _marketParser.IsAMarkets(market);
|
||||
|
||||
//
|
||||
bool isAMarketFiltered = _amarketsParser.IsFiltered(
|
||||
signal,
|
||||
conditions,
|
||||
force //
|
||||
);
|
||||
|
||||
//
|
||||
if (!force)
|
||||
{
|
||||
//
|
||||
if (isEURUSD)
|
||||
{
|
||||
//
|
||||
result =
|
||||
_eurusdLongParser.IsFiltered(conditions);
|
||||
}
|
||||
else if (isGBPUSD)
|
||||
{
|
||||
//
|
||||
result =
|
||||
_gbpusdLongParser.IsFiltered(conditions);
|
||||
}
|
||||
else if (isEURGBP)
|
||||
{
|
||||
//
|
||||
result =
|
||||
_eurgbpLongParser.IsFiltered(conditions);
|
||||
}
|
||||
else if (isUSDJPY)
|
||||
{
|
||||
//
|
||||
result =
|
||||
_usdjpyLongParser.IsFiltered(conditions);
|
||||
}
|
||||
else if (isEURJPY)
|
||||
{
|
||||
//
|
||||
result =
|
||||
_eurjpyLongParser.IsFiltered(conditions);
|
||||
}
|
||||
else if (isUSDCHF)
|
||||
{
|
||||
//
|
||||
result =
|
||||
_usdchfLongParser.IsFiltered(conditions);
|
||||
}
|
||||
else if (isEURCHF)
|
||||
{
|
||||
//
|
||||
result =
|
||||
_eurchfLongParser.IsFiltered(conditions);
|
||||
}
|
||||
else if (isXAUUSD)
|
||||
{
|
||||
//
|
||||
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 (isEURCAD)
|
||||
{
|
||||
//
|
||||
result =
|
||||
_eurcadLongParser.IsFiltered(conditions);
|
||||
}
|
||||
else if (isDowJones)
|
||||
{
|
||||
//
|
||||
result =
|
||||
_dowjonesLongParser.IsFiltered(conditions);
|
||||
}
|
||||
result = isAMarketFiltered;
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
result =
|
||||
//
|
||||
_eurusdLongParser.IsFiltered(conditions)
|
||||
isAMarketFiltered
|
||||
//
|
||||
||
|
||||
//
|
||||
_gbpusdLongParser.IsFiltered(conditions)
|
||||
//
|
||||
||
|
||||
//
|
||||
_eurgbpLongParser.IsFiltered(conditions)
|
||||
//
|
||||
||
|
||||
//
|
||||
_usdjpyLongParser.IsFiltered(conditions)
|
||||
//
|
||||
||
|
||||
//
|
||||
_eurjpyLongParser.IsFiltered(conditions)
|
||||
//
|
||||
||
|
||||
//
|
||||
_usdchfLongParser.IsFiltered(conditions)
|
||||
//
|
||||
||
|
||||
//
|
||||
_eurchfLongParser.IsFiltered(conditions)
|
||||
//
|
||||
||
|
||||
//
|
||||
_xauusdLongParser.IsFiltered(conditions)
|
||||
//
|
||||
||
|
||||
//
|
||||
_audusdLongParser.IsFiltered(conditions)
|
||||
//
|
||||
||
|
||||
//
|
||||
_nzdusdLongParser.IsFiltered(conditions)
|
||||
//
|
||||
||
|
||||
//
|
||||
_usdcadLongParser.IsFiltered(conditions)
|
||||
//
|
||||
||
|
||||
//
|
||||
_eurcadLongParser.IsFiltered(conditions)
|
||||
//
|
||||
||
|
||||
//
|
||||
_dowjonesLongParser.IsFiltered(conditions)
|
||||
//
|
||||
;
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Filter Short Signals ...
|
||||
bool IsShortFiltered(
|
||||
XSignal &signal,
|
||||
XCHStrategyConditions &conditions,
|
||||
bool force = false //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
bool isEURUSD = _symbolParser.IsEURUSD(signal.symbol);
|
||||
bool isGBPUSD = _symbolParser.IsGBPUSD(signal.symbol);
|
||||
bool isEURGBP = _symbolParser.IsEURGBP(signal.symbol);
|
||||
bool isXAUUSD = _symbolParser.IsXAUUSD(signal.symbol);
|
||||
bool isUSDJPY = _symbolParser.IsUSDJPY(signal.symbol);
|
||||
bool isEURJPY = _symbolParser.IsEURJPY(signal.symbol);
|
||||
bool isUSDCHF = _symbolParser.IsUSDCHF(signal.symbol);
|
||||
bool isEURCHF = _symbolParser.IsEURCHF(signal.symbol);
|
||||
bool isAUDUSD = _symbolParser.IsAUDUSD(signal.symbol);
|
||||
bool isNZDUSD = _symbolParser.IsNZDUSD(signal.symbol);
|
||||
bool isUSDCAD = _symbolParser.IsUSDCAD(signal.symbol);
|
||||
bool isEURCAD = _symbolParser.IsEURCAD(signal.symbol);
|
||||
bool isDowJones = _symbolParser.IsDowJones(signal.symbol);
|
||||
|
||||
//
|
||||
string market = _account.GetCompany();
|
||||
bool isAMarkets = _marketParser.IsAMarkets(market);
|
||||
|
||||
//
|
||||
if (!force)
|
||||
{
|
||||
//
|
||||
if (isEURUSD)
|
||||
{
|
||||
//
|
||||
result =
|
||||
_eurusdShortParser.IsFiltered(conditions);
|
||||
}
|
||||
else if (isGBPUSD)
|
||||
{
|
||||
//
|
||||
result =
|
||||
_gbpusdShortParser.IsFiltered(conditions);
|
||||
}
|
||||
else if (isEURGBP)
|
||||
{
|
||||
//
|
||||
result =
|
||||
_eurgbpShortParser.IsFiltered(conditions);
|
||||
}
|
||||
else if (isUSDJPY)
|
||||
{
|
||||
//
|
||||
result =
|
||||
_usdjpyShortParser.IsFiltered(conditions);
|
||||
}
|
||||
else if (isEURJPY)
|
||||
{
|
||||
//
|
||||
result =
|
||||
_eurjpyShortParser.IsFiltered(conditions);
|
||||
}
|
||||
else if (isUSDCHF)
|
||||
{
|
||||
//
|
||||
result =
|
||||
_usdchfShortParser.IsFiltered(conditions);
|
||||
}
|
||||
else if (isEURCHF)
|
||||
{
|
||||
//
|
||||
result =
|
||||
_eurchfShortParser.IsFiltered(conditions);
|
||||
}
|
||||
else if (isXAUUSD)
|
||||
{
|
||||
//
|
||||
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 (isEURCAD)
|
||||
{
|
||||
//
|
||||
result =
|
||||
_eurcadShortParser.IsFiltered(conditions);
|
||||
}
|
||||
else if (isDowJones)
|
||||
{
|
||||
//
|
||||
result =
|
||||
_dowjonesShortParser.IsFiltered(conditions);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
result =
|
||||
//
|
||||
_eurusdShortParser.IsFiltered(conditions)
|
||||
//
|
||||
||
|
||||
//
|
||||
_gbpusdShortParser.IsFiltered(conditions)
|
||||
//
|
||||
||
|
||||
//
|
||||
_eurgbpShortParser.IsFiltered(conditions)
|
||||
//
|
||||
||
|
||||
//
|
||||
_usdjpyShortParser.IsFiltered(conditions)
|
||||
//
|
||||
||
|
||||
//
|
||||
_eurjpyShortParser.IsFiltered(conditions)
|
||||
//
|
||||
||
|
||||
//
|
||||
_usdchfShortParser.IsFiltered(conditions)
|
||||
//
|
||||
||
|
||||
//
|
||||
_eurchfShortParser.IsFiltered(conditions)
|
||||
//
|
||||
||
|
||||
//
|
||||
_xauusdShortParser.IsFiltered(conditions)
|
||||
//
|
||||
||
|
||||
//
|
||||
_audusdShortParser.IsFiltered(conditions)
|
||||
//
|
||||
||
|
||||
//
|
||||
_nzdusdShortParser.IsFiltered(conditions)
|
||||
//
|
||||
||
|
||||
//
|
||||
_usdcadShortParser.IsFiltered(conditions)
|
||||
//
|
||||
||
|
||||
//
|
||||
_eurcadShortParser.IsFiltered(conditions)
|
||||
//
|
||||
||
|
||||
//
|
||||
_dowjonesShortParser.IsFiltered(conditions)
|
||||
false
|
||||
//
|
||||
;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user