last ...
This commit is contained in:
@@ -1064,7 +1064,10 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
|||||||
// Validator Flags ...
|
// Validator Flags ...
|
||||||
bool validateByZones = true;
|
bool validateByZones = true;
|
||||||
bool validateByXFIMARejected = true;
|
bool validateByXFIMARejected = true;
|
||||||
|
bool validateByXFIMAMACrossed = true;
|
||||||
bool validateByCyclesMATresnding = true;
|
bool validateByCyclesMATresnding = true;
|
||||||
|
bool validateByHasDirectionalZones = true;
|
||||||
|
bool validateByHasInDirectionalZones = true;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Define Requirements ...
|
// Define Requirements ...
|
||||||
@@ -1077,6 +1080,8 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
|||||||
double rejecteds[];
|
double rejecteds[];
|
||||||
bool isBullish = false;
|
bool isBullish = false;
|
||||||
bool isBearish = false;
|
bool isBearish = false;
|
||||||
|
XBoxZone directionalZone;
|
||||||
|
XBoxZone inDirectionalZone;
|
||||||
XPatternAnalysis pBarPatterns;
|
XPatternAnalysis pBarPatterns;
|
||||||
XPatternAnalysis p2BarPatterns;
|
XPatternAnalysis p2BarPatterns;
|
||||||
XPatternAnalysis p3BarPatterns;
|
XPatternAnalysis p3BarPatterns;
|
||||||
@@ -1260,6 +1265,13 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
|||||||
if (result && validateByZones)
|
if (result && validateByZones)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
|
int bullishCount = 0;
|
||||||
|
int bearishCount = 0;
|
||||||
|
XBoxZone bullishZones[];
|
||||||
|
XBoxZone bearishZones[];
|
||||||
|
|
||||||
|
//
|
||||||
|
// Detect Zones ...
|
||||||
int zonesCount = poiDetector.DetectZones(
|
int zonesCount = poiDetector.DetectZones(
|
||||||
bar,
|
bar,
|
||||||
zones,
|
zones,
|
||||||
@@ -1280,29 +1292,131 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
|||||||
UpdateToTime(zones, bar.time);
|
UpdateToTime(zones, bar.time);
|
||||||
|
|
||||||
//
|
//
|
||||||
|
// Validate by Zones Existance ...
|
||||||
result = result && IsValidSize(zonesCount);
|
result = result && IsValidSize(zonesCount);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Validate By Directional Zones Existance ...
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
XBoxZone tmpZones[];
|
// Separate Bullish Zones ...
|
||||||
int bullishCount = ExtractByDirection(
|
bullishCount = ExtractByDirection(
|
||||||
tmpZones,
|
bullishZones,
|
||||||
zones,
|
zones,
|
||||||
X_DIRECTION_BULLISH //
|
X_DIRECTION_BULLISH //
|
||||||
);
|
);
|
||||||
int bearishCount = ExtractByDirection(
|
|
||||||
tmpZones,
|
//
|
||||||
|
// Separate Bearish Zones ...
|
||||||
|
bearishCount = ExtractByDirection(
|
||||||
|
bearishZones,
|
||||||
zones,
|
zones,
|
||||||
X_DIRECTION_BEARISH //
|
X_DIRECTION_BEARISH //
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
result =
|
// Validate by Has Directional Zones ...
|
||||||
result &&
|
if (result && validateByHasDirectionalZones)
|
||||||
IsValidSize(bullishCount) &&
|
{
|
||||||
IsValidSize(bearishCount);
|
//
|
||||||
|
// 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 ...
|
// Reset Flags ...
|
||||||
if (!result)
|
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 ...
|
// TODO: Remove this and Put inside Draws Part ...
|
||||||
if (result)
|
if (result)
|
||||||
@@ -1365,6 +1486,20 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
|
|||||||
{
|
{
|
||||||
poiDrawer.DrawZones(zones, iConfig);
|
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();
|
p2BarPatterns.Clean();
|
||||||
p3BarPatterns.Clean();
|
p3BarPatterns.Clean();
|
||||||
iPatternsConfig.Clean();
|
iPatternsConfig.Clean();
|
||||||
|
directionalZone.Clean();
|
||||||
|
inDirectionalZone.Clean();
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
Reference in New Issue
Block a user