complete and fix momentums ...
This commit is contained in:
@@ -788,10 +788,10 @@ class XCPOIDetector : public XCBaseAlert
|
||||
|
||||
//
|
||||
// Momentum ...
|
||||
// DetectMomentum(
|
||||
// iBar,
|
||||
// iEvent //
|
||||
// );
|
||||
DetectMomentum(
|
||||
iBar,
|
||||
iEvent //
|
||||
);
|
||||
|
||||
//
|
||||
// Rejection ...
|
||||
@@ -952,10 +952,10 @@ class XCPOIDetector : public XCBaseAlert
|
||||
|
||||
//
|
||||
// Momentum ...
|
||||
// has = DetectMomentum(
|
||||
// iBar,
|
||||
// iEvent //
|
||||
// );
|
||||
has = DetectMomentum(
|
||||
iBar,
|
||||
iEvent //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
@@ -1181,7 +1181,7 @@ class XCPOIDetector : public XCBaseAlert
|
||||
|
||||
//
|
||||
Copy(
|
||||
mBullishMomentums,
|
||||
mBearishMomentums,
|
||||
state.bearishMomentums //
|
||||
);
|
||||
|
||||
@@ -1570,10 +1570,32 @@ class XCPOIDetector : public XCBaseAlert
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
XOHCL sBar;
|
||||
if (bar.Index() == 0)
|
||||
{
|
||||
//
|
||||
result = sBar.Init(
|
||||
bar.symbol,
|
||||
bar.period,
|
||||
bar.Index() + 1 //
|
||||
);
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
sBar.Clean();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sBar = bar;
|
||||
}
|
||||
|
||||
//
|
||||
ENUM_X_DIRECTION iDir;
|
||||
result = mBarAnalyser.IsMomentum(
|
||||
bar,
|
||||
sBar,
|
||||
iDir,
|
||||
mMomentumLoopback,
|
||||
mMomentumRangeExtendMultiplier //
|
||||
@@ -1584,6 +1606,8 @@ class XCPOIDetector : public XCBaseAlert
|
||||
HasDirection(iDir);
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
sBar.Clean();
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1602,10 +1626,12 @@ class XCPOIDetector : public XCBaseAlert
|
||||
XCMomentumBar *momentum;
|
||||
momentum = new XCMomentumBar();
|
||||
result = momentum.Init(
|
||||
bar //
|
||||
sBar //
|
||||
);
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
sBar.Clean();
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1617,6 +1643,8 @@ class XCPOIDetector : public XCBaseAlert
|
||||
result = !IsValidIndex(idx);
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
sBar.Clean();
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1653,6 +1681,9 @@ class XCPOIDetector : public XCBaseAlert
|
||||
? X_BULLISH_MOMENTUM_BAR_DETECTED
|
||||
: X_BEARISH_MOMENTUM_BAR_DETECTED;
|
||||
|
||||
//
|
||||
sBar.Clean();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user