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( int DrawCycleState(
X121SMCCycleState &state, 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 ... // Order Blocks ...
if (drawOrderBlocks)
//
// Bullish ...
bool hasBullishOBs = state.HasBullishOBs();
int bullishOBsCount = state.CountBullishOBs();
if (hasBullishOBs)
{ {
// //
for (int i = 0; i < bullishOBsCount; i++) // Bullish ...
bool hasBullishOBs = state.HasBullishOBs();
int bullishOBsCount = state.CountBullishOBs();
if (hasBullishOBs)
{ {
// //
XCOrderBlock *iOb = state.bullishOBs[i]; for (int i = 0; i < bullishOBsCount; i++)
//
XCBullishOrderBlockObject *iObObj;
bool isCreated = mPOIDrawer
.CreateBullishOrderBlock(
iOb,
iObObj //
);
if (isCreated)
{ {
// //
Add( XCOrderBlock *iOb = state.bullishOBs[i];
(XCBaseObject *)iObObj,
drawnObjects // //
); 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]; for (int i = 0; i < bearishOBsCount; i++)
//
XCBearishOrderBlockObject *iObObj;
bool isCreated = mPOIDrawer
.CreateBearishOrderBlock(
iOb,
iObObj //
);
if (isCreated)
{ {
// //
Add( XCOrderBlock *iOb = state.bearishOBs[i];
(XCBaseObject *)iObObj,
drawnObjects // //
); XCBearishOrderBlockObject *iObObj;
bool isCreated = mPOIDrawer
.CreateBearishOrderBlock(
iOb,
iObObj //
);
if (isCreated)
{
//
Add(
(XCBaseObject *)iObObj,
drawnObjects //
);
}
} }
} }
} }
// //
// Fair Value Gaps ... // Fair Value Gaps ...
if (drawFairValueGaps)
//
// Bullish ...
bool hasBullishFVGs = state.HasBullishFVGs();
int bullishFVGsCount = state.CountBullishFVGs();
if (hasBullishFVGs)
{ {
// //
for (int i = 0; i < bullishFVGsCount; i++) // Bullish ...
bool hasBullishFVGs = state.HasBullishFVGs();
int bullishFVGsCount = state.CountBullishFVGs();
if (hasBullishFVGs)
{ {
// //
XCFVG *iFVG = state.bullishFVGs[i]; for (int i = 0; i < bullishFVGsCount; i++)
//
XCBullishFairValueGapObject *iFVGObj;
bool isCreated = mPOIDrawer
.CreateBullishFairValueGap(
iFVG,
iFVGObj //
);
if (isCreated)
{ {
// //
iFVGObj.ZoneColor(clrLime); XCFVG *iFVG = state.bullishFVGs[i];
// //
Add( XCBullishFairValueGapObject *iFVGObj;
(XCBaseObject *)iFVGObj, bool isCreated = mPOIDrawer
drawnObjects // .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 ... // Support and Resistance Zones ...
bool hasBearishFVGs = state.HasBearishFVGs(); if (drawSupportAndResistanceZones)
int bearishFVGsCount = state.CountBearishFVGs();
if (hasBearishFVGs)
{ {
// //
for (int i = 0; i < bearishFVGsCount; i++) // Support Zones ...
bool hasSupportZones = state.HasSupportZones();
int supportZonesCount = state.CountSupportZones();
if (hasSupportZones)
{ {
// //
XCFVG *iFVG = state.bearishFVGs[i]; for (int i = 0; i < supportZonesCount; i++)
//
XCBearishFairValueGapObject *iFVGObj;
bool isCreated = mPOIDrawer
.CreateBearishFairValueGap(
iFVG,
iFVGObj //
);
if (isCreated)
{ {
// //
iFVGObj.ZoneColor(clrRed); XCSupportZoneObject *iObj;
bool isCreated = mPOIDrawer
.CreateSupportZone(
state.supportZones[i],
iObj //
);
// //
Add( if (isCreated)
(XCBaseObject *)iFVGObj, {
drawnObjects // //
); 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 ... // Supply and Demand Zones ...
bool hasSupportZones = state.HasSupportZones(); if (drawSupplyAndDemandZones)
int supportZonesCount = state.CountSupportZones();
if (hasSupportZones)
{ {
// //
for (int i = 0; i < supportZonesCount; i++) // Demand Zones ...
bool hasDemandZones = state.HasDemandZones();
int demandZonesCount = state.CountDemandZones();
if (hasDemandZones)
{ {
// //
XCSupportZoneObject *iObj; for (int i = 0; i < demandZonesCount; i++)
bool isCreated = mPOIDrawer
.CreateSupportZone(
state.supportZones[i],
iObj //
);
//
if (isCreated)
{ {
// //
iObj.ZoneColor(clrDarkSeaGreen); XCDemandZoneObject *iObj;
bool isCreated = mPOIDrawer
.CreateDemandZone(
state.demandZones[i],
iObj //
);
// //
Add( if (isCreated)
(XCBaseObject *)iObj, {
drawnObjects // //
); 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; for (int i = 0; i < supplyZonesCount; i++)
bool isCreated = mPOIDrawer
.CreateResistanceZone(
state.resistanceZones[i],
iObj //
);
//
if (isCreated)
{ {
// //
iObj.ZoneColor(clrSaddleBrown); XCSupplyZoneObject *iObj;
bool isCreated = mPOIDrawer
.CreateSupplyZone(
state.supplyZones[i],
iObj //
);
// //
Add( if (isCreated)
(XCBaseObject *)iObj, {
drawnObjects // //
); iObj.ZoneColor(clrChocolate);
}
}
}
// //
// Demand Zones ... Add(
bool hasDemandZones = state.HasDemandZones(); (XCBaseObject *)iObj,
int demandZonesCount = state.CountDemandZones(); drawnObjects //
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 //
);
} }
} }
} }
+20 -3
View File
@@ -804,10 +804,21 @@ struct X121SMCCycleState
// //
}; };
/**
* Detect Price inside Box ...
*
* @param box: XBoxZone instance Reference, Founded Price Inside Box ...
* @param orderBlock: XCOrderBlock pointer Reference, Founded Price Inside Order Block ...
* @param xConditions: X121Conditions instance Reference, provides Market Conditions ...
* @param state: X121SMCCycleState instance Reference ...
*
* @return ( bool )
*/
bool DetectPriceInsideBox( bool DetectPriceInsideBox(
XBoxZone &box, XBoxZone &box, // Price Inside Bo ...
X121Conditions &xConditions, XCOrderBlock *&orderBlock, // Price Inside Order Block ...
X121SMCCycleState &state // X121Conditions &xConditions, // X121Conditions for Validation ...
X121SMCCycleState &state // Cycle State ...
) )
{ {
// //
@@ -912,6 +923,12 @@ bool DetectPriceInsideBox(
} }
} }
//
if (hasPriceInsideOB)
{
orderBlock = priceInsideOB;
}
// //
bool hasBullishFVGs = state.HasBullishFVGs(); bool hasBullishFVGs = state.HasBullishFVGs();
bool hasBearishFVGs = state.HasBearishFVGs(); bool hasBearishFVGs = state.HasBearishFVGs();
@@ -691,18 +691,20 @@ bool DetectX121SMCXHKPVSignalSetup(
// //
XBoxZone priceBox; XBoxZone priceBox;
bool hasBox = false; bool hasPriceBox = false;
XCOrderBlock *priceOB = NULL;
if (hasState) if (hasState)
{ {
// //
hasBox = DetectPriceInsideBox( hasPriceBox = DetectPriceInsideBox(
priceBox, priceBox,
priceOB,
decisionXConditions, decisionXConditions,
conditions.state // conditions.state //
); );
// //
if (hasBox) if (hasPriceBox)
{ {
// //
// Here We Can Validate Box by Same Cycles Peaks and Vales ... // Here We Can Validate Box by Same Cycles Peaks and Vales ...
@@ -718,11 +720,12 @@ bool DetectX121SMCXHKPVSignalSetup(
); );
// //
if (hasBox) if (hasPriceBox)
{ {
// //
bool isBullish = IsBullish(priceBox.dir); bool isBullish = IsBullish(priceBox.dir);
color boxColor = isBullish ? clrYellow : clrOrange; color boxColor = isBullish ? clrYellow : clrOrange;
// //
XCBoxObject *iObj; XCBoxObject *iObj;
bool isCreated = visionCycleHelper.mPOIDrawer.CreateBox( bool isCreated = visionCycleHelper.mPOIDrawer.CreateBox(
@@ -743,6 +746,65 @@ bool DetectX121SMCXHKPVSignalSetup(
drawnObjects // drawnObjects //
); );
} }
//
XCBaseObject *priceOBObj = NULL;
if (isBullish)
{
//
XCBullishOrderBlockObject *iObj;
isCreated = visionCycleHelper
.mPOIDrawer
.CreateBullishOrderBlock(
priceOB,
iObj //
);
//
if (isCreated)
{
//
iObj.ZoneWidth(2);
iObj.ZoneColor(boxColor);
iObj.ZoneStyle(STYLE_SOLID);
//
priceOBObj = (XCBaseObject *)iObj;
}
}
else
{
//
XCBearishOrderBlockObject *iObj;
isCreated = visionCycleHelper
.mPOIDrawer
.CreateBearishOrderBlock(
priceOB,
iObj //
);
//
if (isCreated)
{
//
iObj.ZoneWidth(2);
iObj.ZoneColor(boxColor);
iObj.ZoneStyle(STYLE_SOLID);
//
priceOBObj = (XCBaseObject *)iObj;
}
}
//
if (isCreated)
{
//
Add(
priceOBObj,
drawnObjects //
);
}
} }
// //