This commit is contained in:
2025-10-29 15:25:15 +03:30
parent 6b0c1247bb
commit 90988de7bf
4 changed files with 4634 additions and 153 deletions
File diff suppressed because it is too large Load Diff
+2 -1
View File
@@ -501,7 +501,8 @@ struct XTrend
// //
if (IsValid()) if (IsValid())
{ {
result = "XTRND_" + ToXString(dir) + "_" + ToXString(TimeToSeconds(time)); double ifv = NormalizePrice(fromValue, symbol);
result = "XTRND_" + ToXString(dir) + "_" + ToXString(ifv) + "_" + ToXString(TimeToSeconds(fromTime));
} }
// //
@@ -1882,6 +1882,350 @@ class XCXFIMAHelperParser : XCBase
return result; return result;
} }
/**
* Check Price is Over HK Band Lower ...
*
* @param barIndex: int, Specified Bar Index ...
* @param priceType: ENUM_X_PRICE, Specified Price Type ...
*
* @return ( bool )
*/
bool IsOverHKBandLower(
int barIndex = 0,
ENUM_X_PRICE priceType = X_PRICE_CLOSE //
)
{
//
bool result = false;
//
// Normalize ...
barIndex = NormalizeBarIndex(barIndex);
//
// Validate ...
result = IsValid() &&
IsXValid(priceType);
if (!result)
{
return result;
}
//
XOHCL bar;
result = bar.Init(symbol, period, barIndex);
double price = bar.GetPrice(priceType);
double value = helper.GetHKBandLower(barIndex);
result =
result &&
price > value;
//
// Cleanup ...
bar.Clean();
//
return result;
}
/**
* Check Price is Over HK Band Upper ...
*
* @param barIndex: int, Specified Bar Index ...
* @param priceType: ENUM_X_PRICE, Specified Price Type ...
*
* @return ( bool )
*/
bool IsOverHKBandUpper(
int barIndex = 0,
ENUM_X_PRICE priceType = X_PRICE_CLOSE //
)
{
//
bool result = false;
//
// Normalize ...
barIndex = NormalizeBarIndex(barIndex);
//
// Validate ...
result = IsValid() &&
IsXValid(priceType);
if (!result)
{
return result;
}
//
XOHCL bar;
result = bar.Init(symbol, period, barIndex);
double price = bar.GetPrice(priceType);
double value = helper.GetHKBandUpper(barIndex);
result =
result &&
price > value;
//
// Cleanup ...
bar.Clean();
//
return result;
}
/**
* Check Price is Under HK Band Lower ...
*
* @param barIndex: int, Specified Bar Index ...
* @param priceType: ENUM_X_PRICE, Specified Price Type ...
*
* @return ( bool )
*/
bool IsUnderHKBandLower(
int barIndex = 0,
ENUM_X_PRICE priceType = X_PRICE_CLOSE //
)
{
//
bool result = false;
//
// Normalize ...
barIndex = NormalizeBarIndex(barIndex);
//
// Validate ...
result = IsValid() &&
IsXValid(priceType);
if (!result)
{
return result;
}
//
XOHCL bar;
result = bar.Init(symbol, period, barIndex);
double price = bar.GetPrice(priceType);
double value = helper.GetHKBandLower(barIndex);
result =
result &&
price < value;
//
// Cleanup ...
bar.Clean();
//
return result;
}
/**
* Check Price is Under HK Band Upper ...
*
* @param barIndex: int, Specified Bar Index ...
* @param priceType: ENUM_X_PRICE, Specified Price Type ...
*
* @return ( bool )
*/
bool IsUnderHKBandUpper(
int barIndex = 0,
ENUM_X_PRICE priceType = X_PRICE_CLOSE //
)
{
//
bool result = false;
//
// Normalize ...
barIndex = NormalizeBarIndex(barIndex);
//
// Validate ...
result = IsValid() &&
IsXValid(priceType);
if (!result)
{
return result;
}
//
XOHCL bar;
result = bar.Init(symbol, period, barIndex);
double price = bar.GetPrice(priceType);
double value = helper.GetHKBandUpper(barIndex);
result =
result &&
price < value;
//
// Cleanup ...
bar.Clean();
//
return result;
}
/**
* Check Price Crossed Over HK Band Lower ...
*
* @param barIndex: int, Specified Bar Index ...
* @param priceType: ENUM_X_PRICE, Specified Price Type ...
*
* @return ( bool )
*/
bool IsCrossedOverHKBandLower(
int barIndex = 0,
ENUM_X_PRICE priceType = X_PRICE_CLOSE //
)
{
//
bool result = false;
//
// Normalize ...
barIndex = NormalizeBarIndex(barIndex);
//
// Validate ...
result = IsValid() &&
IsXValid(priceType);
if (!result)
{
return result;
}
//
bool isC = IsOverHKBandLower(barIndex, priceType);
bool isP = IsOverHKBandLower(barIndex + 1, priceType);
//
result = isC && !isP;
//
return result;
}
/**
* Check Price Crossed Under HK Band Lower ...
*
* @param barIndex: int, Specified Bar Index ...
* @param priceType: ENUM_X_PRICE, Specified Price Type ...
*
* @return ( bool )
*/
bool IsCrossedUnderHKBandLower(
int barIndex = 0,
ENUM_X_PRICE priceType = X_PRICE_CLOSE //
)
{
//
bool result = false;
//
// Normalize ...
barIndex = NormalizeBarIndex(barIndex);
//
// Validate ...
result = IsValid() &&
IsXValid(priceType);
if (!result)
{
return result;
}
//
bool isC = IsUnderHKBandLower(barIndex, priceType);
bool isP = IsUnderHKBandLower(barIndex + 1, priceType);
//
result = isC && !isP;
//
return result;
}
/**
* Check Price Crossed Over HK Band Upper ...
*
* @param barIndex: int, Specified Bar Index ...
* @param priceType: ENUM_X_PRICE, Specified Price Type ...
*
* @return ( bool )
*/
bool IsCrossedOverHKBandUpper(
int barIndex = 0,
ENUM_X_PRICE priceType = X_PRICE_CLOSE //
)
{
//
bool result = false;
//
// Normalize ...
barIndex = NormalizeBarIndex(barIndex);
//
// Validate ...
result = IsValid() &&
IsXValid(priceType);
if (!result)
{
return result;
}
//
bool isC = IsOverHKBandUpper(barIndex, priceType);
bool isP = IsOverHKBandUpper(barIndex + 1, priceType);
//
result = isC && !isP;
//
return result;
}
/**
* Check Price Crossed Under HK Band Upper ...
*
* @param barIndex: int, Specified Bar Index ...
* @param priceType: ENUM_X_PRICE, Specified Price Type ...
*
* @return ( bool )
*/
bool IsCrossedUnderHKBandUpper(
int barIndex = 0,
ENUM_X_PRICE priceType = X_PRICE_CLOSE //
)
{
//
bool result = false;
//
// Normalize ...
barIndex = NormalizeBarIndex(barIndex);
//
// Validate ...
result = IsValid() &&
IsXValid(priceType);
if (!result)
{
return result;
}
//
bool isC = IsUnderHKBandUpper(barIndex, priceType);
bool isP = IsUnderHKBandUpper(barIndex + 1, priceType);
//
result = isC && !isP;
//
return result;
}
/** /**
* Count Bullish HK(s) ... * Count Bullish HK(s) ...
* *
@@ -2988,6 +3332,361 @@ class XCXFIMAHelperParser : XCBase
return result; return result;
} }
//
// XATR ...
/**
* Check Price is Over ATR Band Lower ...
*
* @param barIndex: int, Specified Bar Index ...
* @param priceType: ENUM_X_PRICE, Specified Price Type ...
*
* @return ( bool )
*/
bool IsOverATRBandLower(
int barIndex = 0,
ENUM_X_PRICE priceType = X_PRICE_CLOSE //
)
{
//
bool result = false;
//
// Normalize ...
barIndex = NormalizeBarIndex(barIndex);
//
// Validate ...
result =
IsValid() &&
IsXValid(priceType);
if (!result)
{
return result;
}
//
XOHCL bar;
result = bar.Init(symbol, period, barIndex);
double price = bar.GetPrice(priceType);
double value = helper.GetATRBandLower(barIndex);
result =
result &&
NotEmptyZero(value) &&
NotEmptyZero(price) &&
price > value;
//
// Cleanup ...
bar.Clean();
//
return result;
}
/**
* Check Price is Over ATR Band Upper ...
*
* @param barIndex: int, Specified Bar Index ...
* @param priceType: ENUM_X_PRICE, Specified Price Type ...
*
* @return ( bool )
*/
bool IsOverATRBandUpper(
int barIndex = 0,
ENUM_X_PRICE priceType = X_PRICE_CLOSE //
)
{
//
bool result = false;
//
// Normalize ...
barIndex = NormalizeBarIndex(barIndex);
//
// Validate ...
result =
IsValid() &&
IsXValid(priceType);
if (!result)
{
return result;
}
//
XOHCL bar;
result = bar.Init(symbol, period, barIndex);
double price = bar.GetPrice(priceType);
double value = helper.GetATRBandUpper(barIndex);
result =
result &&
NotEmptyZero(value) &&
NotEmptyZero(price) &&
price > value;
//
// Cleanup ...
bar.Clean();
//
return result;
}
/**
* Check Price is Under ATR Band Lower ...
*
* @param barIndex: int, Specified Bar Index ...
* @param priceType: ENUM_X_PRICE, Specified Price Type ...
*
* @return ( bool )
*/
bool IsUnderATRBandLower(
int barIndex = 0,
ENUM_X_PRICE priceType = X_PRICE_CLOSE //
)
{
//
bool result = false;
//
// Normalize ...
barIndex = NormalizeBarIndex(barIndex);
//
// Validate ...
result =
IsValid() &&
IsXValid(priceType);
if (!result)
{
return result;
}
//
XOHCL bar;
result = bar.Init(symbol, period, barIndex);
double price = bar.GetPrice(priceType);
double value = helper.GetATRBandLower(barIndex);
result =
result &&
NotEmptyZero(value) &&
NotEmptyZero(price) &&
price < value;
//
// Cleanup ...
bar.Clean();
//
return result;
}
/**
* Check Price is Under ATR Band Upper ...
*
* @param barIndex: int, Specified Bar Index ...
* @param priceType: ENUM_X_PRICE, Specified Price Type ...
*
* @return ( bool )
*/
bool IsUnderATRBandUpper(
int barIndex = 0,
ENUM_X_PRICE priceType = X_PRICE_CLOSE //
)
{
//
bool result = false;
//
// Normalize ...
barIndex = NormalizeBarIndex(barIndex);
//
// Validate ...
result =
IsValid() &&
IsXValid(priceType);
if (!result)
{
return result;
}
//
XOHCL bar;
result = bar.Init(symbol, period, barIndex);
double price = bar.GetPrice(priceType);
double value = helper.GetATRBandUpper(barIndex);
result =
result &&
NotEmptyZero(value) &&
NotEmptyZero(price) &&
price < value;
//
// Cleanup ...
bar.Clean();
//
return result;
}
/**
* Check Price is Crossed Over ATR Band Lower ...
*
* @param barIndex: int, Specified Bar Index ...
* @param priceType: ENUM_X_PRICE, Specified Price Type ...
*
* @return ( bool )
*/
bool IsCrossedOverATRBandLower(
int barIndex = 0,
ENUM_X_PRICE priceType = X_PRICE_CLOSE //
)
{
//
bool result = false;
//
// Normalize ...
barIndex = NormalizeBarIndex(barIndex);
//
result = IsValid() &&
IsXValid(priceType);
if (!result)
{
return result;
}
//
bool isC = IsOverATRBandLower(barIndex, priceType);
bool isP = IsOverATRBandLower(barIndex + 1, priceType);
//
result = isC && !isP;
//
return result;
}
/**
* Check Price is Crossed Under ATR Band Lower ...
*
* @param barIndex: int, Specified Bar Index ...
* @param priceType: ENUM_X_PRICE, Specified Price Type ...
*
* @return ( bool )
*/
bool IsCrossedUnderATRBandLower(
int barIndex = 0,
ENUM_X_PRICE priceType = X_PRICE_CLOSE //
)
{
//
bool result = false;
//
// Normalize ...
barIndex = NormalizeBarIndex(barIndex);
//
result = IsValid() &&
IsXValid(priceType);
if (!result)
{
return result;
}
//
bool isC = IsUnderATRBandLower(barIndex, priceType);
bool isP = IsUnderATRBandLower(barIndex + 1, priceType);
//
result = isC && !isP;
//
return result;
}
/**
* Check Price is Crossed Over ATR Band Upper ...
*
* @param barIndex: int, Specified Bar Index ...
* @param priceType: ENUM_X_PRICE, Specified Price Type ...
*
* @return ( bool )
*/
bool IsCrossedOverATRBandUpper(
int barIndex = 0,
ENUM_X_PRICE priceType = X_PRICE_CLOSE //
)
{
//
bool result = false;
//
// Normalize ...
barIndex = NormalizeBarIndex(barIndex);
//
result = IsValid() &&
IsXValid(priceType);
if (!result)
{
return result;
}
//
bool isC = IsOverATRBandUpper(barIndex, priceType);
bool isP = IsOverATRBandUpper(barIndex + 1, priceType);
//
result = isC && !isP;
//
return result;
}
/**
* Check Price is Crossed Under ATR Band Upper ...
*
* @param barIndex: int, Specified Bar Index ...
* @param priceType: ENUM_X_PRICE, Specified Price Type ...
*
* @return ( bool )
*/
bool IsCrossedUnderATRBandUpper(
int barIndex = 0,
ENUM_X_PRICE priceType = X_PRICE_CLOSE //
)
{
//
bool result = false;
//
// Normalize ...
barIndex = NormalizeBarIndex(barIndex);
//
result = IsValid() &&
IsXValid(priceType);
if (!result)
{
return result;
}
//
bool isC = IsUnderATRBandUpper(barIndex, priceType);
bool isP = IsUnderATRBandUpper(barIndex + 1, priceType);
//
result = isC && !isP;
//
return result;
}
// //
// Cycles Tools ... // Cycles Tools ...
@@ -8507,6 +9206,115 @@ class XCXFIMAHelperParser : XCBase
return result; return result;
} }
//
// Other Tools ...
int CollectPivots(
XPivot &pivots[],
int barIndex = 0,
int loopback = 500 //
)
{
//
int result = 0;
//
// Prepare ...
XClean(pivots);
//
// Normalize ...
loopback = NormalizeInt(loopback, 50);
barIndex = NormalizeBarIndex(barIndex);
//
// Validate ...
bool has = IsValid();
if (!has)
{
return result;
}
//
has = false;
XOHCL tmpBar;
XPivot tmpPivot;
double tmpValue;
datetime tmpTime;
bool isBullish = false;
bool isBearish = false;
string tmpSymbol = symbol;
ENUM_TIMEFRAMES tmpPeriod = period;
ENUM_X_DIRECTION tmpDir = X_DIRECTION_NONE;
for (int i = barIndex; i < barIndex + loopback; i++)
{
//
tmpBar.Clean();
tmpPivot.Clean();
//
has = tmpBar.Init(tmpSymbol, tmpPeriod, i);
if (!has)
{
continue;
}
//
// XSAR ...
isBullish = IsSARSwitchedToBullish(i);
isBearish = IsSARSwitchedToBearish(i);
has = isBullish || isBearish;
if (has)
{
}
//
// XMA Fast / Slow ...
//
// States ...
isBullish = IsMASlowSwitchedToBullish(i);
isBearish = IsMASlowSwitchedToBearish(i);
has = isBullish || isBearish;
if (has)
{
}
//
// Crossed Fast Slow ...
isBullish = IsMAFastCrossedOverSlow(i);
isBearish = IsMAFastCrossedUnderSlow(i);
has = isBullish || isBearish;
if (has)
{
}
//
// Crossed Last ...
isBullish = IsMASlowCrossedOverLast(i);
isBearish = IsMASlowCrossedUnderLast(i);
has = isBullish || isBearish;
if (has)
{
}
//
// XHK ...
isBullish = IsHKSwitchedToBullish(i);
isBearish = IsHKSwitchedToBearish(i);
has = isBullish || isBearish;
if (has)
{
}
}
//
result = ArraySize(pivots);
//
return result;
}
// //
// Protected ... // Protected ...
protected: protected:
@@ -1564,10 +1564,10 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
// //
// Signaller Flags ... // Signaller Flags ...
bool useSignaller1 = true; bool useSignaller1 = false;
bool useSignaller2 = false; bool useSignaller2 = true;
bool useSignaller3 = false; bool useSignaller3 = true;
bool useSignaller4 = false; bool useSignaller4 = true;
// //
XBoxZone tmpZone; XBoxZone tmpZone;
@@ -2049,6 +2049,7 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
// //
XOHCL pBar; XOHCL pBar;
XOHCL p2Bar; XOHCL p2Bar;
XOHCL p3Bar;
bool isBullish = false; bool isBullish = false;
bool isBearish = false; bool isBearish = false;
@@ -2057,56 +2058,19 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
result = bar.GetPreviousBar(pBar); result = bar.GetPreviousBar(pBar);
result = result && result = result &&
pBar.GetPreviousBar(p2Bar); pBar.GetPreviousBar(p2Bar);
result = result &&
p2Bar.GetPreviousBar(p3Bar);
if (!result) if (!result)
{ {
// //
pBar.Clean(); pBar.Clean();
p2Bar.Clean(); p2Bar.Clean();
p3Bar.Clean();
//
return result; return result;
} }
//
// Reading Conditions ...
int pullBackStartBar = -1;
bool isPullBack = result &&
poiDetector.IsPullbackPattern(
pBar,
zone,
dir,
2,
false // Force Break ...
);
bool isPullbackBullish = isPullBack &&
IsXBullish(dir);
bool isPullbackBearish = isPullBack &&
IsXBearish(dir);
if (isPullBack)
{
pullBackStartBar = zone.FromIndex();
}
//
// Reading HK Band ...
//
double pHKBandUpper = fimaHelper.GetHKBandUpper(pBar.Index());
double pHKBandLower = fimaHelper.GetHKBandLower(pBar.Index());
int overHKBandUpperCount = fimaParser.CountOverHKBandUpper(pullBackStartBar, X_PRICE_LOW);
int underHKBandLowerCount = fimaParser.CountUnderHKBandLower(pullBackStartBar, X_PRICE_HIGH);
//
// Reading PV Requirements ...
//
int lastPeakOverLastIDX = -1;
int lastValeUnderLastIDX = -1;
double pPeak = fimaHelper.GetPeak(pBar.Index());
double pVale = fimaHelper.GetVale(pBar.Index());
int samePeaks = fimaParser.CountSamePeaks(pBar.Index());
int sameVales = fimaParser.CountSameVales(pBar.Index());
fimaParser.FindLastPeakOverLast(lastPeakOverLastIDX, pBar.Index());
fimaParser.FindLastValeUnderLast(lastValeUnderLastIDX, pBar.Index());
// //
// Reading pBar Patterns ... // Reading pBar Patterns ...
XPatternAnalysis pBarPatterns; XPatternAnalysis pBarPatterns;
@@ -2115,9 +2079,18 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
pBarPatterns, pBarPatterns,
structureConfig.barsAnalysisConfig // structureConfig.barsAnalysisConfig //
); );
bool hasSupport = pBarPatterns.IsSupport();
bool hasResistance = pBarPatterns.IsResistance();
// //
// Check Bar Patterns ... // Check Boundary Trend ...
XTrend boundaryTrend;
bool hasBoundaryTrend = fimaParser.HasBoundaryTrend(boundaryTrend, pBar.Index());
bool hasBoundaryBullishTrend = hasBoundaryTrend && boundaryTrend.IsBullish();
bool hasBoundaryBearishTrend = hasBoundaryTrend && boundaryTrend.IsBearish();
//
// Bullish ...
bool isPBarHasBullishPatterns = bool isPBarHasBullishPatterns =
(bar.close > pBar.low || (bar.close > pBar.low ||
bar.open > pBar.low) && bar.open > pBar.low) &&
@@ -2130,6 +2103,9 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
pBarPatterns.IsSignalKey(X_DIRECTION_BULLISH) pBarPatterns.IsSignalKey(X_DIRECTION_BULLISH)
// //
); );
//
// Bearish ...
bool isPBarHasBearishPatterns = bool isPBarHasBearishPatterns =
(bar.close < pBar.high || (bar.close < pBar.high ||
bar.open < pBar.high) && bar.open < pBar.high) &&
@@ -2144,94 +2120,78 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
); );
// //
// Check PBar Close Over Under Fast Ma ... // Check Pull Back Pattern ...
bool isPBarCloseOverFast = pBar.close > fimaHelper.GetMAFast(pBar.Index()); XBoxZone pullbackZone;
bool isPBarCloseUnderFast = pBar.close < fimaHelper.GetMAFast(pBar.Index()); ENUM_X_DIRECTION pullbackDir;
bool isPullback = poiDetector.IsPullbackPattern(
//
// Try To Find Affected Zone ...
//
// Collecting Zones ...
XBoxZone zones[];
XBoxZone affectedZones[];
XBoxZone affectedZonesBullish[];
XBoxZone affectedZonesBearish[];
int zonesCount = poiDetector.CollectZones(
pBar, pBar,
zones, // pullbackZone,
5, // Zones Loopback ... pullbackDir //
3 // Zones Validation Length ...
// Required Zones ...
// Loopback ...
);
int affectedZonesCount = ExtractAffectedZones(
pBar,
zones,
affectedZones //
);
int affectedZonesBullishCount = ExtractByDirection(
affectedZonesBullish,
affectedZones,
X_DIRECTION_BULLISH //
);
int affectedZonesBearishCount = ExtractByDirection(
affectedZonesBearish,
affectedZones,
X_DIRECTION_BEARISH //
); );
bool isBullishPullback = isPullback && IsXBullish(pullbackDir);
bool isBearishPullback = isPullback && IsXBearish(pullbackDir);
// //
int insideBullishIDX = -1; // Force P2Bar is Pin Bar ...
int insideBearishIDX = -1; ENUM_X_DIRECTION p2Dir;
bool hasBullishInside = bool isP2BarPinned = poiDetector.IsPinnedBar(
pBar.IsBullish() && p2Bar,
HasInside( p2Dir //
insideBullishIDX,
pBar,
affectedZonesBullish //
);
bool hasBearishInside =
pBar.IsBearish() &&
HasInside(
insideBearishIDX,
pBar,
affectedZonesBearish //
); );
bool isP2BarBullishPinned =
isP2BarPinned &&
IsXBullish(p2Dir);
bool isP2BarBearishPinned =
isP2BarPinned &&
IsXBearish(p2Dir);
// //
// Detecting Boundary Trend ... // Checking For Leg Pattern ...
XTrend boundaryTrend; XLeg _leg;
bool hasBoundaryTrend = fimaParser.HasBoundaryTrend(boundaryTrend, pBar.Index()); XBoxZone legZone;
bool hasBoundaryBullishTrend = hasBoundaryTrend && boundaryTrend.IsBullish(); bool hasLeg = poiDetector.IsLegPattern(
bool hasBoundaryBearishTrend = hasBoundaryTrend && boundaryTrend.IsBearish(); pBar,
_leg,
3,
100 //
);
if (hasLeg)
{
hasLeg = _leg.ToBox(legZone);
}
bool hasBullishLeg = hasLeg && _leg.IsBullish();
bool hasBearishLeg = hasLeg && _leg.IsBearish();
// //
// Do ... // Check Based On LC and HC MA State ...
//
bool isLCMABullish = fimaParser.IsLCMABullish(pBar.Index());
bool isHCMABullish = fimaParser.IsHCMABullish(pBar.Index());
bool isCycleMABullish = isLCMABullish && isHCMABullish;
//
bool isLCMABearish = fimaParser.IsLCMABearish(pBar.Index());
bool isHCMABearish = fimaParser.IsHCMABearish(pBar.Index());
bool isCycleMABearish = isLCMABearish && isHCMABearish;
//
//
//
// //
isBullish = isBullish =
// hasBullishLeg &&
hasBullishInside && isCycleMABullish &&
isPullbackBullish && isBullishPullback &&
isPBarHasBullishPatterns && isP2BarBullishPinned;
fimaParser.IsSARBullish(pBar.Index()) &&
(pVale >= affectedZonesBullish[insideBullishIDX].lower &&
pVale <= affectedZonesBullish[insideBullishIDX].upper)
//
;
// //
isBearish = isBearish =
// hasBearishLeg &&
hasBearishInside && isCycleMABearish &&
isPullbackBearish && isBearishPullback &&
isPBarHasBearishPatterns && isP2BarBearishPinned;
fimaParser.IsSARBearish(pBar.Index()) &&
(pPeak >= affectedZonesBearish[insideBearishIDX].lower &&
pPeak <= affectedZonesBearish[insideBearishIDX].upper)
//
;
// //
// Validate ... // Validate ...
@@ -2255,48 +2215,35 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
{ {
// //
zone.Clean(); zone.Clean();
if (isBullish) zone = pullbackZone;
{
zone = affectedZonesBullish[insideBullishIDX];
}
else
{
zone = affectedZonesBearish[insideBearishIDX];
}
// //
result = zone.IsValid(); // Draws ...
//
// Zone Validations ...
if (result) if (result)
{ {
// //
if (boundaryTrend.IsValid()) XPOIDrawConfig iConfig = structureDrawConfig.drawConfig;
{ iConfig.trendRayLeft = false;
poiDrawer.DrawTrendLine(boundaryTrend, structureDrawConfig.drawConfig); iConfig.trendRayRight = false;
}
// //
poiDrawer.DrawZone(zone, structureDrawConfig.drawConfig); poiDrawer.DrawZone(legZone, iConfig);
poiDrawer.DrawZone(pullbackZone, iConfig);
//
// poiDrawer.DrawTrendLine(boundaryTrend, iConfig);
// poiDrawer.DrawZone(zone, structureDrawConfig.drawConfig);
poiDrawer.DrawPatternAnalysis(pBarPatterns, structureDrawConfig.barAnalysisDrawConfig); poiDrawer.DrawPatternAnalysis(pBarPatterns, structureDrawConfig.barAnalysisDrawConfig);
//
iConfig.Clean();
// //
DebugBreak(); DebugBreak();
} }
// //
result = zone.IsValid(); result = zone.IsValid();
//
// Reset Flags ...
if (!result)
{
//
zone.Clean();
isBullish = false;
isBearish = false;
}
} }
// //
@@ -2316,12 +2263,10 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
} }
pBar.Clean(); pBar.Clean();
p2Bar.Clean(); p2Bar.Clean();
XClean(zones); p3Bar.Clean();
pullbackZone.Clean();
pBarPatterns.Clean(); pBarPatterns.Clean();
boundaryTrend.Clean(); boundaryTrend.Clean();
XClean(affectedZones);
XClean(affectedZonesBullish);
XClean(affectedZonesBearish);
// //
return result; return result;