This commit is contained in:
2024-07-23 12:07:06 +03:30
parent 23d25e3e58
commit d4b6e6df06
3 changed files with 1988 additions and 11 deletions
+66 -11
View File
@@ -28,6 +28,7 @@
#include "../Helpers/x-saherelm.xcc.helper.mq5"
//
#include "../Strategies/x-saherelm.xdtd.strategy.mq5"
#include "../Strategies/x-saherelm.xtest.strategy.mq5"
//
@@ -45,8 +46,8 @@ int eaMaxAllowedLongs = 0; // Max Allowed Long Positions
int eaMaxAllowedShorts = 0; // Max Allowed Short Positions
//
double eaTPPoint = 200; // Static TP Point
double eaSLPoint = 100; // Static SL Point
input double eaTPPoint = 200; // Static TP Point
input double eaSLPoint = 100; // Static SL Point
//
bool eaIgnoreTP = false; // Ignore TP
@@ -246,7 +247,7 @@ bool InitialEA()
//
// Configure Hedging ...
eaTradeHandler.AllowHedging(true);
eaTradeHandler.AllowHedging(false);
eaTradeHandler.HedgeVolumeFactor(eaVolume);
eaTradeHandler.HedgeMinProfitPerVolumeFactor(0.2);
@@ -272,11 +273,8 @@ bool InitialEA()
bool useXAUUSD = false;
//
bool useXSRBR = false;
bool useXEMRNG = false;
bool useXOBVG = false;
bool useXPVFMC = false;
bool useXTest = true;
bool useXTest = false;
bool useXDTD = false;
//
// EURUSD ...
@@ -287,6 +285,37 @@ bool InitialEA()
// MAGIC NUMBER ...
long magicNumber = eaMagicNumber + 1;
//
// XDTD ...
if (useXDTD)
{
//
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,
eaIgnoreSL,
eaAllowLong,
eaAllowShort,
eaMaxAllowedLongs, // Max Longs
eaMaxAllowedShorts // Max Shorts
);
eurusdXTDTStrategy.SetAlertLogAlerts(true);
eurusdXTDTStrategy.SetAlertEnableAlerts(true);
eurusdXTDTStrategy.AddSignalEventHandler(OnSignalRecieved);
RegisterStrategy(eurusdXTDTStrategy);
}
//
// XTest ...
if (useXTest)
@@ -300,9 +329,9 @@ bool InitialEA()
eaR2R, // R2R ...
eaSlippage,
magicNumber,
true, // Ignore Signal Execution
true, // Use TP SL Point
false, // Use Max
true, // Ignore Signal Execution
true, // Use TP SL Point
false, // Use Max
eaTPPoint, // TP
eaSLPoint, // SL
eaIgnoreTP,
@@ -319,6 +348,32 @@ bool InitialEA()
}
}
//
XSCXDTDStrategy *xTDTStrategy;
xTDTStrategy = new XSCXDTDStrategy(
_Symbol,
_Period,
eaVolume,
eaR2R, // R2R ...
eaSlippage,
eaMagicNumber,
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
);
xTDTStrategy.SetAlertLogAlerts(true);
xTDTStrategy.SetAlertEnableAlerts(true);
xTDTStrategy.AddSignalEventHandler(OnSignalRecieved);
RegisterStrategy(xTDTStrategy);
//
return result;
}