This commit is contained in:
2025-03-18 23:41:12 +03:30
parent 3e82c26a3d
commit 9f0ebd1afe
6 changed files with 1328 additions and 1327 deletions
File diff suppressed because it is too large Load Diff
@@ -224,7 +224,7 @@ class XCX121SMCXWZSignalDetector : public XCBase
// Detectiong Signal Boxes ...
hasWaitingBoxes = workingZone
.DetectSignalBoxes(
X_CYCLE_ANALYSE,
X_CYCLE_DECISION,
provider,
zIndex //
);
@@ -464,58 +464,59 @@ class XCX121SMCXWZSignalDetector : public XCBase
//
// Select and Provide SL Based on ...
double iAtr = 0;
if (signalProvider == X121SMC_XWZ_PROVIDER_ACTIVATED_MA)
if (signalProvider == X121SMC_XWZ_PROVIDER_XHKMA)
{
//
iAtr = provider.decisionXConditions.atrBuffer[1];
iAtr *= 1.5;
iAtr *= 0;
}
else if (signalProvider == X121SMC_XWZ_PROVIDER_ACTIVATED_BOX)
{
//
iAtr = provider.decisionXConditions.atrBuffer[1];
iAtr *= 1.5;
// else
// if (signalProvider == X121SMC_XWZ_PROVIDER_ACTIVATED_BOX)
// {
// //
// iAtr = provider.decisionXConditions.atrBuffer[1];
// iAtr *= 1.5;
// //
// 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;
}
// // //
// // 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;
// }
//
// Select Condition SL ...
+308 -93
View File
@@ -31,10 +31,7 @@
enum ENUM_X121SMC_XWZ_PROVIDERS
{
X121SMC_XWZ_PROVIDER_NONE,
X121SMC_XWZ_PROVIDER_PVHK,
X121SMC_XWZ_PROVIDER_ACTIVATED_MA,
X121SMC_XWZ_PROVIDER_ACTIVATED_BOX,
X121SMC_XWZ_PROVIDER_ACTIVATED_AREA,
X121SMC_XWZ_PROVIDER_XHKMA,
};
//
@@ -478,6 +475,11 @@ struct X121SMCStrategyXWZWorkingZone
//
bool result = false;
//
int idx = -1;
int count = 0;
bool has = false;
//
if (barIndex < 0)
{
@@ -487,12 +489,14 @@ struct X121SMCStrategyXWZWorkingZone
//
// Select Cycle ...
XPOIState cState;
XPOIStateEvents cStateEvents;
X121Conditions cXConditions;
XC121SMCCycleHelper *cHelper;
X121SMCCycleConditions cConditions;
result = provider.SelectCycle(
cycle,
cState,
cStateEvents,
cXConditions,
cHelper,
cConditions //
@@ -503,6 +507,7 @@ struct X121SMCStrategyXWZWorkingZone
cState.Clean();
ZeroMemory(cHelper);
cConditions.Clean();
cStateEvents.Clean();
cXConditions.Clean();
//
@@ -510,30 +515,231 @@ struct X121SMCStrategyXWZWorkingZone
}
//
// Select Validate Rejection Boxes ...
XBoxZone rejections[];
int count = cHelper
.DetectRejections(
rejections,
barIndex //
);
// Select Rejection Boxes ...
// //
// // Select Validate Rejection Boxes ...
// XBoxZone rejections[];
// int count = cHelper
// .DetectRejections(
// rejections,
// barIndex //
// );
// //
// result = IsValidSize(count);
// if (result)
// {
// //
// for (int i = 0; i < count; i++)
// {
// //
// has = IsExists(rejections[i]);
// if (!has)
// {
// //
// AddRef(
// rejections[i],
// waitingBoxes //
// );
// }
// }
// }
//
result = IsValidSize(count);
if (result)
// Select Order Blocks ...
// if (cStateEvents.hasNewOrderBlock)
// {
// //
// idx = GetYoungest(cState.orderBlocks);
// has = IsValidIndex(idx);
// if (has)
// {
// //
// XCOrderBlock *iOB = cState.orderBlocks[idx];
// //
// XBoxZone iBox;
// has = ToBox(
// iBox,
// iOB //
// );
// if (has)
// {
// //
// has = IsExists(iBox);
// if (!has)
// {
// //
// AddRef(
// iBox,
// waitingBoxes //
// );
// }
// }
// }
// }
//
// Select Fair Value Gaps ...
// if (cStateEvents.hasNewFairValueGap)
// {
// //
// idx = GetYoungest(cState.fairValueGaps);
// has = IsValidIndex(idx);
// if (has)
// {
// //
// XCFVG *iOB = cState.fairValueGaps[idx];
// //
// XBoxZone iBox;
// has = ToBox(
// iBox,
// iOB //
// );
// if (has)
// {
// //
// has = IsExists(iBox);
// if (!has)
// {
// //
// AddRef(
// iBox,
// waitingBoxes //
// );
// }
// }
// }
// }
//
// Select Supply/Demand Zones ...
// if (cStateEvents.hasNewSupplyZone)
// {
// //
// idx = GetYoungest(cState.supplyZones);
// has = IsValidIndex(idx);
// if (has)
// {
// //
// XCSupplyZone *iSupply = cState.supplyZones[idx];
// //
// XBoxZone iBox;
// has = ToBox(
// iBox,
// iSupply //
// );
// if (has)
// {
// //
// has = IsExists(iBox);
// if (!has)
// {
// //
// AddRef(
// iBox,
// waitingBoxes //
// );
// }
// }
// }
// }
// if (cStateEvents.hasNewDemandZone)
// {
// //
// idx = GetYoungest(cState.demandZones);
// has = IsValidIndex(idx);
// if (has)
// {
// //
// XCDemandZone *iDemand = cState.demandZones[idx];
// //
// XBoxZone iBox;
// has = ToBox(
// iBox,
// iDemand //
// );
// if (has)
// {
// //
// has = IsExists(iBox);
// if (!has)
// {
// //
// AddRef(
// iBox,
// waitingBoxes //
// );
// }
// }
// }
// }
//
// Select Support/Resistance Zones ...
if (cStateEvents.hasNewSupportZone)
{
//
for (int i = 0; i < count; i++)
idx = GetYoungest(cState.supportZones);
has = IsValidIndex(idx);
if (has)
{
//
bool has = IsExists(rejections[i]);
if (!has)
XCSupportZone *iSupport = cState.supportZones[idx];
//
XBoxZone iBox;
has = ToBox(
iBox,
iSupport //
);
if (has)
{
//
AddRef(
rejections[i],
waitingBoxes //
);
has = IsExists(iBox);
if (!has)
{
//
AddRef(
iBox,
waitingBoxes //
);
}
}
}
}
if (cStateEvents.hasNewResistanceZone)
{
//
idx = GetYoungest(cState.resistanceZones);
has = IsValidIndex(idx);
if (has)
{
//
XCResistanceZone *iResistance = cState.resistanceZones[idx];
//
XBoxZone iBox;
has = ToBox(
iBox,
iResistance //
);
if (has)
{
//
has = IsExists(iBox);
if (!has)
{
//
AddRef(
iBox,
waitingBoxes //
);
}
}
}
}
@@ -550,6 +756,7 @@ struct X121SMCStrategyXWZWorkingZone
ZeroMemory(cHelper);
cConditions.Clean();
cXConditions.Clean();
cStateEvents.Clean();
//
return result;
@@ -765,6 +972,13 @@ struct X121SMCStrategyXWZWorkingZone
return result;
}
/**
* Detect Trend Based On Boxes ...
*
* @param dir: ENUM_X_DIRECTION ember ...
*
* @return ( bool )
*/
bool DetectTreand(
ENUM_X_DIRECTION &dir //
)
@@ -1014,6 +1228,7 @@ struct X121SMCStrategyXWZWorkingZone
box,
holderBox,
dir,
waitingBoxes,
provider,
X_CYCLE_ANALYSE,
barIndex //
@@ -1032,7 +1247,7 @@ struct X121SMCStrategyXWZWorkingZone
//
if (isSenario1Happend)
{
signalProvider = X121SMC_XWZ_PROVIDER_PVHK;
signalProvider = X121SMC_XWZ_PROVIDER_XHKMA;
}
}
@@ -1045,50 +1260,50 @@ struct X121SMCStrategyXWZWorkingZone
bool isSenario2Happend = false;
bool isSenario2Bullish = false;
bool isSenario2Bearish = false;
if (useSenario2)
{
//
// Senario 2 Working Based on
// Breaked Boxes ...
// Since we Works only
// when Has UnAvailable Boxes ...
has = HasBreakedBoxes();
if (has)
{
//
ENUM_X_DIRECTION overalTrend;
bool hasTrend = DetectOveralDirection(overalTrend);
// if (useSenario2)
// {
// //
// // Senario 2 Working Based on
// // Breaked Boxes ...
// // Since we Works only
// // when Has UnAvailable Boxes ...
// has = HasBreakedBoxes();
// if (has)
// {
// //
// ENUM_X_DIRECTION overalTrend;
// bool hasTrend = DetectOveralDirection(overalTrend);
if (hasTrend)
{
//
isSenario2Happend = cParser.HasSenario2Conditions(
X_CYCLE_DECISION,
breakedBoxes,
box,
dir,
provider,
barIndex //
);
// if (hasTrend)
// {
// //
// isSenario2Happend = cParser.HasSenario2Conditions(
// X_CYCLE_DECISION,
// breakedBoxes,
// box,
// dir,
// provider,
// barIndex //
// );
//
isSenario2Bullish =
isSenario2Happend &&
IsBullish(dir);
// //
// isSenario2Bullish =
// isSenario2Happend &&
// IsBullish(dir);
//
isSenario2Bearish =
isSenario2Happend &&
IsBearish(dir);
// //
// isSenario2Bearish =
// isSenario2Happend &&
// IsBearish(dir);
//
if (isSenario2Happend)
{
signalProvider = X121SMC_XWZ_PROVIDER_ACTIVATED_BOX;
}
}
}
}
// //
// if (isSenario2Happend)
// {
// signalProvider = X121SMC_XWZ_PROVIDER_ACTIVATED_BOX;
// }
// }
// }
// }
//
// Senario 3:
@@ -1098,9 +1313,9 @@ struct X121SMCStrategyXWZWorkingZone
bool isSenario3Happend = false;
bool isSenario3Bullish = false;
bool isSenario3Bearish = false;
if (useSenario3)
{
}
// if (useSenario3)
// {
// }
//
// Senario 4:
@@ -1111,35 +1326,35 @@ struct X121SMCStrategyXWZWorkingZone
bool isSenario4Happend = false;
bool isSenario4Bullish = false;
bool isSenario4Bearish = false;
if (useSenario4)
{
//
isSenario4Happend = cParser.HasSenario4Conditions(
X_CYCLE_ANALYSE,
box,
holderBox,
dir,
provider,
X_CYCLE_CONSOLIDATION,
barIndex //
);
// if (useSenario4)
// {
// //
// isSenario4Happend = cParser.HasSenario4Conditions(
// X_CYCLE_ANALYSE,
// box,
// holderBox,
// dir,
// provider,
// X_CYCLE_CONSOLIDATION,
// barIndex //
// );
//
isSenario4Bullish =
isSenario4Happend &&
IsBullish(dir);
// //
// isSenario4Bullish =
// isSenario4Happend &&
// IsBullish(dir);
//
isSenario4Bearish =
isSenario4Happend &&
IsBearish(dir);
// //
// isSenario4Bearish =
// isSenario4Happend &&
// IsBearish(dir);
//
if (isSenario4Happend)
{
signalProvider = X121SMC_XWZ_PROVIDER_ACTIVATED_BOX;
}
}
// //
// if (isSenario4Happend)
// {
// signalProvider = X121SMC_XWZ_PROVIDER_ACTIVATED_BOX;
// }
// }
//
// Senario 5:
@@ -1149,9 +1364,9 @@ struct X121SMCStrategyXWZWorkingZone
bool isSenario5Happend = false;
bool isSenario5Bullish = false;
bool isSenario5Bearish = false;
if (useSenario5)
{
}
// if (useSenario5)
// {
// }
//
// Summarize All Senario(s) Conditions ...
+13 -13
View File
@@ -786,27 +786,27 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
//
// XPV ...
x121Inputs.xpvInputs.showSar = showAll || true;
x121Inputs.xpvInputs.showPeaks = showAll || true;
x121Inputs.xpvInputs.showVales = showAll || true;
x121Inputs.xpvInputs.showSupports = showAll || true;
x121Inputs.xpvInputs.showResistances = showAll || true;
x121Inputs.xpvInputs.showGoldenZones = showAll || true;
x121Inputs.xpvInputs.showSar = showAll || false;
x121Inputs.xpvInputs.showPeaks = showAll || false;
x121Inputs.xpvInputs.showVales = showAll || false;
x121Inputs.xpvInputs.showSupports = showAll || false;
x121Inputs.xpvInputs.showResistances = showAll || false;
x121Inputs.xpvInputs.showGoldenZones = showAll || false;
//
// XHK ...
//
x121Inputs.xhkInputs.drawRawXHKCandles = showAll || false;
x121Inputs.xhkInputs.drawSmoothedXHKCandles = showAll || true;
x121Inputs.xhkInputs.drawSmoothedXHKCandles = showAll || false;
//
// XMAS ...
//
x121Inputs.xmasInputs.showUpper = showAll || true;
x121Inputs.xmasInputs.showMid = showAll || true;
x121Inputs.xmasInputs.showLower = showAll || true;
x121Inputs.xmasInputs.showUpper = showAll || false;
x121Inputs.xmasInputs.showMid = showAll || false;
x121Inputs.xmasInputs.showLower = showAll || false;
//
// XATR ...
@@ -841,9 +841,9 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
//
// X3MA ...
x121Inputs.x3maInputs.showX3MaFast = showAll || false;
x121Inputs.x3maInputs.showX3MaMid = showAll || false;
x121Inputs.x3maInputs.showX3MaSlow = showAll || false;
x121Inputs.x3maInputs.showX3MaFast = showAll || true;
x121Inputs.x3maInputs.showX3MaMid = showAll || true;
x121Inputs.x3maInputs.showX3MaSlow = showAll || true;
//
// Initialize Cycle Helpers ...