last ...
This commit is contained in:
@@ -28,130 +28,4 @@
|
||||
//
|
||||
// Models ...
|
||||
|
||||
//
|
||||
// Consolidation Zone ...
|
||||
struct XConsolidationZone
|
||||
{
|
||||
//
|
||||
// Props ...
|
||||
|
||||
//
|
||||
string symbol; // Symbol ...
|
||||
ENUM_TIMEFRAMES period; // Period ...
|
||||
|
||||
//
|
||||
double upper; // Upper ...
|
||||
double lower; // Lower ...
|
||||
|
||||
//
|
||||
datetime from; // Start Date
|
||||
datetime to; // Breake Date
|
||||
|
||||
//
|
||||
ENUM_X_DIRECTION dir; // Break Direction ...
|
||||
|
||||
//
|
||||
// Constructor ...
|
||||
XConsolidationZone()
|
||||
{
|
||||
Clean();
|
||||
}
|
||||
|
||||
//
|
||||
// Tools ...
|
||||
|
||||
/**
|
||||
* Cleanup ...
|
||||
*/
|
||||
void Clean()
|
||||
{
|
||||
//
|
||||
upper = 0;
|
||||
lower = 0;
|
||||
|
||||
//
|
||||
to = NULL;
|
||||
from = NULL;
|
||||
symbol = NULL;
|
||||
period = NULL;
|
||||
dir = X_DIRECTION_NONE;
|
||||
|
||||
//
|
||||
ZeroMemory(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate ...
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool IsValid()
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
result =
|
||||
//
|
||||
upper > 0 &&
|
||||
lower > 0 &&
|
||||
IsValid(to) &&
|
||||
IsValid(from) &&
|
||||
IsValid(symbol) &&
|
||||
IsValid(period) &&
|
||||
HasDirection(dir)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
bool IsSameAs(
|
||||
XConsolidationZone &item //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
result = IsValid() &&
|
||||
item.IsValid() &&
|
||||
dir == item.dir &&
|
||||
from == item.from &&
|
||||
upper == item.upper &&
|
||||
lower == item.lower &&
|
||||
symbol == item.symbol &&
|
||||
period == item.period;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve Unique Identifier ...
|
||||
*
|
||||
* @return ( string )
|
||||
*/
|
||||
string GetTag()
|
||||
{
|
||||
//
|
||||
string result =
|
||||
//
|
||||
"XCZONE" + "_" +
|
||||
ToString(dir) + "_" +
|
||||
symbol + "_" +
|
||||
ToString(period) + "_" +
|
||||
ToString(upper) + "_" +
|
||||
ToString(lower)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
};
|
||||
|
||||
//
|
||||
File diff suppressed because it is too large
Load Diff
@@ -309,11 +309,11 @@ struct XBoxZone
|
||||
}
|
||||
|
||||
/**
|
||||
* Extract Rejection Price based on Box Direction ...
|
||||
*
|
||||
* Retrieve Box Applied Price ...
|
||||
*
|
||||
* @return ( double )
|
||||
*/
|
||||
double GetRejection()
|
||||
double GetDirectionalPrice()
|
||||
{
|
||||
//
|
||||
double result = 0;
|
||||
@@ -334,6 +334,32 @@ struct XBoxZone
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve Box Breaked Price ...
|
||||
*
|
||||
* @return ( double )
|
||||
*/
|
||||
double GetInDirectionalPrice()
|
||||
{
|
||||
//
|
||||
double result = 0;
|
||||
|
||||
//
|
||||
if (!IsValid())
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
result =
|
||||
IsBullish()
|
||||
? lower
|
||||
: upper;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* To Bar Index ...
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user