last ...
This commit is contained in:
@@ -2581,6 +2581,15 @@ struct XPatternAnalysisConfig
|
||||
//
|
||||
// Collection Manipulations ...
|
||||
|
||||
/**
|
||||
* Remove all Allowed Patterns and Directions ...
|
||||
*/
|
||||
void CleanPatterns() {
|
||||
//
|
||||
XClean(allowedDirs);
|
||||
XClean(allowedPatterns);
|
||||
}
|
||||
|
||||
/**
|
||||
* Full Detect Patterns ...
|
||||
*
|
||||
|
||||
@@ -652,6 +652,53 @@ int GetHighestByBar(
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Highest Bar Price Index of Specified Collection ...
|
||||
*
|
||||
* @param source: reference collection, Provides Data Source ...
|
||||
*
|
||||
* @return ( int )
|
||||
*/
|
||||
int GetHighestBarPrice(
|
||||
XOHCL &source[],
|
||||
ENUM_X_PRICE priceType //
|
||||
)
|
||||
{
|
||||
//
|
||||
int result = -1;
|
||||
|
||||
//
|
||||
// Validate ...
|
||||
bool has = HasChild(source) &&
|
||||
IsXValid(priceType);
|
||||
if (!has)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
double price = EMPTY_VALUE;
|
||||
double selected = EMPTY_VALUE;
|
||||
int count = ArraySize(source);
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
price = source[i].GetPrice(priceType);
|
||||
has = !NotEmptyZero(selected)
|
||||
? true
|
||||
: price > selected;
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
result = i;
|
||||
selected = price;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Highest Index of Specified Collection ...
|
||||
*
|
||||
@@ -903,6 +950,53 @@ int GetLowestByBar(
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Lowest Bar Price Index of Specified Collection ...
|
||||
*
|
||||
* @param source: reference collection, Provides Data Source ...
|
||||
*
|
||||
* @return ( int )
|
||||
*/
|
||||
int GetLowestBarPrice(
|
||||
XOHCL &source[],
|
||||
ENUM_X_PRICE priceType //
|
||||
)
|
||||
{
|
||||
//
|
||||
int result = -1;
|
||||
|
||||
//
|
||||
// Validate ...
|
||||
bool has = HasChild(source) &&
|
||||
IsXValid(priceType);
|
||||
if (!has)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
double price = EMPTY_VALUE;
|
||||
double selected = EMPTY_VALUE;
|
||||
int count = ArraySize(source);
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
price = source[i].GetPrice(priceType);
|
||||
has = !NotEmptyZero(selected)
|
||||
? true
|
||||
: price < selected;
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
result = i;
|
||||
selected = price;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Lowest Index of Specified Collection ...
|
||||
*
|
||||
|
||||
@@ -51,6 +51,7 @@ enum ENUM_X_BAR_PATTERN
|
||||
X_BAR_PATTERN_RESISTANCE = 15,
|
||||
X_BAR_PATTERN_PULLBACK = 16,
|
||||
X_BAR_PATTERN_CONSOLIDATION = 17,
|
||||
X_BAR_PATTERN_LEG = 18,
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -87,87 +88,92 @@ string ToXString(ENUM_X_BAR_PATTERN value)
|
||||
|
||||
//
|
||||
case X_BAR_PATTERN_HIGH:
|
||||
result = "XHIGH";
|
||||
result = "XHIGHP";
|
||||
break;
|
||||
|
||||
//
|
||||
case X_BAR_PATTERN_LOW:
|
||||
result = "XLOW";
|
||||
result = "XLOWP";
|
||||
break;
|
||||
|
||||
//
|
||||
case X_BAR_PATTERN_MOMENTUM:
|
||||
result = "XMOMENTUM";
|
||||
result = "XMOMENTUMP";
|
||||
break;
|
||||
|
||||
//
|
||||
case X_BAR_PATTERN_ENGULFED:
|
||||
result = "XENGULFED";
|
||||
result = "XENGULFEDP";
|
||||
break;
|
||||
|
||||
//
|
||||
case X_BAR_PATTERN_TRUE_GAPED:
|
||||
result = "XGAPED";
|
||||
result = "XGAPEDP";
|
||||
break;
|
||||
|
||||
//
|
||||
case X_BAR_PATTERN_PINNED:
|
||||
result = "XPINNED";
|
||||
result = "XPINNEDP";
|
||||
break;
|
||||
|
||||
//
|
||||
case X_BAR_PATTERN_STAR:
|
||||
result = "XSTAR";
|
||||
result = "XSTARP";
|
||||
break;
|
||||
|
||||
//
|
||||
case X_BAR_PATTERN_PIERCING:
|
||||
result = "XPIERCING";
|
||||
result = "XPIERCINGP";
|
||||
break;
|
||||
|
||||
//
|
||||
case X_BAR_PATTERN_RISING:
|
||||
result = "XRISING";
|
||||
result = "XRISINGP";
|
||||
break;
|
||||
|
||||
//
|
||||
case X_BAR_PATTERN_FLAG:
|
||||
result = "XFLAG";
|
||||
result = "XFLAGP";
|
||||
break;
|
||||
|
||||
//
|
||||
case X_BAR_PATTERN_SIGNALKEY:
|
||||
result = "XSIGNALKEY";
|
||||
result = "XSIGNALKEYP";
|
||||
break;
|
||||
|
||||
//
|
||||
case X_BAR_PATTERN_OB:
|
||||
result = "XOB";
|
||||
result = "XOBP";
|
||||
break;
|
||||
|
||||
//
|
||||
case X_BAR_PATTERN_FVG:
|
||||
result = "XFVG";
|
||||
result = "XFVGP";
|
||||
break;
|
||||
|
||||
//
|
||||
case X_BAR_PATTERN_SUPPORT:
|
||||
result = "XSUPPORT";
|
||||
result = "XSUPPORTP";
|
||||
break;
|
||||
|
||||
//
|
||||
case X_BAR_PATTERN_RESISTANCE:
|
||||
result = "XRESISTANCE";
|
||||
result = "XRESISTANCEP";
|
||||
break;
|
||||
|
||||
//
|
||||
case X_BAR_PATTERN_PULLBACK:
|
||||
result = "XPULLBACK";
|
||||
result = "XPULLBACKP";
|
||||
break;
|
||||
|
||||
//
|
||||
case X_BAR_PATTERN_CONSOLIDATION:
|
||||
result = "XCONSOLIDATION";
|
||||
result = "XCONSOLIDATIONP";
|
||||
break;
|
||||
|
||||
//
|
||||
case X_BAR_PATTERN_LEG:
|
||||
result = "XLEGP";
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -267,6 +273,10 @@ ENUM_X_BAR_PATTERN ToBarPattern(string value)
|
||||
{
|
||||
result = X_BAR_PATTERN_CONSOLIDATION;
|
||||
}
|
||||
else if (value == ToXString(X_BAR_PATTERN_LEG))
|
||||
{
|
||||
result = X_BAR_PATTERN_LEG;
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
@@ -302,6 +312,7 @@ int GetAllBarPatters(ENUM_X_BAR_PATTERN &dest[])
|
||||
Add(X_BAR_PATTERN_RESISTANCE, dest);
|
||||
Add(X_BAR_PATTERN_PULLBACK, dest);
|
||||
Add(X_BAR_PATTERN_CONSOLIDATION, dest);
|
||||
Add(X_BAR_PATTERN_LEG, dest);
|
||||
|
||||
//
|
||||
return ArraySize(dest);
|
||||
|
||||
Reference in New Issue
Block a user