Last ...
This commit is contained in:
@@ -120,6 +120,9 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
|||||||
double pip = GetPipPrice(_symbol);
|
double pip = GetPipPrice(_symbol);
|
||||||
double pip2 = 2 * pip;
|
double pip2 = 2 * pip;
|
||||||
|
|
||||||
|
//
|
||||||
|
datetime cTime = TimeCurrent();
|
||||||
|
|
||||||
//
|
//
|
||||||
int zIndex = 0;
|
int zIndex = 0;
|
||||||
int cIndex = zIndex + 1;
|
int cIndex = zIndex + 1;
|
||||||
@@ -184,9 +187,6 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
RedrawOrderFlow();
|
|
||||||
|
|
||||||
//
|
//
|
||||||
XPVPivot lastPivot;
|
XPVPivot lastPivot;
|
||||||
result = GetLastItem(
|
result = GetLastItem(
|
||||||
@@ -197,6 +197,113 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
|||||||
{
|
{
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
bool isBullishOrderFlow = IsBullish(mOrderFlowDir);
|
||||||
|
bool isBearishOrderFlow = IsBearish(mOrderFlowDir);
|
||||||
|
double pivotMid = lastPivot.CalculateMid();
|
||||||
|
// RedrawOrderFlow();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Calculate Liquidity Percent ...
|
||||||
|
double bullishLiquidityPercent = lastPivot
|
||||||
|
.CalculateLiquidityPercent(X_DIRECTION_BULLISH);
|
||||||
|
double bearishLiquidityPercent = lastPivot
|
||||||
|
.CalculateLiquidityPercent(X_DIRECTION_BEARISH);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Detect Order Blocks ...
|
||||||
|
int obsCount = 0;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Find Bullish Order Block ...
|
||||||
|
XCOrderBlock *bullishOB = NULL;
|
||||||
|
obsCount = lastPivot.state.CountBullishOrderBlocks();
|
||||||
|
if (IsValidSize(obsCount))
|
||||||
|
{
|
||||||
|
//
|
||||||
|
for (int i = 0; i < obsCount; i++)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XCOrderBlock *iOB = lastPivot.state.bullishOrderBlocks[i];
|
||||||
|
|
||||||
|
//
|
||||||
|
XOHCL iBar;
|
||||||
|
bool hasBar = iOB.FillBar(iBar);
|
||||||
|
bool isPeriodSame = hasBar &&
|
||||||
|
iBar.period == _period;
|
||||||
|
|
||||||
|
//
|
||||||
|
if (iOB.Upper() <= pivotMid &&
|
||||||
|
iOB.Lower() >= lastPivot.lower)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
bullishOB = iOB;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
bool hasBullishOB = bullishOB != NULL;
|
||||||
|
if (hasBullishOB)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
bullishOB.To(cTime);
|
||||||
|
XCBullishOrderBlockObject *iObj;
|
||||||
|
bool isCreated = mPOIDrawer.CreateBullishOrderBlock(
|
||||||
|
bullishOB,
|
||||||
|
iObj //
|
||||||
|
);
|
||||||
|
if (isCreated)
|
||||||
|
{
|
||||||
|
AddObjectIfNotExists(iObj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Find Bearish Order Block ...
|
||||||
|
XCOrderBlock *bearishOB = NULL;
|
||||||
|
obsCount = lastPivot.state.CountBearishOrderBlocks();
|
||||||
|
if (IsValidSize(obsCount))
|
||||||
|
{
|
||||||
|
//
|
||||||
|
for (int i = 0; i < obsCount; i++)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XCOrderBlock *iOB = lastPivot.state.bearishOrderBlocks[i];
|
||||||
|
|
||||||
|
//
|
||||||
|
XOHCL iBar;
|
||||||
|
bool hasBar = iOB.FillBar(iBar);
|
||||||
|
bool isPeriodSame = hasBar &&
|
||||||
|
iBar.period == _period;
|
||||||
|
|
||||||
|
//
|
||||||
|
if (iOB.Lower() >= pivotMid &&
|
||||||
|
iOB.Upper() <= lastPivot.upper)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
bearishOB = iOB;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
bool hasBearishOB = bearishOB != NULL;
|
||||||
|
if (hasBearishOB)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
bearishOB.To(cTime);
|
||||||
|
XCBearishOrderBlockObject *iObj;
|
||||||
|
bool isCreated = mPOIDrawer.CreateBearishOrderBlock(
|
||||||
|
bearishOB,
|
||||||
|
iObj //
|
||||||
|
);
|
||||||
|
if (isCreated)
|
||||||
|
{
|
||||||
|
AddObjectIfNotExists(iObj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Find an Order Block ...
|
||||||
|
bool isBearishOrderBlockRejected = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Check Candlestick PullBacks ...
|
// Check Candlestick PullBacks ...
|
||||||
@@ -411,16 +518,6 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
|||||||
//
|
//
|
||||||
// Prepare Areas ...
|
// Prepare Areas ...
|
||||||
double bid = GetBid(_symbol);
|
double bid = GetBid(_symbol);
|
||||||
bool isBullish = IsBullish(mOrderFlowDir);
|
|
||||||
bool isBearish = IsBearish(mOrderFlowDir);
|
|
||||||
double pivotMid = lastPivot.CalculateMid();
|
|
||||||
|
|
||||||
//
|
|
||||||
// Calculate Liquidity Percent ...
|
|
||||||
double bullishLiquidityPercent = lastPivot
|
|
||||||
.CalculateLiquidityPercent(X_DIRECTION_BULLISH);
|
|
||||||
double bearishLiquidityPercent = lastPivot
|
|
||||||
.CalculateLiquidityPercent(X_DIRECTION_BEARISH);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
bool isInDiscount =
|
bool isInDiscount =
|
||||||
@@ -439,21 +536,21 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
|||||||
// For Bullish Order Flow ...
|
// For Bullish Order Flow ...
|
||||||
// if Price Breakes Lower to Down, means Change of Charcter Happens ...
|
// if Price Breakes Lower to Down, means Change of Charcter Happens ...
|
||||||
bool isCHOCHHappens =
|
bool isCHOCHHappens =
|
||||||
isBullish ? bid < lastPivot.lower - pip
|
isBullishOrderFlow ? bid < lastPivot.lower - pip
|
||||||
: bid > lastPivot.upper + pip;
|
: bid > lastPivot.upper + pip;
|
||||||
|
|
||||||
//
|
//
|
||||||
// For Bullish Order Flow ...
|
// For Bullish Order Flow ...
|
||||||
// if Price Breakes Upper to Up, means Breake of Structure Happens ...
|
// if Price Breakes Upper to Up, means Breake of Structure Happens ...
|
||||||
bool isBOSHappens =
|
bool isBOSHappens =
|
||||||
isBullish ? bid > lastPivot.upper + pip
|
isBullishOrderFlow ? bid > lastPivot.upper + pip
|
||||||
: bid < lastPivot.lower - pip;
|
: bid < lastPivot.lower - pip;
|
||||||
|
|
||||||
//
|
//
|
||||||
if (isBOSHappens)
|
if (isBOSHappens)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
RedrawOrderFlow();
|
// RedrawOrderFlow();
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -465,27 +562,27 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
// //
|
||||||
hasLong =
|
// hasLong =
|
||||||
//
|
// //
|
||||||
is3Bullish &&
|
// is3Bullish &&
|
||||||
// isInDiscount &&
|
// // isInDiscount &&
|
||||||
isSarBullish &&
|
// isSarBullish // &&
|
||||||
// hasBullishPullback &&
|
// // hasBullishPullback &&
|
||||||
bullishLiquidityPercent > 30
|
// // bullishLiquidityPercent > 30
|
||||||
//
|
// //
|
||||||
;
|
// ;
|
||||||
|
|
||||||
//
|
// //
|
||||||
hasShort =
|
// hasShort =
|
||||||
//
|
// //
|
||||||
is3Bearish &&
|
// is3Bearish &&
|
||||||
// isInPremium &&
|
// // isInPremium &&
|
||||||
isSarBearish &&
|
// isSarBearish // &&
|
||||||
// hasBearishPullback &&
|
// // hasBearishPullback &&
|
||||||
bearishLiquidityPercent > 30
|
// // bearishLiquidityPercent > 30
|
||||||
//
|
// //
|
||||||
;
|
// ;
|
||||||
|
|
||||||
//
|
//
|
||||||
result = hasLong ||
|
result = hasLong ||
|
||||||
@@ -589,7 +686,7 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
|||||||
|
|
||||||
//
|
//
|
||||||
int cIndex = 1;
|
int cIndex = 1;
|
||||||
|
|
||||||
//
|
//
|
||||||
if (entry <= 0 ||
|
if (entry <= 0 ||
|
||||||
!conditions.IsValid() ||
|
!conditions.IsValid() ||
|
||||||
@@ -776,11 +873,11 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Check Order Flow Direction ...
|
// Check Order Flow Direction ...
|
||||||
result = mOrderFlowDir != X_DIRECTION_NONE;
|
// result = mOrderFlowDir != X_DIRECTION_NONE;
|
||||||
if (!result)
|
// if (!result)
|
||||||
{
|
// {
|
||||||
return result;
|
// return result;
|
||||||
}
|
// }
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
@@ -1952,8 +2049,8 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
|
|||||||
false, // Draw ResistanceZones ..
|
false, // Draw ResistanceZones ..
|
||||||
false, // Draw SupplyZones ..
|
false, // Draw SupplyZones ..
|
||||||
false, // Draw DemandZones ..
|
false, // Draw DemandZones ..
|
||||||
false, // Draw BullishOrderBlocks ..
|
true, // Draw BullishOrderBlocks ..
|
||||||
false, // Draw BearishOrderBlocks ..
|
true, // Draw BearishOrderBlocks ..
|
||||||
false, // Draw BullishFairValueGaps ..
|
false, // Draw BullishFairValueGaps ..
|
||||||
false, // Draw BearishFairValueGaps ..
|
false, // Draw BearishFairValueGaps ..
|
||||||
false, // Draw BullishRejectionBars ..
|
false, // Draw BullishRejectionBars ..
|
||||||
|
|||||||
Reference in New Issue
Block a user