This commit is contained in:
2025-03-07 03:56:11 +03:30
parent 6157bbe125
commit 5534bde7e5
6 changed files with 3636 additions and 3126 deletions
+52 -45
View File
@@ -4585,6 +4585,7 @@ class XCPOIDrawer : public XCBase
// //
bool drawOrderBlock = true, bool drawOrderBlock = true,
bool drawFairValueGaps = true, bool drawFairValueGaps = true,
bool drawAllFVGs = true,
// //
bool drawOBStartedBar = true, bool drawOBStartedBar = true,
bool drawOBActivatedBar = true, bool drawOBActivatedBar = true,
@@ -4695,9 +4696,12 @@ class XCPOIDrawer : public XCBase
// //
// Fair Value Gap ... // Fair Value Gap ...
if (!drawAllFVGs)
{
XCFVG *fvg; XCFVG *fvg;
has = item.GetMainFVG(fvg); has = item.GetMainFVG(fvg);
if (has) if (has &&
drawFairValueGaps)
{ {
// //
Clean(tmpObjects); Clean(tmpObjects);
@@ -4732,50 +4736,53 @@ class XCPOIDrawer : public XCBase
); );
} }
} }
}
// // else
// has = item.HasFVGs(); {
// if (has && //
// drawFairValueGaps) has = item.HasFVGs();
// { if (has &&
// // drawFairValueGaps)
// count = item.CountFVGs(); {
// for (int i = 0; i < count; i++) //
// { count = item.CountFVGs();
// // for (int i = 0; i < count; i++)
// Clean(tmpObjects); {
// int fvgsCount = DrawFairValueGap( //
// item.fvgs[i], Clean(tmpObjects);
// tmpObjects, int fvgsCount = DrawFairValueGap(
// drawFVGStartedBar, item.fvgs[i],
// drawFVGActivatedBar, tmpObjects,
// drawFVGBreakedBar, drawFVGStartedBar,
// drawFVGWorkedBar, drawFVGActivatedBar,
// widthFVGStartedBar, drawFVGBreakedBar,
// clrFVGStartedBar, drawFVGWorkedBar,
// styleFVGStartedBar, widthFVGStartedBar,
// widthFVGActivatedBar, clrFVGStartedBar,
// clrFVGActivatedBar, styleFVGStartedBar,
// styleFVGActivatedBar, widthFVGActivatedBar,
// widthFVGBreakedBar, clrFVGActivatedBar,
// clrFVGBreakedBar, styleFVGActivatedBar,
// styleFVGBreakedBar, widthFVGBreakedBar,
// widthFVGWorkedBar, clrFVGBreakedBar,
// clrFVGWorkedBar, styleFVGBreakedBar,
// styleFVGWorkedBar // widthFVGWorkedBar,
// ); clrFVGWorkedBar,
// has = IsValidSize(fvgsCount); styleFVGWorkedBar //
// if (has) );
// { has = IsValidSize(fvgsCount);
// // if (has)
// Copy( {
// tmpObjects, //
// objects, Copy(
// false // tmpObjects,
// ); objects,
// } false //
// } );
// } }
}
}
}
// //
Clean(tmpObjects); Clean(tmpObjects);
+1216 -902
View File
File diff suppressed because it is too large Load Diff
+130 -95
View File
@@ -30,7 +30,7 @@ int OnInit()
_Symbol, _Symbol,
_Period // _Period //
); );
// mPOIDetector.Init(); mPOIDetector.Init();
//--- //---
mPOIDrawer = new XCPOIDrawer(); mPOIDrawer = new XCPOIDrawer();
@@ -79,130 +79,165 @@ void OnTick()
mPOIDetector.GetState(mPOIState); mPOIDetector.GetState(mPOIState);
// //
bool has = mPOIState.HasFairValueGaps(); bool has = Contains(
X_BULLISH_FVG_DETECTED,
mPOIEvents //
) ||
Contains(
X_BEARISH_FVG_DETECTED,
mPOIEvents //
);
if (has) if (has)
{ {
// //
int count = mPOIState.CountFairValueGaps(); XCFVG *fvg;
for (int i = 0; i < count; i++) int idx = GetYoungest(mPOIState.fairValueGaps);
has = IsValidIndex(idx);
if (has)
{ {
// //
mPOIState.fairValueGaps[i].To(TimeCurrent()); fvg = mPOIState.fairValueGaps[idx];
// //
XCBaseObject *iObj; XCBaseObject *iObj;
bool isCreated = mPOIDrawer.CreateFairValueGap( has = mPOIDrawer.CreateFairValueGap(
mPOIState.fairValueGaps[i], fvg,
iObj // iObj //
); );
}
// //
Print("Salam"); if (has)
}
//
return;
//
XOHCL bar;
bool isInited = bar.Init(
_Symbol,
_Period,
0 //
);
if (!isInited)
{
return;
}
//
int index = 0;
ENUM_X_DIRECTION sameBarDir;
bool hasSameBars = mBarAnalyser.HasSameBars(
bar,
sameBarDir,
index,
3 //
);
if (hasSameBars)
{
}
//
// Detect Fair Value Gap ...
XOHCL fvgEndBar;
XOHCL fvgStartBar;
ENUM_X_DIRECTION fvgDir;
bool hasFVG = mBarAnalyser.HasFairValueGap(
bar,
fvgStartBar,
fvgEndBar,
fvgDir,
3 //
);
if (hasFVG)
{ {
// //
XCFVG *fvg; Print("New Fair Value Gap ...");
fvg = new XCFVG(); }
bool isInit = fvg.Init( }
fvgStartBar, }
fvgEndBar,
fvgDir // // //
); // bool has = mPOIState.HasFairValueGaps();
// if (isInit) // if (has)
// { // {
// //
// int count = mPOIState.CountFairValueGaps();
// for (int i = 0; i < count; i++)
// {
// //
// mPOIState.fairValueGaps[i].To(TimeCurrent());
// // // //
// XCBaseObject *iObj; // XCBaseObject *iObj;
// bool isCreated = mPOIDrawer.CreateFairValueGap( // bool isCreated = mPOIDrawer.CreateFairValueGap(
// fvg, // mPOIState.fairValueGaps[i],
// iObj // // iObj //
// ); // );
//
// //
// if (isCreated)
// {
// } // }
// }
}
// //
XOHCL obBar; // Print("Salam");
ENUM_X_DIRECTION obDir;
bool hasOB = mBarAnalyser.HasOrderBlock(
bar,
obBar,
obDir,
3 //
);
if (hasOB)
{
// //
XCOrderBlock *ob; return;
ob = new XCOrderBlock();
bool isInit = ob.Init(
obBar,
obDir //
);
if (isInit)
{
// // // //
// XCBaseObject *iObj; // XOHCL bar;
// bool isCreated = mPOIDrawer.CreateOrderBlock( // bool isInited = bar.Init(
// ob, // _Symbol,
// iObj // // _Period,
// 0 //
// ); // );
// if (!isInited)
// {
// return;
// }
// // // //
// if (isCreated) // int index = 0;
// ENUM_X_DIRECTION sameBarDir;
// bool hasSameBars = mBarAnalyser.HasSameBars(
// bar,
// sameBarDir,
// index,
// 3 //
// );
// if (hasSameBars)
// { // {
// Print("Order Block ...");
// } // }
// }
}
// // //
} // // Detect Fair Value Gap ...
// XOHCL fvgEndBar;
// XOHCL fvgStartBar;
// ENUM_X_DIRECTION fvgDir;
// bool hasFVG = mBarAnalyser.HasFairValueGap(
// bar,
// fvgStartBar,
// fvgEndBar,
// fvgDir,
// 3 //
// );
// if (hasFVG)
// {
// //
// XCFVG *fvg;
// fvg = new XCFVG();
// bool isInit = fvg.Init(
// fvgStartBar,
// fvgEndBar,
// fvgDir //
// );
// // if (isInit)
// // {
// // //
// // XCBaseObject *iObj;
// // bool isCreated = mPOIDrawer.CreateFairValueGap(
// // fvg,
// // iObj //
// // );
// //
// // //
// // if (isCreated)
// // {
// // }
// // }
// }
// //
// XOHCL obBar;
// ENUM_X_DIRECTION obDir;
// bool hasOB = mBarAnalyser.HasOrderBlock(
// bar,
// obBar,
// obDir,
// 3 //
// );
// if (hasOB)
// {
// //
// XCOrderBlock *ob;
// ob = new XCOrderBlock();
// bool isInit = ob.Init(
// obBar,
// obDir //
// );
// if (isInit)
// {
// // //
// // XCBaseObject *iObj;
// // bool isCreated = mPOIDrawer.CreateOrderBlock(
// // ob,
// // iObj //
// // );
// // //
// // if (isCreated)
// // {
// // Print("Order Block ...");
// // }
// // }
// }
// //
// }
} }
//+------------------------------------------------------------------+ //+------------------------------------------------------------------+
+57 -30
View File
@@ -388,7 +388,6 @@ struct XOBFVG
// //
bool IsValidZone( bool IsValidZone(
XOHCL &invalidBar,
int barIndex = 0 // int barIndex = 0 //
) )
{ {
@@ -401,9 +400,6 @@ struct XOBFVG
barIndex = 0; barIndex = 0;
} }
//
invalidBar.Clean();
// //
result = IsValid(); result = IsValid();
if (!result) if (!result)
@@ -412,64 +408,78 @@ struct XOBFVG
} }
// //
XCFVG *fvg; XCFVG *tmpFVGs[];
result = GetMainFVG(fvg); Copy(
if (!result) fvgs,
tmpFVGs //
);
int count = CountFVGs();
for (int i = 0; i < count; i++)
{ {
// //
ZeroMemory(fvg); XCFVG *iFVG = tmpFVGs[i];
return result;
}
// //
XOHCL startedBar; XOHCL startedBar;
bool isBodyOut = false; bool isBodyOut = false;
result = fvg.IsStarted( result = iFVG.IsStarted(
fvg.GetDirection(), iFVG.GetDirection(),
startedBar, startedBar,
isBodyOut // isBodyOut //
); );
if (!result) if (!result)
{ {
// //
ZeroMemory(fvg); ZeroMemory(iFVG);
startedBar.Clean(); startedBar.Clean();
ArrayRemove(
fvgs,
i,
1 //
);
// //
return result; continue;
} }
// //
XOHCL bar; XOHCL bar;
bool isBullish = fvg.IsBullish(); bool isBullish = iFVG.IsBullish();
datetime fromTime = startedBar.NextAt();
// //
int fromIndex = iBarShift( int fromIndex = iBarShift(
fvg.GetSymbol(), iFVG.GetSymbol(),
fvg.GetPeriod(), iFVG.GetPeriod(),
startedBar.NextAt() // fromTime //
); );
result = IsValidIndex(fromIndex); result = IsValidIndex(fromIndex);
if (!result) if (!result)
{ {
// //
bar.Clean(); bar.Clean();
ZeroMemory(fvg); ZeroMemory(iFVG);
startedBar.Clean(); startedBar.Clean();
ArrayRemove(
fvgs,
i,
1 //
);
// //
return result; continue;
} }
// //
bool isInited = false; bool isInited = false;
for (int i = barIndex; i < fromIndex; i++) bool isValidFVG = false;
for (int j = barIndex; j < fromIndex; j++)
{ {
// //
isInited = bar.Init( isInited = bar.Init(
fvg.GetSymbol(), iFVG.GetSymbol(),
fvg.GetPeriod(), iFVG.GetPeriod(),
i // j //
); );
if (!isInited) if (!isInited)
{ {
@@ -480,19 +490,18 @@ struct XOBFVG
// //
bool isBarAbove = bool isBarAbove =
bar.low > fvg.Upper(); bar.low > iFVG.Upper();
bool isBarBelow = bool isBarBelow =
bar.high < fvg.Lower(); bar.high < iFVG.Lower();
// //
result = isValidFVG =
isBullish isBullish
? isBarAbove ? isBarAbove
: isBarBelow; : isBarBelow;
if (!result) if (!isValidFVG)
{ {
// //
invalidBar = bar;
bar.Clean(); bar.Clean();
// //
@@ -503,10 +512,28 @@ struct XOBFVG
bar.Clean(); bar.Clean();
} }
//
if (!isValidFVG)
{
//
ArrayRemove(
fvgs,
i,
1 //
);
}
// //
bar.Clean(); bar.Clean();
ZeroMemory(fvg); ZeroMemory(iFVG);
startedBar.Clean(); startedBar.Clean();
}
//
Clean(tmpFVGs);
//
result = HasFVGs();
// //
return result; return result;
@@ -164,7 +164,8 @@ class XCX121SMCXWZSignalDetector : public XCBase
double targets[]; double targets[];
double reward = 0; double reward = 0;
XBoxZone signalBox; XBoxZone signalBox;
XOBFVG activatedZone; int activatedFVGIDX = 0;
int activatedZoneIDX = 0;
double amountPercent = 0; double amountPercent = 0;
bool hasPriority = false; bool hasPriority = false;
bool hasSignalBox = false; bool hasSignalBox = false;
@@ -214,16 +215,8 @@ class XCX121SMCXWZSignalDetector : public XCBase
// //
hasWaitingZones = workingZone.DetectZone( hasWaitingZones = workingZone.DetectZone(
drawer,
provider // provider //
); );
if (hasWaitingZones)
{
//
// Validate Waiting Zones ...
workingZone.ValidateWaitingZones(zIndex);
hasWaitingZones = HasChild(workingZone.waitingZones);
}
// //
// Checking Working Zone Destory or not ... // Checking Working Zone Destory or not ...
@@ -239,7 +232,6 @@ class XCX121SMCXWZSignalDetector : public XCBase
// //
result = false; result = false;
workingZone.Clean(); workingZone.Clean();
activatedZone.Clean();
hasWorkingZone = false; hasWorkingZone = false;
// //
@@ -255,13 +247,41 @@ class XCX121SMCXWZSignalDetector : public XCBase
} }
} }
//
// Start Draw ...
//
//
UpdateTo(cTime);
//
// Draw Working Zone ...
if (hasWorkingZone)
{
//
workingZone.Draw(
drawer,
//
true, // Draw Supply Zone ...
true, // Draw Demand Zone ...
true, // Draw Waiting Zones ...
true // Draw Waiting Zones Box Area ...
//
);
}
//
// End Draw ...
//
// //
// Detect Signal Box ... // Detect Signal Box ...
hasSignalBox = hasSignalBox =
hasWorkingZone && hasWorkingZone &&
hasWaitingZones && hasWaitingZones &&
workingZone.IsZoneActivated( workingZone.IsZoneActivated(
activatedZone, activatedZoneIDX,
activatedFVGIDX,
provider, provider,
zIndex // zIndex //
); );
@@ -269,7 +289,14 @@ class XCX121SMCXWZSignalDetector : public XCBase
{ {
// //
signalBox.Clean(); signalBox.Clean();
hasSignalBox = activatedZone.ToZone(signalBox);
//
XOBFVG iOBFVG = workingZone.waitingZones[activatedZoneIDX];
XCFVG *activatedFVG = iOBFVG.fvgs[activatedFVGIDX];
hasSignalBox = ToBox(
signalBox,
activatedFVG //
);
if (hasSignalBox) if (hasSignalBox)
{ {
// //
@@ -278,27 +305,42 @@ class XCX121SMCXWZSignalDetector : public XCBase
signalProvider = X121SMC_XWZ_PROVIDER_ACTIVATED_ZONE; signalProvider = X121SMC_XWZ_PROVIDER_ACTIVATED_ZONE;
// //
int idx = FindIndex( ArrayRemove(
activatedZone, workingZone.waitingZones[activatedZoneIDX].fvgs,
workingZone.waitingZones // activatedFVGIDX,
1 //
); );
bool has = IsValidIndex(idx); bool isValid = workingZone.waitingZones[activatedZoneIDX].IsValid();
if (has) if (!isValid)
{ {
// //
ArrayRemove( AddRef(
workingZone.waitingZones, workingZone.waitingZones[activatedZoneIDX],
idx, workingZone.unavailableZones //
1 //
); );
// //
AddRef( ArrayRemove(
activatedZone, workingZone.waitingZones,
workingZone.unavailableZones // activatedZoneIDX,
1 //
); );
} }
} }
//
iOBFVG.Clean();
ZeroMemory(activatedFVG);
}
//
// Remove Invalidate Zones ...
if (hasWaitingZones)
{
//
// Validate Waiting Zones ...
workingZone.ValidateWaitingZones(zIndex);
hasWaitingZones = workingZone.HasWaitingZones();
} }
// //
@@ -314,10 +356,6 @@ class XCX121SMCXWZSignalDetector : public XCBase
signalBoxDir = X_DIRECTION_NONE; signalBoxDir = X_DIRECTION_NONE;
} }
//
//
//
// //
// Check Priority Exists ... // Check Priority Exists ...
hasPriority = workingZone hasPriority = workingZone
@@ -732,37 +770,11 @@ class XCX121SMCXWZSignalDetector : public XCBase
mConditions.setupTime = cTime; mConditions.setupTime = cTime;
mConditions.dir = signalBoxDir; mConditions.dir = signalBoxDir;
mConditions.priority = priority; mConditions.priority = priority;
mConditions.provider = signalProvider;
mConditions.signalBox = signalBox; mConditions.signalBox = signalBox;
mConditions.provider = signalProvider;
mConditions.amountPercent = amountPercent; mConditions.amountPercent = amountPercent;
} }
//
UpdateTo(cTime);
//
// Draw Working Zone ...
if (hasWorkingZone)
{
//
workingZone.Draw(
drawer,
//
true, // Draw Supply Zone ...
true, // Draw Demand Zone ...
true, // Draw Waiting Zones ...
true // Draw Waiting Zones Box Area ...
//
);
//
if (hasSignalBox)
{
//
Print("Has Signal Box ...");
}
}
// //
// //
// //
@@ -779,7 +791,6 @@ class XCX121SMCXWZSignalDetector : public XCBase
// //
signalBox.Clean(); signalBox.Clean();
activatedZone.Clean();
consolidationZBar.Clean(); consolidationZBar.Clean();
// //
+249 -133
View File
@@ -273,7 +273,6 @@ struct X121SMCStrategyXWZWorkingZone
// //
bool DetectZone( bool DetectZone(
XCPOIDrawer *drawer,
X121SMCStrategySignalProviderData &provider // X121SMCStrategySignalProviderData &provider //
) )
{ {
@@ -290,6 +289,7 @@ struct X121SMCStrategyXWZWorkingZone
// //
int idx = -1; int idx = -1;
int count = 0;
bool has = false; bool has = false;
datetime cTime = TimeCurrent(); datetime cTime = TimeCurrent();
@@ -461,15 +461,102 @@ struct X121SMCStrategyXWZWorkingZone
// //
// Detect OB FVG ... // Detect OB FVG ...
result = if (hasNewOrderBlock)
hasNewOrderBlock && {
hasNewFairValueGap && //
ob.GetDirection() == fvg.GetDirection(); XOHCL obStartedBar;
if (result) bool isOBStartedBodyOut = false;
bool isOBStarted = ob.IsStarted(
ob.GetDirection(),
obStartedBar,
isOBStartedBodyOut //
);
//
has = isOBStarted &&
isOBStartedBodyOut;
if (has)
{ {
// //
obFVG.ob = ob; obFVG.ob = ob;
obFVG.AddFVG(fvg);
//
// Select FVGs ...
count = provider
.analyseState
.CountFairValueGaps();
has = IsValidSize(count);
if (!has)
{
obFVG.Clean();
}
else
{
//
// Select FVG ...
for (int i = 0; i < count; i++)
{
//
XCFVG *iFVG = provider
.analyseState
.fairValueGaps[i];
bool isBullish = iFVG.IsBullish();
//
XOHCL iStartedBar;
bool isBodyOut = false;
bool isStarted = iFVG.IsStarted(
iFVG.GetDirection(),
iStartedBar,
isBodyOut //
);
iStartedBar.Clean();
//
bool isKindPassed = isStarted &&
isBodyOut;
bool isSameDir = iFVG.GetDirection() == ob.GetDirection();
bool isFromPassed = iFVG.From() >= obStartedBar.time;
bool isPlacePassed =
//
IsInsideOrDiff(
iFVG,
ob //
)
//
||
//
(isBullish
? IsAboveDiff(
iFVG,
ob,
true // Ignore Inside ...
)
: IsBelowDiff(
iFVG,
ob,
true // Ignore Inside ...
)
//
)
//
;
//
has = isSameDir &&
isKindPassed &&
isFromPassed &&
isPlacePassed;
if (has)
{
obFVG.AddFVG(iFVG);
}
//
ZeroMemory(iFVG);
}
}
}
// //
has = obFVG.IsValid(); has = obFVG.IsValid();
@@ -503,97 +590,11 @@ struct X121SMCStrategyXWZWorkingZone
} }
} }
} }
}
// //
// Detect SupDem FVG ... obFVG.Clean();
// if (!result) obStartedBar.Clean();
// { }
// //
// result = hasNewFairValueGap &&
// (hasNewSupply ||
// hasNewDemand);
// if (result)
// {
// //
// // Converts Supply or Demand Zone to OrderBlock ...
// XOHCL bar;
// ob = new XCOrderBlock();
// if (hasNewSupply)
// {
// //
// has = supply.FillBar(bar);
// if (has)
// {
// //
// has = ob.Init(
// bar,
// X_DIRECTION_BEARISH //
// );
// if (has)
// {
// //
// ob.Upper(supply.Upper());
// ob.Lower(supply.Lower());
// }
// }
// }
// else if (hasNewDemand)
// {
// //
// has = demand.FillBar(bar);
// if (has)
// {
// //
// has = ob.Init(
// bar,
// X_DIRECTION_BULLISH //
// );
// if (has)
// {
// //
// ob.Upper(demand.Upper());
// ob.Lower(demand.Lower());
// }
// }
// }
// //
// obFVG.ob = ob;
// obFVG.AddFVG(fvg);
// //
// has = obFVG.IsValid();
// if (has)
// {
// //
// // Check Item Is not Exists ...
// idx = FindIndex(
// obFVG,
// waitingZones //
// );
// has = !IsValidIndex(idx);
// if (has)
// {
// //
// // New Waiting Zone ...
// AddRef(
// obFVG,
// waitingZones //
// );
// }
// else
// {
// //
// // Update Exists Waiting Zone ...
// waitingZones[idx].AddFVG(fvg);
// }
// }
// //
// bar.Clean();
// }
// }
// //
result = HasWaitingZones(); result = HasWaitingZones();
@@ -635,6 +636,12 @@ struct X121SMCStrategyXWZWorkingZone
barIndex = 0; barIndex = 0;
} }
//
if (barIndex == 0)
{
barIndex = 1;
}
// //
has = IsValid() && has = IsValid() &&
HasWaitingZones(); HasWaitingZones();
@@ -649,12 +656,7 @@ struct X121SMCStrategyXWZWorkingZone
for (int i = 0; i < result; i++) for (int i = 0; i < result; i++)
{ {
// //
XOBFVG iOBFVG = waitingZones[i]; has = waitingZones[i].IsValidZone(
//
XOHCL iInvalidBar;
has = iOBFVG.IsValidZone(
iInvalidBar,
barIndex // barIndex //
); );
if (!has) if (!has)
@@ -667,13 +669,10 @@ struct X121SMCStrategyXWZWorkingZone
// //
AddRef( AddRef(
iOBFVG, waitingZones[i],
unavailableZones // unavailableZones //
); );
} }
//
iInvalidBar.Clean();
} }
// //
@@ -697,7 +696,8 @@ struct X121SMCStrategyXWZWorkingZone
// //
bool IsZoneActivated( bool IsZoneActivated(
XOBFVG &zone, int &zoneIDX,
int &fvgIDX,
X121SMCStrategySignalProviderData &provider, X121SMCStrategySignalProviderData &provider,
int barIndex = 0 // int barIndex = 0 //
) )
@@ -706,8 +706,10 @@ struct X121SMCStrategyXWZWorkingZone
bool result = false; bool result = false;
// //
// Cleanup Result ... zoneIDX = -1;
zone.Clean();
//
fvgIDX = -1;
// //
// Normalize Bar Index ... // Normalize Bar Index ...
@@ -742,7 +744,6 @@ struct X121SMCStrategyXWZWorkingZone
{ {
// //
bar.Clean(); bar.Clean();
zone.Clean();
// //
return result; return result;
@@ -752,6 +753,64 @@ struct X121SMCStrategyXWZWorkingZone
double peak = provider.decisionXConditions.peaksBuffer[1]; double peak = provider.decisionXConditions.peaksBuffer[1];
double vale = provider.decisionXConditions.valesBuffer[1]; double vale = provider.decisionXConditions.valesBuffer[1];
//
double analysePeak = provider.analyseXConditions.peaksBuffer[1];
double analyseVale = provider.analyseXConditions.valesBuffer[1];
//
double consolidationPeak = provider.consolidationXConditions.peaksBuffer[1];
double consolidationVale = provider.consolidationXConditions.valesBuffer[1];
//
double visionPeak = provider.visionXConditions.peaksBuffer[1];
double visionVale = provider.visionXConditions.valesBuffer[1];
//
bool isPeaksSame =
peak == analysePeak &&
analysePeak == consolidationPeak;
//
bool isValesSame =
vale == analyseVale &&
analyseVale == consolidationVale;
//
//
//
//
bool isDecisionScoreBullish =
provider.decisionBullishScore > provider.decisionBearishScore;
//
bool isDecisionScoreBearish =
provider.decisionBearishScore > provider.decisionBullishScore;
//
bool isAnalyseScoreBullish =
provider.analyseBullishScore > provider.analyseBearishScore;
//
bool isAnalyseScoreBearish =
provider.analyseBearishScore > provider.analyseBullishScore;
//
bool isConsolidationScoreBullish =
provider.consolidationBullishScore > provider.consolidationBearishScore;
//
bool isConsolidationScoreBearish =
provider.consolidationBearishScore > provider.consolidationBullishScore;
//
bool isVisionScoreBullish =
provider.visionBullishScore > provider.visionBearishScore;
//
bool isVisionScoreBearish =
provider.visionBearishScore > provider.visionBullishScore;
// //
int count = CountWaitingZones(); int count = CountWaitingZones();
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
@@ -764,56 +823,112 @@ struct X121SMCStrategyXWZWorkingZone
bool isBullish = iOBFVG.IsBullish(); bool isBullish = iOBFVG.IsBullish();
// //
XBoxZone iBox; int fvgsCount = iOBFVG.CountFVGs();
result = iOBFVG.ToZone(iBox); bool has = IsValidSize(fvgsCount);
if (!result) if (has)
{ {
// //
iBox.Clean(); for (int j = 0; j < fvgsCount; j++)
iOBFVG.Clean(); {
//
XCFVG *jFVG = iOBFVG.fvgs[j];
// //
continue; XBoxZone iBox;
} has = ToBox(
iBox,
jFVG //
);
if (has)
{
//
double iRange = iBox.lower + ((iBox.upper - iBox.lower) / 2);
// //
// XCFVG *fvg; // Activate Zone Using PV ...
// result = iOBFVG.GetMainFVG(fvg); bool isPVPassed =
// if (!result)
// {
// //
// iOBFVG.Clean();
// ZeroMemory(fvg);
// //
// continue;
// }
//
result =
isBullish isBullish
? vale < iBox.upper && ? vale < iBox.upper &&
vale > iBox.lower vale > iBox.lower
: peak < iBox.upper && : peak < iBox.upper &&
peak > iBox.lower; peak > iBox.lower;
bool isPV50Passed =
isBullish
? vale < iBox.upper &&
vale < iRange &&
vale > iBox.lower
: peak < iBox.upper &&
peak < iRange &&
peak > iBox.lower;
//
// Activate Zone using Rejection ...
bool isRejected =
isBullish
? bar.low <= iBox.upper &&
bar.GetDown() > iBox.upper
: bar.high >= iBox.lower &&
bar.GetUp() < iBox.lower;
//
// Combine Result ...
result = isPV50Passed;
// || isPV50Passed
// || isRejected;
if (result) if (result)
{ {
// //
zone = iOBFVG; fvgIDX = j;
iBox.Clean();
zoneIDX = i;
//
break;
}
}
//
if (result)
{
//
iBox.Clean();
ZeroMemory(jFVG);
//
break; break;
} }
// //
iBox.Clean(); iBox.Clean();
}
}
//
if (result)
{
//
iOBFVG.Clean();
break;
}
//
iOBFVG.Clean(); iOBFVG.Clean();
} }
// //
result = zone.IsValid(); result =
IsValidIndex(fvgIDX) &&
IsValidIndex(zoneIDX);
// //
bar.Clean(); bar.Clean();
//
if (result)
{
bar.Clean();
}
// //
return result; return result;
} }
@@ -1466,6 +1581,7 @@ struct X121SMCStrategyXWZWorkingZone
iObjects, iObjects,
true, // Draw Order Block ... true, // Draw Order Block ...
true, // Draw Fair Value Gaps ... true, // Draw Fair Value Gaps ...
true, // Draw All Fair Value Gaps ...
// //
true, // Draw OB StartedBar ... true, // Draw OB StartedBar ...
true, // Draw OB ActivatedBar ... true, // Draw OB ActivatedBar ...