last ...
This commit is contained in:
@@ -6425,6 +6425,110 @@ struct XFVGOrderBlock
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve Boundary of Zone ...
|
||||
*
|
||||
* @param upper: Upper Boundary ...ّ
|
||||
* @param lower: Lower Bondary ...
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool GetBoundary(
|
||||
double &upper,
|
||||
double &lower //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
upper = 0;
|
||||
lower = 0;
|
||||
|
||||
//
|
||||
result = IsValid();
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
upper = orderBlock.Upper();
|
||||
upper = MathMax(upper, fairValueGap.Upper());
|
||||
|
||||
//
|
||||
lower = orderBlock.Lower();
|
||||
lower = MathMax(lower, fairValueGap.Lower());
|
||||
|
||||
//
|
||||
result = lower > 0 &&
|
||||
upper > 0 &&
|
||||
upper > lower;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check Model is same as another Istance ...
|
||||
*
|
||||
* @param value: XFVGOrderBlock instance Reference ...
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool IsSameAs(XFVGOrderBlock &value)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
result =
|
||||
IsValid() &&
|
||||
value.IsValid();
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
ENUM_X_DIRECTION dir;
|
||||
result = GetDirection(dir);
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
ENUM_X_DIRECTION valueDir;
|
||||
result = value.GetDirection(valueDir);
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
result =
|
||||
//
|
||||
dir = valueDir
|
||||
//
|
||||
&&
|
||||
//
|
||||
orderBlock.From() == value.orderBlock.From() &&
|
||||
orderBlock.Upper() == value.orderBlock.Upper() &&
|
||||
orderBlock.Lower() == value.orderBlock.Lower()
|
||||
//
|
||||
&&
|
||||
//
|
||||
fairValueGap.From() == value.fairValueGap.From() &&
|
||||
fairValueGap.Upper() == value.fairValueGap.Upper() &&
|
||||
fairValueGap.Lower() == value.fairValueGap.Lower()
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
//
|
||||
};
|
||||
|
||||
//
|
||||
@@ -8819,7 +8923,7 @@ bool CalculateStateZones(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
result = zones.IsValid();
|
||||
|
||||
@@ -9055,15 +9159,9 @@ bool IsPriceAboveZone(
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
double ask = GetAsk(bar.symbol);
|
||||
double bid = GetBid(bar.symbol);
|
||||
|
||||
//
|
||||
result =
|
||||
//
|
||||
ask > zone.Upper() &&
|
||||
bid > zone.Upper() &&
|
||||
bar.low > zone.Upper()
|
||||
//
|
||||
;
|
||||
@@ -9131,16 +9229,10 @@ bool IsPriceBelowZone(
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
double ask = GetAsk(bar.symbol);
|
||||
double bid = GetBid(bar.symbol);
|
||||
|
||||
//
|
||||
result =
|
||||
//
|
||||
ask < zone.Lower() &&
|
||||
bid < zone.Lower() &&
|
||||
bar.low < zone.Lower()
|
||||
bar.high < zone.Lower()
|
||||
//
|
||||
;
|
||||
|
||||
@@ -9207,21 +9299,13 @@ bool IsPriceInsideZone(
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
double ask = GetAsk(bar.symbol);
|
||||
double bid = GetBid(bar.symbol);
|
||||
|
||||
//
|
||||
result =
|
||||
//
|
||||
ask <= zone.Upper() &&
|
||||
bid <= zone.Upper() &&
|
||||
bar.low <= zone.Upper()
|
||||
//
|
||||
&&
|
||||
//
|
||||
ask >= zone.Lower() &&
|
||||
bid >= zone.Lower() &&
|
||||
bar.low >= zone.Lower()
|
||||
//
|
||||
;
|
||||
@@ -9249,21 +9333,13 @@ bool IsPriceInsideZone(
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
double ask = GetAsk(bar.symbol);
|
||||
double bid = GetBid(bar.symbol);
|
||||
|
||||
//
|
||||
result =
|
||||
//
|
||||
ask <= upper &&
|
||||
bid <= upper &&
|
||||
bar.low <= upper
|
||||
//
|
||||
&&
|
||||
//
|
||||
ask >= lower &&
|
||||
bid >= lower &&
|
||||
bar.low >= lower
|
||||
//
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user