last ...
This commit is contained in:
@@ -421,6 +421,7 @@ int AddGuard(
|
||||
|
||||
//
|
||||
bool DetectXCAEAConditions(
|
||||
ENUM_X_DIRECTION trend,
|
||||
XBoxZone &pivots[],
|
||||
XCAEAConditions &conditions,
|
||||
XBoxZone &pivotBox,
|
||||
@@ -454,11 +455,21 @@ bool DetectXCAEAConditions(
|
||||
loopback = NormalizeInt(loopback, 5);
|
||||
|
||||
//
|
||||
// Retrieve Some Requirements ...
|
||||
string symbol = helper.GetSymbol();
|
||||
ENUM_TIMEFRAMES period = helper.GetPeriod();
|
||||
double points = GetPoints(symbol);
|
||||
|
||||
//
|
||||
// Trend Parsing ...
|
||||
bool hasTrend = HasDirection(trend);
|
||||
bool hasBullishTrend = hasTrend &&
|
||||
IsBullish(trend);
|
||||
bool hasBearishTrend = hasTrend &&
|
||||
IsBearish(trend);
|
||||
|
||||
//
|
||||
// Retrieve Previous and Current Bar Conditions ...
|
||||
XCAEAConditions pConditions;
|
||||
result = helper.GetConditions(
|
||||
conditions,
|
||||
@@ -482,6 +493,7 @@ bool DetectXCAEAConditions(
|
||||
}
|
||||
|
||||
//
|
||||
// Define IDXses ...
|
||||
int zIDX = barIndex;
|
||||
int cIDX = zIDX + 1;
|
||||
int pIDX = cIDX + 1;
|
||||
@@ -489,9 +501,6 @@ bool DetectXCAEAConditions(
|
||||
int p3IDX = p2IDX + 1;
|
||||
int p4IDX = p3IDX + 1;
|
||||
|
||||
//
|
||||
// Reading Parameters ...
|
||||
|
||||
//
|
||||
// Reading Bars ...
|
||||
|
||||
@@ -545,6 +554,7 @@ bool DetectXCAEAConditions(
|
||||
// Bars Conditions ...
|
||||
|
||||
//
|
||||
// Temparory Bar Direction ...
|
||||
ENUM_X_DIRECTION cBarDir;
|
||||
|
||||
//
|
||||
@@ -647,6 +657,7 @@ bool DetectXCAEAConditions(
|
||||
bearishScore > bullishScore;
|
||||
|
||||
//
|
||||
// Generating Conditions Summary ...
|
||||
string summary =
|
||||
conditions
|
||||
.GenerateSummary();
|
||||
@@ -654,16 +665,76 @@ bool DetectXCAEAConditions(
|
||||
//
|
||||
// Conditions ...
|
||||
|
||||
//
|
||||
// Parsing Pivots ...
|
||||
|
||||
//
|
||||
// Detect Selected Pivot ...
|
||||
XBoxZone oscPivots[];
|
||||
XBoxZone lastOSCPivot;
|
||||
double providedSL = 0;
|
||||
bool hasPivots = HasChild(pivots);
|
||||
if (hasPivots)
|
||||
{
|
||||
//
|
||||
// Detect Selected Boxes ...
|
||||
// Detect Selected Pivots ...
|
||||
count = ArraySize(pivots);
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XBoxZone iPivot = pivots[i];
|
||||
|
||||
//
|
||||
// Detect Selected Last OSC Pivots ...
|
||||
bool isOSC =
|
||||
Contains(
|
||||
"XCA_RSI",
|
||||
iPivot.type //
|
||||
) ||
|
||||
Contains(
|
||||
"XCA_CCI",
|
||||
iPivot.type //
|
||||
);
|
||||
bool canSetOSC =
|
||||
!isOSC
|
||||
? false
|
||||
: !lastOSCPivot.IsValid()
|
||||
? true
|
||||
: lastOSCPivot.from < iPivot.from;
|
||||
if (canSetOSC)
|
||||
{
|
||||
lastOSCPivot = iPivot;
|
||||
}
|
||||
|
||||
//
|
||||
iPivot.Clean();
|
||||
|
||||
//
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Detect New OSC Pivot Happens ...
|
||||
bool hasNewOSC = lastOSCPivot.IsValid() &&
|
||||
cBar.time == lastOSCPivot.to;
|
||||
if (hasNewOSC)
|
||||
{
|
||||
//
|
||||
XCBoxObject *iObj;
|
||||
has = helper.poiDrawer.DrawBox(
|
||||
lastOSCPivot,
|
||||
iObj //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
iObj.BoxWidth(2);
|
||||
|
||||
//
|
||||
Print("OSC Box Detected ...");
|
||||
}
|
||||
|
||||
//
|
||||
ZeroMemory(iObj);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -855,6 +926,9 @@ bool DetectXCAEAConditions(
|
||||
conditions.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
lastOSCPivot.Clean();
|
||||
|
||||
//
|
||||
zBar.Clean();
|
||||
cBar.Clean();
|
||||
|
||||
Reference in New Issue
Block a user