last ...
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include "../../Helpers/x-saherelm.x121.xca.helper.mq5"
|
||||
#include "../../Helpers/x-saherelm.x121.xcc.helper.mq5"
|
||||
#include "../../Helpers/x-saherelm.x121.xct.helper.mq5"
|
||||
#include "../../Helpers/x-saherelm.x121.x3ma.helper.mq5"
|
||||
#include "../../Helpers/x-saherelm.x121.xoscs.helper.mq5"
|
||||
|
||||
//
|
||||
@@ -51,6 +52,7 @@ struct XCAEAInputs
|
||||
X121XCTInputs ctInputs;
|
||||
X121XCCInputs ccInputs;
|
||||
X121XCAInputs caInputs;
|
||||
X121X3MAInputs x3maInputs;
|
||||
X121XOCSInputs oscsInputs;
|
||||
|
||||
//
|
||||
@@ -85,6 +87,7 @@ struct XCAEAInputs
|
||||
ctInputs.Clean();
|
||||
ccInputs.Clean();
|
||||
caInputs.Clean();
|
||||
x3maInputs.Clean();
|
||||
oscsInputs.Clean();
|
||||
|
||||
//
|
||||
@@ -100,6 +103,7 @@ struct XCAEAInputs
|
||||
ctInputs.Default();
|
||||
ccInputs.Default();
|
||||
caInputs.Default();
|
||||
x3maInputs.Default();
|
||||
oscsInputs.Default();
|
||||
}
|
||||
|
||||
@@ -119,7 +123,8 @@ struct XCAEAInputs
|
||||
ctInputs.IsValid() &&
|
||||
ccInputs.IsValid() &&
|
||||
caInputs.IsValid() &&
|
||||
oscsInputs.IsValid()
|
||||
x3maInputs.IsValid() &&
|
||||
oscsInputs.IsValid()
|
||||
//
|
||||
;
|
||||
|
||||
@@ -142,11 +147,13 @@ struct XCAEAInputs
|
||||
int ccMax = ccInputs.Max();
|
||||
int caMax = caInputs.Max();
|
||||
int ocsMax = oscsInputs.Max();
|
||||
int x3maMax = x3maInputs.Max();
|
||||
|
||||
//
|
||||
result = MathMax(ctMax, ccMax);
|
||||
result = MathMax(result, caMax);
|
||||
result = MathMax(result, ocsMax);
|
||||
result = MathMax(result, x3maMax);
|
||||
|
||||
//
|
||||
return result;
|
||||
@@ -167,6 +174,47 @@ struct XCAEAConditions
|
||||
datetime to;
|
||||
datetime from;
|
||||
|
||||
//
|
||||
// X3MA ...
|
||||
|
||||
//
|
||||
// Buffers ...
|
||||
|
||||
//
|
||||
double fastBuffer[];
|
||||
double mediumBuffer[];
|
||||
double slowBuffer[];
|
||||
double fastStateBuffer[];
|
||||
double mediumStateBuffer[];
|
||||
double slowStateBuffer[];
|
||||
|
||||
//
|
||||
// Conditions ...
|
||||
|
||||
//
|
||||
bool isFastOverMedium;
|
||||
bool isFastUnderMedium;
|
||||
|
||||
//
|
||||
bool isFastCrossedOverMedium;
|
||||
bool isFastCrossedUnderMedium;
|
||||
|
||||
//
|
||||
bool isFastOverSlow;
|
||||
bool isFastUnderSlow;
|
||||
|
||||
//
|
||||
bool isFastCrossedOverSlow;
|
||||
bool isFastCrossedUnderSlow;
|
||||
|
||||
//
|
||||
bool isMediumOverSlow;
|
||||
bool isMediumUnderSlow;
|
||||
|
||||
//
|
||||
bool isMediumCrossedOverSlow;
|
||||
bool isMediumCrossedUnderSlow;
|
||||
|
||||
//
|
||||
// XCA ...
|
||||
|
||||
@@ -673,6 +721,55 @@ struct XCAEAConditions
|
||||
from = NULL;
|
||||
time = NULL;
|
||||
|
||||
//
|
||||
// X3MA ...
|
||||
|
||||
//
|
||||
// Buffers ...
|
||||
|
||||
//
|
||||
Clean(fastBuffer);
|
||||
Clean(mediumBuffer);
|
||||
Clean(slowBuffer);
|
||||
Clean(fastStateBuffer);
|
||||
Clean(mediumStateBuffer);
|
||||
Clean(slowStateBuffer);
|
||||
|
||||
//
|
||||
ArraySetAsSeries(fastBuffer, true);
|
||||
ArraySetAsSeries(mediumBuffer, true);
|
||||
ArraySetAsSeries(slowBuffer, true);
|
||||
ArraySetAsSeries(fastStateBuffer, true);
|
||||
ArraySetAsSeries(mediumStateBuffer, true);
|
||||
ArraySetAsSeries(slowStateBuffer, true);
|
||||
|
||||
//
|
||||
// Conditions ...
|
||||
|
||||
//
|
||||
isFastOverMedium = false;
|
||||
isFastUnderMedium = false;
|
||||
|
||||
//
|
||||
isFastCrossedOverMedium = false;
|
||||
isFastCrossedUnderMedium = false;
|
||||
|
||||
//
|
||||
isFastOverSlow = false;
|
||||
isFastUnderSlow = false;
|
||||
|
||||
//
|
||||
isFastCrossedOverSlow = false;
|
||||
isFastCrossedUnderSlow = false;
|
||||
|
||||
//
|
||||
isMediumOverSlow = false;
|
||||
isMediumUnderSlow = false;
|
||||
|
||||
//
|
||||
isMediumCrossedOverSlow = false;
|
||||
isMediumCrossedUnderSlow = false;
|
||||
|
||||
//
|
||||
// XCA ...
|
||||
|
||||
@@ -1158,9 +1255,64 @@ struct XCAEAConditions
|
||||
double minScore = 0.5;
|
||||
double highScore = 1.5;
|
||||
|
||||
//
|
||||
// X3MA ...
|
||||
|
||||
//
|
||||
// XCA ...
|
||||
|
||||
//
|
||||
if (isFastOverSlow)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isFastOverMedium)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isMediumOverSlow)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isFastCrossedOverSlow)
|
||||
{
|
||||
bullishScore += score;
|
||||
}
|
||||
if (isFastCrossedOverMedium)
|
||||
{
|
||||
bullishScore += score;
|
||||
}
|
||||
if (isMediumCrossedOverSlow)
|
||||
{
|
||||
bullishScore += score;
|
||||
}
|
||||
|
||||
//
|
||||
if (isFastUnderSlow)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isMediumUnderSlow)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isFastUnderMedium)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isFastCrossedUnderSlow)
|
||||
{
|
||||
bearishScore += score;
|
||||
}
|
||||
if (isFastCrossedUnderMedium)
|
||||
{
|
||||
bearishScore += score;
|
||||
}
|
||||
if (isMediumCrossedUnderSlow)
|
||||
{
|
||||
bearishScore += score;
|
||||
}
|
||||
|
||||
//
|
||||
// KI ...
|
||||
|
||||
@@ -1931,6 +2083,22 @@ struct XCAEAConditions
|
||||
//
|
||||
string conditionsStr =
|
||||
//
|
||||
//
|
||||
"-----------------------" + separator +
|
||||
"X3MA: " + separator +
|
||||
"-----------------------" + separator +
|
||||
ToString("isFastOverMedium", isFastOverMedium, ignoreFalseConditions, separator) +
|
||||
ToString("isFastUnderMedium", isFastUnderMedium, ignoreFalseConditions, separator) +
|
||||
ToString("isFastCrossedOverMedium", isFastCrossedOverMedium, ignoreFalseConditions, separator) +
|
||||
ToString("isFastCrossedUnderMedium", isFastCrossedUnderMedium, ignoreFalseConditions, separator) +
|
||||
ToString("isFastOverSlow", isFastOverSlow, ignoreFalseConditions, separator) +
|
||||
ToString("isFastUnderSlow", isFastUnderSlow, ignoreFalseConditions, separator) +
|
||||
ToString("isFastCrossedOverSlow", isFastCrossedOverSlow, ignoreFalseConditions, separator) +
|
||||
ToString("isFastCrossedUnderSlow", isFastCrossedUnderSlow, ignoreFalseConditions, separator) +
|
||||
ToString("isMediumOverSlow", isMediumOverSlow, ignoreFalseConditions, separator) +
|
||||
ToString("isMediumUnderSlow", isMediumUnderSlow, ignoreFalseConditions, separator) +
|
||||
ToString("isMediumCrossedOverSlow", isMediumCrossedOverSlow, ignoreFalseConditions, separator) +
|
||||
ToString("isMediumCrossedUnderSlow", isMediumCrossedUnderSlow, ignoreFalseConditions, separator) +
|
||||
"-----------------------" + separator +
|
||||
"XCA: " + separator +
|
||||
"-----------------------" + separator +
|
||||
@@ -2159,6 +2327,7 @@ class XCXCAEAHelper : XCBase
|
||||
XCX121XCTHelper *ctHelper;
|
||||
XCX121XCAHelper *caHelper;
|
||||
XCX121XOCSHelper *ocsHelper;
|
||||
XCX121X3MAHelper *x3maHelper;
|
||||
|
||||
//
|
||||
// Constructor ...
|
||||
@@ -2180,6 +2349,7 @@ class XCXCAEAHelper : XCBase
|
||||
ZeroMemory(ctHelper);
|
||||
ZeroMemory(caHelper);
|
||||
ZeroMemory(ocsHelper);
|
||||
ZeroMemory(x3maHelper);
|
||||
|
||||
//
|
||||
ZeroMemory(poiDrawer);
|
||||
@@ -2310,6 +2480,17 @@ class XCXCAEAHelper : XCBase
|
||||
mInputs.oscsInputs //
|
||||
);
|
||||
|
||||
//
|
||||
// X3MA ...
|
||||
x3maHelper = new XCX121X3MAHelper();
|
||||
result =
|
||||
result &&
|
||||
x3maHelper.Init(
|
||||
symbol,
|
||||
period,
|
||||
mInputs.x3maInputs //
|
||||
);
|
||||
|
||||
//
|
||||
if (!result)
|
||||
{
|
||||
@@ -2318,6 +2499,7 @@ class XCXCAEAHelper : XCBase
|
||||
ZeroMemory(ctHelper);
|
||||
ZeroMemory(caHelper);
|
||||
ZeroMemory(ocsHelper);
|
||||
ZeroMemory(x3maHelper);
|
||||
|
||||
//
|
||||
ZeroMemory(poiDrawer);
|
||||
@@ -2539,6 +2721,7 @@ class XCXCAEAHelper : XCBase
|
||||
ZeroMemory(ctHelper);
|
||||
ZeroMemory(caHelper);
|
||||
ZeroMemory(ocsHelper);
|
||||
ZeroMemory(x3maHelper);
|
||||
|
||||
//
|
||||
IndicatorRelease(acHandler);
|
||||
@@ -2564,6 +2747,35 @@ class XCXCAEAHelper : XCBase
|
||||
//
|
||||
// Conditions Readers ...
|
||||
|
||||
/**
|
||||
* Retrieve Conditions ...
|
||||
*
|
||||
* @param conditions: Argument 1
|
||||
* @param barIndex: int, Specified Bar Index ...
|
||||
* @param loopback: int, Loopback looking for others ...
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool Get3MAConditions(
|
||||
X121X3MAConditions &conditions, //
|
||||
int barIndex = 0, //
|
||||
int loopback = 5 //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
result = x3maHelper.GetConditions(
|
||||
conditions,
|
||||
barIndex,
|
||||
loopback //
|
||||
);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve Conditions ...
|
||||
*
|
||||
@@ -2631,6 +2843,7 @@ class XCXCAEAHelper : XCBase
|
||||
//
|
||||
caHelper.Free();
|
||||
ocsHelper.Free();
|
||||
x3maHelper.Free();
|
||||
}
|
||||
|
||||
//
|
||||
@@ -2672,6 +2885,7 @@ class XCXCAEAHelper : XCBase
|
||||
//
|
||||
X121XCAConditions xcaConditions;
|
||||
X121XOCSConditions xocsConditions;
|
||||
X121X3MAConditions x3maConditions;
|
||||
|
||||
//
|
||||
result = zBar.Init(
|
||||
@@ -2682,7 +2896,7 @@ class XCXCAEAHelper : XCBase
|
||||
result =
|
||||
result &&
|
||||
zBar.GetPreviousBar(cBar);
|
||||
result =
|
||||
result =
|
||||
result &&
|
||||
cBar.GetPreviousBar(pBar);
|
||||
result =
|
||||
@@ -2715,6 +2929,16 @@ class XCXCAEAHelper : XCBase
|
||||
loopback //
|
||||
);
|
||||
|
||||
//
|
||||
// X3MA ...
|
||||
result =
|
||||
result &&
|
||||
Get3MAConditions(
|
||||
x3maConditions,
|
||||
barIndex,
|
||||
loopback //
|
||||
);
|
||||
|
||||
//
|
||||
// Check Result ...
|
||||
if (!result)
|
||||
@@ -2728,6 +2952,7 @@ class XCXCAEAHelper : XCBase
|
||||
//
|
||||
xcaConditions.Clean();
|
||||
xocsConditions.Clean();
|
||||
x3maConditions.Clean();
|
||||
|
||||
//
|
||||
return result;
|
||||
@@ -2745,6 +2970,65 @@ class XCXCAEAHelper : XCBase
|
||||
int cIDX = 1;
|
||||
int pIDX = cIDX + 1;
|
||||
|
||||
//
|
||||
// X3MA ...
|
||||
|
||||
//
|
||||
// Buffers ...
|
||||
|
||||
//
|
||||
Copy (
|
||||
x3maConditions.fastBuffer,
|
||||
conditions.fastBuffer //
|
||||
);
|
||||
|
||||
//
|
||||
Copy (
|
||||
x3maConditions.mediumBuffer,
|
||||
conditions.mediumBuffer //
|
||||
);
|
||||
|
||||
//
|
||||
Copy (
|
||||
x3maConditions.slowBuffer,
|
||||
conditions.slowBuffer //
|
||||
);
|
||||
|
||||
//
|
||||
Copy (
|
||||
x3maConditions.fastStateBuffer,
|
||||
conditions.fastStateBuffer //
|
||||
);
|
||||
|
||||
//
|
||||
Copy (
|
||||
x3maConditions.mediumStateBuffer,
|
||||
conditions.mediumStateBuffer //
|
||||
);
|
||||
|
||||
//
|
||||
Copy (
|
||||
x3maConditions.slowStateBuffer,
|
||||
conditions.slowStateBuffer //
|
||||
);
|
||||
|
||||
//
|
||||
// Conditions ...
|
||||
|
||||
//
|
||||
conditions.isFastOverSlow = x3maConditions.isFastOverSlow;
|
||||
conditions.isFastUnderSlow = x3maConditions.isFastUnderSlow;
|
||||
conditions.isFastOverMedium = x3maConditions.isFastOverMedium;
|
||||
conditions.isMediumOverSlow = x3maConditions.isMediumOverSlow;
|
||||
conditions.isFastUnderMedium = x3maConditions.isFastUnderMedium;
|
||||
conditions.isMediumUnderSlow = x3maConditions.isMediumUnderSlow;
|
||||
conditions.isFastCrossedOverSlow = x3maConditions.isFastCrossedOverSlow;
|
||||
conditions.isFastCrossedUnderSlow = x3maConditions.isFastCrossedUnderSlow;
|
||||
conditions.isFastCrossedOverMedium = x3maConditions.isFastCrossedOverMedium;
|
||||
conditions.isMediumCrossedOverSlow = x3maConditions.isMediumCrossedOverSlow;
|
||||
conditions.isFastCrossedUnderMedium = x3maConditions.isFastCrossedUnderMedium;
|
||||
conditions.isMediumCrossedUnderSlow = x3maConditions.isMediumCrossedUnderSlow;
|
||||
|
||||
//
|
||||
// XCA ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user