last ...
This commit is contained in:
+127
-114
@@ -190,6 +190,15 @@ XTimeTracker eaTimeTracker;
|
||||
// Trade Handler Instance Class ...
|
||||
X121SCTradeHandler *eaTradeHandler;
|
||||
|
||||
//
|
||||
// Since Signal Filtering done based on
|
||||
// Strategy and it's not related to Public
|
||||
// TradeHandler for Seperation of Concern issue,
|
||||
// we do this here ...
|
||||
XCHStartegyConditionsParser chParser;
|
||||
XCHCHEStartegyConditionsParser chcheParser;
|
||||
XCHICHWAPStartegyConditionsParser chichwapParser;
|
||||
|
||||
//
|
||||
string mTag = "";
|
||||
|
||||
@@ -624,6 +633,60 @@ bool InitEA()
|
||||
// Single Symbol ...
|
||||
if (!eaMultiSymbol)
|
||||
{
|
||||
|
||||
//
|
||||
// Register XICHWAP Strategy ...
|
||||
|
||||
//
|
||||
bool isEURUSD = _symbolParser.IsEURUSD(_Symbol);
|
||||
bool isGBPUSD = _symbolParser.IsGBPUSD(_Symbol);
|
||||
bool canRegisterICHWAP = isEURUSD ||
|
||||
isGBPUSD;
|
||||
if (canRegisterICHWAP)
|
||||
{
|
||||
//
|
||||
// Create Class Instance ...
|
||||
XSCXCHICHWAPStrategy *xchichwapStrategy;
|
||||
xchichwapStrategy = new XSCXCHICHWAPStrategy(
|
||||
_Symbol,
|
||||
_Period,
|
||||
PERIOD_H1, // Analyzing Period
|
||||
eaVolume,
|
||||
eaR2R, // R2R ...
|
||||
eaSlippage,
|
||||
eaMagicNumber,
|
||||
true, // Ignore Signal Execution
|
||||
eaUseFixedTPSLPoints, // Use TP SL Point
|
||||
false, // Use Max
|
||||
eaTPPoint, // TP
|
||||
eaSLPoint, // SL
|
||||
eaIgnoreTP,
|
||||
eaIgnoreSL,
|
||||
eaAllowLong,
|
||||
eaAllowShort,
|
||||
eaMaxAllowedLongs, // Max Longs
|
||||
eaMaxAllowedShorts // Max Shorts
|
||||
);
|
||||
|
||||
//
|
||||
// Configuere Strategy ...
|
||||
xchichwapStrategy.DrawImportantAreas(false);
|
||||
xchichwapStrategy.AddXCHSignalEventHandler(OnSignalRecieved);
|
||||
|
||||
//
|
||||
// Configure Alerts ...
|
||||
xchichwapStrategy.SetAlertPrefix(mTag);
|
||||
xchichwapStrategy.SetAlertEnableAlerts(eAEnableAlerts);
|
||||
xchichwapStrategy.SetAlertLogAlerts(eALogAlerts);
|
||||
xchichwapStrategy.SetAlertMailAlerts(eAMailAlerts);
|
||||
xchichwapStrategy.SetAlertPushAlerts(eAPushAlerts);
|
||||
xchichwapStrategy.SetAlertTerminalAlerts(eATerminalAlerts);
|
||||
|
||||
//
|
||||
// Register Strategy ...
|
||||
RegisterStrategy(xchichwapStrategy);
|
||||
}
|
||||
|
||||
//
|
||||
// Register XCH Strategy ...
|
||||
|
||||
@@ -717,59 +780,6 @@ bool InitEA()
|
||||
//
|
||||
// Register Strategy ...
|
||||
RegisterStrategy(xchcheStrategy);
|
||||
|
||||
//
|
||||
// Register XICHWAP Strategy ...
|
||||
|
||||
//
|
||||
bool isEURUSD = _symbolParser.IsEURUSD(_Symbol);
|
||||
bool isGBPUSD = _symbolParser.IsGBPUSD(_Symbol);
|
||||
bool canRegisterICHWAP = isEURUSD ||
|
||||
isGBPUSD;
|
||||
if (canRegisterICHWAP)
|
||||
{
|
||||
//
|
||||
// Create Class Instance ...
|
||||
XSCXCHICHWAPStrategy *xchichwapStrategy;
|
||||
xchichwapStrategy = new XSCXCHICHWAPStrategy(
|
||||
_Symbol,
|
||||
_Period,
|
||||
PERIOD_H1, // Analyzing Period
|
||||
eaVolume,
|
||||
eaR2R, // R2R ...
|
||||
eaSlippage,
|
||||
eaMagicNumber,
|
||||
true, // Ignore Signal Execution
|
||||
eaUseFixedTPSLPoints, // Use TP SL Point
|
||||
false, // Use Max
|
||||
eaTPPoint, // TP
|
||||
eaSLPoint, // SL
|
||||
eaIgnoreTP,
|
||||
eaIgnoreSL,
|
||||
eaAllowLong,
|
||||
eaAllowShort,
|
||||
eaMaxAllowedLongs, // Max Longs
|
||||
eaMaxAllowedShorts // Max Shorts
|
||||
);
|
||||
|
||||
//
|
||||
// Configuere Strategy ...
|
||||
xchichwapStrategy.DrawImportantAreas(false);
|
||||
xchichwapStrategy.AddXCHSignalEventHandler(OnSignalRecieved);
|
||||
|
||||
//
|
||||
// Configure Alerts ...
|
||||
xchichwapStrategy.SetAlertPrefix(mTag);
|
||||
xchichwapStrategy.SetAlertEnableAlerts(eAEnableAlerts);
|
||||
xchichwapStrategy.SetAlertLogAlerts(eALogAlerts);
|
||||
xchichwapStrategy.SetAlertMailAlerts(eAMailAlerts);
|
||||
xchichwapStrategy.SetAlertPushAlerts(eAPushAlerts);
|
||||
xchichwapStrategy.SetAlertTerminalAlerts(eATerminalAlerts);
|
||||
|
||||
//
|
||||
// Register Strategy ...
|
||||
RegisterStrategy(xchichwapStrategy);
|
||||
}
|
||||
}
|
||||
//
|
||||
// Multi Symbol ...
|
||||
@@ -795,6 +805,59 @@ bool InitEA()
|
||||
// Select Symbol ...
|
||||
string iSymbol = symbols[i];
|
||||
|
||||
//
|
||||
// Register XICHWAP Strategy ...
|
||||
|
||||
//
|
||||
bool isEURUSD = _symbolParser.IsEURUSD(iSymbol);
|
||||
bool isGBPUSD = _symbolParser.IsGBPUSD(iSymbol);
|
||||
bool canRegisterICHWAP = isEURUSD ||
|
||||
isGBPUSD;
|
||||
if (canRegisterICHWAP)
|
||||
{
|
||||
//
|
||||
// Create Class Instance ...
|
||||
XSCXCHICHWAPStrategy *iXCHICHWAPStrategy;
|
||||
iXCHICHWAPStrategy = new XSCXCHICHWAPStrategy(
|
||||
iSymbol,
|
||||
_Period,
|
||||
PERIOD_H1, // Analyzing Period
|
||||
eaVolume,
|
||||
eaR2R, // R2R ...
|
||||
eaSlippage,
|
||||
eaMagicNumber,
|
||||
true, // Ignore Signal Execution
|
||||
eaUseFixedTPSLPoints, // Use TP SL Point
|
||||
false, // Use Max
|
||||
eaTPPoint, // TP
|
||||
eaSLPoint, // SL
|
||||
eaIgnoreTP,
|
||||
eaIgnoreSL,
|
||||
eaAllowLong,
|
||||
eaAllowShort,
|
||||
eaMaxAllowedLongs, // Max Longs
|
||||
eaMaxAllowedShorts // Max Shorts
|
||||
);
|
||||
|
||||
//
|
||||
// Configuere Strategy ...
|
||||
iXCHICHWAPStrategy.DrawImportantAreas(false);
|
||||
iXCHICHWAPStrategy.AddXCHSignalEventHandler(OnSignalRecieved);
|
||||
|
||||
//
|
||||
// Configure Alerts ...
|
||||
iXCHICHWAPStrategy.SetAlertPrefix(mTag);
|
||||
iXCHICHWAPStrategy.SetAlertEnableAlerts(eAEnableAlerts);
|
||||
iXCHICHWAPStrategy.SetAlertLogAlerts(eALogAlerts);
|
||||
iXCHICHWAPStrategy.SetAlertMailAlerts(eAMailAlerts);
|
||||
iXCHICHWAPStrategy.SetAlertPushAlerts(eAPushAlerts);
|
||||
iXCHICHWAPStrategy.SetAlertTerminalAlerts(eATerminalAlerts);
|
||||
|
||||
//
|
||||
// Register Strategy ...
|
||||
RegisterStrategy(iXCHICHWAPStrategy);
|
||||
}
|
||||
|
||||
//
|
||||
// Register XCH Strategy ...
|
||||
|
||||
@@ -888,59 +951,6 @@ bool InitEA()
|
||||
//
|
||||
// Register Strategy ...
|
||||
RegisterStrategy(iXCHCHEStrategy);
|
||||
|
||||
//
|
||||
// Register XICHWAP Strategy ...
|
||||
|
||||
//
|
||||
bool isEURUSD = _symbolParser.IsEURUSD(iSymbol);
|
||||
bool isGBPUSD = _symbolParser.IsGBPUSD(iSymbol);
|
||||
bool canRegisterICHWAP = isEURUSD ||
|
||||
isGBPUSD;
|
||||
if (canRegisterICHWAP)
|
||||
{
|
||||
//
|
||||
// Create Class Instance ...
|
||||
XSCXCHICHWAPStrategy *iXCHICHWAPStrategy;
|
||||
iXCHICHWAPStrategy = new XSCXCHICHWAPStrategy(
|
||||
iSymbol,
|
||||
_Period,
|
||||
PERIOD_H1, // Analyzing Period
|
||||
eaVolume,
|
||||
eaR2R, // R2R ...
|
||||
eaSlippage,
|
||||
eaMagicNumber,
|
||||
true, // Ignore Signal Execution
|
||||
eaUseFixedTPSLPoints, // Use TP SL Point
|
||||
false, // Use Max
|
||||
eaTPPoint, // TP
|
||||
eaSLPoint, // SL
|
||||
eaIgnoreTP,
|
||||
eaIgnoreSL,
|
||||
eaAllowLong,
|
||||
eaAllowShort,
|
||||
eaMaxAllowedLongs, // Max Longs
|
||||
eaMaxAllowedShorts // Max Shorts
|
||||
);
|
||||
|
||||
//
|
||||
// Configuere Strategy ...
|
||||
iXCHICHWAPStrategy.DrawImportantAreas(false);
|
||||
iXCHICHWAPStrategy.AddXCHSignalEventHandler(OnSignalRecieved);
|
||||
|
||||
//
|
||||
// Configure Alerts ...
|
||||
iXCHICHWAPStrategy.SetAlertPrefix(mTag);
|
||||
iXCHICHWAPStrategy.SetAlertEnableAlerts(eAEnableAlerts);
|
||||
iXCHICHWAPStrategy.SetAlertLogAlerts(eALogAlerts);
|
||||
iXCHICHWAPStrategy.SetAlertMailAlerts(eAMailAlerts);
|
||||
iXCHICHWAPStrategy.SetAlertPushAlerts(eAPushAlerts);
|
||||
iXCHICHWAPStrategy.SetAlertTerminalAlerts(eATerminalAlerts);
|
||||
|
||||
//
|
||||
// Register Strategy ...
|
||||
RegisterStrategy(iXCHICHWAPStrategy);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1263,17 +1273,10 @@ void OnSignalRecieved(
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
// Since Signal Filtering done based on
|
||||
// Strategy and it's not related to Public
|
||||
// TradeHandler for Seperation of Concern issue,
|
||||
// we do this here ...
|
||||
XCHStartegyConditionsParser chParser;
|
||||
XCHCHEStartegyConditionsParser chcheParser;
|
||||
|
||||
//
|
||||
bool isXCHSignal = signal.provider == XCHStartegyToken;
|
||||
bool isXCHCHESignal = signal.provider == XCHCHEStartegyToken;
|
||||
bool isXCHICHWAPSignal = signal.provider == XCHICHWAPStartegyToken;
|
||||
bool isFiltered =
|
||||
isXCHSignal
|
||||
? chParser.IsFiltered(
|
||||
@@ -1285,6 +1288,11 @@ void OnSignalRecieved(
|
||||
signal,
|
||||
conditions //
|
||||
)
|
||||
: isXCHICHWAPSignal
|
||||
? chichwapParser.IsFiltered(
|
||||
signal,
|
||||
conditions //
|
||||
)
|
||||
: true;
|
||||
if (isFiltered)
|
||||
{
|
||||
@@ -1314,6 +1322,11 @@ void OnSignalRecieved(
|
||||
signal,
|
||||
conditions //
|
||||
)
|
||||
: isXCHICHWAPSignal
|
||||
? chichwapParser.GenerateSignalConditions(
|
||||
signal,
|
||||
conditions //
|
||||
)
|
||||
: conditionsSummary;
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user