update tasks and add multi asset ...
This commit is contained in:
@@ -60,6 +60,10 @@ bool eaIgnoreSL = false; // Ignore SL
|
||||
//
|
||||
double eaR2R = 1.5; // Risk to Reward Ratio
|
||||
|
||||
//
|
||||
bool eaMultiSymbol = true; // Use Multi Symbol
|
||||
string eaSymbols = "EURUSDb,USDJPYb,USDCHFb,GBPUSDb,XAUUSDb,XAGUSDb";
|
||||
|
||||
//
|
||||
// Variables ...
|
||||
|
||||
@@ -281,161 +285,99 @@ bool InitialEA()
|
||||
|
||||
//
|
||||
// Configure Recovery ...
|
||||
eaTradeHandler.AllowRecover(true);
|
||||
eaTradeHandler.MaxAllowedRecover(0);
|
||||
eaTradeHandler.AllowRecover(false);
|
||||
eaTradeHandler.RecoveryTPPoint(50);
|
||||
eaTradeHandler.RecoverySLPoint(eaSLPoint);
|
||||
eaTradeHandler.MaxAllowedRecover(3);
|
||||
eaTradeHandler.MaxAllowedRecoveryVolume(0.1);
|
||||
eaTradeHandler.RecoverySLPoint(200);
|
||||
eaTradeHandler.RecoveryVolumeMultiplier(2);
|
||||
eaTradeHandler.ForcePressuresInRecovery(false);
|
||||
|
||||
//
|
||||
XSymbolParser symbolParser;
|
||||
|
||||
//
|
||||
bool drawAreas = false;
|
||||
|
||||
//
|
||||
bool useEURUSD = false;
|
||||
bool useUSDCHF = false;
|
||||
bool useUSDJPY = false;
|
||||
bool useGBPUSD = false;
|
||||
bool useXAUUSD = false;
|
||||
|
||||
//
|
||||
bool useXTest = false;
|
||||
bool useXDTD = false;
|
||||
bool useXCHKM = false;
|
||||
|
||||
//
|
||||
// EURUSD ...
|
||||
string eurusdSymbol = "EURUSDb"; // symbolParser.GetEURUSDSymbol();
|
||||
if (useEURUSD && IsValid(eurusdSymbol))
|
||||
// Single Symbol ...
|
||||
if (!eaMultiSymbol)
|
||||
{
|
||||
//
|
||||
// MAGIC NUMBER ...
|
||||
long magicNumber = eaMagicNumber + 1;
|
||||
|
||||
XSCXCHKMStrategy *xchmStrategy;
|
||||
xchmStrategy = new XSCXCHKMStrategy(
|
||||
_Symbol,
|
||||
_Period,
|
||||
PERIOD_H1, // Analyzing Period
|
||||
eaVolume,
|
||||
eaR2R, // R2R ...
|
||||
eaSlippage,
|
||||
eaMagicNumber,
|
||||
true, // Ignore Signal Execution
|
||||
true, // Use TP SL Point
|
||||
false, // Use Max
|
||||
eaTPPoint, // TP
|
||||
eaSLPoint, // SL
|
||||
eaIgnoreTP,
|
||||
true, // eaIgnoreSL,
|
||||
eaAllowLong,
|
||||
eaAllowShort,
|
||||
eaMaxAllowedLongs, // Max Longs
|
||||
eaMaxAllowedShorts // Max Shorts
|
||||
);
|
||||
xchmStrategy.SetAlertLogAlerts(true);
|
||||
xchmStrategy.SetAlertEnableAlerts(true);
|
||||
xchmStrategy.AddSignalEventHandler(OnSignalRecieved);
|
||||
RegisterStrategy(xchmStrategy);
|
||||
}
|
||||
//
|
||||
// Multi Symbol ...
|
||||
else
|
||||
{
|
||||
//
|
||||
// XDTD ...
|
||||
if (useXDTD)
|
||||
// Parse Symbols ...
|
||||
string symbols[];
|
||||
int symbolsCount = SplitContent(
|
||||
symbols,
|
||||
eaSymbols //
|
||||
);
|
||||
result = IsValidSize(symbolsCount);
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
XSCXDTDStrategy *eurusdXTDTStrategy;
|
||||
eurusdXTDTStrategy = new XSCXDTDStrategy(
|
||||
eurusdSymbol,
|
||||
PERIOD_M15,
|
||||
eaVolume,
|
||||
eaR2R, // R2R ...
|
||||
eaSlippage,
|
||||
magicNumber,
|
||||
true, // Ignore Signal Execution
|
||||
true, // Use TP SL Point
|
||||
false, // Use Max
|
||||
eaTPPoint, // TP
|
||||
eaSLPoint, // SL
|
||||
eaIgnoreTP,
|
||||
false, // eaIgnoreSL,
|
||||
eaAllowLong,
|
||||
eaAllowShort,
|
||||
eaMaxAllowedLongs, // Max Longs
|
||||
eaMaxAllowedShorts // Max Shorts
|
||||
);
|
||||
eurusdXTDTStrategy.SetAlertLogAlerts(true);
|
||||
eurusdXTDTStrategy.SetAlertEnableAlerts(true);
|
||||
eurusdXTDTStrategy.AddSignalEventHandler(OnSignalRecieved);
|
||||
RegisterStrategy(eurusdXTDTStrategy);
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// XTest ...
|
||||
if (useXTest)
|
||||
for (int i = 0; i < symbolsCount; i++)
|
||||
{
|
||||
//
|
||||
XSCXTestStrategy *eurusdTestStrategy;
|
||||
eurusdTestStrategy = new XSCXTestStrategy(
|
||||
eurusdSymbol,
|
||||
PERIOD_M15,
|
||||
eaVolume,
|
||||
eaR2R, // R2R ...
|
||||
eaSlippage,
|
||||
magicNumber,
|
||||
true, // Ignore Signal Execution
|
||||
true, // Use TP SL Point
|
||||
false, // Use Max
|
||||
eaTPPoint, // TP
|
||||
eaSLPoint, // SL
|
||||
eaIgnoreTP,
|
||||
eaIgnoreSL,
|
||||
eaAllowLong,
|
||||
eaAllowShort,
|
||||
eaMaxAllowedLongs, // Max Longs
|
||||
eaMaxAllowedShorts // Max Shorts
|
||||
);
|
||||
eurusdTestStrategy.SetAlertLogAlerts(true);
|
||||
eurusdTestStrategy.SetAlertEnableAlerts(true);
|
||||
eurusdTestStrategy.AddSignalEventHandler(OnSignalRecieved);
|
||||
RegisterStrategy(eurusdTestStrategy);
|
||||
}
|
||||
string iSymbol = symbols[i];
|
||||
|
||||
//
|
||||
// XCHKM ...
|
||||
if (useXCHKM)
|
||||
{
|
||||
//
|
||||
XSCXCHKMStrategy *eurusdXCHKMStrategy;
|
||||
eurusdXCHKMStrategy = new XSCXCHKMStrategy(
|
||||
eurusdSymbol,
|
||||
PERIOD_M5,
|
||||
XSCXCHKMStrategy *iStrategy;
|
||||
iStrategy = new XSCXCHKMStrategy(
|
||||
iSymbol,
|
||||
_Period,
|
||||
PERIOD_H1, // Analyzing Period
|
||||
eaVolume,
|
||||
eaR2R, // R2R ...
|
||||
eaSlippage,
|
||||
magicNumber,
|
||||
eaMagicNumber,
|
||||
true, // Ignore Signal Execution
|
||||
false, // Use TP SL Point
|
||||
true, // Use TP SL Point
|
||||
false, // Use Max
|
||||
eaTPPoint, // TP
|
||||
eaSLPoint, // SL
|
||||
eaIgnoreTP,
|
||||
false, // eaIgnoreSL,
|
||||
true, // eaIgnoreSL,
|
||||
eaAllowLong,
|
||||
eaAllowShort,
|
||||
eaMaxAllowedLongs, // Max Longs
|
||||
eaMaxAllowedShorts // Max Shorts
|
||||
);
|
||||
eurusdXCHKMStrategy.SetAlertLogAlerts(true);
|
||||
eurusdXCHKMStrategy.SetAlertEnableAlerts(true);
|
||||
eurusdXCHKMStrategy.AddSignalEventHandler(OnSignalRecieved);
|
||||
RegisterStrategy(eurusdXCHKMStrategy);
|
||||
iStrategy.SetAlertLogAlerts(true);
|
||||
iStrategy.SetAlertEnableAlerts(true);
|
||||
iStrategy.AddSignalEventHandler(OnSignalRecieved);
|
||||
|
||||
//
|
||||
RegisterStrategy(iStrategy);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
XSCXCHKMStrategy *xchmStrategy;
|
||||
xchmStrategy = new XSCXCHKMStrategy(
|
||||
_Symbol,
|
||||
_Period,
|
||||
PERIOD_H1, // Analyzing Period
|
||||
eaVolume,
|
||||
eaR2R, // R2R ...
|
||||
eaSlippage,
|
||||
eaMagicNumber,
|
||||
true, // Ignore Signal Execution
|
||||
true, // Use TP SL Point
|
||||
false, // Use Max
|
||||
eaTPPoint, // TP
|
||||
eaSLPoint, // SL
|
||||
eaIgnoreTP,
|
||||
true, // eaIgnoreSL,
|
||||
eaAllowLong,
|
||||
eaAllowShort,
|
||||
eaMaxAllowedLongs, // Max Longs
|
||||
eaMaxAllowedShorts // Max Shorts
|
||||
);
|
||||
xchmStrategy.SetAlertLogAlerts(true);
|
||||
xchmStrategy.SetAlertEnableAlerts(true);
|
||||
xchmStrategy.AddSignalEventHandler(OnSignalRecieved);
|
||||
RegisterStrategy(xchmStrategy);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user