This commit is contained in:
2025-05-13 23:50:17 +03:30
parent 6e0936b469
commit ca28c56256
2 changed files with 68 additions and 37 deletions
+61 -36
View File
@@ -40,12 +40,14 @@ class XCXCAEASignaller : XCBase
//
// Props ...
bool useGuards;
int poiLoopback;
bool allowDraws;
XCAEAInputs inputs;
bool allowDrawPOIs;
XBarTracker barTraker;
XCXCAEAHelper *helper;
int maxAllowedSetupAge;
XBoxZone unavailables[];
XCXCAEAPOIDrawer *drawer;
XBoxZone unAvailableBoxes[];
XCXCAEAHelper *analyseHelper;
XCXCAEAPOIDetector *detector;
XCAEAStrategyConditions mConditions;
@@ -84,9 +86,14 @@ class XCXCAEASignaller : XCBase
void Init()
{
//
// Configure Signaller Handler ...
useGuards = false;
allowDraws = true;
allowDrawPOIs = false;
maxAllowedSetupAge = 576;
//
// Initial Bar Tracker ...
barTraker.Init(
symbol,
period //
@@ -121,6 +128,9 @@ class XCXCAEASignaller : XCBase
ZeroMemory(detector);
ZeroMemory(analyseHelper);
//
Clean(unavailables);
//
mConditions.Clean();
Clean(mConditionsCollection);
@@ -178,7 +188,7 @@ class XCXCAEASignaller : XCBase
int zIndex = 0;
int cIndex = zIndex + 1;
int pIndex = cIndex + 1;
int ppIndex = pIndex + 1;
int p2Index = pIndex + 1;
//
int loopback = 10;
@@ -232,13 +242,17 @@ class XCXCAEASignaller : XCBase
//
// Validate Pivots ...
detector.Validate(
unAvailableBoxes,
unavailables,
zIndex //
);
//
// Draw Pivots ...
// drawer.Draw(cTime);
if (allowDraws &&
allowDrawPOIs)
{
drawer.Draw(cTime);
}
//
// Setup Conditions ...
@@ -255,7 +269,7 @@ class XCXCAEASignaller : XCBase
drawer,
decisionZone,
decisionZoneDir,
unAvailableBoxes,
unavailables,
conditions,
zIndex,
loopback //
@@ -274,7 +288,7 @@ class XCXCAEASignaller : XCBase
//
AddRef(
decisionZone,
unAvailableBoxes //
unavailables //
);
}
@@ -347,17 +361,18 @@ class XCXCAEASignaller : XCBase
*/
bool DetectSignalTrigger(
XCAEAStrategyConditions &conditions,
int barIndex = 0,
int maxAllowedSetupAge = 576 //
int barIndex = 0 //
)
{
//
bool result = false;
//
// Normalize Args ...
barIndex = NormalizeInt(barIndex, 0);
//
// Validate Setup ...
result = conditions.IsSetuped();
if (!result)
{
@@ -365,34 +380,28 @@ class XCXCAEASignaller : XCBase
}
//
// Reading Requirements ...
//
int loopback = 10;
double ask = GetAsk(symbol);
double bid = GetBid(symbol);
datetime cTime = TimeCurrent();
double points = GetPoints(symbol);
datetime setupTime = conditions.setupTime;
ENUM_X_DIRECTION setupDir = conditions.dir;
//
helper.GetConditions(
conditions.conditions,
barIndex //
);
//
bool isBullish = IsBullish(setupDir);
bool isBearish = IsBearish(setupDir);
//
int zIndex = 0;
int cIndex = zIndex + 1;
int pIndex = cIndex + 1;
int ppIndex = pIndex + 1;
//
bool has = false;
int loopback = 10;
//
double ask = GetAsk(symbol);
double bid = GetBid(symbol);
datetime cTime = TimeCurrent();
double points = GetPoints(symbol);
// Extract Current Bar Conditions ...
helper.GetConditions(
conditions.conditions,
barIndex,
loopback //
);
//
// Check Signal Validation ...
@@ -407,6 +416,13 @@ class XCXCAEASignaller : XCBase
return result;
}
//
bool has = false;
int zIndex = 0;
int cIndex = zIndex + 1;
int pIndex = cIndex + 1;
int p2Index = pIndex + 1;
//
// Checking Trigger Conditions ...
double sl = 0;
@@ -425,12 +441,16 @@ class XCXCAEASignaller : XCBase
//
// Draw Decision Zone ...
drawer.DrawBox(
conditions.decisionZone,
cTime,
true, // Draw Middle Line ...
true // Ignore Type ...
);
if (allowDraws)
{
//
drawer.DrawBox(
conditions.decisionZone,
cTime,
true, // Draw Middle Line ...
true // Ignore Type ...
);
}
//
// Detect Required Pivots ...
@@ -455,7 +475,7 @@ class XCXCAEASignaller : XCBase
int decisionPivotsCount = detector.FillPivots(
conditions.decisionZone,
decisionPivots,
unAvailableBoxes,
unavailables,
allowedTypes,
cTime //
);
@@ -486,6 +506,7 @@ class XCXCAEASignaller : XCBase
triggerDir,
sl,
targets,
allowDraws,
iObjects,
barIndex //
);
@@ -504,6 +525,7 @@ class XCXCAEASignaller : XCBase
triggerDir,
sl,
targets,
allowDraws,
iObjects,
barIndex //
);
@@ -693,6 +715,9 @@ class XCXCAEASignaller : XCBase
//
bool result = false;
//
// TODO: Implement this ...
//
return result;
}