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
+117 -5
View File
@@ -174,6 +174,18 @@ struct XCAEAConditions
datetime to;
datetime from;
//
// Bars ...
XOHCL bars[];
double bodies[];
double ranges[];
double velocities[];
double scoreBullish;
double scoreBearish;
double volumeBullish;
double volumeBearish;
double priceChangeRate;
//
// X3MA ...
@@ -810,6 +822,22 @@ struct XCAEAConditions
from = 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 ...
@@ -2705,13 +2733,18 @@ struct XCAEAConditions
;
//
if (onlyCommons && !onlyConditions) {
result += commonStr = separator;
} else if (onlyConditions && !onlyCommons) {
if (onlyCommons && !onlyConditions)
{
result += commonStr = separator;
}
else if (onlyConditions && !onlyCommons)
{
result += conditionsStr + separator;
} else {
}
else
{
//
result +=
result +=
//
commonStr + separator +
conditionsStr + separator
@@ -3299,6 +3332,25 @@ class XCXCAEAHelper : XCBase
conditions.period = mPeriod;
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 cIndex = zIndex + 1;
@@ -3990,6 +4042,65 @@ class XCXCAEAHelper : XCBase
conditions.isStochasticCrossedOverSignal = xocsConditions.isStochasticCrossedOverSignal;
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 ...
@@ -4002,6 +4113,7 @@ class XCXCAEAHelper : XCBase
//
xcaConditions.Clean();
xocsConditions.Clean();
x3maConditions.Clean();
//
Free();