This commit is contained in:
2025-03-12 13:33:44 +03:30
parent 30e6749e09
commit 935c8405fa
7 changed files with 1954 additions and 469 deletions
+96
View File
@@ -28,6 +28,7 @@
#include "../Helpers/x-saherelm.x121.xche.helper.mq5"
#include "../Helpers/x-saherelm.x121.xdon.helper.mq5"
#include "../Helpers/x-saherelm.x121.xhk.helper.mq5"
#include "../Helpers/x-saherelm.x121.xmas.helper.mq5"
#include "../Helpers/x-saherelm.x121.xpv.helper.mq5"
#include "../Helpers/x-saherelm.x121.xstr.helper.mq5"
#include "../Helpers/x-saherelm.x121.xtrend.helper.mq5"
@@ -43,6 +44,7 @@ struct X121Inputs
X121XCCInputs xccInputs;
X121XPVInputs xpvInputs;
X121XHKInputs xhkInputs;
X121XMASInputs xmasInputs;
X121XATRInputs xatrInputs;
X121XSTRInputs xstrInputs;
X121XCHEInputs xcheInputs;
@@ -70,6 +72,7 @@ struct X121Inputs
xccInputs.Clean();
xpvInputs.Clean();
xhkInputs.Clean();
xmasInputs.Clean();
xatrInputs.Clean();
xstrInputs.Clean();
xcheInputs.Clean();
@@ -90,6 +93,7 @@ struct X121Inputs
xccInputs.Default();
xpvInputs.Default();
xhkInputs.Default();
xmasInputs.Default();
xatrInputs.Default();
xstrInputs.Default();
xcheInputs.Default();
@@ -115,6 +119,7 @@ struct X121Inputs
xccInputs.IsValid() &&
xpvInputs.IsValid() &&
xhkInputs.IsValid() &&
xmasInputs.IsValid() &&
xatrInputs.IsValid() &&
xstrInputs.IsValid() &&
xcheInputs.IsValid() &&
@@ -141,6 +146,7 @@ struct X121Inputs
//
int xpvMax = xpvInputs.Max();
int xhkMax = xpvInputs.Max();
int xmasMax = xpvInputs.Max();
int xatrMax = xatrInputs.Max();
int xstrMax = xstrInputs.Max();
int xcheMax = xcheInputs.Max();
@@ -150,6 +156,7 @@ struct X121Inputs
//
result = MathMax(xpvMax, xhkMax);
result = MathMax(result, xmasMax);
result = MathMax(result, xatrMax);
result = MathMax(result, xstrMax);
result = MathMax(result, xcheMax);
@@ -202,6 +209,9 @@ struct X121Conditions
double valesBuffer[];
double strUpBuffer[];
double downTBuffer[];
double masMidBuffer[];
double masUpperBuffer[];
double masLowerBuffer[];
double strDownBuffer[];
double vwapMidBuffer[];
double upTrendBuffer[];
@@ -635,10 +645,13 @@ struct X121Conditions
Clean(strUpBuffer);
Clean(downTBuffer);
Clean(volumeBuffer);
Clean(masMidBuffer);
Clean(strDownBuffer);
Clean(vwapMidBuffer);
Clean(upTrendBuffer);
Clean(x3maMidBuffer);
Clean(masUpperBuffer);
Clean(masLowerBuffer);
Clean(le1StartBuffer);
Clean(se1StartBuffer);
Clean(le2StartBuffer);
@@ -710,10 +723,13 @@ struct X121Conditions
ArraySetAsSeries(strUpBuffer, true);
ArraySetAsSeries(downTBuffer, true);
ArraySetAsSeries(volumeBuffer, true);
ArraySetAsSeries(masMidBuffer, true);
ArraySetAsSeries(strDownBuffer, true);
ArraySetAsSeries(vwapMidBuffer, true);
ArraySetAsSeries(upTrendBuffer, true);
ArraySetAsSeries(x3maMidBuffer, true);
ArraySetAsSeries(masUpperBuffer, true);
ArraySetAsSeries(masLowerBuffer, true);
ArraySetAsSeries(le1StartBuffer, true);
ArraySetAsSeries(se1StartBuffer, true);
ArraySetAsSeries(le2StartBuffer, true);
@@ -2397,6 +2413,7 @@ class XCX121Helper : public XCBase
XCX121XCCHelper *xccHelper;
XCX121XPVHelper *xpvHelper;
XCX121XHKHelper *xhkHelper;
XCX121XMASHelper *xmasHelper;
XCX121XATRHelper *xatrHelper;
XCX121XSTRHelper *xstrHelper;
XCX121XCHEHelper *xcheHelper;
@@ -2420,6 +2437,7 @@ class XCX121Helper : public XCBase
xccInputs.Clean();
xpvInputs.Clean();
xhkInputs.Clean();
xmasInputs.Clean();
xatrInputs.Clean();
xdonInputs.Clean();
xstrInputs.Clean();
@@ -2432,6 +2450,7 @@ class XCX121Helper : public XCBase
delete xccHelper;
delete xpvHelper;
delete xhkHelper;
delete xmasHelper;
delete xatrHelper;
delete xstrHelper;
delete xcheHelper;
@@ -2444,6 +2463,7 @@ class XCX121Helper : public XCBase
ZeroMemory(xccHelper);
ZeroMemory(xpvHelper);
ZeroMemory(xhkHelper);
ZeroMemory(xmasHelper);
ZeroMemory(xatrHelper);
ZeroMemory(xstrHelper);
ZeroMemory(xcheHelper);
@@ -2508,6 +2528,7 @@ class XCX121Helper : public XCBase
xccInputs = inputs.xccInputs;
xpvInputs = inputs.xpvInputs;
xhkInputs = inputs.xhkInputs;
xmasInputs = inputs.xmasInputs;
xatrInputs = inputs.xatrInputs;
xstrInputs = inputs.xstrInputs;
xcheInputs = inputs.xcheInputs;
@@ -2558,6 +2579,19 @@ class XCX121Helper : public XCBase
return result;
}
//
// XMAS ...
xmasHelper = new XCX121XMASHelper();
result = xmasHelper.Init(
symbol,
period,
xmasInputs //
);
if (!result)
{
return result;
}
//
// XATR ...
xatrHelper = new XCX121XATRHelper();
@@ -2719,6 +2753,28 @@ class XCX121Helper : public XCBase
return result;
}
//
// XMAS ...
bool GetMASConditions(
X121XMASConditions &conditions, //
int barIndex = 0, //
int loopback = 5 //
)
{
//
bool result = false;
//
result = xmasHelper.GetConditions(
conditions,
barIndex,
loopback //
);
//
return result;
}
//
// XATR ...
bool GetATRConditions(
@@ -2879,6 +2935,7 @@ class XCX121Helper : public XCBase
//
xpvHelper.Free();
xhkHelper.Free();
xmasHelper.Free();
xatrHelper.Free();
xstrHelper.Free();
xcheHelper.Free();
@@ -2979,6 +3036,19 @@ class XCX121Helper : public XCBase
return result;
}
//
// XMAS ...
X121XMASConditions xmasConditions;
result = GetMASConditions(
xmasConditions,
barIndex,
loopback //
);
if (!result)
{
return result;
}
//
// XATR ...
X121XATRConditions xatrConditions;
@@ -3293,6 +3363,30 @@ class XCX121Helper : public XCBase
conditions.isSMHKSwitchedToBullish = xhkConditions.isSMHKSwitchedToBullish;
conditions.isRawHKSwitchedToBullish = xhkConditions.isRawHKSwitchedToBullish;
//
// XMAS ...
//
// Buffers ...
//
Copy(
xmasConditions.upperBuffer,
conditions.masUpperBuffer //
);
//
Copy(
xmasConditions.midBuffer,
conditions.masMidBuffer //
);
//
Copy(
xmasConditions.lowerBuffer,
conditions.masLowerBuffer //
);
//
// XTREND ...
@@ -4458,6 +4552,7 @@ class XCX121Helper : public XCBase
//
xpvConditions.Clean();
xhkConditions.Clean();
xmasConditions.Clean();
xatrConditions.Clean();
xstrConditions.Clean();
xcheConditions.Clean();
@@ -4491,6 +4586,7 @@ class XCX121Helper : public XCBase
X121XCCInputs xccInputs;
X121XPVInputs xpvInputs;
X121XHKInputs xhkInputs;
X121XMASInputs xmasInputs;
X121XATRInputs xatrInputs;
X121XDONInputs xdonInputs;
X121XSTRInputs xstrInputs;