Files
xMQL5/BKPS/14031206/Documents/BKP/tmpPOIS.mq5
T
2025-02-24 19:20:10 +03:30

347 lines
7.3 KiB
Plaintext

//
// Detect Inside Zones ...
//
XCFVG *insideFVG;
bool hasInsideFVG = false;
//
XCOrderBlock *insideOB;
bool hasInsideOB = false;
//
XCSupplyZone *insideSupply;
bool hasInsideSupply = false;
//
XCDemandZone *insideDemand;
bool hasInsideDemand = false;
//
XCSupportZone *insideSupport;
bool hasInsideSupport = false;
//
XCResistanceZone *insideResistnce;
bool hasInsideResistance = false;
//
// Detect PullBack ...
//
ENUM_X_DIRECTION pullbackDir;
bool hasPullBack = mXWZBarAnalyser.HasPullBack(
pullbackDir,
iBar //
);
bool hasBullishPullBack =
hasPullBack &&
IsBullish(pullbackDir);
bool hasBearishPullBack =
hasPullBack &&
IsBearish(pullbackDir);
//
// Detect PinBar ...
//
ENUM_X_DIRECTION pinBarDir;
bool hasPinBar = mXWZBarAnalyser.IsPinBar(
iBar,
pinBarDir,
0 //
);
bool hasBullishPinBar =
hasPinBar &&
IsBullish(pinBarDir);
bool hasBearishPinBar =
hasPinBar &&
IsBearish(pinBarDir);
//
// Detect Order Block ...
//
XOHCL obBar;
XCOrderBlock *ob;
ENUM_X_DIRECTION obDir;
bool hasOB = mXWZBarAnalyser.HasOrderBlock(
iBar,
obBar,
obDir //
);
bool hasBullishOB =
hasOB &&
IsBullish(obDir);
bool hasBearishOB =
hasOB &&
IsBearish(obDir);
if (hasOB)
{
//
ob = new XCOrderBlock();
bool isInited = ob.Init(obBar, obDir);
if (isInited)
{
//
ENUM_X_DIRECTION forDir = ob.GetDirection();
//
// Check OB Not Activated ...
XOHCL activationBar;
bool isObActivationBarBodyIn = false;
bool isActivated = ob.IsActivated(
forDir,
activationBar,
isObActivationBarBodyIn,
false,
_Period //
);
//
if (isActivated)
{
//
hasOB = false;
obBar.Clean();
ZeroMemory(ob);
hasBullishOB = false;
hasBearishOB = false;
}
}
}
//
if (hasBullishPinBar)
{
//
XCBarArrowObject *iObj;
bool isCreated = mXWZPOIDrawer
.CreateBarArrow(
iBar,
iObj,
X_PRICE_LOW,
159,
clrAqua,
3,
ANCHOR_BOTTOM,
"BULLPULL" //
);
if (isCreated)
{
mXWZDrawnObjects.Add(iObj);
}
}
//
if (hasBearishPinBar)
{
//
XCBarArrowObject *iObj;
bool isCreated = mXWZPOIDrawer
.CreateBarArrow(
iBar,
iObj,
X_PRICE_HIGH,
159,
clrMagenta,
3,
ANCHOR_TOP,
"BEARPULL" //
);
if (isCreated)
{
mXWZDrawnObjects.Add(iObj);
}
}
//
if (hasOB)
{
//
XCBaseObject *iObj;
bool isCreated = mXWZPOIDrawer.CreateOrderBlock(
ob,
iObj //
);
if (isCreated)
{
mXWZDrawnObjects.Add(iObj);
}
}
//
int idx = -1;
int count = 0;
bool has = false;
//
ENUM_X_DIRECTION trend =
IsValid(lastBullishTrend) &&
lastBullishTrend > lastBearishTrend
? X_DIRECTION_BULLISH
: IsValid(lastBearishTrend) &&
lastBearishTrend > lastBullishTrend
? X_DIRECTION_BEARISH
: X_DIRECTION_NONE;
bool hasTrend = HasDirection(trend);
bool hasBullishTrend = hasTrend &&
IsBullish(trend);
bool hasBearishTrend = hasTrend &&
IsBearish(trend);
//
// Order Block ...
has = hasBullishTrend;
if (has)
{
}
has = hasBearishTrend;
if (has)
{
}
//
// Fair Value Gap ...
has = hasBullishTrend;
if (has)
{
}
has = hasBearishTrend;
if (has)
{
}
//
// Supply Zone ...
has = hasBearishTrend;
if (has)
{
}
//
// Resistance Zone ...
has = hasBearishTrend;
if (has)
{
}
//
// Demand Zone ...
has = hasBullishTrend;
if (has)
{
}
//
// Support Zone ...
has = hasBullishTrend;
if (has)
{
}
//
// Draw Inside Zones ...
//
if (hasInsideOB)
{
//
XCBaseObject *iObj;
bool isCreated = mXWZPOIDrawer
.CreateOrderBlock(
insideOB,
iObj //
);
//
if (isCreated)
{
mXWZDrawnObjects.Add(iObj);
}
}
//
if (hasInsideFVG)
{
//
XCBaseObject *iObj;
bool isCreated = mXWZPOIDrawer
.CreateFairValueGap(
insideFVG,
iObj //
);
//
if (isCreated)
{
mXWZDrawnObjects.Add(iObj);
}
}
//
if (hasInsideSupply)
{
//
XCSupplyZoneObject *iObj;
bool isCreated = mXWZPOIDrawer
.CreateSupplyZone(
insideSupply,
iObj //
);
//
if (isCreated)
{
mXWZDrawnObjects.Add(iObj);
}
}
//
if (hasInsideDemand)
{
//
XCDemandZoneObject *iObj;
bool isCreated = mXWZPOIDrawer
.CreateDemandZone(
insideDemand,
iObj //
);
//
if (isCreated)
{
mXWZDrawnObjects.Add(iObj);
}
}
//
if (hasInsideSupport)
{
//
XCSupportZoneObject *iObj;
bool isCreated = mXWZPOIDrawer
.CreateSupportZone(
insideSupport,
iObj //
);
//
if (isCreated)
{
mXWZDrawnObjects.Add(iObj);
}
}
//
if (hasInsideResistance)
{
//
XCResistanceZoneObject *iObj;
bool isCreated = mXWZPOIDrawer
.CreateResistanceZone(
insideResistnce,
iObj //
);
//
if (isCreated)
{
mXWZDrawnObjects.Add(iObj);
}
}