last ...
This commit is contained in:
@@ -223,7 +223,7 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
||||
//
|
||||
// Detectiong Signal Boxes ...
|
||||
hasWaitingBoxes = workingZone
|
||||
.DetectSignalBoxes(
|
||||
.DetectWaitingBoxes(
|
||||
X_CYCLE_ANALYSE,
|
||||
provider,
|
||||
zIndex //
|
||||
@@ -472,53 +472,23 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
||||
iAtr = provider.decisionXConditions.atrBuffer[1];
|
||||
iAtr *= 0;
|
||||
}
|
||||
// else
|
||||
// if (signalProvider == X121SMC_XWZ_PROVIDER_ACTIVATED_BOX)
|
||||
// {
|
||||
// //
|
||||
// iAtr = provider.decisionXConditions.atrBuffer[1];
|
||||
// iAtr *= 1.5;
|
||||
else if (signalProvider == X121SMC_XWZ_PROVIDER_XREJECTED_BOX)
|
||||
{
|
||||
//
|
||||
iAtr = provider.decisionXConditions.atrBuffer[1];
|
||||
iAtr *= 0;
|
||||
|
||||
// // //
|
||||
// // if (isBullish)
|
||||
// // {
|
||||
// // //
|
||||
// // iSL = MathMin(
|
||||
// // provider.decisionXConditions.le1Buffer[1],
|
||||
// // provider.decisionXConditions.le2Buffer[1] //
|
||||
// // );
|
||||
// // if (iSL > 0)
|
||||
// // {
|
||||
// // //
|
||||
// // Add(
|
||||
// // iSL,
|
||||
// // sls //
|
||||
// // );
|
||||
// // }
|
||||
// // }
|
||||
// // else
|
||||
// // {
|
||||
// // //
|
||||
// // iSL = MathMax(
|
||||
// // provider.decisionXConditions.se1Buffer[1],
|
||||
// // provider.decisionXConditions.se2Buffer[1] //
|
||||
// // );
|
||||
// // if (iSL > 0)
|
||||
// // {
|
||||
// // //
|
||||
// // Add(
|
||||
// // iSL,
|
||||
// // sls //
|
||||
// // );
|
||||
// // }
|
||||
// // }
|
||||
// }
|
||||
// else if (signalProvider == X121SMC_XWZ_PROVIDER_ACTIVATED_AREA)
|
||||
// {
|
||||
// //
|
||||
// iAtr = provider.decisionXConditions.atrBuffer[1];
|
||||
// iAtr *= 1.5;
|
||||
// }
|
||||
//
|
||||
Clean(sls);
|
||||
|
||||
//
|
||||
// Prepare Box fro SL ...
|
||||
iSL = signalBox.lower + ((signalBox.upper - signalBox.lower) / 2);
|
||||
Add(
|
||||
iSL,
|
||||
sls //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Select Condition SL ...
|
||||
|
||||
@@ -32,6 +32,7 @@ enum ENUM_X121SMC_XWZ_PROVIDERS
|
||||
{
|
||||
X121SMC_XWZ_PROVIDER_NONE,
|
||||
X121SMC_XWZ_PROVIDER_XHKMA,
|
||||
X121SMC_XWZ_PROVIDER_XREJECTED_BOX,
|
||||
};
|
||||
|
||||
//
|
||||
@@ -466,7 +467,7 @@ struct X121SMCStrategyXWZWorkingZone
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool DetectSignalBoxes(
|
||||
bool DetectWaitingBoxes(
|
||||
ENUM_X_CYCLES cycle,
|
||||
X121SMCStrategySignalProviderData &provider,
|
||||
int barIndex = 0 //
|
||||
@@ -524,46 +525,91 @@ struct X121SMCStrategyXWZWorkingZone
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
XCFVG *iFVG = NULL;
|
||||
XCOrderBlock *iOB = cState.orderBlocks[idx];
|
||||
bool isBullish = iOB.IsBullish();
|
||||
|
||||
//
|
||||
// Detecting Inside FVG ...
|
||||
has = cState.HasFairValueGaps();
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
XCFVG *tmpFVGs[];
|
||||
count = cState.CountFairValueGaps();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XCFVG *jFVG = cState.fairValueGaps[i];
|
||||
|
||||
//
|
||||
bool isDirPassed = jFVG.GetDirection() == iOB.GetDirection();
|
||||
bool isFromPassed = jFVG.From() >= iOB.From();
|
||||
bool isPlacePassed = IsInsideOrDiff(
|
||||
jFVG,
|
||||
iOB,
|
||||
false //
|
||||
);
|
||||
|
||||
//
|
||||
has = isDirPassed &&
|
||||
isFromPassed &&
|
||||
isPlacePassed;
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
jFVG,
|
||||
tmpFVGs //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
ZeroMemory(jFVG);
|
||||
}
|
||||
|
||||
//
|
||||
// Selecting iFVG Based on Direction of OB ...
|
||||
has = HasChild(tmpFVGs);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
idx =
|
||||
isBullish
|
||||
? GetLowest(tmpFVGs)
|
||||
: GetHighest(tmpFVGs);
|
||||
has = IsValidIndex(idx);
|
||||
if (has)
|
||||
{
|
||||
iFVG = tmpFVGs[idx];
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
Clean(tmpFVGs);
|
||||
}
|
||||
|
||||
//
|
||||
XBoxZone iOBBox;
|
||||
XBoxZone iFVGBox;
|
||||
if (iFVG != NULL)
|
||||
{
|
||||
//
|
||||
has = ToBox(
|
||||
iFVGBox,
|
||||
iFVG //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
has = ToBox(
|
||||
iOBBox,
|
||||
iOB //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
// Detect FVGs ...
|
||||
if (cStateEvents.hasNewFairValueGap)
|
||||
{
|
||||
//
|
||||
int idx =
|
||||
isBullish
|
||||
? GetLowest(cState.bullishFairValueGaps)
|
||||
: GetHighest(cState.bearishFairValueGaps);
|
||||
XCFVG *iFVG =
|
||||
isBullish
|
||||
? cState.bullishFairValueGaps[idx]
|
||||
: cState.bearishFairValueGaps[idx];
|
||||
has = IsValidIndex(idx);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
ToBox(
|
||||
iFVGBox,
|
||||
iFVG //
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
has = iOBBox.IsValid() &&
|
||||
iFVGBox.IsValid();
|
||||
has = iOBBox.IsValid();
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
@@ -586,6 +632,8 @@ struct X121SMCStrategyXWZWorkingZone
|
||||
//
|
||||
iOBBox.Clean();
|
||||
iFVGBox.Clean();
|
||||
ZeroMemory(iOB);
|
||||
ZeroMemory(iFVG);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1099,7 +1147,7 @@ struct X121SMCStrategyXWZWorkingZone
|
||||
//
|
||||
if (isSenario1Happend)
|
||||
{
|
||||
signalProvider = X121SMC_XWZ_PROVIDER_XHKMA;
|
||||
signalProvider = X121SMC_XWZ_PROVIDER_XREJECTED_BOX;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1661,6 +1709,10 @@ struct X121SMCStrategyXWZWorkingZone
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
iFVGBoxObj.BoxStyle(STYLE_SOLID);
|
||||
|
||||
//
|
||||
mDrawnObjects.Add(iFVGBoxObj);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user