This commit is contained in:
2025-05-18 18:35:34 +03:30
parent 29527083b4
commit 1c6a60cf1a
6 changed files with 1542 additions and 87 deletions
+3 -3
View File
@@ -219,9 +219,6 @@ bool ToSignal(
//
double points = GetPoints(box.symbol);
//
double risk = box.GetRange();
//
double entry =
isBullish
@@ -235,6 +232,9 @@ bool ToSignal(
? box.lower
: box.upper;
//
double risk = MathAbs(entry - sl);
//
double tp = 0;
+1 -4
View File
@@ -264,10 +264,7 @@ void OnTick()
//
// Detect Signal Setups ...
has = eaSignallers[is].DetectSignalSetup(
r2r,
300 // Max Allowed SL Distance ...
);
has = eaSignallers[is].DetectSignalSetup(r2r);
if (has)
{
//
+2 -23
View File
@@ -25,6 +25,7 @@
#include "../../Classes/x-saherelm.x-bar.analyser.class.mq5"
#include "../../Classes/x-saherelm.x-poi.drawer.class.mq5"
#include "../Helpers/xcaea.helper.mq5"
#include "../Libraries/xcaea.trigger.block.lib.mq5"
//
// Definitions ...
@@ -45,8 +46,6 @@ enum ENUM_XCA_PIVOTS
XCA_RSI_CUOB, // RSICUOB
XCA_TREND_BULL, // TrendBull
XCA_TREND_BEAR, // TrendBear
XCA_TRIGGER_BULL, // TriggerBull
XCA_TRIGGER_BEAR, // TriggerBear
};
//
@@ -91,7 +90,6 @@ ENUM_X_DIRECTION GetDirection(ENUM_XCA_PIVOTS value)
case XCA_FVG_BULL:
case XCA_RSI_COOS:
case XCA_TREND_BULL:
case XCA_TRIGGER_BULL:
result = X_DIRECTION_BULLISH;
break;
@@ -102,7 +100,6 @@ ENUM_X_DIRECTION GetDirection(ENUM_XCA_PIVOTS value)
case XCA_FVG_BEAR:
case XCA_RSI_CUOB:
case XCA_TREND_BEAR:
case XCA_TRIGGER_BEAR:
result = X_DIRECTION_BEARISH;
break;
}
@@ -145,12 +142,6 @@ string GetBoxType(ENUM_XCA_PIVOTS value)
case XCA_TREND_BEAR:
result = "XCA_TREND";
break;
//
case XCA_TRIGGER_BULL:
case XCA_TRIGGER_BEAR:
result = "XCA_TRIGGER";
break;
}
//
@@ -195,10 +186,6 @@ ENUM_XCA_PIVOTS GetPivotType(XBoxZone &value)
value.dir == GetDirection(XCA_TREND_BULL);
bool isTrendBearish = value.type == GetBoxType(XCA_TREND_BEAR) &&
value.dir == GetDirection(XCA_TREND_BEAR);
bool isTriggerBullish = value.type == GetBoxType(XCA_TRIGGER_BULL) &&
value.dir == GetDirection(XCA_TRIGGER_BULL);
bool isTriggerBearish = value.type == GetBoxType(XCA_TRIGGER_BEAR) &&
value.dir == GetDirection(XCA_TRIGGER_BEAR);
//
if (isSWL)
@@ -249,14 +236,6 @@ ENUM_XCA_PIVOTS GetPivotType(XBoxZone &value)
{
result = XCA_TREND_BEAR;
}
else if (isTriggerBullish)
{
result = XCA_TRIGGER_BULL;
}
else if (isTriggerBearish)
{
result = XCA_TRIGGER_BEAR;
}
//
return result;
@@ -1023,7 +1002,7 @@ class XCXCAEAPOIDetector : public XCBase
//
continue;
}
//
// Checking Pivots ...
File diff suppressed because it is too large Load Diff
+52 -57
View File
@@ -51,6 +51,8 @@ class XCXCAEASignaller : XCBase
XCXCAEAHelper *analyseHelper;
XCXCAEAPOIDetector *detector;
XCAEAStrategyConditions mConditions;
bool allowAnalyseDecisionZoneSignalling;
bool allowTriggerBlockDecisionZoneSignalling;
XCAEAStrategyConditions mConditionsCollection[];
//
@@ -92,6 +94,11 @@ class XCXCAEASignaller : XCBase
allowDrawPOIs = false;
maxAllowedSetupAge = 576;
//
// Signallings ...
allowAnalyseDecisionZoneSignalling = false;
allowTriggerBlockDecisionZoneSignalling = true;
//
// Initial Bar Tracker ...
barTraker.Init(
@@ -166,13 +173,16 @@ class XCXCAEASignaller : XCBase
* @return ( bool )
*/
bool DetectSignalSetup(
double tpReward = 3,
double maxAllowedSLDistanceInPoint = 100 //
double tpReward = 3 //
)
{
//
bool result = false;
//
// Normalize Args ...
tpReward = NormalizeDouble(tpReward, 1);
//
// Check Bar Processing ...
if (!barTraker.CanProcessBar())
@@ -181,59 +191,30 @@ class XCXCAEASignaller : XCBase
}
//
int idx = -1;
int count = 0;
int zIndex = 0;
bool has = false;
int loopback = 10;
bool isBullish = false;
bool isBearish = false;
//
int zIndex = 0;
int cIndex = zIndex + 1;
int pIndex = cIndex + 1;
int p2Index = pIndex + 1;
//
int loopback = 10;
//
int idx = -1;
int count = 0;
bool has = false;
//
double ask = GetAsk(symbol);
double bid = GetBid(symbol);
datetime cTime = TimeCurrent();
double points = GetPoints(symbol);
//
XOHCL zBar;
XOHCL cBar;
XOHCL pBar;
XOHCL pPBar;
result = zBar.Init(
symbol,
period,
zIndex //
);
result =
result &&
zBar.GetPreviousBar(cBar);
result =
result &&
cBar.GetPreviousBar(pBar);
result =
result &&
pBar.GetPreviousBar(pPBar);
if (!result)
{
//
zBar.Clean();
cBar.Clean();
pBar.Clean();
pPBar.Clean();
//
return result;
}
datetime cTime = zBar.time;
//
// Detect Pivots ...
@@ -262,23 +243,42 @@ class XCXCAEASignaller : XCBase
ENUM_X_DIRECTION decisionZoneDir = X_DIRECTION_NONE;
//
// Checking Signal's Decision Zone ...
// On Analyse Time Frame ...
hasDecisionZone = DetectDecisionZone(
analyseHelper,
drawer,
decisionZone,
decisionZoneDir,
unavailables,
conditions,
zIndex,
loopback //
);
// Check Decision Zone Detection Based On Several Signalling ...
//
// Analyse DecisionZone ...
// In this Used Case we fond an Analyse TF OB
// then waits for trigger on it ...
if (allowAnalyseDecisionZoneSignalling)
{
//
// Checking Signal's Decision Zone ...
// On Analyse Time Frame ...
hasDecisionZone = DetectDecisionZone(
analyseHelper,
drawer,
decisionZone,
decisionZoneDir,
unavailables,
conditions,
zIndex,
loopback //
);
//
// Here we Can Validate Decision Zone ...
if (hasDecisionZone)
{
}
}
//
// Here we Can Validate Decision Zone ...
if (hasDecisionZone)
{
// TriggerBlock Decision Zone ...
// In this Used Case we found a Tigger Block and use it
// for Triggering ...
if (!hasDecisionZone &&
allowTriggerBlockDecisionZoneSignalling) {
//
}
//
@@ -339,11 +339,6 @@ class XCXCAEASignaller : XCBase
//
zBar.Clean();
cBar.Clean();
pBar.Clean();
pPBar.Clean();
//
conditions.Clean();
decisionZone.Clean();