last works on Testing XHK Zones ...

This commit is contained in:
2025-09-29 19:43:49 +03:30
parent 7b27a4ad2f
commit 0a59459e8d
2 changed files with 531 additions and 37 deletions
@@ -631,7 +631,6 @@ class XCXFIMAStrategy2Signaller : public XCXFIMABaseSignaller
ENUM_X_PRICE iPriceType = X_PRICE_NONE;
ENUM_X_DIRECTION iDir = X_DIRECTION_NONE;
ENUM_X_PRICE iPriceEdgeType = X_PRICE_NONE;
ENUM_X_DIRECTION iHKSwitchedDir = X_DIRECTION_NONE;
//
XPivot pvPivots[];
@@ -684,41 +683,6 @@ class XCXFIMAStrategy2Signaller : public XCXFIMABaseSignaller
analyserConfig //
);
//
// TODO: Testing ...
//
double cHKO = fimaConditions.hkOpenBuffer[0];
double cHKH = fimaConditions.hkHighBuffer[0];
double cHKL = fimaConditions.hkLowBuffer[0];
double cHKC = fimaConditions.hkCloseBuffer[0];
//
double pHKO = fimaConditions.hkOpenBuffer[1];
double pHKH = fimaConditions.hkHighBuffer[1];
double pHKL = fimaConditions.hkLowBuffer[1];
double pHKC = fimaConditions.hkCloseBuffer[1];
//
bool isCHKBullish = cHKO < cHKC;
bool isCHKBearish = cHKO > cHKC;
//
bool isPHKBullish = pHKO < pHKC;
bool isPHKBearish = pHKO > pHKC;
//
bool isCHKSwitchedToBullish = isCHKBullish && !isPHKBullish;
bool isCHKSwitchedToBearish = isCHKBearish && !isPHKBearish;
//
// Add this as Param in Strategy Finders for Using it ...
iHKSwitchedDir = isCHKSwitchedToBullish
? X_DIRECTION_BULLISH
: isCHKSwitchedToBullish
? X_DIRECTION_BEARISH
: X_DIRECTION_NONE;
//
// Collect Support and Resistance Zones and Validate by them ...
@@ -1196,6 +1160,43 @@ class XCXFIMAStrategy2Signaller : public XCXFIMABaseSignaller
);
}
//
// Calling Without Candlestick Patterns Strategies ...
//
// Testing HK Zones ...
XBoxZone hkZones[];
int hkCounts = fima2Signaller.fimaHelper.ExtractHKZones(
hkZones,
1, // Bar Index ...
50, // Number of Zones ...
5, // Shadow Multiplier ...
1, // Strength ...
21 // Validation Length ...
);
if (IsValidSize(hkCounts))
{
//
XCBoxObject *iObj;
for (int i = 0; i < hkCounts; i++)
{
//
iObj = NULL;
bool isCreated = fima2Signaller.poiDrawer.DrawBox(
hkZones[i],
iObj,
true, // Ignore At ...
hkZones[i].type // Name ...
);
//
ZeroMemory(iObj);
}
//
Print("HK Zones Detected ...");
}
//
// Check Required Pattern Exists ...
bool hasPinnedBar = HasDirection(structure.pinnedDir);
@@ -1779,7 +1780,7 @@ class XCXFIMAStrategy2Signaller : public XCXFIMABaseSignaller
}
/**
* Check Pattern Has Signal Based on Strategy 1 ...
* Check Pattern Has Signal Based on Strategy 2 ...
*
* @param bar: XOHCL, reference to Pattern Bar ...
* @param iZone: XBoxZone, reference to holds affected zone ...
@@ -1809,6 +1810,7 @@ class XCXFIMAStrategy2Signaller : public XCXFIMABaseSignaller
//
// Prepare ...
iZone.Clean();
//
// Validate ...
@@ -1826,6 +1828,75 @@ class XCXFIMAStrategy2Signaller : public XCXFIMABaseSignaller
return result;
}
/**
* Check Pattern Has Signal Based on Strategy 1 ...
*
* @param bar: XOHCL, reference to Pattern Bar ...
* @param iZone: XBoxZone, reference to holds affected zone ...
* @param supports: XBoxZone, array reference to Provide Exists Supports ...
* @param resistances: XBoxZone, array reference to Provide Exists Resistances ...
* @param structure: XFIMAMarketStructure, refrence to Provides Market Structure ...
* @param fimaConditions: XFIMAConditions, reference to Bar Specified XFIMA Conditions ...
*
* @return ( bool )
*/
bool Strategy3HasSignal(
XOHCL &bar,
XBoxZone &iZone,
XBoxZone &supports[],
XBoxZone &resistances[],
XFIMAMarketStructure &structure,
XFIMAConditions &fimaConditions //
)
{
//
bool result = false;
//
// Prepare ...
iZone.Clean();
//
// Validate ...
result = bar.IsValid();
if (!result)
{
return result;
}
//
// Reading XHK ...
//
// Bar 1 ...
double cHKO = fimaConditions.hkOpenBuffer[0];
double cHKH = fimaConditions.hkHighBuffer[0];
double cHKL = fimaConditions.hkLowBuffer[0];
double cHKC = fimaConditions.hkCloseBuffer[0];
//
// Bar 2 ...
double pHKO = fimaConditions.hkOpenBuffer[1];
double pHKH = fimaConditions.hkHighBuffer[1];
double pHKL = fimaConditions.hkLowBuffer[1];
double pHKC = fimaConditions.hkCloseBuffer[1];
//
bool isCHKBullish = cHKO < cHKC;
bool isCHKBearish = cHKO > cHKC;
//
bool isPHKBullish = pHKO < pHKC;
bool isPHKBearish = pHKO > pHKC;
//
bool isCHKSwitchedToBullish = isCHKBullish && !isPHKBullish;
bool isCHKSwitchedToBearish = isCHKBearish && !isPHKBearish;
//
return result;
}
//
};