Complete Fair Value Gaps Detetion ...
This commit is contained in:
@@ -1216,6 +1216,31 @@ struct XOHCL
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Get Direction of Bar ...
|
||||
ENUM_X_DIRECTION GetDirection()
|
||||
{
|
||||
//
|
||||
ENUM_X_DIRECTION result = X_DIRECTION_NONE;
|
||||
|
||||
//
|
||||
bool isBullish = IsBullish();
|
||||
bool isBearish = IsBearish();
|
||||
|
||||
//
|
||||
result =
|
||||
isBullish && isBearish
|
||||
? X_DIRECTION_ALL
|
||||
: !isBullish && !isBearish
|
||||
? X_DIRECTION_NONE
|
||||
: isBullish
|
||||
? X_DIRECTION_BULLISH
|
||||
: X_DIRECTION_BEARISH;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Find Next Bar Time ...
|
||||
datetime NextAt()
|
||||
|
||||
@@ -894,7 +894,13 @@ class XCTwoBarZone : public XCZone
|
||||
|
||||
//
|
||||
result = IsValidTwoBarZone();
|
||||
|
||||
if (result)
|
||||
{
|
||||
//
|
||||
From(startBar.time);
|
||||
To(endBar.time);
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
@@ -902,6 +908,98 @@ class XCTwoBarZone : public XCZone
|
||||
//
|
||||
// Getter(s) / Setter(s) ...
|
||||
|
||||
/**
|
||||
* Set From Date ...
|
||||
*
|
||||
* @param value: DateTime ...
|
||||
*/
|
||||
void From(datetime value)
|
||||
{
|
||||
//
|
||||
if (!IsValidTwoBarZone())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
value = NormalizeTime(value);
|
||||
|
||||
//
|
||||
mFrom = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set To Date ...
|
||||
*
|
||||
* @param value: DateTime ...
|
||||
*/
|
||||
void To(datetime value)
|
||||
{
|
||||
//
|
||||
if (!IsValidTwoBarZone())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
value = NormalizeTime(value);
|
||||
|
||||
//
|
||||
mTo = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fill Start Bar ...
|
||||
*
|
||||
* @param bar: XOHCL instance ...
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool FillStartBar(XOHCL &bar)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
result = IsValidTwoBarZone();
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
bar = mStartBar;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fill End Bar ...
|
||||
*
|
||||
* @param bar: XOHCL instance ...
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool FillEndBar(XOHCL &bar)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
result = IsValidTwoBarZone();
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
bar = mEndBar;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Overrides ...
|
||||
|
||||
@@ -918,38 +1016,12 @@ class XCTwoBarZone : public XCZone
|
||||
|
||||
datetime From() override
|
||||
{
|
||||
//
|
||||
datetime result = NULL;
|
||||
|
||||
//
|
||||
if (!IsValidTwoBarZone())
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
result = mStartBar.time;
|
||||
|
||||
//
|
||||
return result;
|
||||
return mFrom;
|
||||
}
|
||||
|
||||
datetime To() override
|
||||
{
|
||||
//
|
||||
datetime result = NULL;
|
||||
|
||||
//
|
||||
if (!IsValidTwoBarZone())
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
result = TimeCurrent();
|
||||
|
||||
//
|
||||
return result;
|
||||
return mTo;
|
||||
}
|
||||
|
||||
string GetTag() override
|
||||
@@ -1031,6 +1103,8 @@ class XCTwoBarZone : public XCZone
|
||||
private:
|
||||
//
|
||||
// Props ...
|
||||
datetime mFrom;
|
||||
datetime mTo;
|
||||
|
||||
//
|
||||
};
|
||||
@@ -2158,7 +2232,8 @@ class XCFVG : public XCTwoBarZone
|
||||
/**
|
||||
* Initialize POI ...
|
||||
*
|
||||
* @param bar: XOHCL instance ...
|
||||
* @param startBar: XOHCL instance ...
|
||||
* @param endBar: XOHCL instance ...
|
||||
* @param dir: ENUM_X_DIRECTION member ...
|
||||
*
|
||||
* @return ( bool )
|
||||
@@ -2236,7 +2311,7 @@ class XCFVG : public XCTwoBarZone
|
||||
|
||||
//
|
||||
result = IsValid() &&
|
||||
Type() == X_POI_BULLISH_ORDERBLOCK;
|
||||
Type() == X_POI_BULLISH_FVG;
|
||||
|
||||
//
|
||||
return result;
|
||||
@@ -2254,7 +2329,7 @@ class XCFVG : public XCTwoBarZone
|
||||
|
||||
//
|
||||
result = IsValid() &&
|
||||
Type() == X_POI_BEARISH_ORDERBLOCK;
|
||||
Type() == X_POI_BEARISH_FVG;
|
||||
|
||||
//
|
||||
return result;
|
||||
@@ -2270,8 +2345,8 @@ class XCFVG : public XCTwoBarZone
|
||||
|
||||
//
|
||||
result = IsValidTwoBarZone() &&
|
||||
(mType == X_POI_BULLISH_ORDERBLOCK ||
|
||||
mType == X_POI_BEARISH_ORDERBLOCK);
|
||||
(mType == X_POI_BULLISH_FVG ||
|
||||
mType == X_POI_BEARISH_FVG);
|
||||
|
||||
//
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user