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