last ...
This commit is contained in:
@@ -5923,3 +5923,97 @@ struct XBoxZone
|
||||
};
|
||||
|
||||
//
|
||||
struct XDirectionShift
|
||||
{
|
||||
//
|
||||
// Props ...
|
||||
string type;
|
||||
datetime at;
|
||||
double after;
|
||||
double before;
|
||||
string symbol;
|
||||
ENUM_TIMEFRAMES period;
|
||||
ENUM_X_DIRECTION shiftTo;
|
||||
|
||||
//
|
||||
// Constructor ...
|
||||
XDirectionShift()
|
||||
{
|
||||
Clean();
|
||||
}
|
||||
|
||||
//
|
||||
// Tools ...
|
||||
|
||||
//
|
||||
// Cleanup ...
|
||||
void Clean()
|
||||
{
|
||||
//
|
||||
at = NULL;
|
||||
after = 0;
|
||||
before = 0;
|
||||
type = NULL;
|
||||
symbol = NULL;
|
||||
period = NULL;
|
||||
shiftTo = X_DIRECTION_NONE;
|
||||
|
||||
//
|
||||
ZeroMemory(this);
|
||||
}
|
||||
|
||||
//
|
||||
// Validate ...
|
||||
bool IsValid()
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
result =
|
||||
after > 0 &&
|
||||
IsValid(at) &&
|
||||
IsValid(type) &&
|
||||
after != before &&
|
||||
IsValid(symbol) &&
|
||||
IsValid(period) &&
|
||||
HasDirection(shiftTo);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Check Same ...
|
||||
bool IsSameAs(XDirectionShift &item)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
result = IsValid() &&
|
||||
item.IsValid();
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
result =
|
||||
//
|
||||
at == item.at &&
|
||||
type == item.type &&
|
||||
after == item.after &&
|
||||
before == item.before &&
|
||||
symbol == item.symbol &&
|
||||
period == item.period &&
|
||||
shiftTo == item.shiftTo
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user