last ...
This commit is contained in:
@@ -490,10 +490,10 @@ class XCXFIMAPOIDetector : public XCMarketPatternDetector
|
||||
|
||||
/**
|
||||
* Detect XPV Zone ...
|
||||
*
|
||||
*
|
||||
* @param zone: XBoxZone, reference to Holds detected Zone ...
|
||||
* @param barIndex: int, Specified Bar Index ...
|
||||
*
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool DetectXPVZone(
|
||||
@@ -1610,11 +1610,11 @@ class XCXFIMAPOIDetector : public XCMarketPatternDetector
|
||||
|
||||
/**
|
||||
* Collect Specified ZOnes Boundary Min / Max Values ...
|
||||
*
|
||||
*
|
||||
* @param uppers: XPivot, collection reference to holds Peaks of Zone's Boundary ...
|
||||
* @param lowers: XPivot, collection reference to holds Vales of Zone's Boundary ...
|
||||
* @param zone: XBoxZone, reference to Provide Specified Zone for Boundary Detection ...
|
||||
*
|
||||
*
|
||||
* @return ( int )
|
||||
*/
|
||||
int CollectZonesBoundary(
|
||||
@@ -2088,6 +2088,112 @@ class XCXFIMAPOIDetector : public XCMarketPatternDetector
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check Specified Bar is Rejected Specified XFIMA Values or not ...
|
||||
*
|
||||
* @param bar: XOHCL, reference to Specified Bar ...
|
||||
* @param rejecteds: double, collection reference to holds Rejected Values ...
|
||||
* @param forDir: ENUM_X_DIRECTION, Specified required Rejection Direction ...
|
||||
* @param bullishRejectUpperPriceType: ENUM_X_PRICE, Specified Bullish Rejection Upper Price Type ...
|
||||
* @param bullishRejectLowerPriceType: ENUM_X_PRICE, Specified Bullish Rejection Lower Price Type ...
|
||||
* @param bearishRejectUpperPriceType: ENUM_X_PRICE, Specified Bearish Rejection Upper Price Type ...
|
||||
* @param bearishRejectLowerPriceType: ENUM_X_PRICE, Specified Bearish Rejection Lower Price Type ...
|
||||
* @param ignoreBoundary: bool, ignoring XFIMA Max and Min Values Rejections ...
|
||||
*
|
||||
* @return ( int )
|
||||
*/
|
||||
int IsRejectXFIMA(
|
||||
XOHCL &bar,
|
||||
double &rejecteds[],
|
||||
ENUM_X_DIRECTION forDir,
|
||||
ENUM_X_PRICE bullishRejectUpperPriceType = X_PRICE_DOWN,
|
||||
ENUM_X_PRICE bullishRejectLowerPriceType = X_PRICE_LOW,
|
||||
ENUM_X_PRICE bearishRejectUpperPriceType = X_PRICE_HIGH,
|
||||
ENUM_X_PRICE bearishRejectLowerPriceType = X_PRICE_UP,
|
||||
bool ignoreBoundary = false //
|
||||
)
|
||||
{
|
||||
//
|
||||
int result = 0;
|
||||
|
||||
//
|
||||
// Prepare ...
|
||||
XClean(rejecteds);
|
||||
|
||||
//
|
||||
// Validate ...
|
||||
bool has =
|
||||
bar.IsValid() &&
|
||||
fimaParser.IsValid() &&
|
||||
HasDirection(forDir) &&
|
||||
IsXValid(bullishRejectLowerPriceType) &&
|
||||
IsXValid(bullishRejectUpperPriceType) &&
|
||||
IsXValid(bearishRejectUpperPriceType) &&
|
||||
IsXValid(bearishRejectLowerPriceType);
|
||||
if (!has)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
int pBarIndex = bar.Index() + 1;
|
||||
bool isBullish = IsXBullish(forDir);
|
||||
|
||||
//
|
||||
// Reading Values ...
|
||||
double values[];
|
||||
int count = fimaParser.ReadXFIMAValues(values, pBarIndex);
|
||||
has = HasChild(values);
|
||||
|
||||
//
|
||||
// Detect Rejected Prices ...
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
double min = GetMin(values);
|
||||
double max = GetMax(values);
|
||||
|
||||
//
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
// Detect Rejection ...
|
||||
has =
|
||||
isBullish
|
||||
? (bar.GetPrice(bullishRejectLowerPriceType) < values[i] &&
|
||||
bar.GetPrice(bullishRejectUpperPriceType) > values[i])
|
||||
: (bar.GetPrice(bearishRejectUpperPriceType) > values[i] &&
|
||||
bar.GetPrice(bearishRejectLowerPriceType) < values[i]);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
// Validate Rejection ...
|
||||
if (ignoreBoundary)
|
||||
{
|
||||
//
|
||||
has =
|
||||
has &&
|
||||
(values[i] != min &&
|
||||
values[i] != max);
|
||||
}
|
||||
|
||||
//
|
||||
// Add Result ...
|
||||
if (has)
|
||||
{
|
||||
Add(values[i], rejecteds);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
result = ArraySize(rejecteds);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Others ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user