last ...
This commit is contained in:
@@ -263,7 +263,8 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
||||
|
||||
//
|
||||
// Has Order Flow ...
|
||||
|
||||
mConditions.UpdateTo(cTime);
|
||||
|
||||
//
|
||||
// TODO: Remove this ...
|
||||
DrawConditions(
|
||||
@@ -272,7 +273,32 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
||||
);
|
||||
|
||||
//
|
||||
// Checking Order Flow Break ...
|
||||
bool isOrderFlowBreaked = mConditions
|
||||
.IsOrderFlowBreaked(
|
||||
zIndex,
|
||||
period //
|
||||
);
|
||||
|
||||
//
|
||||
// Order Flow Breaked Senario ...
|
||||
if (isOrderFlowBreaked)
|
||||
{
|
||||
//
|
||||
// TODO: Implement Order Flow Breaker Bar Senario ...
|
||||
|
||||
//
|
||||
mConditions.Clean();
|
||||
}
|
||||
result = !isOrderFlowBreaked;
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
// TODO: Implement Clean ...
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
return false;
|
||||
|
||||
@@ -436,9 +436,9 @@ struct X121SMCStrategyXWZSignalConditions
|
||||
bool hasBearOBFVGs = IsValidSize(bearOBFVGsCount);
|
||||
|
||||
//
|
||||
bool hasOrderBlow = hasBearOBFVGs ||
|
||||
bool hasOrderFlow = hasBearOBFVGs ||
|
||||
hasBullOBFVGs;
|
||||
if (hasOrderBlow)
|
||||
if (hasOrderFlow)
|
||||
{
|
||||
//
|
||||
// Vlidate ...
|
||||
@@ -446,13 +446,13 @@ struct X121SMCStrategyXWZSignalConditions
|
||||
//
|
||||
(hasBullOBFVGs &&
|
||||
!hasBearOBFVGs &&
|
||||
bullOBFVGsCount > 1)
|
||||
bullOBFVGsCount >= 1)
|
||||
//
|
||||
||
|
||||
//
|
||||
(hasBearOBFVGs &&
|
||||
!hasBullOBFVGs &&
|
||||
bearOBFVGsCount > 1)
|
||||
bearOBFVGsCount >= 1)
|
||||
//
|
||||
;
|
||||
|
||||
@@ -496,6 +496,88 @@ struct X121SMCStrategyXWZSignalConditions
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
bool IsOrderFlowBreaked(
|
||||
int barIndex = 0,
|
||||
ENUM_TIMEFRAMES forPeriod = NULL //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
if (barIndex < 0)
|
||||
{
|
||||
barIndex = 0;
|
||||
}
|
||||
|
||||
//
|
||||
if (!IsValid(forPeriod))
|
||||
{
|
||||
forPeriod = period;
|
||||
}
|
||||
|
||||
//
|
||||
ENUM_X_DIRECTION orderFlowDir;
|
||||
result = HasOrderFlow(orderFlowDir);
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
XOHCL bar;
|
||||
result = bar.Init(
|
||||
symbol,
|
||||
forPeriod,
|
||||
barIndex //
|
||||
);
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
bar.Clean();
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
bool isBullish = IsBullish(orderFlowDir);
|
||||
|
||||
//
|
||||
int idx =
|
||||
isBullish
|
||||
? GetHighest(orderFlow)
|
||||
: GetLowest(orderFlow);
|
||||
result = IsValidIndex(idx);
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
bar.Clean();
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
XOHCL breakerBar;
|
||||
bool isBodyOut = false;
|
||||
result = orderFlow[idx].ob.IsBreaked(
|
||||
orderFlowDir,
|
||||
breakerBar,
|
||||
isBodyOut,
|
||||
false, // Ignore Start ...
|
||||
true, // Started Bar Body Out ...
|
||||
forPeriod //
|
||||
);
|
||||
|
||||
//
|
||||
result = breakerBar.Index() == bar.Index() + 1;
|
||||
|
||||
//
|
||||
bar.Clean();
|
||||
breakerBar.Clean();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user