This commit is contained in:
2025-09-17 23:40:07 +03:30
parent 177d115de6
commit 4c9fe89fad
8 changed files with 208 additions and 70 deletions
@@ -262,14 +262,16 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
XOHCL bar;
XSignal signal;
bool has = false;
int cIdx = barIndex + 1;
int pIdx = cIdx + 1;
ENUM_X_DIRECTION signalDir = X_DIRECTION_NONE;
//
// Initialize Bar ...
// Initialize Bar as CBar ...
has = bar.Init(
symbol,
period,
barIndex //
cIdx //
);
if (!has)
{
@@ -299,6 +301,58 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
//
// Analyse Conditions for Finding Signal ...
//
// TODO: Remove this ...
//
bool isFastCrossedOverSlow =
fimaConditions.maFastBuffer[cIdx] > fimaConditions.maSlowBuffer[cIdx] &&
fimaConditions.maFastBuffer[pIdx] < fimaConditions.maSlowBuffer[pIdx];
//
bool isFastCrossedUnderSlow =
fimaConditions.maFastBuffer[cIdx] < fimaConditions.maSlowBuffer[cIdx] &&
fimaConditions.maFastBuffer[pIdx] > fimaConditions.maSlowBuffer[pIdx];
//
has =
isFastCrossedOverSlow ||
isFastCrossedUnderSlow;
if (has)
{
//
// Do Conditions Validating ...
//
// Bullish Validation ...
bool isBullish =
//
isFastCrossedOverSlow
//
;
//
// Bearish Validation ...
bool isBearish =
//
isFastCrossedUnderSlow
//
;
//
has =
(isBullish && !isBearish) ||
(isBearish && !isBullish);
if (has)
{
//
signalDir =
isBullish
? X_DIRECTION_BULLISH
: X_DIRECTION_BEARISH;
}
}
//
// Check Signal Founded ...
has = HasDirection(signalDir);