This commit is contained in:
2025-06-07 09:27:02 +03:30
parent c5ad6e50c2
commit 739464f6ee
2 changed files with 220 additions and 4 deletions
+97 -1
View File
@@ -171,6 +171,9 @@ class XCXCATBEASignaller : XCBase
//
// Props ...
//
int maxAllowedSetupAge; // Maximum Allowed Setup Age for Living
//
bool allowSignallingBasedOnConditions; // Signalling Based on Market Conditions
bool allowSignallingBasedOnTriggerBlocks; // Signalling Based on Trigger Blocks
@@ -1450,7 +1453,7 @@ class XCXCATBEASignaller : XCBase
* Detect Trigger Conditions for Specified Signal ...
*
* @param conditions: XCATBEAStrategyConditions instance Reference, Specified Signal Conditions ...
* @param maxAllowedSetupAge: specified Setup Age for Expiration (if bigger than Zero) ...
* @param barIndex: int, Bar Index ...
*
* @return ( bool )
*/
@@ -1582,6 +1585,77 @@ class XCXCATBEASignaller : XCBase
// Check atleast 3 Bars Close Outside of applied Edge ...
// Check Current Bar is a Trigger Bar ...
// TODO: Complete this ...
//
// Checking Score ...
double bullishScore = 0;
double bearishScore = 0;
cConditions
.GenerateScore(
bullishScore,
bearishScore //
);
bool isScorePassed =
true;
// isBullish
// ? bullishScore > bearishScore
// : bearishScore > bullishScore;
//
// Check Bar is Inside Zone ...
bool isBarInside =
(isBullish
? (cConditions.bars[1].low < conditions.pivotZone.upper &&
cConditions.bars[1].low > conditions.pivotZone.lower)
: (cConditions.bars[1].high > conditions.pivotZone.lower &&
cConditions.bars[1].high < conditions.pivotZone.upper));
//
isBullish =
isBullish &&
isBarInside &&
isScorePassed &&
isBullishTriggerBar;
//
isBearish =
isBearish &&
isBarInside &&
isScorePassed &&
isBearishTriggerBar;
//
result = isBullish ||
isBearish;
if (result)
{
//
// Check Bar is Touched Zone Middle or not ...
double mid = conditions.pivotZone.GetMid();
bool isMiddlePassed =
isBullish
? (cConditions.bars[1].low < mid &&
(cConditions.bars[1].GetDown() > mid ||
cConditions.bars[1].close > mid))
: (cConditions.bars[1].high > mid &&
(cConditions.bars[1].GetUp() < mid ||
cConditions.bars[1].close < mid));
//
result =
result &&
isMiddlePassed;
//
if (result)
{
//
Print("Trigger Bar Detected ...");
conditions.triggerTime = TimeCurrent();
}
}
//
}
@@ -1602,9 +1676,30 @@ class XCXCATBEASignaller : XCBase
//
// Validate Pivot Zone Based Setups ...
if (isBasedOnPivotZone)
{
//
// Check Box Breaked ...
has = IsSignalZoneBreaked(
helper,
conditions.pivotZone,
barIndex //
);
if (has)
{
conditions.Clean();
}
}
//
// Validate Setup Age ...
int age = conditions.GetSetupAge();
bool has = maxAllowedSetupAge > 0 &&
age <= maxAllowedSetupAge;
if (!has)
{
conditions.Clean();
}
}
//
@@ -1675,6 +1770,7 @@ class XCXCATBEASignaller : XCBase
void Init(XCATBEASignallerInputs &inputs)
{
//
maxAllowedSetupAge = 288;
maxAllowedCollection = 100;
//