add supports for Symbol Restrictions ...

This commit is contained in:
2025-05-09 03:43:56 +03:30
parent c7f14e90a1
commit 87c6321dcb
2 changed files with 506 additions and 72 deletions
+24 -31
View File
@@ -53,17 +53,19 @@ input double eaConstantBalance = 0.0; // Constant Ba
//
// Management ...
input group "Management";
input bool eaAllowTrade = true; // Allow Trade on Signals
input bool eaAllowLongs = true; // Allow Long Trades
input bool eaAllowShorts = true; // Allow Short Trades
input int eaMaxAllowedTradesPerDay = 3; // Max Allowed Trades per Day
input int eaMaxAllowedSLsPerDay = 2; // Max Allowed SL(s) per Day
input string eaSessionStartTime = ""; // Trade Start Time
input string eaSessionEndTime = ""; // Trade End Time
input int eaMaxAllowedPositions = 5; // Max Allowed Same Time Trades
input double eaMaxAllowedSpread = 25; // Max Allowed Spread For Trade
input double eaMaxAllowedDrawdownFactor = 0.3; // Max Allowed DrawDown for Trade
input string eaCloseAllOpenTradesAt = ""; // Close All Open Trades per Day At Specified Time
input bool eaAllowTrade = true; // Allow Trade on Signals
input bool eaAllowLongs = true; // Allow Long Trades
input bool eaAllowShorts = true; // Allow Short Trades
input ENUM_XCAEA_TRADE_RESTRICTION_PERIOD eaRestrictionsPeriod = XCAEA_TRADE_RESTRICATION_DAILY; // Trade Restrictions Period
input int eaMaxAllowedTPs = 2; // Max Allowed TP(s) per Day
input int eaMaxAllowedSLs = 2; // Max Allowed SL(s) per Day
input int eaMaxAllowedTrades = 3; // Max Allowed Trades per Day
input string eaSessionStartTime = ""; // Trade Start Time
input string eaSessionEndTime = ""; // Trade End Time
input int eaMaxAllowedPositions = 5; // Max Allowed Same Time Trades
input double eaMaxAllowedSpread = 25; // Max Allowed Spread For Trade
input double eaMaxAllowedDrawdownFactor = 0.3; // Max Allowed DrawDown for Trade
input string eaCloseAllOpenTradesAt = ""; // Close All Open Trades per Day At Specified Time
//
// Alert ...
@@ -662,13 +664,13 @@ void InitRequirements()
);
//
//
//
//
// eaMaxAllowedTradesPerDay
// eaMaxAllowedSLsPerDay
// eaSessionStartTime
// eaSessionEndTime
// Setting Trade Restrictions ...
eaTradeManager.SetTradeRestrictions(
eaRestrictionsPeriod,
eaMaxAllowedTPs,
eaMaxAllowedSLs,
eaMaxAllowedTrades //
);
//
// EA Signaller ...
@@ -711,23 +713,14 @@ void HandleTimeReport()
//
// Daily Report ....
bool isNewDay = eaTimeTracker.IsNewDay();
if (isNewDay)
if (eaReportNewDays &&
eaTimeTracker.IsNewDay())
{
//
// Handle New Day on Trade Manager ...
eaTradeManager.HandleNewDay();
string msg = "New Day ...";
//
// Reporting New Day if Reuired ...
if (eaReportNewDays)
{
//
string msg = "New Day ...";
//
eaAlert.Alert(msg);
}
eaAlert.Alert(msg);
}
//