last ...
This commit is contained in:
@@ -1478,7 +1478,6 @@ class XCXCAEAPOIDetector : public XCBase
|
|||||||
XBoxZone tmp[];
|
XBoxZone tmp[];
|
||||||
int count = FillPivots(
|
int count = FillPivots(
|
||||||
tmp,
|
tmp,
|
||||||
pivots,
|
|
||||||
unavailables,
|
unavailables,
|
||||||
allowedTypes,
|
allowedTypes,
|
||||||
to //
|
to //
|
||||||
@@ -1495,20 +1494,20 @@ class XCXCAEAPOIDetector : public XCBase
|
|||||||
has =
|
has =
|
||||||
//
|
//
|
||||||
// Validate Time ..
|
// Validate Time ..
|
||||||
iBox.from > box.from
|
iBox.from > decision.from
|
||||||
//
|
//
|
||||||
&&
|
&&
|
||||||
//
|
//
|
||||||
// Validate Price ...
|
// Validate Price ...
|
||||||
(
|
(
|
||||||
//
|
//
|
||||||
(iBox.upper < box.upper &&
|
(iBox.upper < decision.upper &&
|
||||||
iBox.upper > box.lower)
|
iBox.upper > decision.lower)
|
||||||
//
|
//
|
||||||
||
|
||
|
||||||
//
|
//
|
||||||
(iBox.lower > box.lower &&
|
(iBox.lower > decision.lower &&
|
||||||
iBox.lower < box.upper)
|
iBox.lower < decision.upper)
|
||||||
//
|
//
|
||||||
);
|
);
|
||||||
if (has)
|
if (has)
|
||||||
|
|||||||
@@ -538,6 +538,7 @@ bool DetectDecisionZone(
|
|||||||
XCXCAEAPOIDrawer *drawer,
|
XCXCAEAPOIDrawer *drawer,
|
||||||
XBoxZone &box,
|
XBoxZone &box,
|
||||||
ENUM_X_DIRECTION &dir,
|
ENUM_X_DIRECTION &dir,
|
||||||
|
XBoxZone &unavailables[],
|
||||||
XCAEAConditions &conditions,
|
XCAEAConditions &conditions,
|
||||||
int barIndex = 0,
|
int barIndex = 0,
|
||||||
int loopback = 10 //
|
int loopback = 10 //
|
||||||
@@ -1210,7 +1211,20 @@ bool DetectDecisionZone(
|
|||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Do Signal Preparing ...
|
// Check UnAvailables ...
|
||||||
|
int idx = -1;
|
||||||
|
has = FindBoxIndex(
|
||||||
|
idx,
|
||||||
|
box,
|
||||||
|
unavailables //
|
||||||
|
);
|
||||||
|
if (has)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
box.Clean();
|
||||||
|
conditions.Clean();
|
||||||
|
dir = X_DIRECTION_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Check Box is Prepared or Not ...
|
// Check Box is Prepared or Not ...
|
||||||
@@ -1235,6 +1249,7 @@ bool DetectDecisionZone(
|
|||||||
//
|
//
|
||||||
box.Clean();
|
box.Clean();
|
||||||
conditions.Clean();
|
conditions.Clean();
|
||||||
|
dir = X_DIRECTION_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -1660,46 +1675,195 @@ bool CanTriggerCond2(
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
string symbol = helper.GetSymbol();
|
||||||
|
bool isBullish = decisionZone.IsBullish();
|
||||||
|
bool isBearish = decisionZone.IsBearish();
|
||||||
|
ENUM_TIMEFRAMES period = helper.GetPeriod();
|
||||||
|
|
||||||
|
//
|
||||||
|
int zIndex = barIndex;
|
||||||
|
int cIndex = zIndex + 1;
|
||||||
|
int pIndex = cIndex + 1;
|
||||||
|
int p2Index = pIndex + 1;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Extract Bars ...
|
||||||
|
XOHCL zBar;
|
||||||
|
XOHCL cBar;
|
||||||
|
result = zBar.Init(
|
||||||
|
symbol,
|
||||||
|
period,
|
||||||
|
cIndex //
|
||||||
|
);
|
||||||
|
result =
|
||||||
|
result &&
|
||||||
|
zBar.GetPreviousBar(cBar);
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
zBar.Clean();
|
||||||
|
cBar.Clean();
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
bool has = false;
|
bool has = false;
|
||||||
|
XBoxZone selectedPivot;
|
||||||
bool hasPivots = HasChild(decisionPivots);
|
bool hasPivots = HasChild(decisionPivots);
|
||||||
int pivotsCount = ArraySize(decisionPivots);
|
int pivotsCount = ArraySize(decisionPivots);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Draw Decision Pivots ...
|
// Select Activated Pivot ...
|
||||||
if (hasPivots)
|
if (hasPivots)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
for (int i = 0; i < pivotsCount; i++)
|
for (int i = 0; i < pivotsCount; i++)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
XCBoxObject *iObj;
|
// Check Rejection of Block ...
|
||||||
|
has =
|
||||||
//
|
isBullish
|
||||||
has = helper.poiDrawer.DrawBox(
|
? cBar.IsBullish() &&
|
||||||
decisionPivots[i],
|
decisionPivots[i].IsBullish() &&
|
||||||
iObj //
|
cBar.low < decisionPivots[i].upper &&
|
||||||
);
|
cBar.low > decisionPivots[i].lower &&
|
||||||
|
cBar.close > decisionPivots[i].upper
|
||||||
|
: cBar.IsBearish() &&
|
||||||
|
decisionPivots[i].IsBearish() &&
|
||||||
|
cBar.high > decisionPivots[i].lower &&
|
||||||
|
cBar.high < decisionPivots[i].upper &&
|
||||||
|
cBar.close < decisionPivots[i].lower;
|
||||||
if (has)
|
if (has)
|
||||||
{
|
{
|
||||||
drawns.Add(iObj);
|
selectedPivot = decisionPivots[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
// //
|
||||||
ZeroMemory(iObj);
|
// // Draw Pivot ...
|
||||||
|
// XCBoxObject *iObj;
|
||||||
|
|
||||||
|
// //
|
||||||
|
// has = helper.poiDrawer.DrawBox(
|
||||||
|
// decisionPivots[i],
|
||||||
|
// iObj //
|
||||||
|
// );
|
||||||
|
// if (has)
|
||||||
|
// {
|
||||||
|
// drawns.Add(iObj);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// //
|
||||||
|
// ZeroMemory(iObj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Check Selected Pivot is Exists or not ...
|
||||||
|
bool hasSelectedPivot = selectedPivot.IsValid();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Detect Liquidity For Selected Pivot ...
|
||||||
|
double ssl = 0;
|
||||||
|
double bsl = 0;
|
||||||
|
bool hasSSL = false;
|
||||||
|
bool hasBSL = false;
|
||||||
|
if (hasSelectedPivot)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Required Info ...
|
||||||
|
// int toIDX = selectedPivot.ToIndex();
|
||||||
|
// int fromIDX = selectedPivot.FromIndex();
|
||||||
|
|
||||||
|
// //
|
||||||
|
// // SSL ...
|
||||||
|
// datetime sslTo = NULL;
|
||||||
|
// datetime sslFrom = NULL;
|
||||||
|
|
||||||
|
// //
|
||||||
|
// // BSL ...
|
||||||
|
// datetime bslTo = NULL;
|
||||||
|
// datetime bslFrom = NULL;
|
||||||
|
|
||||||
|
// //
|
||||||
|
// // Loop ...
|
||||||
|
// XOHCL iBar;
|
||||||
|
// for (int i = fromIDX; i > toIDX; i--)
|
||||||
|
// {
|
||||||
|
// //
|
||||||
|
// hasSSL =
|
||||||
|
// ssl > 0 &&
|
||||||
|
// IsValid(sslTo) &&
|
||||||
|
// IsValid(sslFrom);
|
||||||
|
|
||||||
|
// //
|
||||||
|
// hasBSL =
|
||||||
|
// bsl > 0 &&
|
||||||
|
// IsValid(bslTo) &&
|
||||||
|
// IsValid(bslFrom);
|
||||||
|
|
||||||
|
// //
|
||||||
|
// iBar.Clean();
|
||||||
|
|
||||||
|
// //
|
||||||
|
// if (hasSSL && hasBSL)
|
||||||
|
// {
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// iBar.Clean();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Draw Selected Pivot ...
|
||||||
|
if (hasSelectedPivot)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Draw Pivot ...
|
||||||
|
XCBoxObject *iObj;
|
||||||
|
|
||||||
|
//
|
||||||
|
has = helper.poiDrawer.DrawBox(
|
||||||
|
selectedPivot,
|
||||||
|
iObj //
|
||||||
|
);
|
||||||
|
if (has)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
color iColor =
|
||||||
|
isBullish
|
||||||
|
? clrAqua
|
||||||
|
: clrMagenta;
|
||||||
|
|
||||||
|
//
|
||||||
|
iObj.BoxWidth(2);
|
||||||
|
iObj.BoxColor(iColor);
|
||||||
|
iObj.BoxStyle(STYLE_SOLID);
|
||||||
|
|
||||||
|
//
|
||||||
|
drawns.Add(iObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
ZeroMemory(iObj);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Summarizing ...
|
// Summarizing ...
|
||||||
|
|
||||||
//
|
//
|
||||||
bool canTriggerLong =
|
bool canTriggerLong =
|
||||||
false;
|
isBullish &&
|
||||||
|
hasSelectedPivot &&
|
||||||
|
selectedPivot.IsBullish();
|
||||||
|
|
||||||
//
|
//
|
||||||
bool canTriggerShort =
|
bool canTriggerShort =
|
||||||
false;
|
isBearish &&
|
||||||
|
hasSelectedPivot &&
|
||||||
|
selectedPivot.IsBearish();
|
||||||
|
|
||||||
//
|
//
|
||||||
result = canTriggerLong ||
|
result = canTriggerLong ||
|
||||||
@@ -1715,8 +1879,8 @@ bool CanTriggerCond2(
|
|||||||
|
|
||||||
//
|
//
|
||||||
sl = canTriggerLong
|
sl = canTriggerLong
|
||||||
? decisionZone.lower // activatedFVG.lower
|
? selectedPivot.lower // activatedFVG.lower
|
||||||
: decisionZone.upper; // activatedFVG.upper;
|
: selectedPivot.upper; // activatedFVG.upper;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Since Here TP Must Calculated
|
// Since Here TP Must Calculated
|
||||||
@@ -1726,6 +1890,8 @@ bool CanTriggerCond2(
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Cleanup Resources ...
|
// Cleanup Resources ...
|
||||||
|
zBar.Clean();
|
||||||
|
cBar.Clean();
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -255,6 +255,7 @@ class XCXCAEASignaller : XCBase
|
|||||||
drawer,
|
drawer,
|
||||||
decisionZone,
|
decisionZone,
|
||||||
decisionZoneDir,
|
decisionZoneDir,
|
||||||
|
unAvailableBoxes,
|
||||||
conditions,
|
conditions,
|
||||||
zIndex,
|
zIndex,
|
||||||
loopback //
|
loopback //
|
||||||
@@ -288,8 +289,20 @@ class XCXCAEASignaller : XCBase
|
|||||||
// Do What we Want ...
|
// Do What we Want ...
|
||||||
barTraker.Waits();
|
barTraker.Waits();
|
||||||
|
|
||||||
|
//
|
||||||
|
double pivot = isBullish
|
||||||
|
? decisionZone.lower
|
||||||
|
: decisionZone.upper;
|
||||||
|
|
||||||
|
//
|
||||||
|
double point = isBullish
|
||||||
|
? decisionZone.upper
|
||||||
|
: decisionZone.lower;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Prepare Conditions ...
|
// Prepare Conditions ...
|
||||||
|
mConditions.point = point;
|
||||||
|
mConditions.pivot = pivot;
|
||||||
mConditions.symbol = symbol;
|
mConditions.symbol = symbol;
|
||||||
mConditions.period = period;
|
mConditions.period = period;
|
||||||
mConditions.time = zBar.time;
|
mConditions.time = zBar.time;
|
||||||
@@ -396,40 +409,32 @@ class XCXCAEASignaller : XCBase
|
|||||||
int toIDX = conditions.decisionZone.ToIndex();
|
int toIDX = conditions.decisionZone.ToIndex();
|
||||||
int fromIDX = conditions.decisionZone.FromIndex();
|
int fromIDX = conditions.decisionZone.FromIndex();
|
||||||
|
|
||||||
//
|
//
|
||||||
|
XBoxZone decisionOBs[];
|
||||||
|
ENUM_XCA_PIVOTS allowedTypes[];
|
||||||
// for (int i = fromIDX; i > toIDX; i--)
|
if (isBullish)
|
||||||
// {
|
{
|
||||||
// //
|
//
|
||||||
// // Initializing iBar;
|
Add(
|
||||||
// XOHCL iBar;
|
XCA_OB_BULL,
|
||||||
// has = iBar.Init(
|
allowedTypes //
|
||||||
// conditions.symbol,
|
);
|
||||||
// conditions.period,
|
}
|
||||||
// i //
|
else
|
||||||
// );
|
{
|
||||||
// if (!has)
|
//
|
||||||
// {
|
Add(
|
||||||
// //
|
XCA_OB_BEAR,
|
||||||
// iBar.Clean();
|
allowedTypes //
|
||||||
// continue;
|
);
|
||||||
// }
|
}
|
||||||
|
int decisionOBsCount = detector.FillPivots(
|
||||||
// //
|
conditions.decisionZone,
|
||||||
// // Retrieve Conditions ...
|
decisionOBs,
|
||||||
// XCAEAConditions iConditions;
|
unAvailableBoxes,
|
||||||
// has = helper.GetConditions(
|
allowedTypes,
|
||||||
// iConditions,
|
cTime //
|
||||||
// i,
|
);
|
||||||
// 5 //
|
|
||||||
// );
|
|
||||||
// if (!has) {
|
|
||||||
// //
|
|
||||||
// iBar.Clean();
|
|
||||||
// iConditions.Clean();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
//
|
//
|
||||||
CArrayObj *iObjects;
|
CArrayObj *iObjects;
|
||||||
@@ -594,15 +599,15 @@ class XCXCAEASignaller : XCBase
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Handling RF ...
|
// Handling RF ...
|
||||||
// double rfReward = risk * 1.85;
|
double rfReward = risk * 1.95;
|
||||||
// double rfPrice =
|
double rfPrice =
|
||||||
// isBullish
|
isBullish
|
||||||
// ? entry + rfReward
|
? entry + rfReward
|
||||||
// : entry - rfReward;
|
: entry - rfReward;
|
||||||
// Add(
|
Add(
|
||||||
// rfPrice,
|
rfPrice,
|
||||||
// conditions.targets //
|
conditions.targets //
|
||||||
// );
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
// rfReward = risk * 2.85;
|
// rfReward = risk * 2.85;
|
||||||
@@ -853,7 +858,7 @@ class XCXCAEASignaller : XCBase
|
|||||||
inputs.caInputs.showFiboLevel5 = false;
|
inputs.caInputs.showFiboLevel5 = false;
|
||||||
inputs.caInputs.showPeaksAndVales = true;
|
inputs.caInputs.showPeaksAndVales = true;
|
||||||
inputs.caInputs.showPeakAndValeGolden = false;
|
inputs.caInputs.showPeakAndValeGolden = false;
|
||||||
inputs.caInputs.showSupportAndResistance = false;
|
inputs.caInputs.showSupportAndResistance = true;
|
||||||
|
|
||||||
//
|
//
|
||||||
// XOSCS ...
|
// XOSCS ...
|
||||||
|
|||||||
Reference in New Issue
Block a user