apply some changes on signal senario 1 ...

This commit is contained in:
2025-03-09 22:42:47 +03:30
parent 202ae585dd
commit 09f7f9e27a
5 changed files with 1434 additions and 1443 deletions
File diff suppressed because it is too large Load Diff
+282 -266
View File
@@ -34,6 +34,8 @@ class XCX121SMCXWZSignalDetector : public XCBase
public:
//
// Props ...
bool useGuards;
bool useQuarterTargets;
X121SMCStrategyXWZWorkingZone workingZone;
X121SMCStrategyXWZSignalConditions mConditions;
X121SMCStrategyXWZSignalConditions mConditionsCollection[];
@@ -443,39 +445,39 @@ class XCX121SMCXWZSignalDetector : public XCBase
}
else if (signalProvider == X121SMC_XWZ_PROVIDER_ACTIVATED_BOX)
{
//
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 //
);
}
}
// //
// 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)
{
@@ -483,7 +485,7 @@ class XCX121SMCXWZSignalDetector : public XCBase
//
double iAtr = provider.decisionXConditions.atrBuffer[1];
iAtr *= 0;
iAtr *= 2;
//
// Select Condition SL ...
@@ -532,266 +534,271 @@ class XCX121SMCXWZSignalDetector : public XCBase
//
// Based On Priority ...
has = priority != X121SMC_XWZ_PRIORITY_NONE;
if (has)
useQuarterTargets = false;
if (useQuarterTargets)
{
//
switch (priority)
has = priority != X121SMC_XWZ_PRIORITY_NONE;
if (has)
{
//
case X121SMC_XWZ_PRIORITY_WEAK:
//
if (isBullish)
switch (priority)
{
//
// Weak ...
Add(
workingZone.supplyZone.Lower(),
targets //
);
}
else
{
//
// Weak ...
Add(
workingZone.demandZone.Upper(),
targets //
);
}
break;
//
case X121SMC_XWZ_PRIORITY_LOW:
//
if (isBullish)
{
case X121SMC_XWZ_PRIORITY_WEAK:
//
// Weak ...
Add(
workingZone.supplyZone.Lower(),
targets //
);
if (isBullish)
{
//
// Weak ...
Add(
workingZone.supplyZone.Lower(),
targets //
);
}
else
{
//
// Weak ...
Add(
workingZone.demandZone.Upper(),
targets //
);
}
break;
//
// Low ...
Add(
workingZone.quarter1,
targets //
);
}
else
{
//
// Weak ...
Add(
workingZone.demandZone.Upper(),
targets //
);
//
// Low ...
Add(
workingZone.quarter3,
targets //
);
}
break;
//
case X121SMC_XWZ_PRIORITY_REGULAR:
//
if (isBullish)
{
case X121SMC_XWZ_PRIORITY_LOW:
//
// Weak ...
Add(
workingZone.supplyZone.Lower(),
targets //
);
if (isBullish)
{
//
// Weak ...
Add(
workingZone.supplyZone.Lower(),
targets //
);
//
// Low ...
Add(
workingZone.quarter1,
targets //
);
//
// Low ...
Add(
workingZone.quarter1,
targets //
);
}
else
{
//
// Weak ...
Add(
workingZone.demandZone.Upper(),
targets //
);
//
// Regular ...
Add(
workingZone.quarter2,
targets //
);
}
else
{
//
// Weak ...
Add(
workingZone.demandZone.Upper(),
targets //
);
//
// Low ...
Add(
workingZone.quarter3,
targets //
);
}
break;
//
// Low ...
Add(
workingZone.quarter3,
targets //
);
//
// Regular ...
Add(
workingZone.quarter2,
targets //
);
}
break;
//
case X121SMC_XWZ_PRIORITY_HIGH:
//
if (isBullish)
{
case X121SMC_XWZ_PRIORITY_REGULAR:
//
// Weak ...
Add(
workingZone.supplyZone.Lower(),
targets //
);
if (isBullish)
{
//
// Weak ...
Add(
workingZone.supplyZone.Lower(),
targets //
);
//
// Low ...
Add(
workingZone.quarter1,
targets //
);
//
// Low ...
Add(
workingZone.quarter1,
targets //
);
//
// Regular ...
Add(
workingZone.quarter2,
targets //
);
//
// Regular ...
Add(
workingZone.quarter2,
targets //
);
}
else
{
//
// Weak ...
Add(
workingZone.demandZone.Upper(),
targets //
);
//
// High ...
Add(
workingZone.quarter3,
targets //
);
}
else
{
//
// Weak ...
Add(
workingZone.demandZone.Upper(),
targets //
);
//
// Low ...
Add(
workingZone.quarter3,
targets //
);
//
// Low ...
Add(
workingZone.quarter3,
targets //
);
//
// Regular ...
Add(
workingZone.quarter2,
targets //
);
}
break;
//
// Regular ...
Add(
workingZone.quarter2,
targets //
);
//
// High ...
Add(
workingZone.quarter1,
targets //
);
}
break;
//
case X121SMC_XWZ_PRIORITY_STRONG_HIGH:
//
if (isBullish)
{
case X121SMC_XWZ_PRIORITY_HIGH:
//
// Weak ...
Add(
workingZone.supplyZone.Lower(),
targets //
);
if (isBullish)
{
//
// Weak ...
Add(
workingZone.supplyZone.Lower(),
targets //
);
//
// Low ...
Add(
workingZone.quarter1,
targets //
);
//
// Low ...
Add(
workingZone.quarter1,
targets //
);
//
// Regular ...
Add(
workingZone.quarter2,
targets //
);
//
// Regular ...
Add(
workingZone.quarter2,
targets //
);
//
// High ...
Add(
workingZone.quarter3,
targets //
);
//
// High ...
Add(
workingZone.quarter3,
targets //
);
}
else
{
//
// Weak ...
Add(
workingZone.demandZone.Upper(),
targets //
);
//
// Low ...
Add(
workingZone.quarter3,
targets //
);
//
// Regular ...
Add(
workingZone.quarter2,
targets //
);
//
// High ...
Add(
workingZone.quarter1,
targets //
);
}
break;
//
case X121SMC_XWZ_PRIORITY_STRONG_HIGH:
//
// Strong High ...
Add(
workingZone.demandZone.Upper(),
targets //
);
if (isBullish)
{
//
// Weak ...
Add(
workingZone.supplyZone.Lower(),
targets //
);
//
// Low ...
Add(
workingZone.quarter1,
targets //
);
//
// Regular ...
Add(
workingZone.quarter2,
targets //
);
//
// High ...
Add(
workingZone.quarter3,
targets //
);
//
// Strong High ...
Add(
workingZone.demandZone.Upper(),
targets //
);
}
else
{
//
// Weak ...
Add(
workingZone.demandZone.Upper(),
targets //
);
//
// Low ...
Add(
workingZone.quarter3,
targets //
);
//
// Regular ...
Add(
workingZone.quarter2,
targets //
);
//
// High ...
Add(
workingZone.quarter1,
targets //
);
//
// Strong High ...
Add(
workingZone.supplyZone.Lower(),
targets //
);
}
break;
}
else
{
//
// Weak ...
Add(
workingZone.demandZone.Upper(),
targets //
);
//
// Low ...
Add(
workingZone.quarter3,
targets //
);
//
// Regular ...
Add(
workingZone.quarter2,
targets //
);
//
// High ...
Add(
workingZone.quarter1,
targets //
);
//
// Strong High ...
Add(
workingZone.supplyZone.Lower(),
targets //
);
}
break;
}
}
}
@@ -967,6 +974,12 @@ class XCX121SMCXWZSignalDetector : public XCBase
//
bool result = false;
//
if (!useGuards)
{
return result;
}
//
Clean(guards);
@@ -1653,6 +1666,9 @@ class XCX121SMCXWZSignalDetector : public XCBase
*/
void Init()
{
//
useGuards = true;
useQuarterTargets = true;
}
/**
+22 -826
View File
@@ -924,38 +924,7 @@ struct X121SMCStrategyXWZWorkingZone
bool isBearish = false;
//
XOHCL zBar;
XOHCL cBar;
XOHCL pBar;
//
// Initial Bars ...
result = zBar.Init(
symbol,
period,
barIndex //
);
result =
result &&
zBar.GetPreviousBar(cBar);
result =
result &&
cBar.GetPreviousBar(pBar);
if (!result)
{
//
zBar.Clean();
cBar.Clean();
pBar.Clean();
//
return result;
}
//
// Detecting Signal Conditions ...
X121SMCStrategyConditionParser decisionParser;
decisionParser.Parse(provider.decisionXConditions);
X121SMCStrategyConditionParser cParser;
//
// Senario 1:
@@ -967,405 +936,30 @@ struct X121SMCStrategyXWZWorkingZone
if (useSenario1)
{
//
// Senario 1 Bullish Conditions ...
isSenario1Happend = cParser.HasSenario1Conditions(
X_CYCLE_DECISION,
box,
holderBox,
dir,
provider,
X_CYCLE_ANALYSE,
barIndex //
);
//
isSenario1Bullish =
//
// X3Ma / XVwap Switched To Bulish ...
(
//
// X3Ma Switched To Bulish ...
(
//
(provider.decisionXConditions.isX3MaFastCrossedOverMid &&
decisionParser.isX3MaBullishStateUnderValesGoldenZone)
//
)
//
||
//
// XVWap Switched To Bulish ...
(
//
(provider.decisionXConditions.isVWapFastCrossedOverMid &&
decisionParser.isVWapBullishStateUnderValesGoldenZone)
//
)
//
)
//
&&
//
// Checking other Conditions ...
(
//
// XSTR ...
provider.decisionXConditions.isStrBullish &&
//
// XCHE ...
provider.decisionXConditions.isCheBullish &&
provider.decisionXConditions.le1Buffer[cIDX] < cBar.low &&
provider.decisionXConditions.le2Buffer[cIDX] < cBar.low
//
)
//
;
isSenario1Happend &&
IsBullish(dir);
//
// Senario 1 Bearish Conditions ...
isSenario1Bearish =
//
// X3Ma / XVwap Switched To Bearish ...
(
//
// X3Ma Switched To Bearish ...
(
//
(provider.decisionXConditions.isX3MaFastCrossedUnderMid &&
decisionParser.isX3MaBearishStateOverPeaksGoldenZone)
//
)
//
||
//
// XVWap Switched To Bearish ...
(
//
(provider.decisionXConditions.isVWapFastCrossedUnderMid &&
decisionParser.isVWapBearishStateOverPeaksGoldenZone)
//
)
//
)
//
&&
//
// Checking other Conditions ...
(
//
// XSTR ...
provider.decisionXConditions.isStrBearish &&
//
// XCHE ...
provider.decisionXConditions.isCheBearish &&
provider.decisionXConditions.se1Buffer[cIDX] > cBar.high &&
provider.decisionXConditions.se2Buffer[cIDX] > cBar.high
//
)
//
;
isSenario1Happend &&
IsBearish(dir);
//
// Filling Requirements using Senario 1 ...
isSenario1Happend =
isSenario1Bullish ||
isSenario1Bearish;
if (isSenario1Happend)
{
//
dir =
isSenario1Bullish
? X_DIRECTION_BULLISH
: X_DIRECTION_BEARISH;
//
box.dir = dir;
box.to = TimeCurrent();
box.symbol = provider
.decisionXConditions
.symbol;
box.period = provider
.decisionXConditions
.period;
//
int fromIDX = -1;
if (isSenario1Bullish)
{
//
double vale = provider
.decisionXConditions
.valesBuffer[cIDX];
//
box.lower = vale;
//
box.upper = provider
.decisionXConditions
.valesGoldenBuffer[cIDX];
//
int lowerValeIDX = -1;
double lowerVale = provider
.decisionCycleHelper
.mX121Helper
.xpvHelper
.GetLowerVale(
lowerValeIDX,
vale,
cBar.Index() //
);
//
int higherValeIDX = -1;
double higherVale = provider
.decisionCycleHelper
.mX121Helper
.xpvHelper
.GetHigherVale(
higherValeIDX,
vale,
cBar.Index() //
);
//
if (IsValidIndex(lowerValeIDX) &&
IsValidIndex(higherValeIDX))
{
//
fromIDX =
lowerValeIDX < higherValeIDX
? lowerValeIDX
: higherValeIDX;
}
else if (IsValidIndex(lowerValeIDX) &&
!IsValidIndex(higherValeIDX))
{
//
fromIDX = lowerValeIDX;
}
else if (!IsValidIndex(lowerValeIDX) &&
IsValidIndex(higherValeIDX))
{
//
fromIDX = higherValeIDX;
}
}
else
{
//
double peak = provider
.decisionXConditions
.peaksBuffer[cIDX];
//
box.upper = peak;
//
box.lower = provider
.decisionXConditions
.peaksGoldenBuffer[cIDX];
//
int lowerPeakIDX = -1;
double lowerPeak = provider
.decisionCycleHelper
.mX121Helper
.xpvHelper
.GetLowerPeak(
lowerPeakIDX,
peak,
cBar.Index() //
);
//
int higherPeakIDX = -1;
double higherPeak = provider
.decisionCycleHelper
.mX121Helper
.xpvHelper
.GetHigherPeak(
higherPeakIDX,
peak,
cBar.Index() //
);
//
if (IsValidIndex(lowerPeakIDX) &&
IsValidIndex(higherPeakIDX))
{
//
fromIDX =
lowerPeakIDX < higherPeakIDX
? lowerPeakIDX
: higherPeakIDX;
}
else if (IsValidIndex(lowerPeakIDX) &&
!IsValidIndex(higherPeakIDX))
{
//
fromIDX = lowerPeakIDX;
}
else if (!IsValidIndex(lowerPeakIDX) &&
IsValidIndex(higherPeakIDX))
{
//
fromIDX = higherPeakIDX;
}
}
//
if (IsValidIndex(fromIDX))
{
//
box.from = iTime(
zBar.symbol,
zBar.period,
fromIDX //
);
}
else
{
box.from = pBar.time;
}
//
// Detect Holder Box ...
XBoxZone tmpBoxes[];
if (isSenario1Bullish)
{
//
// Demand Zones ...
XBoxZone tmp[];
ToBox(
provider.visionState.demandZones,
tmp //
);
Copy(
tmp,
tmpBoxes,
false //
);
Clean(tmp);
//
// Bullish Order Blocks ...
ToBox(
provider.visionState.bullishOrderBlocks,
tmp //
);
Copy(
tmp,
tmpBoxes,
false //
);
Clean(tmp);
//
// Bullish Fair Value Gaps ...
ToBox(
provider.visionState.bullishFairValueGaps,
tmp //
);
Copy(
tmp,
tmpBoxes,
false //
);
Clean(tmp);
}
else
{
//
// Supply Zones ...
XBoxZone tmp[];
ToBox(
provider.visionState.supplyZones,
tmp //
);
Copy(
tmp,
tmpBoxes,
false //
);
Clean(tmp);
//
// Bearish Order Blocks ...
ToBox(
provider.visionState.bearishOrderBlocks,
tmp //
);
Copy(
tmp,
tmpBoxes,
false //
);
Clean(tmp);
//
// Bearish Fair Value Gaps ...
ToBox(
provider.visionState.bearishFairValueGaps,
tmp //
);
Copy(
tmp,
tmpBoxes,
false //
);
Clean(tmp);
}
//
has = HasChild(tmpBoxes);
if (has)
{
//
while (HasChild(tmpBoxes))
{
//
idx = GetOldest(tmpBoxes);
has = IsValidIndex(idx);
if (!has)
{
break;
}
//
XBoxZone iBox = tmpBoxes[idx];
ArrayRemove(
tmpBoxes,
idx,
1 //
);
//
has = IsBoxInside(
box,
iBox //
);
if (has)
{
//
holderBox = iBox;
holderBox.to = TimeCurrent();
iBox.Clean();
break;
}
//
iBox.Clean();
}
}
//
Clean(tmpBoxes);
//
signalProvider = X121SMC_XWZ_PROVIDER_ACTIVATED_BOX;
//
// Validate Conditions to Force Has Holder Box ...
// isSenario1Happend =
// holderBox.IsValid() &&
// isSenario1Happend;
// if (!isSenario1Happend)
// {
// //
// isSenario1Bullish = false;
// isSenario1Bearish = false;
// }
}
}
@@ -1378,228 +972,6 @@ struct X121SMCStrategyXWZWorkingZone
bool isSenario2Bearish = false;
if (useSenario2)
{
//
// Senario 2 Bullish Conditions ...
isSenario2Bullish =
//
// XSMHK ...
(
//
(decisionParser.isRawHKBullishUnderValesGoldenZone &&
decisionParser.isSMHKSwitchedToBullishUnderValesGoldenZone)
//
||
//
(decisionParser.isSMHKBullishUnderValesGoldenZone &&
decisionParser.isRawHKSwitchedToBullishUnderValesGoldenZone)
//
)
//
&&
//
// Other Conditions ...
(
//
provider.decisionXConditions.isSarBullish &&
provider.decisionXConditions.isStrBullish
//
);
//
// Senario 2 Bearish Conditions ...
isSenario2Bearish =
//
// XSMHK ...
(
//
(decisionParser.isRawHKBearishOverPeaksGoldenZone &&
decisionParser.isSMHKSwitchedToBearishOverPeaksGoldenZone)
//
||
//
(decisionParser.isSMHKBearishOverPeaksGoldenZone &&
decisionParser.isRawHKSwitchedToBearishOverPeaksGoldenZone)
//
)
//
&&
//
// Other Conditions ...
(
//
provider.decisionXConditions.isSarBearish &&
provider.decisionXConditions.isStrBearish
//
);
//
// Filling Requirements using Senario 2 ...
isSenario2Happend =
isSenario2Bullish ||
isSenario2Bearish;
if (isSenario2Happend)
{
//
dir =
isSenario2Bullish
? X_DIRECTION_BULLISH
: X_DIRECTION_BEARISH;
//
box.dir = dir;
box.to = TimeCurrent();
box.symbol = provider
.decisionXConditions
.symbol;
box.period = provider
.decisionXConditions
.period;
//
int fromIDX = -1;
if (isSenario2Bullish)
{
//
double vale = provider
.decisionXConditions
.valesBuffer[cIDX];
//
box.lower = vale;
//
box.upper = provider
.decisionXConditions
.valesGoldenBuffer[cIDX];
//
int lowerValeIDX = -1;
double lowerVale = provider
.decisionCycleHelper
.mX121Helper
.xpvHelper
.GetLowerVale(
lowerValeIDX,
vale,
cBar.Index() //
);
//
int higherValeIDX = -1;
double higherVale = provider
.decisionCycleHelper
.mX121Helper
.xpvHelper
.GetHigherVale(
higherValeIDX,
vale,
cBar.Index() //
);
//
if (IsValidIndex(lowerValeIDX) &&
IsValidIndex(higherValeIDX))
{
//
fromIDX =
lowerValeIDX < higherValeIDX
? lowerValeIDX
: higherValeIDX;
}
else if (IsValidIndex(lowerValeIDX) &&
!IsValidIndex(higherValeIDX))
{
//
fromIDX = lowerValeIDX;
}
else if (!IsValidIndex(lowerValeIDX) &&
IsValidIndex(higherValeIDX))
{
//
fromIDX = higherValeIDX;
}
}
else
{
//
double peak = provider
.decisionXConditions
.peaksBuffer[cIDX];
//
box.upper = peak;
//
box.lower = provider
.decisionXConditions
.peaksGoldenBuffer[cIDX];
//
int lowerPeakIDX = -1;
double lowerPeak = provider
.decisionCycleHelper
.mX121Helper
.xpvHelper
.GetLowerPeak(
lowerPeakIDX,
peak,
cBar.Index() //
);
//
int higherPeakIDX = -1;
double higherPeak = provider
.decisionCycleHelper
.mX121Helper
.xpvHelper
.GetHigherPeak(
higherPeakIDX,
peak,
cBar.Index() //
);
//
if (IsValidIndex(lowerPeakIDX) &&
IsValidIndex(higherPeakIDX))
{
//
fromIDX =
lowerPeakIDX < higherPeakIDX
? lowerPeakIDX
: higherPeakIDX;
}
else if (IsValidIndex(lowerPeakIDX) &&
!IsValidIndex(higherPeakIDX))
{
//
fromIDX = lowerPeakIDX;
}
else if (!IsValidIndex(lowerPeakIDX) &&
IsValidIndex(higherPeakIDX))
{
//
fromIDX = higherPeakIDX;
}
}
//
if (IsValidIndex(fromIDX))
{
//
box.from = iTime(
zBar.symbol,
zBar.period,
fromIDX //
);
}
else
{
box.from = pBar.time;
}
//
signalProvider = X121SMC_XWZ_PROVIDER_ACTIVATED_BOX;
}
}
//
@@ -1611,182 +983,6 @@ struct X121SMCStrategyXWZWorkingZone
bool isSenario3Bearish = false;
if (useSenario3)
{
//
// Senario 3 Bullish Conditions ...
isSenario3Bullish = false;
//
// Senario 3 Bearish Conditions ...
isSenario3Bearish = false;
//
// Filling Requirements using Senario 3 ...
isSenario3Happend =
isSenario3Bullish ||
isSenario3Bearish;
if (isSenario3Happend)
{
//
dir =
isSenario3Bullish
? X_DIRECTION_BULLISH
: X_DIRECTION_BEARISH;
//
box.dir = dir;
box.to = TimeCurrent();
box.symbol = provider
.decisionXConditions
.symbol;
box.period = provider
.decisionXConditions
.period;
//
int fromIDX = -1;
if (isSenario3Bullish)
{
//
double vale = provider
.decisionXConditions
.valesBuffer[cIDX];
//
box.lower = vale;
//
box.upper = provider
.decisionXConditions
.valesGoldenBuffer[cIDX];
//
int lowerValeIDX = -1;
double lowerVale = provider
.decisionCycleHelper
.mX121Helper
.xpvHelper
.GetLowerVale(
lowerValeIDX,
vale,
cBar.Index() //
);
//
int higherValeIDX = -1;
double higherVale = provider
.decisionCycleHelper
.mX121Helper
.xpvHelper
.GetHigherVale(
higherValeIDX,
vale,
cBar.Index() //
);
//
if (IsValidIndex(lowerValeIDX) &&
IsValidIndex(higherValeIDX))
{
//
fromIDX =
lowerValeIDX < higherValeIDX
? lowerValeIDX
: higherValeIDX;
}
else if (IsValidIndex(lowerValeIDX) &&
!IsValidIndex(higherValeIDX))
{
//
fromIDX = lowerValeIDX;
}
else if (!IsValidIndex(lowerValeIDX) &&
IsValidIndex(higherValeIDX))
{
//
fromIDX = higherValeIDX;
}
}
else
{
//
double peak = provider
.decisionXConditions
.peaksBuffer[cIDX];
//
box.upper = peak;
//
box.lower = provider
.decisionXConditions
.peaksGoldenBuffer[cIDX];
//
int lowerPeakIDX = -1;
double lowerPeak = provider
.decisionCycleHelper
.mX121Helper
.xpvHelper
.GetLowerPeak(
lowerPeakIDX,
peak,
cBar.Index() //
);
//
int higherPeakIDX = -1;
double higherPeak = provider
.decisionCycleHelper
.mX121Helper
.xpvHelper
.GetHigherPeak(
higherPeakIDX,
peak,
cBar.Index() //
);
//
if (IsValidIndex(lowerPeakIDX) &&
IsValidIndex(higherPeakIDX))
{
//
fromIDX =
lowerPeakIDX < higherPeakIDX
? lowerPeakIDX
: higherPeakIDX;
}
else if (IsValidIndex(lowerPeakIDX) &&
!IsValidIndex(higherPeakIDX))
{
//
fromIDX = lowerPeakIDX;
}
else if (!IsValidIndex(lowerPeakIDX) &&
IsValidIndex(higherPeakIDX))
{
//
fromIDX = higherPeakIDX;
}
}
//
if (IsValidIndex(fromIDX))
{
//
box.from = iTime(
zBar.symbol,
zBar.period,
fromIDX //
);
}
else
{
box.from = pBar.time;
}
//
signalProvider = X121SMC_XWZ_PROVIDER_ACTIVATED_BOX;
}
}
//
@@ -1819,12 +1015,12 @@ struct X121SMCStrategyXWZWorkingZone
isBearish);
//
// Cleanup Resources ...
//
zBar.Clean();
cBar.Clean();
pBar.Clean();
if (!result)
{
//
box.Clean();
holderBox.Clean();
}
//
return result;
@@ -268,6 +268,9 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
type //
);
//
double spread = GetSpread(conditions.symbol);
//
double slAddition = 0;
sl =
@@ -317,8 +320,10 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
hasXWZSignal)
{
//
// Configuring Amount Percent and ETC ...
bool ignoreEAVolume = mXWZConditions.reward > 0 &&
// Configuring Amount Percent and etc ...
// TODO: Enable if required ...
bool ignoreEAVolume = false &&
mXWZConditions.reward > 0 &&
mXWZConditions.amountPercent > 0;
if (ignoreEAVolume)
{
@@ -379,6 +384,13 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
}
}
//
// Apply Spread on Signal's TP ...
signal.tp =
hasLong
? signal.tp + spread
: signal.tp - spread;
//
hasLong = false;
hasShort = false;
@@ -692,7 +704,7 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
{
//
useXWZSignal = true;
useXWZSignalGuard = false;
useXWZSignalGuard = true;
//
string symbol = GetSymbol();
@@ -735,7 +747,7 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
bool showAll = false;
//
x121Inputs.showRSI = false;
x121Inputs.showRSI = showAll || false;
//
// XPV ...
@@ -791,7 +803,7 @@ 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;
@@ -810,7 +822,7 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
//
// XSTR ...
x121Inputs.xstrInputs.showStr = showAll || false;
x121Inputs.xstrInputs.showStr = showAll || true;
x121Inputs.xstrInputs.showStrUpper = showAll || false;
x121Inputs.xstrInputs.showStrLower = showAll || false;