last works on x Signalling ...
This commit is contained in:
@@ -373,3 +373,225 @@ int DrawX121SMCStrategyConditions(
|
||||
// // !(decisionXConditions.isVWapBearishState ||
|
||||
// // decisionXConditions.isVWapBearishOrdered) &&
|
||||
// //
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
visionXConditions.isBreakedUpPrevCheMax &&
|
||||
visionXConditions.isCheSwitchedToBullish
|
||||
|
||||
visionXConditions.isCheSwitchedToBearish &&
|
||||
visionXConditions.isBreakedDownPrevCheMin
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
//
|
||||
bool hasOrderBlock = hasBullishOrderBlocks ||
|
||||
hasBearishOrderBlocks;
|
||||
if (hasOrderBlock)
|
||||
{
|
||||
//
|
||||
Print("Detect Order Block ...");
|
||||
|
||||
//
|
||||
XCBaseObject *drawnObjects[];
|
||||
|
||||
//
|
||||
if (hasBullishOrderBlocks)
|
||||
{
|
||||
//
|
||||
for (int i = 0; i < bullishOrderBlocksCount; i++)
|
||||
{
|
||||
//
|
||||
XCOrderBlock *iOb = bullishOBs[i];
|
||||
|
||||
//
|
||||
XCBullishOrderBlockObject *iObObj;
|
||||
bool isCreated = triggerCycleHelper
|
||||
.mPOIDetector
|
||||
.mDrawer
|
||||
.CreateBullishOrderBlock(
|
||||
iOb,
|
||||
iObObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
(XCBaseObject *)iObObj,
|
||||
drawnObjects //
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
if (hasBearishOrderBlocks)
|
||||
{
|
||||
//
|
||||
for (int i = 0; i < bearishOrderBlocksCount; i++)
|
||||
{
|
||||
//
|
||||
XCOrderBlock *iOb = bearishOBs[i];
|
||||
|
||||
//
|
||||
XCBearishOrderBlockObject *iObObj;
|
||||
bool isCreated = triggerCycleHelper
|
||||
.mPOIDetector
|
||||
.mDrawer
|
||||
.CreateBearishOrderBlock(
|
||||
iOb,
|
||||
iObObj //
|
||||
);
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
(XCBaseObject *)iObObj,
|
||||
drawnObjects //
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
int drawnCount = ArraySize(drawnObjects);
|
||||
if (IsValidSize(drawnCount))
|
||||
{
|
||||
Print("");
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
//
|
||||
// Summarize Conditions ...
|
||||
|
||||
//
|
||||
bool isCondition1Bullish =
|
||||
//
|
||||
// Vision ...
|
||||
(
|
||||
//
|
||||
false
|
||||
//
|
||||
)
|
||||
//
|
||||
&&
|
||||
//
|
||||
// Consolidation ...
|
||||
(
|
||||
//
|
||||
true
|
||||
//
|
||||
)
|
||||
//
|
||||
&&
|
||||
//
|
||||
// Verification ...
|
||||
(
|
||||
//
|
||||
true
|
||||
//
|
||||
)
|
||||
//
|
||||
&&
|
||||
//
|
||||
// Analyse ...
|
||||
(
|
||||
//
|
||||
true
|
||||
//
|
||||
)
|
||||
//
|
||||
&&
|
||||
//
|
||||
// Decision ...
|
||||
(
|
||||
//
|
||||
true
|
||||
//
|
||||
)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isCondition1Bearish =
|
||||
//
|
||||
// Vision ...
|
||||
(
|
||||
//
|
||||
false
|
||||
//
|
||||
)
|
||||
//
|
||||
&&
|
||||
//
|
||||
// Consolidation ...
|
||||
(
|
||||
//
|
||||
true
|
||||
//
|
||||
)
|
||||
//
|
||||
&&
|
||||
//
|
||||
// Verification ...
|
||||
(
|
||||
//
|
||||
true
|
||||
//
|
||||
)
|
||||
//
|
||||
&&
|
||||
//
|
||||
// Analyse ...
|
||||
(
|
||||
//
|
||||
true
|
||||
//
|
||||
)
|
||||
//
|
||||
&&
|
||||
//
|
||||
// Decision ...
|
||||
(
|
||||
//
|
||||
true
|
||||
//
|
||||
)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool hasCondition1 = isCondition1Bullish ||
|
||||
isCondition1Bearish;
|
||||
if (hasCondition1)
|
||||
{
|
||||
//
|
||||
ENUM_X_DIRECTION pzDir =
|
||||
isCondition1Bullish
|
||||
? X_DIRECTION_BULLISH
|
||||
: X_DIRECTION_BEARISH;
|
||||
|
||||
//
|
||||
double point = GetEntry(
|
||||
conditions.symbol,
|
||||
pzDir //
|
||||
);
|
||||
|
||||
//
|
||||
// Manipulate Conditions Point ...
|
||||
|
||||
//
|
||||
conditions.point = point;
|
||||
|
||||
//
|
||||
// Manipulate Conditions Pivot ...
|
||||
|
||||
//
|
||||
// conditions.pivot =
|
||||
// isCondition1Bullish
|
||||
// ? conditions.pivotZone.upper
|
||||
// : conditions.pivotZone.lower;
|
||||
}
|
||||
|
||||
@@ -6195,12 +6195,6 @@ struct XStateZones
|
||||
//
|
||||
int result = 0;
|
||||
|
||||
//
|
||||
if (!IsValid())
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
result = ArraySize(supportZones);
|
||||
|
||||
@@ -6214,12 +6208,6 @@ struct XStateZones
|
||||
//
|
||||
int result = 0;
|
||||
|
||||
//
|
||||
if (!IsValid())
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
result = ArraySize(resistanceZones);
|
||||
|
||||
@@ -6233,12 +6221,6 @@ struct XStateZones
|
||||
//
|
||||
int result = 0;
|
||||
|
||||
//
|
||||
if (!IsValid())
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
result = ArraySize(supplyZones);
|
||||
|
||||
@@ -6252,12 +6234,6 @@ struct XStateZones
|
||||
//
|
||||
int result = 0;
|
||||
|
||||
//
|
||||
if (!IsValid())
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
result = ArraySize(demandZones);
|
||||
|
||||
@@ -6271,12 +6247,6 @@ struct XStateZones
|
||||
//
|
||||
int result = 0;
|
||||
|
||||
//
|
||||
if (!IsValid())
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
result = ArraySize(bullishOrderBlocks);
|
||||
|
||||
@@ -6290,12 +6260,6 @@ struct XStateZones
|
||||
//
|
||||
int result = 0;
|
||||
|
||||
//
|
||||
if (!IsValid())
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
result = ArraySize(bearishOrderBlocks);
|
||||
|
||||
@@ -6309,12 +6273,6 @@ struct XStateZones
|
||||
//
|
||||
int result = 0;
|
||||
|
||||
//
|
||||
if (!IsValid())
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
result = ArraySize(bullishFairValueGaps);
|
||||
|
||||
@@ -6328,12 +6286,6 @@ struct XStateZones
|
||||
//
|
||||
int result = 0;
|
||||
|
||||
//
|
||||
if (!IsValid())
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
result = ArraySize(bearishFairValueGaps);
|
||||
|
||||
@@ -9400,6 +9352,17 @@ bool CalculatePriceInsideZones(
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate Zone by Providing Specified Data ...
|
||||
*
|
||||
* @param zones: XStateZone instance Reference ...
|
||||
* @param source: XPOIState instance Reference ...
|
||||
* @param upper: Double ...
|
||||
* @param lower: Double ...
|
||||
* @param from: DateTime ...
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool CalculateStateZones(
|
||||
XStateZones &zones,
|
||||
XPOIState &source,
|
||||
@@ -10647,6 +10610,136 @@ double CalculateTarget(
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Detect Valid Order Blocks ...
|
||||
*
|
||||
* @param forDir: ENUM_X_DIRECTION member ...
|
||||
* @param source: XPOIState instance Reference ...
|
||||
*
|
||||
* @return ( int )
|
||||
*/
|
||||
int DetectDirectionOrderBlocks(
|
||||
ENUM_X_DIRECTION forDir,
|
||||
XPOIState &source,
|
||||
XCOrderBlock *&orderBlocks[] //
|
||||
)
|
||||
{
|
||||
//
|
||||
int result = 0;
|
||||
|
||||
//
|
||||
Clean(orderBlocks);
|
||||
|
||||
//
|
||||
bool isValid =
|
||||
//
|
||||
source.IsValid() &&
|
||||
source.HasChild() &&
|
||||
HasDirection(forDir)
|
||||
//
|
||||
;
|
||||
if (!isValid)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
datetime cTime = TimeCurrent();
|
||||
|
||||
//
|
||||
XOHCL cBar;
|
||||
bool isInited = cBar.Init(
|
||||
source.symbol,
|
||||
source.period,
|
||||
1 //
|
||||
);
|
||||
if (!isInited)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
int count = 0;
|
||||
|
||||
//
|
||||
// Bullish ...
|
||||
count = source.CountBullishOrderBlocks();
|
||||
isValid = IsValidSize(count) &&
|
||||
IsBullish(forDir);
|
||||
if (isValid)
|
||||
{
|
||||
//
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XCOrderBlock *iOB = source.bullishOrderBlocks[i];
|
||||
|
||||
//
|
||||
// Update Order Block Time ...
|
||||
iOB.To(cTime);
|
||||
|
||||
//
|
||||
// Check Order Block Validation ...
|
||||
isValid = IsValid(
|
||||
iOB,
|
||||
forDir,
|
||||
cBar.symbol,
|
||||
cBar.period //
|
||||
);
|
||||
if (isValid)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
iOB,
|
||||
orderBlocks //
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Bearish ...
|
||||
count = source.CountBearishOrderBlocks();
|
||||
isValid = IsValidSize(count) &&
|
||||
IsBearish(forDir);
|
||||
if (isValid)
|
||||
{
|
||||
//
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XCOrderBlock *iOB = source.bearishOrderBlocks[i];
|
||||
|
||||
//
|
||||
// Update Order Block Time ...
|
||||
iOB.To(cTime);
|
||||
|
||||
//
|
||||
// Check Order Block Validation ...
|
||||
isValid = IsValid(
|
||||
iOB,
|
||||
forDir,
|
||||
cBar.symbol,
|
||||
cBar.period //
|
||||
);
|
||||
if (isValid)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
iOB,
|
||||
orderBlocks //
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
result = ArraySize(orderBlocks);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test Market for Detect Order Block FVG ...
|
||||
*
|
||||
@@ -11011,6 +11104,415 @@ bool DetectFVGOB(
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Detect a Zone Breaker Bar ...
|
||||
*
|
||||
* @param toBar: XOHCL instance Reference ...
|
||||
* @param fromBar: XOHCL instance Reference ...
|
||||
* @param breakerBar: XOHCL instance Reference ...
|
||||
* @param forDir: ENUM_X_DIRECTION member ...
|
||||
* @param symbol: String ...
|
||||
* @param period: ENUM_TIMEFRAMES member ...
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool HasBreakerBar(
|
||||
XOHCL &toBar,
|
||||
XOHCL &fromBar,
|
||||
XOHCL &breakerBar,
|
||||
ENUM_X_DIRECTION forDir,
|
||||
string symbol,
|
||||
ENUM_TIMEFRAMES period,
|
||||
XCZone *zone //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
toBar.Clean();
|
||||
fromBar.Clean();
|
||||
breakerBar.Clean();
|
||||
|
||||
//
|
||||
result =
|
||||
//
|
||||
zone != NULL &&
|
||||
IsValid(zone.To()) &&
|
||||
IsValid(zone.From()) &&
|
||||
HasDirection(forDir);
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
result = fromBar.Init(
|
||||
symbol,
|
||||
period,
|
||||
zone.From() //
|
||||
);
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
result = toBar.Init(
|
||||
symbol,
|
||||
period,
|
||||
zone.To() //
|
||||
);
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
int toIndex = toBar.Index();
|
||||
int fromIndex = fromBar.Index();
|
||||
|
||||
//
|
||||
double upper = zone.Upper();
|
||||
double lower = zone.Lower();
|
||||
|
||||
//
|
||||
// Detect Zone BreakerBar ...
|
||||
for (int i = fromIndex; i >= toIndex; i--)
|
||||
{
|
||||
//
|
||||
XOHCL iBar;
|
||||
result = iBar.Init(
|
||||
symbol,
|
||||
period,
|
||||
i //
|
||||
);
|
||||
|
||||
//
|
||||
if (!result)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
result =
|
||||
//
|
||||
IsBullish(forDir)
|
||||
?
|
||||
//
|
||||
iBar.low < upper &&
|
||||
iBar.high > upper &&
|
||||
iBar.GetUp() > upper
|
||||
//
|
||||
:
|
||||
//
|
||||
iBar.high > lower &&
|
||||
iBar.low < lower &&
|
||||
iBar.GetDown() < lower
|
||||
//
|
||||
;
|
||||
if (result)
|
||||
{
|
||||
//
|
||||
breakerBar = iBar;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
result = breakerBar.IsValid();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check a Zone is Valid for Specified Direction ...
|
||||
*
|
||||
* @param toBar: XOHCL instance Reference ...
|
||||
* @param fromBar: XOHCL instance Reference ...
|
||||
* @param breakerBar: XOHCL instance Reference ...
|
||||
* @param forDir: ENUM_X_DIRECTION member ...
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool IsValid(
|
||||
XOHCL &toBar,
|
||||
XOHCL &fromBar,
|
||||
XOHCL &breakerBar,
|
||||
ENUM_X_DIRECTION forDir,
|
||||
XCZone *zone //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
result =
|
||||
//
|
||||
zone != NULL &&
|
||||
toBar.IsValid() &&
|
||||
fromBar.IsValid() &&
|
||||
breakerBar.IsValid() &&
|
||||
HasDirection(forDir)
|
||||
//
|
||||
;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
int toIndex = toBar.Index();
|
||||
int fromIndex = fromBar.Index();
|
||||
int breakerIndex = breakerBar.Index();
|
||||
|
||||
//
|
||||
double upper = zone.Upper();
|
||||
double lower = zone.Lower();
|
||||
|
||||
//
|
||||
bool isBreaked = false;
|
||||
for (int i = breakerIndex - 1; i >= toIndex; i--)
|
||||
{
|
||||
//
|
||||
XOHCL iBar;
|
||||
result = iBar.Init(
|
||||
fromBar.symbol,
|
||||
fromBar.period,
|
||||
i //
|
||||
);
|
||||
|
||||
//
|
||||
if (!result)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
isBreaked =
|
||||
//
|
||||
IsBullish(forDir)
|
||||
//
|
||||
?
|
||||
//
|
||||
iBar.low < upper
|
||||
//
|
||||
:
|
||||
//
|
||||
iBar.high > lower
|
||||
//
|
||||
;
|
||||
if (isBreaked)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
result = !isBreaked;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate Specified Order Block ...
|
||||
*
|
||||
* @param forDir: ENUM_X_DIRECTION member ...
|
||||
* @param symbol: String ...
|
||||
* @param period: ENUM_TIMEFRAMES member ...
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool IsValid(
|
||||
XCOrderBlock *orderBlock,
|
||||
ENUM_X_DIRECTION forDir,
|
||||
string symbol,
|
||||
ENUM_TIMEFRAMES period //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
result =
|
||||
//
|
||||
IsValid(symbol) &&
|
||||
IsValid(period) &&
|
||||
orderBlock != NULL &&
|
||||
HasDirection(forDir) &&
|
||||
orderBlock.IsValid()
|
||||
//
|
||||
;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
XOHCL toBar;
|
||||
XOHCL fromBar;
|
||||
XOHCL breakerBar;
|
||||
result = HasBreakerBar(
|
||||
toBar,
|
||||
fromBar,
|
||||
breakerBar,
|
||||
forDir,
|
||||
symbol,
|
||||
period,
|
||||
(XCZone *)orderBlock //
|
||||
);
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Validate Zone Touch ...
|
||||
result = IsValid(
|
||||
toBar,
|
||||
fromBar,
|
||||
breakerBar,
|
||||
forDir,
|
||||
(XCZone *)orderBlock //
|
||||
);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Oldest Zone ...
|
||||
*
|
||||
* @return ( int )
|
||||
*/
|
||||
int GetOldest(
|
||||
XCZone *&source[] //
|
||||
)
|
||||
{
|
||||
//
|
||||
int result = -1;
|
||||
|
||||
//
|
||||
int count = ArraySize(source);
|
||||
if (!IsValidSize(count))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
XCZone *oldest = NULL;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XCZone *iZone = source[i];
|
||||
|
||||
//
|
||||
bool canSet =
|
||||
oldest == NULL ||
|
||||
(oldest != NULL &&
|
||||
oldest.From() > iZone.From());
|
||||
if (canSet)
|
||||
{
|
||||
//
|
||||
result = i;
|
||||
oldest = iZone;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Youngest Zone ...
|
||||
*
|
||||
* @return ( int )
|
||||
*/
|
||||
int GetYoungest(
|
||||
XCZone *&source[] //
|
||||
)
|
||||
{
|
||||
//
|
||||
int result = -1;
|
||||
|
||||
//
|
||||
int count = ArraySize(source);
|
||||
if (!IsValidSize(count))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
XCZone *youngest = NULL;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XCZone *iZone = source[i];
|
||||
|
||||
//
|
||||
bool canSet =
|
||||
youngest == NULL ||
|
||||
(youngest != NULL &&
|
||||
youngest.From() < iZone.From());
|
||||
if (canSet)
|
||||
{
|
||||
//
|
||||
result = i;
|
||||
youngest = iZone;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool ToZone(
|
||||
T *&source[],
|
||||
XCZone *&dest[] //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
Clean(dest);
|
||||
|
||||
//
|
||||
int count = ArraySize(source);
|
||||
result = IsValidSize(count);
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
T *item = source[i];
|
||||
|
||||
//
|
||||
if (item != NULL)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
(XCZone *)item,
|
||||
dest //
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
int destCount = ArraySize(dest);
|
||||
result = IsValidSize(destCount);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
typedef void (*TOnPOIEvent)(ENUM_XPOI_EVENTS event,
|
||||
XCBasePOI *param //
|
||||
|
||||
@@ -82,6 +82,7 @@ class XC121SMCCycleHelper : public XCBase
|
||||
|
||||
//
|
||||
// POI Detector ...
|
||||
XCPOIDrawer *mPOIDrawer;
|
||||
XCPOIDetector *mPOIDetector;
|
||||
|
||||
//
|
||||
@@ -166,6 +167,22 @@ class XC121SMCCycleHelper : public XCBase
|
||||
// Initialize Bar Analyser Class Instance ...
|
||||
mBarAnalyser = new XCBarAnalyser();
|
||||
|
||||
//
|
||||
// Initial and Configure POI Drawer if Required ...
|
||||
mPOIDrawer = new XCPOIDrawer();
|
||||
mPOIDrawer.ChartIdentification(0);
|
||||
mPOIDrawer.SubWindowIdentification(0);
|
||||
|
||||
//
|
||||
mPOIDrawer.DemandZoneFill(false);
|
||||
mPOIDrawer.SupplyZoneFill(false);
|
||||
mPOIDrawer.BullishFVGFill(false);
|
||||
mPOIDrawer.BearishFVGFill(false);
|
||||
mPOIDrawer.SupportZoneFill(false);
|
||||
mPOIDrawer.ResistanceZoneFill(false);
|
||||
mPOIDrawer.BullishOrderBlockFill(false);
|
||||
mPOIDrawer.BearishOrderBlockFill(false);
|
||||
|
||||
//
|
||||
// Set Chart Style ...
|
||||
ApplyChartStyle();
|
||||
@@ -552,6 +569,55 @@ class XC121SMCCycleHelper : public XCBase
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Detect Order Blocks ...
|
||||
*
|
||||
* @return ( int )
|
||||
*/
|
||||
bool DetectOrderBlocks(
|
||||
XCOrderBlock *&bullishOrderBlocks[],
|
||||
XCOrderBlock *&bearishOrderBlocks[] //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
Clean(bullishOrderBlocks);
|
||||
Clean(bearishOrderBlocks);
|
||||
|
||||
//
|
||||
XPOIState state;
|
||||
mPOIDetector.GetState(state);
|
||||
bool isValid = state.IsValid() &&
|
||||
state.HasChild();
|
||||
if (!isValid)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
int bullOBsCount = DetectDirectionOrderBlocks(
|
||||
X_DIRECTION_BULLISH,
|
||||
state,
|
||||
bullishOrderBlocks //
|
||||
);
|
||||
|
||||
//
|
||||
int bearOBsCount = DetectDirectionOrderBlocks(
|
||||
X_DIRECTION_BEARISH,
|
||||
state,
|
||||
bearishOrderBlocks //
|
||||
);
|
||||
|
||||
//
|
||||
result = IsValidSize(bullOBsCount +
|
||||
bearOBsCount);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve Cycle Conditions ...
|
||||
*
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -28,8 +28,8 @@
|
||||
|
||||
//
|
||||
#include "../Signals/x-121.smc.x.signal.lib.mq5"
|
||||
#include "../Signals/x-121.smc.xpz.signal.lib.mq5"
|
||||
#include "../Signals/x-121.smc.xpvt.signal.lib.mq5"
|
||||
#include "../Signals/x-121.smc.xpz.signal.lib.mq5"
|
||||
#include "../Signals/x-121.smc.xrspvi.signal.lib.mq5"
|
||||
#include "../Signals/x-121.smc.xstrpv.signal.lib.mq5"
|
||||
|
||||
@@ -185,14 +185,15 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
||||
|
||||
//
|
||||
// Check Spread for Signalling Conditions ...
|
||||
bool isSpreadPassed = IsSpreadPass();
|
||||
result = isSpreadPassed;
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
conditions.Clean();
|
||||
return result;
|
||||
}
|
||||
// TODO: Uncomment this ...
|
||||
// bool isSpreadPassed = IsSpreadPass();
|
||||
// result = isSpreadPassed;
|
||||
// if (!result)
|
||||
// {
|
||||
// //
|
||||
// conditions.Clean();
|
||||
// return result;
|
||||
// }
|
||||
|
||||
//
|
||||
// Detect Signal Conditions ...
|
||||
@@ -1722,8 +1723,8 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
||||
|
||||
//
|
||||
// XATR ...
|
||||
x121Inputs.xatrInputs.showATRUpper = showAll || true;
|
||||
x121Inputs.xatrInputs.showATRLower = showAll || true;
|
||||
x121Inputs.xatrInputs.showATRUpper = showAll || false;
|
||||
x121Inputs.xatrInputs.showATRLower = showAll || false;
|
||||
|
||||
//
|
||||
x121Inputs.xatrInputs.atrMultiplier = 1.5;
|
||||
@@ -1731,16 +1732,16 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
||||
|
||||
//
|
||||
// XSTR ...
|
||||
x121Inputs.xstrInputs.showStr = true || false;
|
||||
x121Inputs.xstrInputs.showStr = showAll || false;
|
||||
x121Inputs.xstrInputs.showStrUpper = showAll || false;
|
||||
x121Inputs.xstrInputs.showStrLower = showAll || false;
|
||||
|
||||
//
|
||||
// XCHE ...
|
||||
x121Inputs.xcheInputs.showLE1 = showAll || true;
|
||||
x121Inputs.xcheInputs.showLE2 = showAll || true;
|
||||
x121Inputs.xcheInputs.showSE1 = showAll || true;
|
||||
x121Inputs.xcheInputs.showSE2 = showAll || true;
|
||||
x121Inputs.xcheInputs.showLE1 = showAll || false;
|
||||
x121Inputs.xcheInputs.showLE2 = showAll || false;
|
||||
x121Inputs.xcheInputs.showSE1 = showAll || false;
|
||||
x121Inputs.xcheInputs.showSE2 = showAll || false;
|
||||
|
||||
//
|
||||
// XDON ...
|
||||
@@ -1762,6 +1763,7 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
||||
int requiredPOIS = MaxAllowedRequiredPOIs();
|
||||
|
||||
//
|
||||
// Trigger Cycle ...
|
||||
mTriggerCycleHelper = new XC121SMCCycleHelper();
|
||||
isInited = mTriggerCycleHelper.Init(
|
||||
symbol,
|
||||
@@ -1769,8 +1771,56 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
||||
x121Inputs,
|
||||
requiredPOIS //
|
||||
);
|
||||
if (isInited)
|
||||
{
|
||||
//
|
||||
// Configure POI Drawer ...
|
||||
color bullishColor = clrYellowGreen;
|
||||
color bearishColor = clrChocolate;
|
||||
|
||||
//
|
||||
// Bars ...
|
||||
mTriggerCycleHelper.mPOIDrawer.BarBullishColor(bullishColor);
|
||||
mTriggerCycleHelper.mPOIDrawer.BarBearishColor(bearishColor);
|
||||
|
||||
//
|
||||
// Swings ...
|
||||
mTriggerCycleHelper.mPOIDrawer.SwingLowColor(bullishColor);
|
||||
mTriggerCycleHelper.mPOIDrawer.SwingHighColor(bearishColor);
|
||||
|
||||
//
|
||||
// Momentum ...
|
||||
mTriggerCycleHelper.mPOIDrawer.BullishMomentumBarColor(bullishColor);
|
||||
mTriggerCycleHelper.mPOIDrawer.BearishMomentumBarColor(bearishColor);
|
||||
|
||||
//
|
||||
// Rejection ...
|
||||
mTriggerCycleHelper.mPOIDrawer.BullishRejectionBarColor(bullishColor);
|
||||
mTriggerCycleHelper.mPOIDrawer.BearishRejectionBarColor(bearishColor);
|
||||
|
||||
//
|
||||
// Support and Resistance ...
|
||||
mTriggerCycleHelper.mPOIDrawer.SupportZoneColor(bullishColor);
|
||||
mTriggerCycleHelper.mPOIDrawer.ResistanceZoneColor(bearishColor);
|
||||
|
||||
//
|
||||
// Demand and Supply ...
|
||||
mTriggerCycleHelper.mPOIDrawer.DemandZoneColor(bullishColor);
|
||||
mTriggerCycleHelper.mPOIDrawer.SupplyZoneColor(bearishColor);
|
||||
|
||||
//
|
||||
// Order Blocks ...
|
||||
mTriggerCycleHelper.mPOIDrawer.BullishOrderBlockColor(bullishColor);
|
||||
mTriggerCycleHelper.mPOIDrawer.BearishOrderBlockColor(bearishColor);
|
||||
|
||||
//
|
||||
// Fair Value Gaps ...
|
||||
mTriggerCycleHelper.mPOIDrawer.BullishFVGColor(bullishColor);
|
||||
mTriggerCycleHelper.mPOIDrawer.BearishFVGColor(bearishColor);
|
||||
}
|
||||
|
||||
//
|
||||
// Decision Cycle ...
|
||||
mDecisionCycleHelper = new XC121SMCCycleHelper();
|
||||
isInited = mDecisionCycleHelper.Init(
|
||||
symbol,
|
||||
@@ -1778,8 +1828,56 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
||||
x121Inputs,
|
||||
requiredPOIS //
|
||||
);
|
||||
if (isInited)
|
||||
{
|
||||
//
|
||||
// Configure POI Drawer ...
|
||||
color bullishColor = clrDodgerBlue;
|
||||
color bearishColor = clrSienna;
|
||||
|
||||
//
|
||||
// Bars ...
|
||||
mDecisionCycleHelper.mPOIDrawer.BarBullishColor(bullishColor);
|
||||
mDecisionCycleHelper.mPOIDrawer.BarBearishColor(bearishColor);
|
||||
|
||||
//
|
||||
// Swings ...
|
||||
mDecisionCycleHelper.mPOIDrawer.SwingLowColor(bullishColor);
|
||||
mDecisionCycleHelper.mPOIDrawer.SwingHighColor(bearishColor);
|
||||
|
||||
//
|
||||
// Momentum ...
|
||||
mDecisionCycleHelper.mPOIDrawer.BullishMomentumBarColor(bullishColor);
|
||||
mDecisionCycleHelper.mPOIDrawer.BearishMomentumBarColor(bearishColor);
|
||||
|
||||
//
|
||||
// Rejection ...
|
||||
mDecisionCycleHelper.mPOIDrawer.BullishRejectionBarColor(bullishColor);
|
||||
mDecisionCycleHelper.mPOIDrawer.BearishRejectionBarColor(bearishColor);
|
||||
|
||||
//
|
||||
// Support and Resistance ...
|
||||
mDecisionCycleHelper.mPOIDrawer.SupportZoneColor(bullishColor);
|
||||
mDecisionCycleHelper.mPOIDrawer.ResistanceZoneColor(bearishColor);
|
||||
|
||||
//
|
||||
// Demand and Supply ...
|
||||
mDecisionCycleHelper.mPOIDrawer.DemandZoneColor(bullishColor);
|
||||
mDecisionCycleHelper.mPOIDrawer.SupplyZoneColor(bearishColor);
|
||||
|
||||
//
|
||||
// Order Blocks ...
|
||||
mDecisionCycleHelper.mPOIDrawer.BullishOrderBlockColor(bullishColor);
|
||||
mDecisionCycleHelper.mPOIDrawer.BearishOrderBlockColor(bearishColor);
|
||||
|
||||
//
|
||||
// Fair Value Gaps ...
|
||||
mDecisionCycleHelper.mPOIDrawer.BullishFVGColor(bullishColor);
|
||||
mDecisionCycleHelper.mPOIDrawer.BearishFVGColor(bearishColor);
|
||||
}
|
||||
|
||||
//
|
||||
// Analyse Cycle ...
|
||||
mAnalyseCycleHelper = new XC121SMCCycleHelper();
|
||||
isInited = mAnalyseCycleHelper.Init(
|
||||
symbol,
|
||||
@@ -1787,8 +1885,56 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
||||
x121Inputs,
|
||||
requiredPOIS //
|
||||
);
|
||||
if (isInited)
|
||||
{
|
||||
//
|
||||
// Configure POI Drawer ...
|
||||
color bullishColor = clrMediumSeaGreen;
|
||||
color bearishColor = clrBlueViolet;
|
||||
|
||||
//
|
||||
// Bars ...
|
||||
mAnalyseCycleHelper.mPOIDrawer.BarBullishColor(bullishColor);
|
||||
mAnalyseCycleHelper.mPOIDrawer.BarBearishColor(bearishColor);
|
||||
|
||||
//
|
||||
// Swings ...
|
||||
mAnalyseCycleHelper.mPOIDrawer.SwingLowColor(bullishColor);
|
||||
mAnalyseCycleHelper.mPOIDrawer.SwingHighColor(bearishColor);
|
||||
|
||||
//
|
||||
// Momentum ...
|
||||
mAnalyseCycleHelper.mPOIDrawer.BullishMomentumBarColor(bullishColor);
|
||||
mAnalyseCycleHelper.mPOIDrawer.BearishMomentumBarColor(bearishColor);
|
||||
|
||||
//
|
||||
// Rejection ...
|
||||
mAnalyseCycleHelper.mPOIDrawer.BullishRejectionBarColor(bullishColor);
|
||||
mAnalyseCycleHelper.mPOIDrawer.BearishRejectionBarColor(bearishColor);
|
||||
|
||||
//
|
||||
// Support and Resistance ...
|
||||
mAnalyseCycleHelper.mPOIDrawer.SupportZoneColor(bullishColor);
|
||||
mAnalyseCycleHelper.mPOIDrawer.ResistanceZoneColor(bearishColor);
|
||||
|
||||
//
|
||||
// Demand and Supply ...
|
||||
mAnalyseCycleHelper.mPOIDrawer.DemandZoneColor(bullishColor);
|
||||
mAnalyseCycleHelper.mPOIDrawer.SupplyZoneColor(bearishColor);
|
||||
|
||||
//
|
||||
// Order Blocks ...
|
||||
mAnalyseCycleHelper.mPOIDrawer.BullishOrderBlockColor(bullishColor);
|
||||
mAnalyseCycleHelper.mPOIDrawer.BearishOrderBlockColor(bearishColor);
|
||||
|
||||
//
|
||||
// Fair Value Gaps ...
|
||||
mAnalyseCycleHelper.mPOIDrawer.BullishFVGColor(bullishColor);
|
||||
mAnalyseCycleHelper.mPOIDrawer.BearishFVGColor(bearishColor);
|
||||
}
|
||||
|
||||
//
|
||||
// Verification Cycle ...
|
||||
mVerificationCycleHelper = new XC121SMCCycleHelper();
|
||||
isInited = mVerificationCycleHelper.Init(
|
||||
symbol,
|
||||
@@ -1796,8 +1942,56 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
||||
x121Inputs,
|
||||
requiredPOIS //
|
||||
);
|
||||
if (isInited)
|
||||
{
|
||||
//
|
||||
// Configure POI Drawer ...
|
||||
color bullishColor = clrOliveDrab;
|
||||
color bearishColor = clrSteelBlue;
|
||||
|
||||
//
|
||||
// Bars ...
|
||||
mVerificationCycleHelper.mPOIDrawer.BarBullishColor(bullishColor);
|
||||
mVerificationCycleHelper.mPOIDrawer.BarBearishColor(bearishColor);
|
||||
|
||||
//
|
||||
// Swings ...
|
||||
mVerificationCycleHelper.mPOIDrawer.SwingLowColor(bullishColor);
|
||||
mVerificationCycleHelper.mPOIDrawer.SwingHighColor(bearishColor);
|
||||
|
||||
//
|
||||
// Momentum ...
|
||||
mVerificationCycleHelper.mPOIDrawer.BullishMomentumBarColor(bullishColor);
|
||||
mVerificationCycleHelper.mPOIDrawer.BearishMomentumBarColor(bearishColor);
|
||||
|
||||
//
|
||||
// Rejection ...
|
||||
mVerificationCycleHelper.mPOIDrawer.BullishRejectionBarColor(bullishColor);
|
||||
mVerificationCycleHelper.mPOIDrawer.BearishRejectionBarColor(bearishColor);
|
||||
|
||||
//
|
||||
// Support and Resistance ...
|
||||
mVerificationCycleHelper.mPOIDrawer.SupportZoneColor(bullishColor);
|
||||
mVerificationCycleHelper.mPOIDrawer.ResistanceZoneColor(bearishColor);
|
||||
|
||||
//
|
||||
// Demand and Supply ...
|
||||
mVerificationCycleHelper.mPOIDrawer.DemandZoneColor(bullishColor);
|
||||
mVerificationCycleHelper.mPOIDrawer.SupplyZoneColor(bearishColor);
|
||||
|
||||
//
|
||||
// Order Blocks ...
|
||||
mVerificationCycleHelper.mPOIDrawer.BullishOrderBlockColor(bullishColor);
|
||||
mVerificationCycleHelper.mPOIDrawer.BearishOrderBlockColor(bearishColor);
|
||||
|
||||
//
|
||||
// Fair Value Gaps ...
|
||||
mVerificationCycleHelper.mPOIDrawer.BullishFVGColor(bullishColor);
|
||||
mVerificationCycleHelper.mPOIDrawer.BearishFVGColor(bearishColor);
|
||||
}
|
||||
|
||||
//
|
||||
// Consolidation Cycle ...
|
||||
mConsolidationCycleHelper = new XC121SMCCycleHelper();
|
||||
isInited = mConsolidationCycleHelper.Init(
|
||||
symbol,
|
||||
@@ -1805,8 +1999,56 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
||||
x121Inputs,
|
||||
requiredPOIS //
|
||||
);
|
||||
if (isInited)
|
||||
{
|
||||
//
|
||||
// Configure POI Drawer ...
|
||||
color bullishColor = clrLime;
|
||||
color bearishColor = clrRed;
|
||||
|
||||
//
|
||||
// Bars ...
|
||||
mConsolidationCycleHelper.mPOIDrawer.BarBullishColor(bullishColor);
|
||||
mConsolidationCycleHelper.mPOIDrawer.BarBearishColor(bearishColor);
|
||||
|
||||
//
|
||||
// Swings ...
|
||||
mConsolidationCycleHelper.mPOIDrawer.SwingLowColor(bullishColor);
|
||||
mConsolidationCycleHelper.mPOIDrawer.SwingHighColor(bearishColor);
|
||||
|
||||
//
|
||||
// Momentum ...
|
||||
mConsolidationCycleHelper.mPOIDrawer.BullishMomentumBarColor(bullishColor);
|
||||
mConsolidationCycleHelper.mPOIDrawer.BearishMomentumBarColor(bearishColor);
|
||||
|
||||
//
|
||||
// Rejection ...
|
||||
mConsolidationCycleHelper.mPOIDrawer.BullishRejectionBarColor(bullishColor);
|
||||
mConsolidationCycleHelper.mPOIDrawer.BearishRejectionBarColor(bearishColor);
|
||||
|
||||
//
|
||||
// Support and Resistance ...
|
||||
mConsolidationCycleHelper.mPOIDrawer.SupportZoneColor(bullishColor);
|
||||
mConsolidationCycleHelper.mPOIDrawer.ResistanceZoneColor(bearishColor);
|
||||
|
||||
//
|
||||
// Demand and Supply ...
|
||||
mConsolidationCycleHelper.mPOIDrawer.DemandZoneColor(bullishColor);
|
||||
mConsolidationCycleHelper.mPOIDrawer.SupplyZoneColor(bearishColor);
|
||||
|
||||
//
|
||||
// Order Blocks ...
|
||||
mConsolidationCycleHelper.mPOIDrawer.BullishOrderBlockColor(bullishColor);
|
||||
mConsolidationCycleHelper.mPOIDrawer.BearishOrderBlockColor(bearishColor);
|
||||
|
||||
//
|
||||
// Fair Value Gaps ...
|
||||
mConsolidationCycleHelper.mPOIDrawer.BullishFVGColor(bullishColor);
|
||||
mConsolidationCycleHelper.mPOIDrawer.BearishFVGColor(bearishColor);
|
||||
}
|
||||
|
||||
//
|
||||
// Vision Cycle ...
|
||||
mVisionCycleHelper = new XC121SMCCycleHelper();
|
||||
isInited = mVisionCycleHelper.Init(
|
||||
symbol,
|
||||
@@ -1814,6 +2056,53 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
||||
x121Inputs,
|
||||
requiredPOIS //
|
||||
);
|
||||
if (isInited)
|
||||
{
|
||||
//
|
||||
// Configure POI Drawer ...
|
||||
color bullishColor = clrAqua;
|
||||
color bearishColor = clrMagenta;
|
||||
|
||||
//
|
||||
// Bars ...
|
||||
mVisionCycleHelper.mPOIDrawer.BarBullishColor(bullishColor);
|
||||
mVisionCycleHelper.mPOIDrawer.BarBearishColor(bearishColor);
|
||||
|
||||
//
|
||||
// Swings ...
|
||||
mVisionCycleHelper.mPOIDrawer.SwingLowColor(bullishColor);
|
||||
mVisionCycleHelper.mPOIDrawer.SwingHighColor(bearishColor);
|
||||
|
||||
//
|
||||
// Momentum ...
|
||||
mVisionCycleHelper.mPOIDrawer.BullishMomentumBarColor(bullishColor);
|
||||
mVisionCycleHelper.mPOIDrawer.BearishMomentumBarColor(bearishColor);
|
||||
|
||||
//
|
||||
// Rejection ...
|
||||
mVisionCycleHelper.mPOIDrawer.BullishRejectionBarColor(bullishColor);
|
||||
mVisionCycleHelper.mPOIDrawer.BearishRejectionBarColor(bearishColor);
|
||||
|
||||
//
|
||||
// Support and Resistance ...
|
||||
mVisionCycleHelper.mPOIDrawer.SupportZoneColor(bullishColor);
|
||||
mVisionCycleHelper.mPOIDrawer.ResistanceZoneColor(bearishColor);
|
||||
|
||||
//
|
||||
// Demand and Supply ...
|
||||
mVisionCycleHelper.mPOIDrawer.DemandZoneColor(bullishColor);
|
||||
mVisionCycleHelper.mPOIDrawer.SupplyZoneColor(bearishColor);
|
||||
|
||||
//
|
||||
// Order Blocks ...
|
||||
mVisionCycleHelper.mPOIDrawer.BullishOrderBlockColor(bullishColor);
|
||||
mVisionCycleHelper.mPOIDrawer.BearishOrderBlockColor(bearishColor);
|
||||
|
||||
//
|
||||
// Fair Value Gaps ...
|
||||
mVisionCycleHelper.mPOIDrawer.BullishFVGColor(bullishColor);
|
||||
mVisionCycleHelper.mPOIDrawer.BearishFVGColor(bearishColor);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user