This commit is contained in:
2025-06-08 10:59:45 +03:30
parent ad67a892c3
commit bf70c327d5
7 changed files with 2455 additions and 110 deletions
+1 -1
View File
@@ -228,7 +228,7 @@ class XCMD5
//
// Convert DWord to Byte ...
void DWordToByte(uchar &out[], int &in[], uint len)
void DWordToByte(uchar &out[], uint &in[], uint len)
{
//
uint i = 0;
+20
View File
@@ -899,6 +899,26 @@ class XCPOIDrawer : public XCBase
object.BoxStyle(style.style);
}
/**
* Apply Specified Style to Object ...
*/
void ApplyStyle(
XCBarArrowObject *&object,
XPOIStyle &style //
)
{
//
bool has = object != NULL;
if (!has)
{
return;
}
//
object.ArrowColor(style.clr);
object.ArrowWidth(style.width);
}
//
protected:
//
File diff suppressed because it is too large Load Diff
@@ -1056,7 +1056,7 @@ bool IsRunningOnTestMode()
//
// check programm mode ...
result = MQL5InfoInteger(MQL5_TESTING);
result = MQLInfoInteger(MQL_TESTER);
//
return result;
+6 -6
View File
@@ -1972,12 +1972,12 @@ class XCXCATBEAExpert : public XCBase
//
// Make Available all Requirement Buffers of XCATB indicator ...
iSignallerInputs.catbInputs.showPV = false;
iSignallerInputs.catbInputs.showKI = false;
iSignallerInputs.catbInputs.showSar = false;
iSignallerInputs.catbInputs.showTrend = false;
iSignallerInputs.catbInputs.showATRBand = false;
iSignallerInputs.catbInputs.showPVGolden = false;
iSignallerInputs.catbInputs.showPV = true;
iSignallerInputs.catbInputs.showKI = true;
iSignallerInputs.catbInputs.showSar = true;
iSignallerInputs.catbInputs.showTrend = true;
iSignallerInputs.catbInputs.showATRBand = true;
iSignallerInputs.catbInputs.showPVGolden = true;
//
// Signalling Configurations ...
+111 -77
View File
@@ -199,10 +199,10 @@ class XCXCATBEASignaller : XCBase
double slATRMultiplier; // SL ATR Multiplier ...
//
XBarTracker barTraker; // Bar Tracker ...
XCX121XCatbHelper *helper; // XCATB Helper Class instance ...
XCBarAnalyser *barAnalyser; // Bar Analyser ...
XCXCATBEAPOIDrawer *drawer; // POI Drawer ...
XBarTracker ticksBarTracker; // Bar Tracker ...
XTriggerBlockFilters filters; // Trigger Block Filters ...
XCXCATBEAPOIDetector *detector; // POI Detector ...
XTriggerBlockValidationRules validations; // Trigger Block Validations ...
@@ -295,6 +295,13 @@ class XCXCATBEASignaller : XCBase
barIndex //
);
//
// Check Bar Processing ...
if (!ticksBarTracker.CanProcessBar())
{
return;
}
//
// Check Triggered Conditions ...
has = HasChild(mConditionsCollection);
@@ -378,13 +385,6 @@ class XCXCATBEASignaller : XCBase
}
}
//
// Check Bar Processing ...
if (!barTraker.CanProcessBar())
{
return;
}
//
// Initialize Bar ...
bar.Init(
@@ -518,7 +518,7 @@ class XCXCATBEASignaller : XCBase
if (has)
{
//
barTraker.Waits();
ticksBarTracker.Waits();
//
AddConditionsIfNotExists();
@@ -1514,12 +1514,12 @@ class XCXCATBEASignaller : XCBase
.IsValidForTrigger(
cConditions.bars[0],
triggerDir,
false, // Allow Cond 1 ...
false, // Allow Cond 2 ...
false, // Allow Cond 3 ...
false, // Allow Cond 4 ...
false, // Allow Cond 5 ...
false, // Allow Cond 6 ...
true, // Allow Cond 1 ...
true, // Allow Cond 2 ...
true, // Allow Cond 3 ...
true, // Allow Cond 4 ...
true, // Allow Cond 5 ...
true, // Allow Cond 6 ...
true // Allow Cond 7 ...
//
);
@@ -1571,79 +1571,111 @@ class XCXCATBEASignaller : XCBase
DrawPivotZone(conditions.pivotZone);
//
// 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)
// Trigger on Detection Time ...
bool triggerPivotZonesOnSetupTime = true;
if (triggerPivotZonesOnSetupTime)
{
//
conditions.triggerTime = TimeCurrent();
}
else
{
//
// Check atleast 3 Bars Close Outside of applied Edge ...
// Check Current Bar is a Trigger Bar ...
// TODO: Complete this ...
//
// Check Bar is Touched Zone Middle or not ...
double mid = conditions.pivotZone.GetMid();
bool isMiddlePassed =
// Checking Score ...
double bullishScore = 0;
double bearishScore = 0;
cConditions
.GenerateScore(
bullishScore,
bearishScore //
);
bool isScorePassed =
isBullish
? (cConditions.bars[1].low < mid &&
cConditions.bars[1].GetDown() > mid)
: (cConditions.bars[1].high > mid &&
cConditions.bars[1].GetUp() < mid);
? bullishScore > bearishScore
: bearishScore > bullishScore;
// true;
//
result =
result &&
isMiddlePassed;
// 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));
//
// Checking Conditions Requirements ...
//
bool isConditionsBullishPowered =
//
// Trend ...
(cConditions.isTrendBullish ||
(!cConditions.isTrendBullish &&
!cConditions.isTrendBearish));
//
bool isConditionsBearishPowered =
//
// Trend ...
(cConditions.isTrendBearish ||
(!cConditions.isTrendBullish &&
!cConditions.isTrendBearish));
//
isBullish =
isBullish &&
isBarInside &&
isScorePassed &&
isBullishTriggerBar &&
isConditionsBullishPowered;
//
isBearish =
isBearish &&
isBarInside &&
isScorePassed &&
isBearishTriggerBar &&
isConditionsBearishPowered;
//
result = isBullish ||
isBearish;
result = false;
if (result)
{
//
Print("Trigger Bar Detected ...");
conditions.triggerTime = TimeCurrent();
// 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].high > mid &&
cConditions.bars[1].GetUp() < mid);
//
// Ignore Box Middle Pass ...
// result =
// result &&
// isMiddlePassed;
//
if (result)
{
//
// Print("Trigger Bar Detected ...");
conditions.triggerTime = TimeCurrent();
}
}
}
//
}
//
@@ -1800,7 +1832,7 @@ class XCXCATBEASignaller : XCBase
//
// Initialize Bar Tracker ...
has = barTraker.Init(
has = ticksBarTracker.Init(
symbol,
period //
);
@@ -1809,6 +1841,8 @@ class XCXCATBEASignaller : XCBase
return;
}
//
//
// Initialize Bar Analyser ...
barAnalyser = new XCBarAnalyser();
@@ -1863,7 +1897,7 @@ class XCXCATBEASignaller : XCBase
ZeroMemory(barAnalyser);
//
barTraker.Clean();
ticksBarTracker.Clean();
}
/**
+85 -25
View File
@@ -860,17 +860,40 @@ bool DetectSignalZone(
isMomentum &&
IsBearish(iBDir);
//
bool isTriggerBar = barAnalyser
.IsValidForTrigger(
conditions.bars[0],
iBDir,
true, // Allow Cond 1 ...
true, // Allow Cond 2 ...
true, // Allow Cond 3 ...
true, // Allow Cond 4 ...
true, // Allow Cond 5 ...
true, // Allow Cond 6 ...
true // Allow Cond 7 ...
//
);
bool isBullishTriggerBar =
isTriggerBar &&
IsBullish(iBDir);
bool isBearishTriggerBar =
isTriggerBar &&
IsBearish(iBDir);
//
bool isBarBullishPressured =
isBullishRejected ||
isBullishEngulfed ||
isBullishMomentum;
isBullishMomentum ||
isBullishTriggerBar;
//
bool isBarBearishPressured =
isBearishRejected ||
isBearishEngulfed ||
isBearishMomentum;
isBearishMomentum ||
isBearishTriggerBar;
//
// Implement Signalling Conditions ...
@@ -881,9 +904,12 @@ bool DetectSignalZone(
// --------------
// Descriptions:
// - [] Detect Parabolic Sar Direction Change ...
// - [] Check Some others Conditions based on Changed Direction ...
// - [] Generate Direction Change Zone ...
// - [] Use it to Fill Signal Zone ...
// - [] KI is Directional ...
// - [] Bar Has Pressured ...
// - [] ATR is Directional Up/Down ...
// - [] TREND is Directional ...
// - [] TREND is Directional Change ...
// - [] TREND is Directional Up/Down ...
// ------------------------------------
//
@@ -912,8 +938,9 @@ bool DetectSignalZone(
conditions.isATRUp &&
//
// TREND ...
conditions.isTrendUp // &&
// conditions.isTrendBullish
isTrendBullishStart &&
conditions.isTrendUp &&
conditions.isTrendBullish
//
;
@@ -938,8 +965,9 @@ bool DetectSignalZone(
conditions.isATRDown &&
//
// TREND ...
conditions.isTrendDown // &&
// conditions.isTrendBearish
isTrendBearishStart &&
conditions.isTrendDown &&
conditions.isTrendBearish
//
;
}
@@ -990,29 +1018,59 @@ bool DetectSignalZone(
// - [] Generate Direction Change Zone ...
// - [] Use it to Fill Signal Zone ...
// ------------------------------------
// Descriptions:
// - []
// ------------------------------------
//
bool isCond2Bullish = false;
bool isCond2Bearish = false;
if (allowSignallingConditions2)
{
//
isCond2Bullish =
//
// Start ...
(isTrendBullishStart &&
!isTrendBearishStart)
//
;
// //
// isCond2Bullish =
// //
// // Start ...
// (isTrendBullishStart &&
// !isTrendBearishStart)
// //
// ;
// //
// isCond2Bearish =
// //
// // Start ...
// (isTrendBearishStart &&
// !isTrendBullishStart)
// //
// ;
//
// Temp Cndition 2 ...
//
// Bullish ...
isCond2Bullish =
isScoreBullish &&
isBullishTriggerBar &&
conditions.isKIBullish &&
conditions.isSarSwitchedToBullish;
// isScoreBullish &&
// isBarBullishPressured &&
// conditions.isKISwitchedToBullish &&
// conditions.isSarSwitchedToBullish;
//
// Bearish ...
isCond2Bearish =
//
// Start ...
(isTrendBearishStart &&
!isTrendBullishStart)
//
;
isScoreBearish &&
isBearishTriggerBar &&
conditions.isKIBearish &&
conditions.isSarSwitchedToBearish;
// isScoreBearish &&
// isBarBearishPressured &&
// conditions.isKISwitchedToBearish &&
// conditions.isSarSwitchedToBearish;
}
//
@@ -1021,6 +1079,10 @@ bool DetectSignalZone(
isCond2Bearish;
if (isCond2)
{
//
// Retireve Conditions 2 ...
Print("Condition 2 Happens ...");
//
// Generate Direction Shift Zone ...
has = GenerateTrendDirectionShiftBox(
@@ -1443,8 +1505,6 @@ bool DetectSignalZone(
}
//
Print("Conditions ...");
// signalZone.Clean();
}
//