last works on trademanager symbol configurations ...

This commit is contained in:
2025-09-10 16:16:31 +03:30
parent 62af2237e4
commit 4a8924c3f6
4 changed files with 1194 additions and 711 deletions
+56 -11
View File
@@ -2865,18 +2865,32 @@ struct XSymbolTradeConfig
ZeroMemory(this);
}
//
// Initial ...
/**
* Initial ...
*
* @param _symbol: Trading Symbol
* @param _period: Trading Period
* @param _sessionsDescriptor: Sessions Description
* @param _maxAllowedSpread: Max Allowed Spread for Open Trade
* @param _maxAllowedPositions: Max Allowed Same Time Position
* @param _closeAllOpenTradesAt: Close All Open Trades
* @param _maxAllowedTPs: Max Allowed TPs in Restrictions Period
* @param _maxAllowedSLs: Max Allowed SLs in Restrictions Period
* @param _restrictionsPeriod: Restrictions Period
*
* @return ( bool )
*/
bool Init(
string _symbol = NULL,
ENUM_TIMEFRAMES _period = NULL,
string _sessionsDescriptor = NULL,
double _maxAllowedSpread = 25,
int _maxAllowedPositions = 5,
string _closeAllOpenTradesAt = NULL,
int _maxAllowedTPs = 0,
int _maxAllowedSLs = 0,
ENUM_XTRADE_RESTRICTION_PERIOD _restrictionsPeriod = XTRADE_RESTRICATION_NONE //
string _restrictionsDescriptor = NULL //
// string _closeAllOpenTradesAt = NULL,
// int _maxAllowedTPs = 0,
// int _maxAllowedSLs = 0,
// ENUM_XTRADE_RESTRICTION_PERIOD _restrictionsPeriod = XTRADE_RESTRICATION_NONE //
)
{
//
@@ -2890,17 +2904,23 @@ struct XSymbolTradeConfig
//
symbol = _symbol;
period = _period;
maxAllowedTPs = _maxAllowedTPs;
maxAllowedSLs = _maxAllowedSLs;
maxAllowedSpread = _maxAllowedSpread;
restrictionsPeriod = _restrictionsPeriod;
maxAllowedPositions = _maxAllowedPositions;
closeAllOpenTradesAt = _closeAllOpenTradesAt;
//
// maxAllowedTPs = _maxAllowedTPs;
// maxAllowedSLs = _maxAllowedSLs;
// restrictionsPeriod = _restrictionsPeriod;
// closeAllOpenTradesAt = _closeAllOpenTradesAt;
//
// Parse Sessions ...
ParseSessions(_sessionsDescriptor);
//
// Parse Restrictions ...
ParseRestrictions(_restrictionsDescriptor);
//
result = IsValid();
@@ -2908,6 +2928,24 @@ struct XSymbolTradeConfig
return result;
}
//
// Check Same ...
bool IsSame(XSymbolTradeConfig &dest)
{
//
bool result = false;
//
// Validate ...
result = IsValid() &&
dest.IsValid() &&
symbol == dest.symbol &&
period == dest.period;
//
return result;
}
//
// Validate ...
bool IsValid()
@@ -2916,7 +2954,8 @@ struct XSymbolTradeConfig
bool result = false;
//
result = IsSpecifiedValid(symbol);
result = IsSpecifiedValid(symbol) &&
IsSpecifiedValid(period);
//
return result;
@@ -3057,6 +3096,12 @@ struct XSymbolTradeConfig
SpecifiedClean(_sessions);
}
//
// Parse Restrictions ...
void ParseRestrictions(string descriptor) {
}
//
};