last ...
This commit is contained in:
@@ -1064,7 +1064,10 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
||||
// Validator Flags ...
|
||||
bool validateByZones = true;
|
||||
bool validateByXFIMARejected = true;
|
||||
bool validateByXFIMAMACrossed = true;
|
||||
bool validateByCyclesMATresnding = true;
|
||||
bool validateByHasDirectionalZones = true;
|
||||
bool validateByHasInDirectionalZones = true;
|
||||
|
||||
//
|
||||
// Define Requirements ...
|
||||
@@ -1077,6 +1080,8 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
||||
double rejecteds[];
|
||||
bool isBullish = false;
|
||||
bool isBearish = false;
|
||||
XBoxZone directionalZone;
|
||||
XBoxZone inDirectionalZone;
|
||||
XPatternAnalysis pBarPatterns;
|
||||
XPatternAnalysis p2BarPatterns;
|
||||
XPatternAnalysis p3BarPatterns;
|
||||
@@ -1260,6 +1265,13 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
||||
if (result && validateByZones)
|
||||
{
|
||||
//
|
||||
int bullishCount = 0;
|
||||
int bearishCount = 0;
|
||||
XBoxZone bullishZones[];
|
||||
XBoxZone bearishZones[];
|
||||
|
||||
//
|
||||
// Detect Zones ...
|
||||
int zonesCount = poiDetector.DetectZones(
|
||||
bar,
|
||||
zones,
|
||||
@@ -1280,29 +1292,131 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
||||
UpdateToTime(zones, bar.time);
|
||||
|
||||
//
|
||||
// Validate by Zones Existance ...
|
||||
result = result && IsValidSize(zonesCount);
|
||||
|
||||
//
|
||||
// Validate By Directional Zones Existance ...
|
||||
if (result)
|
||||
{
|
||||
//
|
||||
XBoxZone tmpZones[];
|
||||
int bullishCount = ExtractByDirection(
|
||||
tmpZones,
|
||||
// Separate Bullish Zones ...
|
||||
bullishCount = ExtractByDirection(
|
||||
bullishZones,
|
||||
zones,
|
||||
X_DIRECTION_BULLISH //
|
||||
);
|
||||
int bearishCount = ExtractByDirection(
|
||||
tmpZones,
|
||||
|
||||
//
|
||||
// Separate Bearish Zones ...
|
||||
bearishCount = ExtractByDirection(
|
||||
bearishZones,
|
||||
zones,
|
||||
X_DIRECTION_BEARISH //
|
||||
);
|
||||
|
||||
//
|
||||
result =
|
||||
result &&
|
||||
IsValidSize(bullishCount) &&
|
||||
IsValidSize(bearishCount);
|
||||
// Validate by Has Directional Zones ...
|
||||
if (result && validateByHasDirectionalZones)
|
||||
{
|
||||
//
|
||||
// Validate by Existance ...
|
||||
result =
|
||||
result &&
|
||||
(isBullish
|
||||
? IsValidSize(bullishCount)
|
||||
: IsValidSize(bearishCount));
|
||||
|
||||
//
|
||||
// Select Directional Zone ...
|
||||
if (result)
|
||||
{
|
||||
//
|
||||
int idx = -1;
|
||||
if (isBullish)
|
||||
{
|
||||
idx = GetYoungest(bullishZones);
|
||||
}
|
||||
else
|
||||
{
|
||||
idx = GetYoungest(bearishZones);
|
||||
}
|
||||
|
||||
//
|
||||
result = IsValidIndex(idx);
|
||||
if (result)
|
||||
{
|
||||
//
|
||||
if (isBullish)
|
||||
{
|
||||
directionalZone = bullishZones[idx];
|
||||
}
|
||||
else
|
||||
{
|
||||
directionalZone = bearishZones[idx];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Check Result ...
|
||||
result = directionalZone.IsValid();
|
||||
}
|
||||
|
||||
//
|
||||
// Validate by Has InDirectional Zones ...
|
||||
if (result && validateByHasInDirectionalZones)
|
||||
{
|
||||
//
|
||||
// Validate by Existance ...
|
||||
result =
|
||||
result &&
|
||||
(isBullish
|
||||
? IsValidSize(bearishCount)
|
||||
: IsValidSize(bullishCount));
|
||||
|
||||
//
|
||||
// Select InDirectional Zone ...
|
||||
if (result)
|
||||
{
|
||||
//
|
||||
int idx = -1;
|
||||
if (isBullish)
|
||||
{
|
||||
idx = GetYoungest(bearishZones);
|
||||
}
|
||||
else
|
||||
{
|
||||
idx = GetYoungest(bullishZones);
|
||||
}
|
||||
|
||||
//
|
||||
result = IsValidIndex(idx);
|
||||
if (result)
|
||||
{
|
||||
//
|
||||
if (isBullish)
|
||||
{
|
||||
inDirectionalZone = bearishZones[idx];
|
||||
}
|
||||
else
|
||||
{
|
||||
inDirectionalZone = bullishZones[idx];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Check Result ...
|
||||
result = inDirectionalZone.IsValid();
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Cleanup ...
|
||||
XClean(bullishZones);
|
||||
XClean(bearishZones);
|
||||
|
||||
//
|
||||
// Reset Flags ...
|
||||
if (!result)
|
||||
@@ -1316,6 +1430,13 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Validate Detected Zone By Crossed MA Fast Slow ...
|
||||
if (result && validateByXFIMAMACrossed)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
//
|
||||
// TODO: Remove this and Put inside Draws Part ...
|
||||
if (result)
|
||||
@@ -1365,6 +1486,20 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
||||
{
|
||||
poiDrawer.DrawZones(zones, iConfig);
|
||||
}
|
||||
|
||||
//
|
||||
// Draw Directional Zone ...
|
||||
if (directionalZone.IsValid())
|
||||
{
|
||||
poiDrawer.DrawZone(directionalZone, iConfig);
|
||||
}
|
||||
|
||||
//
|
||||
// Draw InDirectional Zone ...
|
||||
if (inDirectionalZone.IsValid())
|
||||
{
|
||||
poiDrawer.DrawZone(inDirectionalZone, iConfig);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
@@ -1493,6 +1628,8 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
||||
p2BarPatterns.Clean();
|
||||
p3BarPatterns.Clean();
|
||||
iPatternsConfig.Clean();
|
||||
directionalZone.Clean();
|
||||
inDirectionalZone.Clean();
|
||||
|
||||
//
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user