last ...
This commit is contained in:
@@ -198,6 +198,216 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Check Candlestick PullBacks ...
|
||||
ENUM_X_DIRECTION pullBackDir;
|
||||
bool hasPullBack = mBarAnalyser.HasPullBack(
|
||||
pullBackDir,
|
||||
cBar,
|
||||
3, // Loopback ...
|
||||
true // Force Body ...
|
||||
);
|
||||
bool hasBullishPullback =
|
||||
hasPullBack &&
|
||||
pullBackDir == X_DIRECTION_BULLISH;
|
||||
bool hasBearishPullback =
|
||||
hasPullBack &&
|
||||
pullBackDir == X_DIRECTION_BEARISH;
|
||||
|
||||
//
|
||||
// Check 3MA and 3VWAP State ...
|
||||
|
||||
//
|
||||
bool isVWAPBullishOrdered =
|
||||
//
|
||||
(
|
||||
//
|
||||
(conditions.x3vwapConditions.isBullishOrdered ||
|
||||
conditions.x3vwapConditions.isSwitchedToBullishOrdered)
|
||||
//
|
||||
||
|
||||
//
|
||||
conditions.x3vwapConditions.fasts[cIndex] > conditions.x3vwapConditions.mids[cIndex]
|
||||
//
|
||||
||
|
||||
//
|
||||
conditions.x3vwapConditions.mids[cIndex] > conditions.x3vwapConditions.slows[cIndex]
|
||||
//
|
||||
)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isVWAPBearishOrdered =
|
||||
//
|
||||
(
|
||||
//
|
||||
(conditions.x3vwapConditions.isBearishOrdered ||
|
||||
conditions.x3vwapConditions.isSwitchedToBearishOrdered)
|
||||
//
|
||||
||
|
||||
//
|
||||
conditions.x3vwapConditions.fasts[cIndex] < conditions.x3vwapConditions.mids[cIndex]
|
||||
//
|
||||
||
|
||||
//
|
||||
conditions.x3vwapConditions.mids[cIndex] < conditions.x3vwapConditions.slows[cIndex]
|
||||
//
|
||||
)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isVWapBullishState =
|
||||
//
|
||||
(
|
||||
//
|
||||
(conditions.x3vwapConditions.isBullishState ||
|
||||
conditions.x3vwapConditions.isSwitchedToBullishState)
|
||||
//
|
||||
||
|
||||
//
|
||||
(x3vwapHelper.IsBullish(conditions.x3vwapConditions.fastStates[cIndex]) &&
|
||||
x3vwapHelper.IsBullish(conditions.x3vwapConditions.midStates[cIndex]))
|
||||
//
|
||||
||
|
||||
//
|
||||
(x3vwapHelper.IsBullish(conditions.x3vwapConditions.midStates[cIndex]) &&
|
||||
x3vwapHelper.IsBullish(conditions.x3vwapConditions.slowStates[cIndex]))
|
||||
//
|
||||
)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isVWapBearishState =
|
||||
//
|
||||
(
|
||||
//
|
||||
(conditions.x3vwapConditions.isBearishState ||
|
||||
conditions.x3vwapConditions.isSwitchedToBearishState)
|
||||
//
|
||||
||
|
||||
//
|
||||
(x3vwapHelper.IsBearish(conditions.x3vwapConditions.fastStates[cIndex]) &&
|
||||
x3vwapHelper.IsBearish(conditions.x3vwapConditions.midStates[cIndex]))
|
||||
//
|
||||
||
|
||||
//
|
||||
(x3vwapHelper.IsBearish(conditions.x3vwapConditions.midStates[cIndex]) &&
|
||||
x3vwapHelper.IsBearish(conditions.x3vwapConditions.slowStates[cIndex]))
|
||||
//
|
||||
)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isVWapOverFastMA =
|
||||
//
|
||||
(
|
||||
//
|
||||
(conditions.x3vwapConditions.fasts[cIndex] > conditions.x3maConditions.fasts[cIndex] &&
|
||||
conditions.x3vwapConditions.mids[cIndex] > conditions.x3maConditions.fasts[cIndex])
|
||||
//
|
||||
||
|
||||
//
|
||||
(conditions.x3vwapConditions.fasts[cIndex] > conditions.x3maConditions.fasts[cIndex] &&
|
||||
conditions.x3vwapConditions.mids[cIndex] > conditions.x3maConditions.fasts[cIndex] &&
|
||||
conditions.x3vwapConditions.slows[cIndex] > conditions.x3maConditions.fasts[cIndex])
|
||||
//
|
||||
)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isVWapUnderFastMA =
|
||||
//
|
||||
(
|
||||
//
|
||||
(conditions.x3vwapConditions.fasts[cIndex] < conditions.x3maConditions.fasts[cIndex] &&
|
||||
conditions.x3vwapConditions.mids[cIndex] < conditions.x3maConditions.fasts[cIndex])
|
||||
//
|
||||
||
|
||||
//
|
||||
(conditions.x3vwapConditions.fasts[cIndex] < conditions.x3maConditions.fasts[cIndex] &&
|
||||
conditions.x3vwapConditions.mids[cIndex] < conditions.x3maConditions.fasts[cIndex] &&
|
||||
conditions.x3vwapConditions.slows[cIndex] < conditions.x3maConditions.fasts[cIndex])
|
||||
//
|
||||
)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool is3Bullish =
|
||||
//
|
||||
(
|
||||
//
|
||||
(isVWAPBullishOrdered &&
|
||||
isVWapBullishState)
|
||||
//
|
||||
||
|
||||
//
|
||||
(isVWAPBullishOrdered &&
|
||||
isVWapOverFastMA)
|
||||
//
|
||||
||
|
||||
//
|
||||
(isVWapBullishState &&
|
||||
isVWapOverFastMA)
|
||||
//
|
||||
)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool is3Bearish =
|
||||
//
|
||||
(
|
||||
//
|
||||
(isVWAPBearishOrdered &&
|
||||
isVWapBearishState)
|
||||
//
|
||||
||
|
||||
//
|
||||
(isVWAPBearishOrdered &&
|
||||
isVWapUnderFastMA)
|
||||
//
|
||||
||
|
||||
//
|
||||
(isVWapBearishState &&
|
||||
isVWapUnderFastMA)
|
||||
//
|
||||
)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
// Check Parabolic Sars State ...
|
||||
|
||||
//
|
||||
bool isSarBullish =
|
||||
//
|
||||
(conditions.xchsarConditions.isCBullish &&
|
||||
conditions.xchsarConditions.isSSwitchedBullish)
|
||||
//
|
||||
||
|
||||
//
|
||||
(conditions.xchsarConditions.isSBullish &&
|
||||
conditions.xchsarConditions.isCSwitchedBullish)
|
||||
//
|
||||
;
|
||||
bool isSarBearish =
|
||||
//
|
||||
(conditions.xchsarConditions.isCBearish &&
|
||||
conditions.xchsarConditions.isSSwitchedBearish)
|
||||
//
|
||||
||
|
||||
//
|
||||
(conditions.xchsarConditions.isSBearish &&
|
||||
conditions.xchsarConditions.isCSwitchedBearish)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
// Prepare Areas ...
|
||||
double bid = GetBid(_symbol);
|
||||
@@ -218,7 +428,7 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
||||
bid > lastPivot.lower;
|
||||
|
||||
//
|
||||
bool IsInPremium =
|
||||
bool isInPremium =
|
||||
bid > pivotMid &&
|
||||
bid < lastPivot.upper;
|
||||
|
||||
@@ -240,15 +450,15 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
||||
: bid < lastPivot.lower - pip;
|
||||
|
||||
//
|
||||
if (isCHOCHHappens)
|
||||
if (isBOSHappens)
|
||||
{
|
||||
//
|
||||
// When Chouch Happens we Have to Destry Order Flow and
|
||||
// Clean another ...
|
||||
|
||||
//
|
||||
Print("CHOCH ...");
|
||||
RedrawOrderFlow();
|
||||
}
|
||||
|
||||
//
|
||||
if (isCHOCHHappens)
|
||||
{
|
||||
//
|
||||
result = false;
|
||||
ResetOrderFlow();
|
||||
@@ -256,20 +466,26 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
||||
}
|
||||
|
||||
//
|
||||
if (isBOSHappens)
|
||||
{
|
||||
hasLong =
|
||||
//
|
||||
// When Chouch Happens we Have to Destry Order Flow and
|
||||
// Clean another ...
|
||||
is3Bullish &&
|
||||
// isInDiscount &&
|
||||
isSarBullish &&
|
||||
// hasBullishPullback &&
|
||||
bullishLiquidityPercent > 30
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
hasShort =
|
||||
//
|
||||
Print("BOS ...");
|
||||
|
||||
is3Bearish &&
|
||||
// isInPremium &&
|
||||
isSarBearish &&
|
||||
// hasBearishPullback &&
|
||||
bearishLiquidityPercent > 30
|
||||
//
|
||||
result = false;
|
||||
ResetOrderFlow();
|
||||
return result;
|
||||
}
|
||||
;
|
||||
|
||||
//
|
||||
result = hasLong ||
|
||||
@@ -368,6 +584,46 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
||||
ENUM_X_POSITION_TYPES type //
|
||||
) override
|
||||
{
|
||||
//
|
||||
Clean(result);
|
||||
|
||||
//
|
||||
int cIndex = 1;
|
||||
|
||||
//
|
||||
if (entry <= 0 ||
|
||||
!conditions.IsValid() ||
|
||||
type == X_POSITION_TYPE_ALL ||
|
||||
type == X_POSITION_TYPE_NONE)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
Add(
|
||||
conditions.x3vwapConditions.fasts[cIndex],
|
||||
result //
|
||||
);
|
||||
|
||||
//
|
||||
Add(
|
||||
conditions.x3vwapConditions.mids[cIndex],
|
||||
result //
|
||||
);
|
||||
|
||||
//
|
||||
Add(
|
||||
conditions.x3vwapConditions.slows[cIndex],
|
||||
result //
|
||||
);
|
||||
|
||||
//
|
||||
Add(
|
||||
conditions.x3maConditions.fasts[cIndex],
|
||||
result //
|
||||
);
|
||||
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1784,7 +2040,7 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
||||
x3maInputs.Default();
|
||||
|
||||
//
|
||||
x3maInputs.showFast = false;
|
||||
x3maInputs.showFast = true;
|
||||
x3maInputs.showMid = false;
|
||||
x3maInputs.showSlow = false;
|
||||
|
||||
@@ -1833,7 +2089,7 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
||||
|
||||
//
|
||||
xchsarInputs.showCurrent = true;
|
||||
xchsarInputs.showShort = true;
|
||||
xchsarInputs.showShort = false;
|
||||
xchsarInputs.showMedium = false;
|
||||
xchsarInputs.showLong = false;
|
||||
xchsarInputs.showHind = false;
|
||||
|
||||
Reference in New Issue
Block a user