Add support for Golden Zone inside XPV indicator and it's Helper ...

This commit is contained in:
2025-03-08 22:00:36 +03:30
parent e0e081628a
commit 3b7ce3816a
9 changed files with 682 additions and 132 deletions
@@ -653,7 +653,6 @@ class XC121SMCCycleHelper : public XCBase
color mVolumesColor = clrGreen; // volumes color
//
ChartSetInteger(chartId, CHART_MODE, mMode);
ChartSetInteger(chartId, CHART_SHOW_BID_LINE, mShowBidLine);
ChartSetInteger(chartId, CHART_SHOW_ASK_LINE, mShowAskLine);
ChartSetInteger(chartId, CHART_SHOW_GRID, mShowGrid);
@@ -663,16 +662,20 @@ class XC121SMCCycleHelper : public XCBase
ChartSetInteger(chartId, CHART_QUICK_NAVIGATION, mQuickNavigation);
ChartSetInteger(chartId, CHART_COLOR_FOREGROUND, mForeGroundColor);
ChartSetInteger(chartId, CHART_COLOR_BACKGROUND, mBackGroundColor);
ChartSetInteger(chartId, CHART_COLOR_CHART_UP, mUpColor);
ChartSetInteger(chartId, CHART_COLOR_CHART_DOWN, mDownColor);
ChartSetInteger(chartId, CHART_COLOR_CANDLE_BULL, mBullishColor);
ChartSetInteger(chartId, CHART_COLOR_CANDLE_BEAR, mBearishColor);
ChartSetInteger(chartId, CHART_COLOR_GRID, mGridColor);
ChartSetInteger(chartId, CHART_COLOR_BID, mBidLineColor);
ChartSetInteger(chartId, CHART_COLOR_ASK, mAskLineColor);
ChartSetInteger(chartId, CHART_COLOR_STOP_LEVEL, mStopColor);
ChartSetInteger(chartId, CHART_COLOR_CHART_LINE, mLineColor);
ChartSetInteger(chartId, CHART_COLOR_VOLUME, mVolumesColor);
//
// For Enabling XCC ...
// ChartSetInteger(chartId, CHART_MODE, mMode);
// ChartSetInteger(chartId, CHART_COLOR_CHART_UP, mUpColor);
// ChartSetInteger(chartId, CHART_COLOR_CHART_DOWN, mDownColor);
// ChartSetInteger(chartId, CHART_COLOR_CANDLE_BULL, mBullishColor);
// ChartSetInteger(chartId, CHART_COLOR_CANDLE_BEAR, mBearishColor);
// ChartSetInteger(chartId, CHART_COLOR_CHART_LINE, mLineColor);
}
//
@@ -63,6 +63,7 @@ class XC121SMCExpert : public XCBaseExpert
// Constructor(s) ...
XC121SMCExpert()
{
mShowCandles = false;
}
//
@@ -1185,6 +1186,7 @@ class XC121SMCExpert : public XCBaseExpert
//
X121XCCInputs xccInputs;
xccInputs.Default();
xccInputs.showCandles = mShowCandles;
xccHelper = new XCX121XCCHelper();
result = xccHelper.Init(
_Symbol,
@@ -1905,6 +1907,9 @@ class XC121SMCExpert : public XCBaseExpert
//
// Props ...
//
bool mShowCandles; // Show Candles ...
//
// Signalling Props ...
bool mAllowLong; // Allow Long Signals ...
@@ -282,29 +282,30 @@ class XCX121SMCXWZSignalDetector : public XCBase
// Detect Signal Box ...
//
// TODO: Check This ...
// bool isZoneActivated =
// hasWorkingZone &&
// hasWaitingZones &&
// workingZone.IsZoneActivated(
// activatedZoneIDX,
// activatedFVGIDX,
// provider,
// zIndex //
// );
//
hasSignalBox =
bool isZoneActivated =
hasWorkingZone &&
hasWaitingBoxes &&
workingZone.IsBoxActivated(
signalBox,
hasWaitingZones &&
workingZone.IsZoneActivated(
activatedZoneIDX,
activatedFVGIDX,
signalBoxDir,
signalProvider,
provider,
zIndex //
);
//
// hasSignalBox =
// hasWorkingZone &&
// hasWaitingBoxes &&
// workingZone.IsBoxActivated(
// signalBox,
// signalBoxDir,
// signalProvider,
// provider,
// zIndex //
// );
//
if (hasSignalBox)
{
+86 -79
View File
@@ -470,8 +470,7 @@ struct X121SMCStrategyXWZWorkingZone
//
// Detect OB FVG ...
if (false &&
hasNewOrderBlock)
if (hasNewOrderBlock)
{
//
XOHCL obStartedBar;
@@ -483,8 +482,7 @@ struct X121SMCStrategyXWZWorkingZone
);
//
has = isOBStarted &&
isOBStartedBodyOut;
has = isOBStarted;
if (has)
{
//
@@ -534,21 +532,21 @@ struct X121SMCStrategyXWZWorkingZone
ob //
)
//
||
//
(isBullish
? IsAboveDiff(
iFVG,
ob,
true // Ignore Inside ...
)
: IsBelowDiff(
iFVG,
ob,
true // Ignore Inside ...
)
//
)
// ||
// //
// (isBullish
// ? IsAboveDiff(
// iFVG,
// ob,
// true // Ignore Inside ...
// )
// : IsBelowDiff(
// iFVG,
// ob,
// true // Ignore Inside ...
// )
// //
// )
//
;
@@ -611,86 +609,91 @@ struct X121SMCStrategyXWZWorkingZone
//
//
// Check New Order Block Detection Analyse ...
XBoxZone analyseOBBox;
XCOrderBlock *analyseOB = NULL;
bool hasNewAnalyseOrderBlock =
Contains(
X_BULLISH_ORDERBLOCK_DETECTED,
provider
.analysePoiEvents //
) ||
Contains(
X_BEARISH_ORDERBLOCK_DETECTED,
provider
.analysePoiEvents //
);
if (hasNewAnalyseOrderBlock)
bool lookingOthers = false;
if (lookingOthers)
{
//
idx = GetYoungest(provider
.analyseState
.orderBlocks //
);
has = IsValidIndex(idx);
if (has)
// Check New Order Block Detection Analyse ...
XBoxZone analyseOBBox;
XCOrderBlock *analyseOB = NULL;
bool hasNewAnalyseOrderBlock =
Contains(
X_BULLISH_ORDERBLOCK_DETECTED,
provider
.analysePoiEvents //
) ||
Contains(
X_BEARISH_ORDERBLOCK_DETECTED,
provider
.analysePoiEvents //
);
if (hasNewAnalyseOrderBlock)
{
//
analyseOB = provider
.analyseState
.orderBlocks[idx];
has = ToBox(
analyseOBBox,
analyseOB //
idx = GetYoungest(provider
.analyseState
.orderBlocks //
);
has = IsValidIndex(idx);
if (has)
{
//
analyseOB.To(cTime);
analyseOBBox.to = cTime;
hasNewAnalyseOrderBlock = analyseOBBox.IsValid();
analyseOB = provider
.analyseState
.orderBlocks[idx];
has = ToBox(
analyseOBBox,
analyseOB //
);
if (has)
{
//
analyseOB.To(cTime);
analyseOBBox.to = cTime;
hasNewAnalyseOrderBlock = analyseOBBox.IsValid();
}
}
}
}
//
// Checking Analyse Order Block ...
if (hasNewAnalyseOrderBlock)
{
//
XOHCL obStartedBar;
bool isOBStartedBodyOut = false;
bool isOBStarted = analyseOB.IsStarted(
analyseOB.GetDirection(),
obStartedBar,
isOBStartedBodyOut //
);
//
has = isOBStarted &&
isOBStartedBodyOut;
if (has)
// Checking Analyse Order Block ...
if (hasNewAnalyseOrderBlock)
{
//
analyseOBBox.from =
obStartedBar.NextAt();
XOHCL obStartedBar;
bool isOBStartedBodyOut = false;
bool isOBStarted = analyseOB.IsStarted(
analyseOB.GetDirection(),
obStartedBar,
isOBStartedBodyOut //
);
//
has = IsExists(analyseOBBox);
if (!has)
has = isOBStarted &&
isOBStartedBodyOut;
if (has)
{
//
AddRef(
analyseOBBox,
waitingBoxes //
);
analyseOBBox.from =
obStartedBar.NextAt();
//
has = IsExists(analyseOBBox);
if (!has)
{
//
AddRef(
analyseOBBox,
waitingBoxes //
);
}
}
}
}
//
analyseOBBox.Clean();
ZeroMemory(analyseOB);
//
analyseOBBox.Clean();
ZeroMemory(analyseOB);
}
//
//
@@ -1051,10 +1054,14 @@ struct X121SMCStrategyXWZWorkingZone
//
// Combine Result ...
result = isPVPassed;
// result = isPVPassed;
// || isPVPassed
// || isPV50Passed
// || isRejected;
//
result = isPVPassed;
if (result)
{
//
@@ -762,16 +762,17 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
//
// XPV ...
x121Inputs.xpvInputs.showSar = showAll || false;
x121Inputs.xpvInputs.showSar = showAll || true;
x121Inputs.xpvInputs.showPeaks = showAll || true;
x121Inputs.xpvInputs.showVales = showAll || true;
x121Inputs.xpvInputs.showGoldenZones = showAll || true;
//
// XHK ...
//
x121Inputs.xhkInputs.drawRawXHKCandles = showAll || false;
x121Inputs.xhkInputs.drawSmoothedXHKCandles = showAll || false;
x121Inputs.xhkInputs.drawSmoothedXHKCandles = showAll || true;
//
// XATR ...
@@ -806,9 +807,9 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
//
// X3MA ...
x121Inputs.x3maInputs.showX3MaFast = showAll || true;
x121Inputs.x3maInputs.showX3MaMid = showAll || true;
x121Inputs.x3maInputs.showX3MaSlow = showAll || true;
x121Inputs.x3maInputs.showX3MaFast = showAll || false;
x121Inputs.x3maInputs.showX3MaMid = showAll || false;
x121Inputs.x3maInputs.showX3MaSlow = showAll || false;
//
// Initialize Cycle Helpers ...