last ...
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user