all prepared ...

This commit is contained in:
2025-09-18 00:02:12 +03:30
parent 4c9fe89fad
commit 59b34922c4
4 changed files with 60 additions and 60 deletions
-2
View File
@@ -605,7 +605,6 @@ class XCBaseExpert : public XCBase
* @return ( bool )
*/
bool HandleCanAnalyseEventTriggered(
string name,
string symbol,
ENUM_TIMEFRAMES period,
datetime time //
@@ -613,7 +612,6 @@ class XCBaseExpert : public XCBase
{
//
return eaTradeManager.CanAnalyse(
name,
symbol,
period,
time //
+29 -24
View File
@@ -752,7 +752,6 @@ class XCTradeManager : public XCBase
* @return ( bool )
*/
bool CanAnalyse(
string name,
string symbol,
ENUM_TIMEFRAMES period,
datetime time //
@@ -765,8 +764,7 @@ class XCTradeManager : public XCBase
// Finding Symbol Configuration Index ...
int idx = FindSymbolConfigurationIndex(
symbol,
period,
name //
period //
);
//
@@ -857,7 +855,6 @@ class XCTradeManager : public XCBase
//
// Check Sessions and Restrictions ...
result = CanAnalyse(
signal.provider,
signal.symbol,
signal.period,
signal.time //
@@ -875,8 +872,7 @@ class XCTradeManager : public XCBase
// Check Signal Spread ...
int idx = FindSymbolConfigurationIndex(
signal.symbol,
signal.period,
signal.provider //
signal.period //
);
if (IsValidIndex(idx))
{
@@ -897,19 +893,30 @@ class XCTradeManager : public XCBase
//
// Checking Max Allowed Positions ...
XPosition positions[];
ENUM_X_POSITION_TYPES mType = IsLong(signal.type)
? X_POSITION_TYPE_LONG
: X_POSITION_TYPE_SHORT;
int positionsCount = trader.GetPositions(
positions,
symbolTradeConfigs[idx].symbol,
signal.provider,
symbolTradeConfigs[idx].period,
mType,
true, // Filter By Magic ...
true // Force Clean ...
);
if (symbolTradeConfigs[idx].maxAllowedPositions > 0)
{
//
XPosition positions[];
ENUM_X_POSITION_TYPES mType = IsLong(signal.type)
? X_POSITION_TYPE_LONG
: X_POSITION_TYPE_SHORT;
int positionsCount = trader.GetPositions(
positions,
symbolTradeConfigs[idx].symbol,
NULL, // All Providers ...
symbolTradeConfigs[idx].period,
mType,
true, // Filter By Magic ...
true // Force Clean ...
);
result = !IsValidSize(positionsCount) ||
(IsValidSize(positionsCount) &&
positionsCount < symbolTradeConfigs[idx].maxAllowedPositions);
//
// Cleanup Resources ...
SpecifiedClean(positions);
}
}
//
@@ -2151,6 +2158,7 @@ class XCTradeManager : public XCBase
//
// Check Initialization ...
bool has = iConfig.Init(
"Default",
_Symbol,
_Period //
);
@@ -2264,8 +2272,7 @@ class XCTradeManager : public XCBase
//
int FindSymbolConfigurationIndex(
string symbol,
ENUM_TIMEFRAMES period,
string name //
ENUM_TIMEFRAMES period //
)
{
//
@@ -2274,7 +2281,6 @@ class XCTradeManager : public XCBase
//
// Validate Args ...
if (
!IsSpecifiedValid(name) ||
!IsSpecifiedValid(symbol) ||
!IsSpecifiedValid(period) ||
!HasChild(symbolTradeConfigs))
@@ -2287,8 +2293,7 @@ class XCTradeManager : public XCBase
for (int i = 0; i < count; i++)
{
//
if (symbolTradeConfigs[i].name == name &&
symbolTradeConfigs[i].symbol == symbol &&
if (symbolTradeConfigs[i].symbol == symbol &&
symbolTradeConfigs[i].period == period)
{
//