last ...
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -9869,6 +9869,247 @@ class XCXFIMAHelperParser : XCBase
|
||||
//
|
||||
// Other Tools ...
|
||||
|
||||
/**
|
||||
* Reading All Values of XFIMA ...
|
||||
*
|
||||
* @param dest: double, collection reference to holds values ...
|
||||
* @param barIndex: int, Specified Bar Index ...
|
||||
*
|
||||
* @return ( int )
|
||||
*/
|
||||
int ReadXFIMAValues(
|
||||
double &dest[],
|
||||
int barIndex = 0 //
|
||||
)
|
||||
{
|
||||
//
|
||||
int result = 0;
|
||||
|
||||
//
|
||||
// Prepare ...
|
||||
XClean(dest);
|
||||
|
||||
//
|
||||
// Normalize ...
|
||||
barIndex = NormalizeBarIndex(barIndex);
|
||||
|
||||
//
|
||||
// Validate ...
|
||||
bool has = IsValid();
|
||||
if (!has)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Reading Values ...
|
||||
double sar = helper.GetSAR(barIndex);
|
||||
double scLL = helper.GetSLL(barIndex);
|
||||
double scHH = helper.GetSHH(barIndex);
|
||||
double mcLL = helper.GetMLL(barIndex);
|
||||
double mcHH = helper.GetMHH(barIndex);
|
||||
double lcLL = helper.GetLLL(barIndex);
|
||||
double lcHH = helper.GetLHH(barIndex);
|
||||
double hcLL = helper.GetHLL(barIndex);
|
||||
double hcHH = helper.GetHHH(barIndex);
|
||||
double peak = helper.GetPeak(barIndex);
|
||||
double vale = helper.GetVale(barIndex);
|
||||
double scMa = helper.GetSCMA(barIndex);
|
||||
double mcMa = helper.GetMCMA(barIndex);
|
||||
double lcMa = helper.GetLCMA(barIndex);
|
||||
double hcMa = helper.GetHCMA(barIndex);
|
||||
double maFast = helper.GetMAFast(barIndex);
|
||||
double maSlow = helper.GetMASlow(barIndex);
|
||||
double fibLower = helper.GetFiboLower(barIndex);
|
||||
double fibUpper = helper.GetFiboUpper(barIndex);
|
||||
double fibMiddle = helper.GetFiboMiddle(barIndex);
|
||||
double maBandUpper = helper.GetMABandUpper(barIndex);
|
||||
double maBandLower = helper.GetMABandLower(barIndex);
|
||||
double hkBandUpper = helper.GetHKBandUpper(barIndex);
|
||||
double hkBandLower = helper.GetHKBandLower(barIndex);
|
||||
double pbBandUpper = helper.GetPBBandUpper(barIndex);
|
||||
double pbBandLower = helper.GetPBBandLower(barIndex);
|
||||
double atrBandUpper = helper.GetATRBandUpper(barIndex);
|
||||
double atrBandLower = helper.GetATRBandLower(barIndex);
|
||||
|
||||
//
|
||||
// Add Values to Dest ...
|
||||
|
||||
//
|
||||
if (NotEmptyZero(sar))
|
||||
{
|
||||
Add(sar, dest);
|
||||
}
|
||||
|
||||
//
|
||||
if (NotEmptyZero(scLL))
|
||||
{
|
||||
Add(scLL, dest);
|
||||
}
|
||||
|
||||
//
|
||||
if (NotEmptyZero(scHH))
|
||||
{
|
||||
Add(scHH, dest);
|
||||
}
|
||||
|
||||
//
|
||||
if (NotEmptyZero(mcLL))
|
||||
{
|
||||
Add(mcLL, dest);
|
||||
}
|
||||
|
||||
//
|
||||
if (NotEmptyZero(mcHH))
|
||||
{
|
||||
Add(mcHH, dest);
|
||||
}
|
||||
|
||||
//
|
||||
if (NotEmptyZero(lcLL))
|
||||
{
|
||||
Add(lcLL, dest);
|
||||
}
|
||||
|
||||
//
|
||||
if (NotEmptyZero(lcHH))
|
||||
{
|
||||
Add(lcHH, dest);
|
||||
}
|
||||
|
||||
//
|
||||
if (NotEmptyZero(hcLL))
|
||||
{
|
||||
Add(hcLL, dest);
|
||||
}
|
||||
|
||||
//
|
||||
if (NotEmptyZero(hcHH))
|
||||
{
|
||||
Add(hcHH, dest);
|
||||
}
|
||||
|
||||
//
|
||||
if (NotEmptyZero(peak))
|
||||
{
|
||||
Add(peak, dest);
|
||||
}
|
||||
|
||||
//
|
||||
if (NotEmptyZero(vale))
|
||||
{
|
||||
Add(vale, dest);
|
||||
}
|
||||
|
||||
//
|
||||
if (NotEmptyZero(scMa))
|
||||
{
|
||||
Add(scMa, dest);
|
||||
}
|
||||
|
||||
//
|
||||
if (NotEmptyZero(mcMa))
|
||||
{
|
||||
Add(mcMa, dest);
|
||||
}
|
||||
|
||||
//
|
||||
if (NotEmptyZero(lcMa))
|
||||
{
|
||||
Add(lcMa, dest);
|
||||
}
|
||||
|
||||
//
|
||||
if (NotEmptyZero(hcMa))
|
||||
{
|
||||
Add(hcMa, dest);
|
||||
}
|
||||
|
||||
//
|
||||
if (NotEmptyZero(maFast))
|
||||
{
|
||||
Add(maFast, dest);
|
||||
}
|
||||
|
||||
//
|
||||
if (NotEmptyZero(maSlow))
|
||||
{
|
||||
Add(maSlow, dest);
|
||||
}
|
||||
|
||||
//
|
||||
if (NotEmptyZero(fibLower))
|
||||
{
|
||||
Add(fibLower, dest);
|
||||
}
|
||||
|
||||
//
|
||||
if (NotEmptyZero(fibUpper))
|
||||
{
|
||||
Add(fibUpper, dest);
|
||||
}
|
||||
|
||||
//
|
||||
if (NotEmptyZero(fibMiddle))
|
||||
{
|
||||
Add(fibMiddle, dest);
|
||||
}
|
||||
|
||||
//
|
||||
if (NotEmptyZero(maBandUpper))
|
||||
{
|
||||
Add(maBandUpper, dest);
|
||||
}
|
||||
|
||||
//
|
||||
if (NotEmptyZero(maBandLower))
|
||||
{
|
||||
Add(maBandLower, dest);
|
||||
}
|
||||
|
||||
//
|
||||
if (NotEmptyZero(hkBandUpper))
|
||||
{
|
||||
Add(hkBandUpper, dest);
|
||||
}
|
||||
|
||||
//
|
||||
if (NotEmptyZero(hkBandLower))
|
||||
{
|
||||
Add(hkBandLower, dest);
|
||||
}
|
||||
|
||||
//
|
||||
if (NotEmptyZero(pbBandUpper))
|
||||
{
|
||||
Add(pbBandUpper, dest);
|
||||
}
|
||||
|
||||
//
|
||||
if (NotEmptyZero(pbBandLower))
|
||||
{
|
||||
Add(pbBandLower, dest);
|
||||
}
|
||||
|
||||
//
|
||||
if (NotEmptyZero(atrBandUpper))
|
||||
{
|
||||
Add(atrBandUpper, dest);
|
||||
}
|
||||
|
||||
//
|
||||
if (NotEmptyZero(atrBandLower))
|
||||
{
|
||||
Add(atrBandLower, dest);
|
||||
}
|
||||
|
||||
//
|
||||
result = ArraySize(dest);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Protected ...
|
||||
protected:
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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