This commit is contained in:
2025-02-11 13:13:49 +03:30
parent ad3a9e691f
commit fe129c3288
4 changed files with 131 additions and 21 deletions
@@ -430,6 +430,95 @@ class XC121SMCCycleHelper : public XCBase
//
// Consolidation Zones Implement here ...
//
int czLoopback = 5;
int maxAllowed = 20;
bool isActiveConsolidationZoneBreaked = false;
bool hasActiveConsolidationZone = mActiveConsolidationZone.IsValid();
if (hasActiveConsolidationZone)
{
//
isActiveConsolidationZoneBreaked = mActiveConsolidationZone.IsBreaked();
//
if (isActiveConsolidationZoneBreaked)
{
//
AddRef(
mActiveConsolidationZone,
mConsolidationZones //
);
//
Add(
CONSOLIDATION_BREAKED_DETECTED,
events //
);
//
CleanupArray(
mConsolidationZones,
maxAllowed //
);
// //
// XCConsolidationZoneObject *czObj;
// bool isCreated = mPOIDrawer.CreateConsolidationZone(
// mActiveConsolidationZone,
// czObj //
// );
// if (isCreated)
// {
// mConsolidationObjects.Add(czObj);
// }
//
mActiveConsolidationZone.Clean();
}
else
{
mActiveConsolidationZone.Update();
}
}
else
{
//
XOHCL mBar;
bool hasBar = GetBar(
mBar,
0 //
);
if (hasBar)
{
//
double upper = 0;
double lower = 0;
bool hasConsolidationZone =
mBarAnalyser.IsConsolidate(
mBar,
upper,
lower,
czLoopback //
);
//
if (hasConsolidationZone)
{
//
mActiveConsolidationZone.Init(
GetSymbol(),
GetPeriod(),
upper,
lower,
loopback //
);
}
}
//
mBar.Clean();
}
//
result = conditions.IsValid();
@@ -461,6 +550,11 @@ class XC121SMCCycleHelper : public XCBase
string mSymbol;
ENUM_TIMEFRAMES mPeriod;
//
CArrayObj mConsolidationObjects;
XConsolidationZone mActiveConsolidationZone;
XConsolidationZone mConsolidationZones[];
//
// Actions ...
@@ -478,6 +572,10 @@ class XC121SMCCycleHelper : public XCBase
delete mX121Helper;
delete mPOIDetector;
delete mBarAnalyser;
//
Clean(mConsolidationZones);
mActiveConsolidationZone.Clean();
}
/**