last works on Strategy 1 of XFIMA Signaller ...
This commit is contained in:
@@ -1062,7 +1062,9 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
||||
|
||||
//
|
||||
// Validator Flags ...
|
||||
bool validateByZones = true;
|
||||
bool validateByXFIMARejected = true;
|
||||
bool validateByCyclesMATresnding = true;
|
||||
|
||||
//
|
||||
// Define Requirements ...
|
||||
@@ -1071,6 +1073,7 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
||||
XOHCL pBar;
|
||||
XOHCL p2Bar;
|
||||
XOHCL p3Bar;
|
||||
XBoxZone zones[];
|
||||
double rejecteds[];
|
||||
bool isBullish = false;
|
||||
bool isBearish = false;
|
||||
@@ -1206,8 +1209,115 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
||||
|
||||
//
|
||||
rejectedBar.Clean();
|
||||
|
||||
//
|
||||
// Reset Flags ...
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
zone.Clean();
|
||||
result = false;
|
||||
isBullish = false;
|
||||
isBearish = false;
|
||||
dir = X_DIRECTION_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Validate Rejection by Cycleas MA Trending ...
|
||||
if (result && validateByCyclesMATresnding)
|
||||
{
|
||||
//
|
||||
int barIDX = pBar.Index();
|
||||
|
||||
//
|
||||
bool isCyclesMABulliah =
|
||||
fimaParser.IsHCMABullish(barIDX) &&
|
||||
fimaParser.IsHCMAOverLast(barIDX);
|
||||
|
||||
//
|
||||
bool isCyclesMABearish =
|
||||
fimaParser.IsHCMABearish(barIDX) &&
|
||||
fimaParser.IsHCMAUnderLast(barIDX);
|
||||
|
||||
//
|
||||
isBullish =
|
||||
isBullish &&
|
||||
isCyclesMABulliah;
|
||||
|
||||
//
|
||||
isBearish =
|
||||
isBearish &&
|
||||
isCyclesMABearish;
|
||||
|
||||
//
|
||||
result = isBullish || isBearish;
|
||||
}
|
||||
|
||||
//
|
||||
// Detect a Zone ...
|
||||
// Validate by Has a Zone (FVG, Support, Resistance) ...
|
||||
if (result && validateByZones)
|
||||
{
|
||||
//
|
||||
int zonesCount = poiDetector.DetectZones(
|
||||
bar,
|
||||
zones,
|
||||
true, // Validated Zones ...
|
||||
false, // Contains Order Block ...
|
||||
true, // Contains Fair Value Gaps ...
|
||||
true, // Contains Supports ...
|
||||
true, // Contains Resistances ...
|
||||
X_DIRECTION_ALL, // For All Directions ...
|
||||
X_SORT_BY_DATE, // Sort by Date ...
|
||||
X_DIRECTION_BEARISH, // Sorting Direction ...
|
||||
10, // Zones Validation Points Factor ...
|
||||
5, // Zones Loopback ...
|
||||
3, // Zones Validation ...
|
||||
0, // All Zones ...
|
||||
50 // Loopback Length ...
|
||||
);
|
||||
UpdateToTime(zones, bar.time);
|
||||
|
||||
//
|
||||
result = result && IsValidSize(zonesCount);
|
||||
if (result)
|
||||
{
|
||||
//
|
||||
XBoxZone tmpZones[];
|
||||
int bullishCount = ExtractByDirection(
|
||||
tmpZones,
|
||||
zones,
|
||||
X_DIRECTION_BULLISH //
|
||||
);
|
||||
int bearishCount = ExtractByDirection(
|
||||
tmpZones,
|
||||
zones,
|
||||
X_DIRECTION_BEARISH //
|
||||
);
|
||||
|
||||
//
|
||||
result =
|
||||
result &&
|
||||
IsValidSize(bullishCount) &&
|
||||
IsValidSize(bearishCount);
|
||||
}
|
||||
|
||||
//
|
||||
// Reset Flags ...
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
zone.Clean();
|
||||
result = false;
|
||||
isBullish = false;
|
||||
isBearish = false;
|
||||
dir = X_DIRECTION_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// TODO: Remove this and Put inside Draws Part ...
|
||||
if (result)
|
||||
{
|
||||
//
|
||||
@@ -1250,7 +1360,11 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
||||
}
|
||||
|
||||
//
|
||||
DebugBreak();
|
||||
// Draw Detected Zones ...
|
||||
if (HasChild(zones))
|
||||
{
|
||||
poiDrawer.DrawZones(zones, iConfig);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
@@ -1373,6 +1487,7 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
||||
pBar.Clean();
|
||||
p2Bar.Clean();
|
||||
p3Bar.Clean();
|
||||
XClean(zones);
|
||||
XClean(rejecteds);
|
||||
pBarPatterns.Clean();
|
||||
p2BarPatterns.Clean();
|
||||
|
||||
Reference in New Issue
Block a user