This commit is contained in:
2025-03-09 01:03:44 +03:30
parent f428892c6d
commit d14f07ba80
8 changed files with 573 additions and 31 deletions
+44 -2
View File
@@ -24,6 +24,7 @@
// Imports ... // Imports ...
#include "../Helpers/x-saherelm.x121.x3ma.helper.mq5" #include "../Helpers/x-saherelm.x121.x3ma.helper.mq5"
#include "../Helpers/x-saherelm.x121.xatr.helper.mq5" #include "../Helpers/x-saherelm.x121.xatr.helper.mq5"
#include "../Helpers/x-saherelm.x121.xcc.helper.mq5"
#include "../Helpers/x-saherelm.x121.xche.helper.mq5" #include "../Helpers/x-saherelm.x121.xche.helper.mq5"
#include "../Helpers/x-saherelm.x121.xdon.helper.mq5" #include "../Helpers/x-saherelm.x121.xdon.helper.mq5"
#include "../Helpers/x-saherelm.x121.xhk.helper.mq5" #include "../Helpers/x-saherelm.x121.xhk.helper.mq5"
@@ -39,6 +40,7 @@ struct X121Inputs
// //
// Props ... // Props ...
bool showRSI; bool showRSI;
X121XCCInputs xccInputs;
X121XPVInputs xpvInputs; X121XPVInputs xpvInputs;
X121XHKInputs xhkInputs; X121XHKInputs xhkInputs;
X121XATRInputs xatrInputs; X121XATRInputs xatrInputs;
@@ -65,6 +67,7 @@ struct X121Inputs
void Clean() void Clean()
{ {
// //
xccInputs.Clean();
xpvInputs.Clean(); xpvInputs.Clean();
xhkInputs.Clean(); xhkInputs.Clean();
xatrInputs.Clean(); xatrInputs.Clean();
@@ -84,6 +87,7 @@ struct X121Inputs
void Default() void Default()
{ {
// //
xccInputs.Default();
xpvInputs.Default(); xpvInputs.Default();
xhkInputs.Default(); xhkInputs.Default();
xatrInputs.Default(); xatrInputs.Default();
@@ -108,6 +112,7 @@ struct X121Inputs
// //
result = result =
// //
xccInputs.IsValid() &&
xpvInputs.IsValid() && xpvInputs.IsValid() &&
xhkInputs.IsValid() && xhkInputs.IsValid() &&
xatrInputs.IsValid() && xatrInputs.IsValid() &&
@@ -223,6 +228,8 @@ struct X121Conditions
double xhkRawHighBuffer[]; double xhkRawHighBuffer[];
double xhkSMCloseBuffer[]; double xhkSMCloseBuffer[];
double vwapVolumeBuffer[]; double vwapVolumeBuffer[];
double peaksGoldenBuffer[];
double valesGoldenBuffer[];
double xhkRawCloseBuffer[]; double xhkRawCloseBuffer[];
double atrUpperRawBuffer[]; double atrUpperRawBuffer[];
double atrLowerRawBuffer[]; double atrLowerRawBuffer[];
@@ -623,11 +630,11 @@ struct X121Conditions
Clean(adxBuffer); Clean(adxBuffer);
Clean(adxPBuffer); Clean(adxPBuffer);
Clean(adxMBuffer); Clean(adxMBuffer);
Clean(volumeBuffer);
Clean(peaksBuffer); Clean(peaksBuffer);
Clean(valesBuffer); Clean(valesBuffer);
Clean(strUpBuffer); Clean(strUpBuffer);
Clean(downTBuffer); Clean(downTBuffer);
Clean(volumeBuffer);
Clean(strDownBuffer); Clean(strDownBuffer);
Clean(vwapMidBuffer); Clean(vwapMidBuffer);
Clean(upTrendBuffer); Clean(upTrendBuffer);
@@ -654,6 +661,8 @@ struct X121Conditions
Clean(xhkRawHighBuffer); Clean(xhkRawHighBuffer);
Clean(xhkSMCloseBuffer); Clean(xhkSMCloseBuffer);
Clean(vwapVolumeBuffer); Clean(vwapVolumeBuffer);
Clean(peaksGoldenBuffer);
Clean(valesGoldenBuffer);
Clean(xhkRawCloseBuffer); Clean(xhkRawCloseBuffer);
Clean(atrUpperRawBuffer); Clean(atrUpperRawBuffer);
Clean(atrLowerRawBuffer); Clean(atrLowerRawBuffer);
@@ -696,11 +705,11 @@ struct X121Conditions
ArraySetAsSeries(adxBuffer, true); ArraySetAsSeries(adxBuffer, true);
ArraySetAsSeries(adxPBuffer, true); ArraySetAsSeries(adxPBuffer, true);
ArraySetAsSeries(adxMBuffer, true); ArraySetAsSeries(adxMBuffer, true);
ArraySetAsSeries(volumeBuffer, true);
ArraySetAsSeries(peaksBuffer, true); ArraySetAsSeries(peaksBuffer, true);
ArraySetAsSeries(valesBuffer, true); ArraySetAsSeries(valesBuffer, true);
ArraySetAsSeries(strUpBuffer, true); ArraySetAsSeries(strUpBuffer, true);
ArraySetAsSeries(downTBuffer, true); ArraySetAsSeries(downTBuffer, true);
ArraySetAsSeries(volumeBuffer, true);
ArraySetAsSeries(strDownBuffer, true); ArraySetAsSeries(strDownBuffer, true);
ArraySetAsSeries(vwapMidBuffer, true); ArraySetAsSeries(vwapMidBuffer, true);
ArraySetAsSeries(upTrendBuffer, true); ArraySetAsSeries(upTrendBuffer, true);
@@ -727,6 +736,8 @@ struct X121Conditions
ArraySetAsSeries(xhkRawHighBuffer, true); ArraySetAsSeries(xhkRawHighBuffer, true);
ArraySetAsSeries(xhkSMCloseBuffer, true); ArraySetAsSeries(xhkSMCloseBuffer, true);
ArraySetAsSeries(vwapVolumeBuffer, true); ArraySetAsSeries(vwapVolumeBuffer, true);
ArraySetAsSeries(peaksGoldenBuffer, true);
ArraySetAsSeries(valesGoldenBuffer, true);
ArraySetAsSeries(xhkRawCloseBuffer, true); ArraySetAsSeries(xhkRawCloseBuffer, true);
ArraySetAsSeries(atrUpperRawBuffer, true); ArraySetAsSeries(atrUpperRawBuffer, true);
ArraySetAsSeries(atrLowerRawBuffer, true); ArraySetAsSeries(atrLowerRawBuffer, true);
@@ -2383,6 +2394,7 @@ class XCX121Helper : public XCBase
// //
// Helpers ... // Helpers ...
XCX121XCCHelper *xccHelper;
XCX121XPVHelper *xpvHelper; XCX121XPVHelper *xpvHelper;
XCX121XHKHelper *xhkHelper; XCX121XHKHelper *xhkHelper;
XCX121XATRHelper *xatrHelper; XCX121XATRHelper *xatrHelper;
@@ -2405,6 +2417,7 @@ class XCX121Helper : public XCBase
{ {
// //
mInputs.Clean(); mInputs.Clean();
xccInputs.Clean();
xpvInputs.Clean(); xpvInputs.Clean();
xhkInputs.Clean(); xhkInputs.Clean();
xatrInputs.Clean(); xatrInputs.Clean();
@@ -2416,6 +2429,7 @@ class XCX121Helper : public XCBase
xtrendInputs.Clean(); xtrendInputs.Clean();
// //
delete xccHelper;
delete xpvHelper; delete xpvHelper;
delete xhkHelper; delete xhkHelper;
delete xatrHelper; delete xatrHelper;
@@ -2427,6 +2441,7 @@ class XCX121Helper : public XCBase
delete xtrendHelper; delete xtrendHelper;
// //
ZeroMemory(xccHelper);
ZeroMemory(xpvHelper); ZeroMemory(xpvHelper);
ZeroMemory(xhkHelper); ZeroMemory(xhkHelper);
ZeroMemory(xatrHelper); ZeroMemory(xatrHelper);
@@ -2490,6 +2505,7 @@ class XCX121Helper : public XCBase
// //
mInputs = inputs; mInputs = inputs;
xccInputs = inputs.xccInputs;
xpvInputs = inputs.xpvInputs; xpvInputs = inputs.xpvInputs;
xhkInputs = inputs.xhkInputs; xhkInputs = inputs.xhkInputs;
xatrInputs = inputs.xatrInputs; xatrInputs = inputs.xatrInputs;
@@ -2503,6 +2519,19 @@ class XCX121Helper : public XCBase
// //
// Initial Helpers ... // Initial Helpers ...
//
// XCC ...
xccHelper = new XCX121XCCHelper();
result = xccHelper.Init(
symbol,
period,
xccInputs //
);
if (!result)
{
return result;
}
// //
// XPV ... // XPV ...
xpvHelper = new XCX121XPVHelper(); xpvHelper = new XCX121XPVHelper();
@@ -3086,6 +3115,18 @@ class XCX121Helper : public XCBase
conditions.valesBuffer // conditions.valesBuffer //
); );
//
Copy(
xpvConditions.peaksGoldenBuffer,
conditions.peaksGoldenBuffer //
);
//
Copy(
xpvConditions.valesGoldenBuffer,
conditions.valesGoldenBuffer //
);
// //
Copy( Copy(
xpvConditions.sarBuffer, xpvConditions.sarBuffer,
@@ -4447,6 +4488,7 @@ class XCX121Helper : public XCBase
// //
// Inputs ... // Inputs ...
X121Inputs mInputs; X121Inputs mInputs;
X121XCCInputs xccInputs;
X121XPVInputs xpvInputs; X121XPVInputs xpvInputs;
X121XHKInputs xhkInputs; X121XHKInputs xhkInputs;
X121XATRInputs xatrInputs; X121XATRInputs xatrInputs;
+1 -1
View File
@@ -195,8 +195,8 @@ class XCX121XCCHelper : public XCBaseHelper
mInputs.upColor, // Up Color mInputs.upColor, // Up Color
mInputs.downColor, // Down Color mInputs.downColor, // Down Color
mInputs.lineColor, // Line mode and Doji candlestick Color mInputs.lineColor, // Line mode and Doji candlestick Color
mInputs.bearishColor, // Bullish Color
mInputs.bullishColor, // Bearish Color mInputs.bullishColor, // Bearish Color
mInputs.bearishColor, // Bullish Color
mInputs.volumesColor, // Volumes Color mInputs.volumesColor, // Volumes Color
// //
// Presentation ... // Presentation ...
+1 -1
View File
@@ -110,7 +110,7 @@ struct X121XVWAPInputs
// //
vwapFastLength = 20; vwapFastLength = 20;
vwapMidLength = 50; vwapMidLength = 50;
vwapSlowLength = 100; vwapSlowLength = 200;
vwapAppliedTo = PRICE_CLOSE; vwapAppliedTo = PRICE_CLOSE;
// //
@@ -681,6 +681,375 @@ class XC121SMCCycleHelper : public XCBase
// //
}; };
//
struct X121SMCStrategyConditionParser
{
//
// Props ...
//
// XSAR ...
//
bool isSarBullishOverPeaksGoldenZone;
bool isSarSwitchedToBullishOverPeaksGoldenZone;
bool isSarBearishOverPeaksGoldenZone;
bool isSarSwitchedToBearishOverPeaksGoldenZone;
bool isSarBullishUnderValesGoldenZone;
bool isSarSwitchedToBullishUnderValesGoldenZone;
bool isSarBearishUnderValesGoldenZone;
bool isSarSwitchedToBearishUnderValesGoldenZone;
//
// XMA ...
//
bool isX3MaFastUnderValesGoldenZone;
bool isX3MaFastCrossedUnderValesGoldenZone;
bool isX3MaFastOverPeaksGoldenZone;
bool isX3MaFastCrossedOverPeaksGoldenZone;
//
bool isX3MaInsidePeaksGoldenZone;
bool isX3MaCrossedInsidePeaksGoldenZone;
//
bool isX3MaInsideValesGoldenZone;
bool isX3MaCrossedInsideValesGoldenZone;
//
// XVWAP ...
//
bool isVWapFastUnderValesGoldenZone;
bool isVWapFastCrossedUnderValesGoldenZone;
bool isVWapFastOverPeaksGoldenZone;
bool isVWapFastCrossedOverPeaksGoldenZone;
//
// XHK ...
//
// XRWHK ...
//
bool isRawHKBearishOverPeaksGoldenZone;
bool isRawHKSwitchedToBearishOverPeaksGoldenZone;
bool isRawHKBullishUnderValesGoldenZone;
bool isRawHKSwitchedToBullishUnderValesGoldenZone;
//
// XSMHK ...
//
bool isSMHKBearishOverPeaksGoldenZone;
bool isSMHKSwitchedToBearishOverPeaksGoldenZone;
bool isSMHKBullishUnderValesGoldenZone;
bool isSMHKSwitchedToBullishUnderValesGoldenZone;
//
bool isXVwapMaOverPeaksGoldeZone;
bool isXVwapMaUnderValesGoldeZone;
//
// Constructor ...
X121SMCStrategyConditionParser()
{
Clean();
}
//
// Tools ...
//
void Clean()
{
//
isSarBullishOverPeaksGoldenZone = false;
isSarSwitchedToBullishOverPeaksGoldenZone = false;
isSarBearishOverPeaksGoldenZone = false;
isSarSwitchedToBearishOverPeaksGoldenZone = false;
isSarBullishUnderValesGoldenZone = false;
isSarSwitchedToBullishUnderValesGoldenZone = false;
isSarBearishUnderValesGoldenZone = false;
isSarSwitchedToBearishUnderValesGoldenZone = false;
//
isX3MaFastUnderValesGoldenZone = false;
isX3MaFastCrossedUnderValesGoldenZone = false;
isX3MaFastOverPeaksGoldenZone = false;
isX3MaFastCrossedOverPeaksGoldenZone = false;
//
isX3MaInsidePeaksGoldenZone = false;
isX3MaCrossedInsidePeaksGoldenZone = false;
//
isX3MaInsideValesGoldenZone = false;
isX3MaCrossedInsideValesGoldenZone = false;
//
isVWapFastUnderValesGoldenZone = false;
isVWapFastCrossedUnderValesGoldenZone = false;
isVWapFastOverPeaksGoldenZone = false;
isVWapFastCrossedOverPeaksGoldenZone = false;
//
isRawHKBearishOverPeaksGoldenZone = false;
isRawHKSwitchedToBearishOverPeaksGoldenZone = false;
isRawHKBullishUnderValesGoldenZone = false;
isRawHKSwitchedToBullishUnderValesGoldenZone = false;
//
isSMHKBearishOverPeaksGoldenZone = false;
isSMHKSwitchedToBearishOverPeaksGoldenZone = false;
isSMHKBullishUnderValesGoldenZone = false;
isSMHKSwitchedToBullishUnderValesGoldenZone = false;
//
isXVwapMaOverPeaksGoldeZone = false;
isXVwapMaUnderValesGoldeZone = false;
//
ZeroMemory(this);
}
//
void Parse(
X121Conditions &conditions //
)
{
//
Clean();
//
//
int zIDX = 0;
int cIDX = zIDX + 1;
int pIDX = cIDX + 1;
//
// XSAR ...
//
isSarBullishOverPeaksGoldenZone =
conditions.isSarBullish &&
conditions.sarBuffer[cIDX] > conditions.peaksGoldenBuffer[cIDX];
//
isSarSwitchedToBullishOverPeaksGoldenZone =
conditions.isSarSwitchedToBullish &&
conditions.sarBuffer[cIDX] > conditions.peaksGoldenBuffer[cIDX];
//
isSarBearishOverPeaksGoldenZone =
conditions.isSarBearish &&
conditions.sarBuffer[cIDX] > conditions.peaksGoldenBuffer[cIDX];
//
isSarSwitchedToBearishOverPeaksGoldenZone =
conditions.isSarSwitchedToBearish &&
conditions.sarBuffer[cIDX] > conditions.peaksGoldenBuffer[cIDX];
//
isSarBullishUnderValesGoldenZone =
conditions.isSarBullish &&
conditions.sarBuffer[cIDX] < conditions.valesGoldenBuffer[cIDX];
//
isSarSwitchedToBullishUnderValesGoldenZone =
conditions.isSarSwitchedToBullish &&
conditions.sarBuffer[cIDX] < conditions.valesGoldenBuffer[cIDX];
//
isSarBearishUnderValesGoldenZone =
conditions.isSarBearish &&
conditions.sarBuffer[cIDX] < conditions.valesGoldenBuffer[cIDX];
//
isSarSwitchedToBearishUnderValesGoldenZone =
conditions.isSarSwitchedToBearish &&
conditions.sarBuffer[cIDX] < conditions.valesGoldenBuffer[cIDX];
//
// X3MA ...
//
isX3MaFastUnderValesGoldenZone =
conditions.x3maFastBuffer[cIDX] < conditions.valesGoldenBuffer[cIDX];
//
isX3MaFastCrossedUnderValesGoldenZone =
isX3MaFastUnderValesGoldenZone &&
conditions.x3maFastBuffer[pIDX] >= conditions.valesGoldenBuffer[pIDX];
//
isX3MaFastOverPeaksGoldenZone =
conditions.x3maFastBuffer[cIDX] > conditions.peaksGoldenBuffer[cIDX];
//
isX3MaFastCrossedOverPeaksGoldenZone =
isX3MaFastOverPeaksGoldenZone &&
conditions.x3maFastBuffer[pIDX] <= conditions.peaksGoldenBuffer[pIDX];
//
isX3MaInsidePeaksGoldenZone =
//
conditions.x3maMin < conditions.peaksBuffer[cIDX] &&
conditions.x3maMin > conditions.peaksGoldenBuffer[cIDX] &&
//
conditions.x3maMax < conditions.peaksBuffer[cIDX] &&
conditions.x3maMax > conditions.peaksGoldenBuffer[cIDX]
//
;
//
isX3MaCrossedInsidePeaksGoldenZone =
isX3MaInsidePeaksGoldenZone &&
!(
//
conditions.x3maMin < conditions.peaksBuffer[pIDX] &&
conditions.x3maMin > conditions.peaksGoldenBuffer[pIDX] &&
//
conditions.x3maMax < conditions.peaksBuffer[pIDX] &&
conditions.x3maMax > conditions.peaksGoldenBuffer[pIDX]
//
);
//
isX3MaInsideValesGoldenZone =
//
conditions.x3maMin > conditions.valesBuffer[cIDX] &&
conditions.x3maMin < conditions.valesGoldenBuffer[cIDX] &&
//
conditions.x3maMax > conditions.valesBuffer[cIDX] &&
conditions.x3maMax < conditions.valesGoldenBuffer[cIDX]
//
;
isX3MaCrossedInsideValesGoldenZone =
isX3MaInsideValesGoldenZone &&
!(
//
conditions.x3maMin > conditions.valesBuffer[pIDX] &&
conditions.x3maMin < conditions.valesGoldenBuffer[pIDX] &&
//
conditions.x3maMax > conditions.valesBuffer[pIDX] &&
conditions.x3maMax < conditions.valesGoldenBuffer[pIDX]
//
);
//
// XVWAP ...
//
isVWapFastUnderValesGoldenZone =
conditions.vwapFastBuffer[cIDX] < conditions.valesGoldenBuffer[cIDX];
//
isVWapFastCrossedUnderValesGoldenZone =
isVWapFastUnderValesGoldenZone &&
conditions.vwapFastBuffer[pIDX] >= conditions.valesGoldenBuffer[pIDX];
//
isVWapFastOverPeaksGoldenZone =
conditions.vwapFastBuffer[cIDX] > conditions.peaksGoldenBuffer[cIDX];
//
isVWapFastCrossedOverPeaksGoldenZone =
isVWapFastOverPeaksGoldenZone &&
conditions.vwapFastBuffer[pIDX] <= conditions.peaksGoldenBuffer[pIDX];
//
// XHK ...
//
// XRWHK ...
//
isRawHKBearishOverPeaksGoldenZone =
conditions.isRawHKBearish &&
conditions.xhkRawHighBuffer[cIDX] > conditions.peaksGoldenBuffer[cIDX];
//
isRawHKSwitchedToBearishOverPeaksGoldenZone =
conditions.isRawHKSwitchedToBearish &&
conditions.xhkRawHighBuffer[cIDX] > conditions.peaksGoldenBuffer[cIDX];
//
isRawHKBullishUnderValesGoldenZone =
conditions.isRawHKBullish &&
conditions.xhkRawLowBuffer[cIDX] < conditions.valesGoldenBuffer[cIDX];
//
isRawHKSwitchedToBullishUnderValesGoldenZone =
conditions.isRawHKSwitchedToBullish &&
conditions.xhkRawLowBuffer[cIDX] < conditions.valesGoldenBuffer[cIDX];
//
// XSMHK ...
//
isSMHKBearishOverPeaksGoldenZone =
conditions.isSMHKBearish &&
conditions.xhkSMHighBuffer[cIDX] > conditions.peaksGoldenBuffer[cIDX];
//
isSMHKSwitchedToBearishOverPeaksGoldenZone =
conditions.isSMHKSwitchedToBearish &&
conditions.xhkSMHighBuffer[cIDX] > conditions.peaksGoldenBuffer[cIDX];
//
isSMHKBullishUnderValesGoldenZone =
conditions.isSMHKBullish &&
conditions.xhkSMLowBuffer[cIDX] < conditions.valesGoldenBuffer[cIDX];
//
isSMHKSwitchedToBullishUnderValesGoldenZone =
conditions.isSMHKSwitchedToBullish &&
conditions.xhkSMLowBuffer[cIDX] < conditions.valesGoldenBuffer[cIDX];
//
// COMBINED Conditions ...
//
isXVwapMaOverPeaksGoldeZone =
//
(
//
(isX3MaFastOverPeaksGoldenZone &&
isVWapFastCrossedOverPeaksGoldenZone)
//
||
//
(isVWapFastOverPeaksGoldenZone &&
isX3MaFastCrossedOverPeaksGoldenZone)
//
)
//
;
//
isXVwapMaUnderValesGoldeZone =
//
(
//
(isX3MaFastUnderValesGoldenZone &&
isVWapFastCrossedUnderValesGoldenZone)
//
||
//
(isVWapFastUnderValesGoldenZone &&
isX3MaFastCrossedUnderValesGoldenZone)
//
)
//
;
}
//
};
// //
struct X121SMCStrategySignalProviderData struct X121SMCStrategySignalProviderData
{ {
+1 -1
View File
@@ -63,7 +63,7 @@ class XC121SMCExpert : public XCBaseExpert
// Constructor(s) ... // Constructor(s) ...
XC121SMCExpert() XC121SMCExpert()
{ {
mShowCandles = false; mShowCandles = true;
} }
// //
@@ -216,9 +216,9 @@ class XCX121SMCXWZSignalDetector : public XCBase
// //
// Detect Zones and Boxes ... // Detect Zones and Boxes ...
hasWaitingZones = workingZone.DetectZone( // hasWaitingZones = workingZone.DetectZone(
provider // // provider //
); // );
// //
hasWaitingBoxes = workingZone.HasWaitingBoxes(); hasWaitingBoxes = workingZone.HasWaitingBoxes();
@@ -281,18 +281,18 @@ class XCX121SMCXWZSignalDetector : public XCBase
// //
// Detect Signal Box ... // Detect Signal Box ...
// // //
bool isZoneActivated = // bool isZoneActivated =
hasWorkingZone && // hasWorkingZone &&
hasWaitingZones && // hasWaitingZones &&
workingZone.IsZoneActivated( // workingZone.IsZoneActivated(
activatedZoneIDX, // activatedZoneIDX,
activatedFVGIDX, // activatedFVGIDX,
signalBoxDir, // signalBoxDir,
signalProvider, // signalProvider,
provider, // provider,
zIndex // // zIndex //
); // );
// //
// hasSignalBox = // hasSignalBox =
@@ -306,6 +306,17 @@ class XCX121SMCXWZSignalDetector : public XCBase
// zIndex // // zIndex //
// ); // );
//
hasSignalBox =
hasWorkingZone &&
workingZone.DetectSignalConditions(
signalBox,
signalBoxDir,
signalProvider,
provider,
zIndex //
);
// //
if (hasSignalBox) if (hasSignalBox)
{ {
+100 -6
View File
@@ -1124,7 +1124,7 @@ struct X121SMCStrategyXWZWorkingZone
bool IsBoxActivated( bool IsBoxActivated(
XBoxZone &box, XBoxZone &box,
ENUM_X_DIRECTION &dir, ENUM_X_DIRECTION &dir,
ENUM_X121SMC_XWZ_PROVIDERS &signalProviderl, ENUM_X121SMC_XWZ_PROVIDERS &signalProvider,
X121SMCStrategySignalProviderData &provider, X121SMCStrategySignalProviderData &provider,
int barIndex = 0 // int barIndex = 0 //
) )
@@ -1135,7 +1135,7 @@ struct X121SMCStrategyXWZWorkingZone
// //
box.Clean(); box.Clean();
dir = X_DIRECTION_NONE; dir = X_DIRECTION_NONE;
signalProviderl = X121SMC_XWZ_PROVIDER_NONE; signalProvider = X121SMC_XWZ_PROVIDER_NONE;
// //
if (barIndex < 0) if (barIndex < 0)
@@ -1428,7 +1428,7 @@ struct X121SMCStrategyXWZWorkingZone
// //
box = iBox; box = iBox;
dir = iBox.dir; dir = iBox.dir;
signalProviderl = X121SMC_XWZ_PROVIDER_ACTIVATED_BOX; signalProvider = X121SMC_XWZ_PROVIDER_ACTIVATED_BOX;
// //
iBox.Clean(); iBox.Clean();
@@ -1590,7 +1590,7 @@ struct X121SMCStrategyXWZWorkingZone
isTrendBullish isTrendBullish
? X_DIRECTION_BULLISH ? X_DIRECTION_BULLISH
: X_DIRECTION_BEARISH; : X_DIRECTION_BEARISH;
signalProviderl = X121SMC_XWZ_PROVIDER_ACTIVATED_MA; signalProvider = X121SMC_XWZ_PROVIDER_ACTIVATED_MA;
break; break;
} }
@@ -1842,7 +1842,7 @@ struct X121SMCStrategyXWZWorkingZone
// //
dir = X_DIRECTION_BEARISH; dir = X_DIRECTION_BEARISH;
signalProviderl = X121SMC_XWZ_PROVIDER_ACTIVATED_AREA; signalProvider = X121SMC_XWZ_PROVIDER_ACTIVATED_AREA;
// //
iBox.Clean(); iBox.Clean();
@@ -1946,7 +1946,7 @@ struct X121SMCStrategyXWZWorkingZone
// //
dir = X_DIRECTION_BULLISH; dir = X_DIRECTION_BULLISH;
signalProviderl = X121SMC_XWZ_PROVIDER_ACTIVATED_AREA; signalProvider = X121SMC_XWZ_PROVIDER_ACTIVATED_AREA;
// //
iBox.Clean(); iBox.Clean();
@@ -1986,6 +1986,100 @@ struct X121SMCStrategyXWZWorkingZone
return result; return result;
} }
//
bool DetectSignalConditions(
XBoxZone &box,
ENUM_X_DIRECTION &dir,
ENUM_X121SMC_XWZ_PROVIDERS &signalProvider,
X121SMCStrategySignalProviderData &provider,
int barIndex = 0 //
)
{
//
bool result = false;
//
// Normalize Bars ...
//
box.Clean();
dir = X_DIRECTION_NONE;
signalProvider = X121SMC_XWZ_PROVIDER_NONE;
//
if (barIndex < 0)
{
barIndex = 0;
}
//
result = IsValid();
if (!result)
{
return result;
}
//
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);
//
bool has =
//
// false
decisionParser.isX3MaCrossedInsideValesGoldenZone
//
;
if (has)
{
Print("Condition ...");
}
//
// Senario 1:
// ----------
//
//
zBar.Clean();
cBar.Clean();
pBar.Clean();
//
return result;
}
// //
bool IsExists(XOBFVG &zone) bool IsExists(XOBFVG &zone)
{ {
@@ -754,6 +754,32 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
x121Inputs.xatrInputs.atrMultiplier = 1.5; x121Inputs.xatrInputs.atrMultiplier = 1.5;
x121Inputs.xatrInputs.atrSmoothingMode = X_MA_MODE_EMA; x121Inputs.xatrInputs.atrSmoothingMode = X_MA_MODE_EMA;
//
x121Inputs.xvwapInputs.vwapFastLength = 20;
x121Inputs.xvwapInputs.vwapMidLength = 50;
x121Inputs.xvwapInputs.vwapSlowLength = 200;
//
x121Inputs.x3maInputs.x3maFastMALength = 20;
x121Inputs.x3maInputs.x3maMidMALength = 50;
x121Inputs.x3maInputs.x3maSlowMALength = 200;
//
// x121Inputs.xccInputs.upColor = clrLime;
// x121Inputs.xccInputs.downColor = clrRed;
// x121Inputs.xccInputs.lineColor = CLR_NONE;
// x121Inputs.xccInputs.bearishColor = clrRed;
// x121Inputs.xccInputs.bullishColor = clrLime;
// x121Inputs.xccInputs.volumesColor = clrGreen;
//
//
//
//
// XCC ...
x121Inputs.xccInputs.showCandles = showAll || false;
// //
// XTREND ... // XTREND ...
x121Inputs.xtrendInputs.showUpTrend = showAll || false; x121Inputs.xtrendInputs.showUpTrend = showAll || false;
@@ -772,7 +798,7 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
// //
x121Inputs.xhkInputs.drawRawXHKCandles = showAll || false; x121Inputs.xhkInputs.drawRawXHKCandles = showAll || false;
x121Inputs.xhkInputs.drawSmoothedXHKCandles = showAll || true; x121Inputs.xhkInputs.drawSmoothedXHKCandles = showAll || false;
// //
// XATR ... // XATR ...
@@ -807,9 +833,9 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
// //
// X3MA ... // X3MA ...
x121Inputs.x3maInputs.showX3MaFast = showAll || false; x121Inputs.x3maInputs.showX3MaFast = showAll || true;
x121Inputs.x3maInputs.showX3MaMid = showAll || false; x121Inputs.x3maInputs.showX3MaMid = showAll || true;
x121Inputs.x3maInputs.showX3MaSlow = showAll || false; x121Inputs.x3maInputs.showX3MaSlow = showAll || true;
// //
// Initialize Cycle Helpers ... // Initialize Cycle Helpers ...