This commit is contained in:
2025-01-27 08:45:57 +03:30
parent 24d152b41d
commit d54fb854c9
3 changed files with 294 additions and 197 deletions
@@ -1302,7 +1302,11 @@ class XC121SMCCycleHelper : public XCBase
*/
int DrawCycleState(
X121SMCCycleState &state,
XCBaseObject *&drawnObjects[] //
XCBaseObject *&drawnObjects[],
bool drawOrderBlocks = true,
bool drawFairValueGaps = true,
bool drawSupplyAndDemandZones = false,
bool drawSupportAndResistanceZones = false //
)
{
//
@@ -1310,260 +1314,274 @@ class XC121SMCCycleHelper : public XCBase
//
// Order Blocks ...
//
// Bullish ...
bool hasBullishOBs = state.HasBullishOBs();
int bullishOBsCount = state.CountBullishOBs();
if (hasBullishOBs)
if (drawOrderBlocks)
{
//
for (int i = 0; i < bullishOBsCount; i++)
// Bullish ...
bool hasBullishOBs = state.HasBullishOBs();
int bullishOBsCount = state.CountBullishOBs();
if (hasBullishOBs)
{
//
XCOrderBlock *iOb = state.bullishOBs[i];
//
XCBullishOrderBlockObject *iObObj;
bool isCreated = mPOIDrawer
.CreateBullishOrderBlock(
iOb,
iObObj //
);
if (isCreated)
for (int i = 0; i < bullishOBsCount; i++)
{
//
Add(
(XCBaseObject *)iObObj,
drawnObjects //
);
XCOrderBlock *iOb = state.bullishOBs[i];
//
XCBullishOrderBlockObject *iObObj;
bool isCreated = mPOIDrawer
.CreateBullishOrderBlock(
iOb,
iObObj //
);
if (isCreated)
{
//
Add(
(XCBaseObject *)iObObj,
drawnObjects //
);
}
}
}
}
//
// Bearish ...
bool hasBearishOBs = state.HasBearishOBs();
int bearishOBsCount = state.CountBearishOBs();
if (hasBearishOBs)
{
//
for (int i = 0; i < bearishOBsCount; i++)
// Bearish ...
bool hasBearishOBs = state.HasBearishOBs();
int bearishOBsCount = state.CountBearishOBs();
if (hasBearishOBs)
{
//
XCOrderBlock *iOb = state.bearishOBs[i];
//
XCBearishOrderBlockObject *iObObj;
bool isCreated = mPOIDrawer
.CreateBearishOrderBlock(
iOb,
iObObj //
);
if (isCreated)
for (int i = 0; i < bearishOBsCount; i++)
{
//
Add(
(XCBaseObject *)iObObj,
drawnObjects //
);
XCOrderBlock *iOb = state.bearishOBs[i];
//
XCBearishOrderBlockObject *iObObj;
bool isCreated = mPOIDrawer
.CreateBearishOrderBlock(
iOb,
iObObj //
);
if (isCreated)
{
//
Add(
(XCBaseObject *)iObObj,
drawnObjects //
);
}
}
}
}
//
// Fair Value Gaps ...
//
// Bullish ...
bool hasBullishFVGs = state.HasBullishFVGs();
int bullishFVGsCount = state.CountBullishFVGs();
if (hasBullishFVGs)
if (drawFairValueGaps)
{
//
for (int i = 0; i < bullishFVGsCount; i++)
// Bullish ...
bool hasBullishFVGs = state.HasBullishFVGs();
int bullishFVGsCount = state.CountBullishFVGs();
if (hasBullishFVGs)
{
//
XCFVG *iFVG = state.bullishFVGs[i];
//
XCBullishFairValueGapObject *iFVGObj;
bool isCreated = mPOIDrawer
.CreateBullishFairValueGap(
iFVG,
iFVGObj //
);
if (isCreated)
for (int i = 0; i < bullishFVGsCount; i++)
{
//
iFVGObj.ZoneColor(clrLime);
XCFVG *iFVG = state.bullishFVGs[i];
//
Add(
(XCBaseObject *)iFVGObj,
drawnObjects //
);
XCBullishFairValueGapObject *iFVGObj;
bool isCreated = mPOIDrawer
.CreateBullishFairValueGap(
iFVG,
iFVGObj //
);
if (isCreated)
{
//
iFVGObj.ZoneColor(clrLime);
//
Add(
(XCBaseObject *)iFVGObj,
drawnObjects //
);
}
}
}
//
// Bearish ...
bool hasBearishFVGs = state.HasBearishFVGs();
int bearishFVGsCount = state.CountBearishFVGs();
if (hasBearishFVGs)
{
//
for (int i = 0; i < bearishFVGsCount; i++)
{
//
XCFVG *iFVG = state.bearishFVGs[i];
//
XCBearishFairValueGapObject *iFVGObj;
bool isCreated = mPOIDrawer
.CreateBearishFairValueGap(
iFVG,
iFVGObj //
);
if (isCreated)
{
//
iFVGObj.ZoneColor(clrRed);
//
Add(
(XCBaseObject *)iFVGObj,
drawnObjects //
);
}
}
}
}
//
// Bearish ...
bool hasBearishFVGs = state.HasBearishFVGs();
int bearishFVGsCount = state.CountBearishFVGs();
if (hasBearishFVGs)
// Support and Resistance Zones ...
if (drawSupportAndResistanceZones)
{
//
for (int i = 0; i < bearishFVGsCount; i++)
// Support Zones ...
bool hasSupportZones = state.HasSupportZones();
int supportZonesCount = state.CountSupportZones();
if (hasSupportZones)
{
//
XCFVG *iFVG = state.bearishFVGs[i];
//
XCBearishFairValueGapObject *iFVGObj;
bool isCreated = mPOIDrawer
.CreateBearishFairValueGap(
iFVG,
iFVGObj //
);
if (isCreated)
for (int i = 0; i < supportZonesCount; i++)
{
//
iFVGObj.ZoneColor(clrRed);
XCSupportZoneObject *iObj;
bool isCreated = mPOIDrawer
.CreateSupportZone(
state.supportZones[i],
iObj //
);
//
Add(
(XCBaseObject *)iFVGObj,
drawnObjects //
);
if (isCreated)
{
//
iObj.ZoneColor(clrDarkSeaGreen);
//
Add(
(XCBaseObject *)iObj,
drawnObjects //
);
}
}
}
//
// Resistance Zones ...
bool hasResistanceZones = state.HasResistanceZones();
int resistanceZonesCount = state.CountResistanceZones();
if (hasResistanceZones)
{
//
for (int i = 0; i < resistanceZonesCount; i++)
{
//
XCResistanceZoneObject *iObj;
bool isCreated = mPOIDrawer
.CreateResistanceZone(
state.resistanceZones[i],
iObj //
);
//
if (isCreated)
{
//
iObj.ZoneColor(clrSaddleBrown);
//
Add(
(XCBaseObject *)iObj,
drawnObjects //
);
}
}
}
}
//
// Support Zones ...
bool hasSupportZones = state.HasSupportZones();
int supportZonesCount = state.CountSupportZones();
if (hasSupportZones)
// Supply and Demand Zones ...
if (drawSupplyAndDemandZones)
{
//
for (int i = 0; i < supportZonesCount; i++)
// Demand Zones ...
bool hasDemandZones = state.HasDemandZones();
int demandZonesCount = state.CountDemandZones();
if (hasDemandZones)
{
//
XCSupportZoneObject *iObj;
bool isCreated = mPOIDrawer
.CreateSupportZone(
state.supportZones[i],
iObj //
);
//
if (isCreated)
for (int i = 0; i < demandZonesCount; i++)
{
//
iObj.ZoneColor(clrDarkSeaGreen);
XCDemandZoneObject *iObj;
bool isCreated = mPOIDrawer
.CreateDemandZone(
state.demandZones[i],
iObj //
);
//
Add(
(XCBaseObject *)iObj,
drawnObjects //
);
if (isCreated)
{
//
iObj.ZoneColor(clrDarkTurquoise);
//
Add(
(XCBaseObject *)iObj,
drawnObjects //
);
}
}
}
}
//
// Resistance Zones ...
bool hasResistanceZones = state.HasResistanceZones();
int resistanceZonesCount = state.CountResistanceZones();
if (hasResistanceZones)
{
//
for (int i = 0; i < resistanceZonesCount; i++)
// Supply Zones ...
bool hasSupplyZones = state.HasSupplyZones();
int supplyZonesCount = state.CountSupplyZones();
if (hasSupplyZones)
{
//
XCResistanceZoneObject *iObj;
bool isCreated = mPOIDrawer
.CreateResistanceZone(
state.resistanceZones[i],
iObj //
);
//
if (isCreated)
for (int i = 0; i < supplyZonesCount; i++)
{
//
iObj.ZoneColor(clrSaddleBrown);
XCSupplyZoneObject *iObj;
bool isCreated = mPOIDrawer
.CreateSupplyZone(
state.supplyZones[i],
iObj //
);
//
Add(
(XCBaseObject *)iObj,
drawnObjects //
);
}
}
}
if (isCreated)
{
//
iObj.ZoneColor(clrChocolate);
//
// Demand Zones ...
bool hasDemandZones = state.HasDemandZones();
int demandZonesCount = state.CountDemandZones();
if (hasDemandZones)
{
//
for (int i = 0; i < demandZonesCount; i++)
{
//
XCDemandZoneObject *iObj;
bool isCreated = mPOIDrawer
.CreateDemandZone(
state.demandZones[i],
iObj //
);
//
if (isCreated)
{
//
iObj.ZoneColor(clrDarkTurquoise);
//
Add(
(XCBaseObject *)iObj,
drawnObjects //
);
}
}
}
//
// Supply Zones ...
bool hasSupplyZones = state.HasSupplyZones();
int supplyZonesCount = state.CountSupplyZones();
if (hasSupplyZones)
{
//
for (int i = 0; i < supplyZonesCount; i++)
{
//
XCSupplyZoneObject *iObj;
bool isCreated = mPOIDrawer
.CreateSupplyZone(
state.supplyZones[i],
iObj //
);
//
if (isCreated)
{
//
iObj.ZoneColor(clrChocolate);
//
Add(
(XCBaseObject *)iObj,
drawnObjects //
);
//
Add(
(XCBaseObject *)iObj,
drawnObjects //
);
}
}
}
}