cleanup and prepare Signallers ...

This commit is contained in:
2025-05-05 20:10:10 +03:30
parent aa08c57413
commit 905ea76a16
4 changed files with 4174 additions and 1891 deletions
+8 -231
View File
@@ -45,7 +45,6 @@ class XCXCAEASignaller : XCBase
XCAEAInputs inputs;
XBarTracker barTraker;
XCXCAEAHelper *helper;
bool rfOnInvalidPivots;
XCXCAEAPOIDrawer *drawer;
bool continuesRFTillTarget;
XBoxZone unAvailableBoxes[];
@@ -86,7 +85,6 @@ class XCXCAEASignaller : XCBase
//
useGuards = false;
useTargets = true;
rfOnInvalidPivots = false;
continuesRFTillTarget = false;
//
@@ -123,7 +121,7 @@ class XCXCAEASignaller : XCBase
inputs.x3maInputs.fastLength = 5;
//
inputs.x3maInputs.showFast = false;
inputs.x3maInputs.showFast = true;
inputs.x3maInputs.showSlow = false;
inputs.x3maInputs.showMedium = false;
@@ -131,6 +129,7 @@ class XCXCAEASignaller : XCBase
inputs.caInputs.showMAH = true;
inputs.caInputs.showMAL = true;
inputs.caInputs.showMAC = true;
inputs.caInputs.showSar = true;
inputs.caInputs.showSwings = true;
inputs.caInputs.showFiboLevel1 = true;
inputs.caInputs.showFiboLevel2 = true;
@@ -142,7 +141,6 @@ class XCXCAEASignaller : XCBase
//
inputs.caInputs.showKI = false;
inputs.caInputs.showTKI = false;
inputs.caInputs.showSar = false;
inputs.caInputs.showVidya = false;
inputs.caInputs.showTrend = false;
inputs.caInputs.showPeakAndValeGolden = false;
@@ -221,8 +219,8 @@ class XCXCAEASignaller : XCBase
detector.selectEngulfedFVGPivots = false;
detector.validateFVGUsingManalyser = true;
detector.applyLastBarToFVGBoundary = false;
detector.selectOnlyFVGWhichHasIndirectionalLastBar = true;
detector.selectOnlyFVGWhichHasIndirectionalLastBar = true;
//
// Bullish ...
detector.detectFVGBullishPivots = true;
@@ -230,7 +228,7 @@ class XCXCAEASignaller : XCBase
//
// Bearish ...
detector.detectFVGBearishPivots = true;
//
// TREND ...
@@ -456,100 +454,14 @@ class XCXCAEASignaller : XCBase
//
// Setup Conditions ...
double targets[];
XBoxZone pivots[];
XBoxZone pivotBox;
XBoxZone signalBox;
int pivotsCount = 0;
bool hasTrend = false;
bool hasPivots = false;
double additionalSL = 0;
bool hasSignalBox = false;
XCAEAConditions conditions;
ENUM_X_DIRECTION trend = X_DIRECTION_NONE;
ENUM_X_DIRECTION signalBoxDir = X_DIRECTION_NONE;
//
// Detecting Pivots ...
// detector.Detect(
// zIndex //
// );
//
// Validate Pivots ...
// detector.Validate(
// unAvailableBoxes,
// zIndex //
// );
//
// if (detector.pivotDetectionLoopbac > 100)
// {
// detector.pivotDetectionLoopbac = 100;
// }
//
// Draw Founded Pivots ...
// drawer.Draw(cTime);
//
// drawer.DrawPeakPivots(cTime);
// drawer.DrawValePivots(cTime);
// drawer.DrawFVGBullishPivots(cTime);
// drawer.DrawFVGBearishPivots(cTime);
// drawer.DrawTrendBullishPivots(cTime);
// drawer.DrawTrendBearishPivots(cTime);
//
// Retrieve Valid Pviots ...
// pivotsCount = detector.FillPivots(pivots);
// hasPivots = IsValidSize(pivotsCount);
//
// Filter UnAvailable Boxes ...
// if (hasPivots)
// {
// //
// // Remove UnAvailable Boxes ...
// has = HasChild(unAvailableBoxes);
// if (has)
// {
// //
// count = ArraySize(unAvailableBoxes);
// for (int i = 0; i < count; i++)
// {
// //
// XBoxZone iBox = unAvailableBoxes[i];
// //
// has = FindBoxIndex(
// idx,
// iBox,
// pivots //
// );
// if (has)
// {
// //
// ArrayRemove(
// pivots,
// idx,
// 1 //
// );
// }
// }
// }
// //
// hasPivots = HasChild(pivots);
// pivotsCount = ArraySize(pivots);
// }
//
//
//
//
TestDetectSignal(
// Checking Test Signal ...
hasSignalBox = TestDetectSignal(
helper,
drawer,
signalBox,
@@ -559,37 +471,9 @@ class XCXCAEASignaller : XCBase
loopback //
);
// //
// // Detect Sinal Box ...
// hasSignalBox = DetectXCAEAConditions(
// drawer,
// trend,
// pivots,
// conditions,
// pivotBox,
// signalBox,
// targets,
// additionalSL,
// signalBoxDir,
// helper,
// zIndex,
// loopback //
// );
//
// Make Pivot Box UnAvailable ...
if (pivotBox.IsValid())
{
//
AddRef(
pivotBox,
unAvailableBoxes //
);
}
//
// Make Signal Box UnAvailable ...
if (signalBox.IsValid())
if (hasSignalBox)
{
//
AddRef(
@@ -651,14 +535,6 @@ class XCXCAEASignaller : XCBase
isBullish
? signalBox.lower
: signalBox.upper;
if (additionalSL > 0)
{
//
sl =
isBullish
? sl - additionalSL
: sl + additionalSL;
}
//
double risk =
@@ -710,12 +586,6 @@ class XCXCAEASignaller : XCBase
// Targets Preparing ...
if (useTargets)
{
//
Copy(
targets,
mConditions.targets //
);
//
// Select RF Rewards ...
if (continuesRFTillTarget)
@@ -759,104 +629,12 @@ class XCXCAEASignaller : XCBase
mConditions.targets //
);
}
//
// Detect Rf on Invalid Pivots ...
if (rfOnInvalidPivots)
{
//
has = detector.HasInvalidPivots();
if (has)
{
//
XBoxZone targetBox;
double targetBoxPrice = 0;
count = detector.CountInvalidPivots();
for (int i = 0; i < count; i++)
{
//
XBoxZone iPivot = detector.invalidPivots[i];
//
bool isValidPivot =
Contains(
"XCA_PEAKSWHRES",
iPivot.type //
) ||
Contains(
"XCA_VALESWLSUP",
iPivot.type //
) ||
Contains(
"XCA_FVG",
iPivot.type //
);
if (!isValidPivot)
{
//
iPivot.Clean();
continue;
}
//
double selectedPrice =
isBullish
? iPivot.lower - (5 * points)
: iPivot.upper + (5 * points);
//
double targetBoxSelectedPrice =
isBullish
? targetBox.lower - (5 * points)
: targetBox.upper + (5 * points);
//
bool isDirPassed = iPivot.dir = signalBoxDir;
bool isPricePassed =
isBullish
? entry < selectedPrice
: entry > selectedPrice;
bool canSetTarget =
!targetBox.IsValid()
? true
: isBullish
? targetBoxSelectedPrice > selectedPrice
: targetBoxSelectedPrice < selectedPrice;
if (canSetTarget)
{
//
targetBox = iPivot;
targetBoxPrice = targetBoxSelectedPrice;
}
//
iPivot.Clean();
}
//
if (targetBox.IsValid() &&
targetBoxPrice > 0)
{
//
Add(
targetBoxPrice,
mConditions.targets //
);
}
//
targetBox.Clean();
}
}
}
}
//
// Cleanup Resource ...
//
Clean(pivots);
//
zBar.Clean();
cBar.Clean();
@@ -864,7 +642,6 @@ class XCXCAEASignaller : XCBase
pPBar.Clean();
//
pivotBox.Clean();
signalBox.Clean();
conditions.Clean();