This commit is contained in:
2025-05-01 14:22:20 +03:30
parent 22605f46b6
commit 4eb3881672
5 changed files with 169 additions and 23 deletions
+7 -1
View File
@@ -315,6 +315,7 @@ class XCBarAnalyser : public XCBase
* @param ranges: double Collection, Calculated Ranges ... * @param ranges: double Collection, Calculated Ranges ...
* @param bar: XOHCL instance Reference, Start Bar ... * @param bar: XOHCL instance Reference, Start Bar ...
* @param forceBody: bool, Force to Calculate Range using Body ... * @param forceBody: bool, Force to Calculate Range using Body ...
* @param forceDiff: bool, Force to Calculate Range using Onl Price Diff ...
* @param loopback: int, loopback period for Range Calculations ... * @param loopback: int, loopback period for Range Calculations ...
* *
* @return ( int ) * @return ( int )
@@ -323,6 +324,7 @@ class XCBarAnalyser : public XCBase
double &ranges[], double &ranges[],
XOHCL &bar, XOHCL &bar,
bool forceBody = false, bool forceBody = false,
bool forceDiff = false,
int loopback = 14 // int loopback = 14 //
) )
{ {
@@ -422,7 +424,11 @@ class XCBarAnalyser : public XCBase
for (int i = 0; i < uppersCount; i++) for (int i = 0; i < uppersCount; i++)
{ {
// //
double iValue = lowers[i] + (uppers[i] - lowers[i]); double iDiff = uppers[i] - lowers[i];
double iValue =
forceDiff
? iDiff
: lowers[i] + iDiff;
// //
Add( Add(
+16 -2
View File
@@ -1310,7 +1310,7 @@ class XCXCAEAPOIDetector : public XCBase
has = helper.GetConditions( has = helper.GetConditions(
conditions, conditions,
start, start,
5 // 10 //
); );
if (!has) if (!has)
{ {
@@ -1511,6 +1511,19 @@ class XCXCAEAPOIDetector : public XCBase
pCCI < p2CCI && pCCI < p2CCI &&
pCCI < zCCI; pCCI < zCCI;
//
// ATR ...
double zATR = conditions.atrBuffer[zIDX];
double cATR = conditions.atrBuffer[cIDX];
double pATR = conditions.atrBuffer[pIDX];
double p2ATR = conditions.atrBuffer[p2IDX];
//
double atrSum = GetSum(conditions.atrBuffer);
double atrMax = GetMax(conditions.atrBuffer);
double atrMin = GetMin(conditions.atrBuffer);
double atrAvg = GetAverage(conditions.atrBuffer);
// //
// Extracting Required Data about Trending ... // Extracting Required Data about Trending ...
@@ -2919,7 +2932,8 @@ class XCXCAEAPOIDetector : public XCBase
// //
bool detectBullishSpikePivots = true; bool detectBullishSpikePivots = true;
if (detectBullishSpikePivots) { if (detectBullishSpikePivots)
{
// //
// For Spike Detection ... // For Spike Detection ...
// [] 80% of Bars Must be Same as Direction ... // [] 80% of Bars Must be Same as Direction ...
+115 -3
View File
@@ -174,6 +174,18 @@ struct XCAEAConditions
datetime to; datetime to;
datetime from; datetime from;
//
// Bars ...
XOHCL bars[];
double bodies[];
double ranges[];
double velocities[];
double scoreBullish;
double scoreBearish;
double volumeBullish;
double volumeBearish;
double priceChangeRate;
// //
// X3MA ... // X3MA ...
@@ -810,6 +822,22 @@ struct XCAEAConditions
from = NULL; from = NULL;
time = NULL; time = NULL;
//
// Bars ...
Clean(bars);
Clean(bodies);
Clean(ranges);
scoreBullish = 0;
scoreBearish = 0;
volumeBullish = 0;
volumeBearish = 0;
Clean(velocities);
priceChangeRate = 0;
ArraySetAsSeries(bars, true);
ArraySetAsSeries(bodies, true);
ArraySetAsSeries(ranges, true);
ArraySetAsSeries(velocities, true);
// //
// X3MA ... // X3MA ...
@@ -2705,11 +2733,16 @@ struct XCAEAConditions
; ;
// //
if (onlyCommons && !onlyConditions) { if (onlyCommons && !onlyConditions)
{
result += commonStr = separator; result += commonStr = separator;
} else if (onlyConditions && !onlyCommons) { }
else if (onlyConditions && !onlyCommons)
{
result += conditionsStr + separator; result += conditionsStr + separator;
} else { }
else
{
// //
result += result +=
// //
@@ -3299,6 +3332,25 @@ class XCXCAEAHelper : XCBase
conditions.period = mPeriod; conditions.period = mPeriod;
conditions.time = TimeCurrent(); conditions.time = TimeCurrent();
//
// Filling Bars ...
int barsCount = GetBars(
conditions.bars,
mSymbol,
mPeriod,
barIndex,
loopback //
);
result = barsCount == loopback;
if (!result)
{
//
conditions.Clean();
//
return result;
}
// //
int zIndex = barIndex; int zIndex = barIndex;
int cIndex = zIndex + 1; int cIndex = zIndex + 1;
@@ -3990,6 +4042,65 @@ class XCXCAEAHelper : XCBase
conditions.isStochasticCrossedOverSignal = xocsConditions.isStochasticCrossedOverSignal; conditions.isStochasticCrossedOverSignal = xocsConditions.isStochasticCrossedOverSignal;
conditions.isStochasticCrossedUnderSignal = xocsConditions.isStochasticCrossedUnderSignal; conditions.isStochasticCrossedUnderSignal = xocsConditions.isStochasticCrossedUnderSignal;
//
int bodiesCount = barAnalyser.GetPriceRange(
conditions.bodies,
zBar,
true, // Force Body ...
true, // Force Price Diff ...
loopback //
);
int rangesCount = barAnalyser.GetPriceRange(
conditions.ranges,
zBar,
true, // Force Body ...
true, // Force Price Diff ...
loopback //
);
//
int velocitiesCount =
barAnalyser
.GetPriceVelocity(
conditions.velocities,
zBar,
X_PRICE_CLOSE,
loopback //
);
//
double bullishVolume = 0.0;
double bearishVolume = 0.0;
barAnalyser
.CalculateRangeVolume(
zBar,
bullishVolume,
bearishVolume,
loopback //
);
conditions.scoreBullish = bullishVolume;
conditions.scoreBearish = bearishVolume;
//
double bullishScore = 0.0;
double bearishScore = 0.0;
conditions.GenerateScore(
bullishScore,
bearishScore //
);
conditions.volumeBullish = bullishScore;
conditions.volumeBearish = bearishScore;
//
double priceChangeRate =
barAnalyser
.GetPriceChangeRate(
zBar,
X_PRICE_CLOSE,
loopback //
);
conditions.priceChangeRate = priceChangeRate;
// //
// Cleanup Resource ... // Cleanup Resource ...
@@ -4002,6 +4113,7 @@ class XCXCAEAHelper : XCBase
// //
xcaConditions.Clean(); xcaConditions.Clean();
xocsConditions.Clean(); xocsConditions.Clean();
x3maConditions.Clean();
// //
Free(); Free();
+15 -1
View File
@@ -660,6 +660,9 @@ bool DetectXCAEAConditions(
bool isScoreBearish = bool isScoreBearish =
bearishScore > bullishScore; bearishScore > bullishScore;
//
bool isScoreNeutural = MathAbs(bullishScore - bearishScore) == 0;
// //
// Generating Conditions Summary ... // Generating Conditions Summary ...
string summary = string summary =
@@ -672,7 +675,7 @@ bool DetectXCAEAConditions(
// //
double bullishVolume = 0; double bullishVolume = 0;
double bearishVolume = 0; double bearishVolume = 0;
int volumeRangeLoopback = 5; int volumeRangeLoopback = loopback;
helper.barAnalyser.CalculateRangeVolume( helper.barAnalyser.CalculateRangeVolume(
cBar, cBar,
bullishVolume, bullishVolume,
@@ -680,6 +683,9 @@ bool DetectXCAEAConditions(
volumeRangeLoopback // volumeRangeLoopback //
); );
//
bool isVolumeNeutural = MathAbs(bullishVolume - bearishVolume) == 0;
// //
double rangeVolume = bullishVolume = bearishVolume; double rangeVolume = bullishVolume = bearishVolume;
double rangeVolumeAvg = rangeVolume / volumeRangeLoopback; double rangeVolumeAvg = rangeVolume / volumeRangeLoopback;
@@ -1009,6 +1015,14 @@ bool DetectXCAEAConditions(
Print(ToString(cBar.GetDirection()), " ATR Growing ..."); Print(ToString(cBar.GetDirection()), " ATR Growing ...");
} }
//
if (isScoreNeutural ||
isVolumeNeutural)
{
//
Print("Zero Volume ...");
}
// //
bool isLowOverMax = cBar.low > maxCTrendValue; bool isLowOverMax = cBar.low > maxCTrendValue;
bool isHighUnderMin = cBar.high < minCTrendValue; bool isHighUnderMin = cBar.high < minCTrendValue;
+14 -14
View File
@@ -888,20 +888,20 @@ class XCXCAEASignaller : XCBase
// Configure Detector ... // Configure Detector ...
detector.detectTickPivots = false; detector.detectTickPivots = false;
detector.detectVolumePivots = false; detector.detectVolumePivots = false;
detector.detectRSIPeakPivots = true; detector.detectRSIPeakPivots = false;
detector.detectRSIValePivots = true; detector.detectRSIValePivots = false;
detector.detectCCIPeakPivots = false; detector.detectCCIPeakPivots = false;
detector.detectCCIValePivots = false; detector.detectCCIValePivots = false;
detector.detectFVGBullishPivots = true; detector.detectFVGBullishPivots = false;
detector.detectFVGBearishPivots = true; detector.detectFVGBearishPivots = false;
detector.detectValeSupSWLPivots = true; detector.detectValeSupSWLPivots = true;
detector.detectPeakResSWHPivots = true; detector.detectPeakResSWHPivots = true;
detector.detectTrendBullishPivots = true; detector.detectTrendBullishPivots = true;
detector.detectTrendBearishPivots = true; detector.detectTrendBearishPivots = true;
detector.detectCCICrossedOverOSPivots = false; detector.detectCCICrossedOverOSPivots = false;
detector.detectCCICrossedUnderOBPivots = false; detector.detectCCICrossedUnderOBPivots = false;
detector.detectRSICrossedOverOSPivots = true; detector.detectRSICrossedOverOSPivots = false;
detector.detectRSICrossedUnderOBPivots = true; detector.detectRSICrossedUnderOBPivots = false;
// //
// Initialize and Configure Drawer ... // Initialize and Configure Drawer ...
@@ -916,20 +916,20 @@ class XCXCAEASignaller : XCBase
drawer.drawTrendLine = false; drawer.drawTrendLine = false;
drawer.drawTickPivots = false; drawer.drawTickPivots = false;
drawer.drawVolumePivots = false; drawer.drawVolumePivots = false;
drawer.drawRSIPeakPivots = true; drawer.drawRSIPeakPivots = false;
drawer.drawRSIValePivots = true; drawer.drawRSIValePivots = false;
drawer.drawCCIPeakPivots = false; drawer.drawCCIPeakPivots = false;
drawer.drawCCIValePivots = false; drawer.drawCCIValePivots = false;
drawer.drawFVGBullishPivots = true; drawer.drawFVGBullishPivots = false;
drawer.drawFVGBearishPivots = true; drawer.drawFVGBearishPivots = false;
drawer.drawValeSupSWLPivots = true; drawer.drawValeSupSWLPivots = false;
drawer.drawPeakResSWHPivots = true; drawer.drawPeakResSWHPivots = false;
drawer.drawTrendBullishPivots = false; drawer.drawTrendBullishPivots = false;
drawer.drawTrendBearishPivots = false; drawer.drawTrendBearishPivots = false;
drawer.drawCCICrossedOverOSPivots = false; drawer.drawCCICrossedOverOSPivots = false;
drawer.drawCCICrossedUnderOBPivots = false; drawer.drawCCICrossedUnderOBPivots = false;
drawer.drawRSICrossedOverOSPivots = true; drawer.drawRSICrossedOverOSPivots = false;
drawer.drawRSICrossedUnderOBPivots = true; drawer.drawRSICrossedUnderOBPivots = false;
// //
// Configure Widths ... // Configure Widths ...