last ...
This commit is contained in:
@@ -227,6 +227,41 @@ class XCMarketPatternDetector : public XCBase
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool HasSameBars(
|
||||||
|
XOHCL &bar,
|
||||||
|
ENUM_X_DIRECTION &dir,
|
||||||
|
int &count,
|
||||||
|
int validation = 3 //
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
bool result = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Normalize ...
|
||||||
|
count = 0;
|
||||||
|
dir = X_DIRECTION_NONE;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Validate ...
|
||||||
|
result =
|
||||||
|
bar.IsValid() &&
|
||||||
|
validation > 1;
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
result =
|
||||||
|
count > 0 &&
|
||||||
|
HasDirection(dir) &&
|
||||||
|
count >= validation;
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Detectors ...
|
// Detectors ...
|
||||||
|
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ class XCX121XKIPOIDetector : public XCMarketPatternDetector
|
|||||||
string forSymbol = NULL,
|
string forSymbol = NULL,
|
||||||
ENUM_TIMEFRAMES forPeriod = NULL,
|
ENUM_TIMEFRAMES forPeriod = NULL,
|
||||||
int loopback = 50,
|
int loopback = 50,
|
||||||
|
int minAllowedSameDirectionalBars = 4,
|
||||||
int confluence = 1,
|
int confluence = 1,
|
||||||
int confluenceLoopback = 50 //
|
int confluenceLoopback = 50 //
|
||||||
)
|
)
|
||||||
@@ -133,6 +134,41 @@ class XCX121XKIPOIDetector : public XCMarketPatternDetector
|
|||||||
confluenceLoopback = 0;
|
confluenceLoopback = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
if (minAllowedSameDirectionalBars < 0)
|
||||||
|
{
|
||||||
|
minAllowedSameDirectionalBars = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Here We have to Detect Zones ...
|
||||||
|
// Preparing Loops ...
|
||||||
|
XOHCL tmpBar;
|
||||||
|
bool has = false;
|
||||||
|
double upper = 0;
|
||||||
|
double lower = 0;
|
||||||
|
XBoxZone tmpZone;
|
||||||
|
string type = NULL;
|
||||||
|
double tmpValue = 0;
|
||||||
|
datetime from = NULL;
|
||||||
|
int start = barIndex;
|
||||||
|
int end = barIndex + loopback;
|
||||||
|
datetime to = GetBarTime(forSymbol, forPeriod, barIndex);
|
||||||
|
for (int i = start; i < end; i++)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Initialize Bar ...
|
||||||
|
has = tmpBar.Init(forSymbol, forPeriod, i);
|
||||||
|
if (has)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Next Step is Detect Sequence Same Directional Bars ...
|
||||||
|
|
||||||
|
//
|
||||||
|
tmpBar.Clean();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
result = ArraySize(zones);
|
result = ArraySize(zones);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user