last ...
This commit is contained in:
@@ -2018,9 +2018,8 @@ class XCTwoBarZone : public XCZone
|
||||
XOHCL &startBar,
|
||||
XOHCL &endBar,
|
||||
ENUM_XPOIS type,
|
||||
bool useStartBarForUpper,
|
||||
ENUM_X_PRICE upperPrice,
|
||||
ENUM_X_PRICE lowerPrice //
|
||||
ENUM_X_PRICE startPrice,
|
||||
ENUM_X_PRICE endPrice //
|
||||
)
|
||||
{
|
||||
//
|
||||
@@ -2042,18 +2041,33 @@ class XCTwoBarZone : public XCZone
|
||||
mType = type;
|
||||
mEndBar = endBar;
|
||||
mStartBar = startBar;
|
||||
mUpperPrice = upperPrice;
|
||||
mLowerPrice = lowerPrice;
|
||||
mUseStartBarForUpper = useStartBarForUpper;
|
||||
|
||||
//
|
||||
int startIndex = startBar.Index();
|
||||
int endIndex = endBar.Index();
|
||||
|
||||
mUpper =
|
||||
useStartBarForUpper
|
||||
? startBar.GetPrice(upperPrice)
|
||||
: endBar.GetPrice(upperPrice);
|
||||
mLower =
|
||||
useStartBarForUpper
|
||||
? endBar.GetPrice(lowerPrice)
|
||||
: startBar.GetPrice(lowerPrice);
|
||||
//
|
||||
double mStartPrice = startBar.GetPrice(startPrice);
|
||||
double mEndPrice = endBar.GetPrice(endPrice);
|
||||
bool isStartOverEnd = mStartPrice > mEndPrice;
|
||||
|
||||
//
|
||||
if (isStartOverEnd)
|
||||
{
|
||||
//
|
||||
mUpperPrice = startPrice;
|
||||
mLowerPrice = endPrice;
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
mUpperPrice = endPrice;
|
||||
mLowerPrice = startPrice;
|
||||
}
|
||||
|
||||
//
|
||||
mUpper = MathMax(mStartPrice, mEndPrice);
|
||||
mLower = MathMin(mStartPrice, mEndPrice);
|
||||
|
||||
//
|
||||
result = IsValidTwoBarZone();
|
||||
@@ -4342,24 +4356,20 @@ class XCFVG : public XCTwoBarZone
|
||||
: X_POI_BEARISH_FVG;
|
||||
|
||||
//
|
||||
bool useFistForUpper = isDirBullish
|
||||
? false
|
||||
: true;
|
||||
ENUM_X_PRICE upPrice = isDirBullish
|
||||
? X_PRICE_LOW
|
||||
: X_PRICE_HIGH;
|
||||
ENUM_X_PRICE loPrice = isDirBullish
|
||||
? X_PRICE_HIGH
|
||||
: X_PRICE_LOW;
|
||||
ENUM_X_PRICE startPrice = isDirBullish
|
||||
? X_PRICE_HIGH
|
||||
: X_PRICE_LOW;
|
||||
ENUM_X_PRICE endPrice = isDirBullish
|
||||
? X_PRICE_LOW
|
||||
: X_PRICE_HIGH;
|
||||
|
||||
//
|
||||
result = InitTwoBarZone(
|
||||
startBar,
|
||||
endBar,
|
||||
mTT,
|
||||
useFistForUpper,
|
||||
upPrice,
|
||||
loPrice //
|
||||
startPrice,
|
||||
endPrice //
|
||||
);
|
||||
if (!result)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user