This commit is contained in:
2025-03-23 03:46:13 +03:30
parent a84b0befe2
commit c49abe21db
10 changed files with 4204 additions and 2932 deletions
@@ -172,9 +172,8 @@ class XCX121SMCXWZSignalDetector : public XCBase
double point = 0;
double targets[];
double reward = 0;
XBoxZone signalBox;
XSignalBox signalBox;
bool hasTrend = false;
XBoxZone signalHolderBox;
bool hasPriority = false;
double amountPercent = -1;
bool hasSignalBox = false;
@@ -279,18 +278,14 @@ class XCX121SMCXWZSignalDetector : public XCBase
//
// Draw Working Zone ...
if (hasWorkingZone)
{
workingZone.Draw(
drawer,
//
workingZone.Draw(
drawer,
//
true, // Draw Supply Zone ...
true, // Draw Demand Zone ...
true, // Draw Waiting Zones ...
true // Draw Trend ...
);
}
false, // Draw Supply Zone ...
false, // Draw Demand Zone ...
true, // Draw Waiting Zones ...
false // Draw Trend ...
);
//
// Detect Signal Box ...
@@ -298,7 +293,6 @@ class XCX121SMCXWZSignalDetector : public XCBase
hasWorkingZone &&
workingZone.DetectSignalConditions(
signalBox,
signalHolderBox,
signalBoxDir,
signalProvider,
provider,
@@ -306,6 +300,10 @@ class XCX121SMCXWZSignalDetector : public XCBase
);
//
// Remove Signal Box form
// Waiting Boxes and Breaked Boxes
// if Exists on them, then add it to
// UnAvailable Boxes ...
if (hasSignalBox)
{
//
@@ -355,6 +353,13 @@ class XCX121SMCXWZSignalDetector : public XCBase
);
}
}
//
// Adding to UnAvailable Box ...
AddRef(
signalBox,
workingZone.unavailableBoxes //
);
}
//
@@ -367,27 +372,30 @@ class XCX121SMCXWZSignalDetector : public XCBase
{
//
signalBox.Clean();
signalHolderBox.Clean();
signalBoxDir = X_DIRECTION_NONE;
}
//
// Check Priority Exists ...
hasPriority = workingZone
.DetectPriority(
priority,
signalBoxDir,
zIndex,
period //
);
hasPriority =
hasWorkingZone &&
workingZone
.DetectPriority(
priority,
signalBoxDir,
zIndex,
period //
);
//
// Check Price Reward and Amount Exists ...
hasRewardAmount = CalculateRiskReward(
priority,
reward,
amountPercent //
);
hasRewardAmount =
hasWorkingZone &&
CalculateRiskReward(
priority,
reward,
amountPercent //
);
//
// Check Signal Conditions ...
@@ -399,37 +407,22 @@ class XCX121SMCXWZSignalDetector : public XCBase
//
// Draw Signal Box ...
XCBoxObject *iSignalBoxObj;
has = drawer.DrawBox(
XCBaseObject *objects[];
has = drawer.DrawSignalBox(
signalBox,
iSignalBoxObj //
objects,
clrYellow //
);
if (has)
{
//
iSignalBoxObj.BoxWidth(1);
iSignalBoxObj.BoxColor(clrYellow);
iSignalBoxObj.BoxStyle(STYLE_SOLID);
//
workingZone.mDrawnObjects.Add(iSignalBoxObj);
}
//
// Draw Signal Holder Box if Exists ...
if (signalHolderBox.IsValid())
{
//
XCBoxObject *iSignalHolderBoxObj;
has = drawer.DrawBox(
signalHolderBox,
iSignalHolderBoxObj //
);
if (has)
int count = ArraySize(objects);
for (int i = 0; i < count; i++)
{
workingZone.mDrawnObjects.Add(iSignalHolderBoxObj);
workingZone.mDrawnObjects.Add(objects[i]);
}
}
Clean(objects);
//
// Detect Signal Direction ...
@@ -438,17 +431,17 @@ class XCX121SMCXWZSignalDetector : public XCBase
//
pivot = isBullish
? signalBox.lower
: signalBox.upper;
? signalBox.ob.lower
: signalBox.ob.upper;
//
point = isBullish
? signalBox.upper
: signalBox.lower;
? signalBox.ob.upper
: signalBox.ob.lower;
//
double entry = GetEntry(
signalBox.symbol,
signalBox.ob.symbol,
signalBoxDir //
);
@@ -471,41 +464,12 @@ class XCX121SMCXWZSignalDetector : public XCBase
//
// Select and Provide SL Based on ...
double iAtr = 0;
if (signalProvider == X121SMC_XWZ_PROVIDER_XHKMA)
if (signalProvider == X121SMC_XWZ_PROVIDER_XREJECTED_BOX)
{
//
iAtr = provider.decisionXConditions.atrBuffer[1];
iAtr *= 0;
//
// Prepare Box fro SL ...
iSL = pivot;
Add(
iSL,
sls //
);
//
// Fix rf Reward ...
rfRewar = 2;
}
else if (signalProvider == X121SMC_XWZ_PROVIDER_XREJECTED_BOX)
{
//
iAtr = provider.decisionXConditions.atrBuffer[1];
iAtr *= 0;
//
Clean(sls);
//
// Prepare Box fro SL ...
iSL = signalBox.lower + ((signalBox.upper - signalBox.lower) / 2);
Add(
iSL,
sls //
);
//
// Fix rf Reward ...
rfRewar = 2;
@@ -900,7 +864,7 @@ class XCX121SMCXWZSignalDetector : public XCBase
mConditions.setupTime = cTime;
mConditions.dir = signalBoxDir;
mConditions.priority = priority;
mConditions.signalBox = signalBox;
mConditions.signalBox = signalBox.ob;
mConditions.provider = signalProvider;
mConditions.amountPercent = amountPercent;
}
@@ -921,7 +885,6 @@ class XCX121SMCXWZSignalDetector : public XCBase
//
signalBox.Clean();
signalHolderBox.Clean();
consolidationZBar.Clean();
//