last ...
This commit is contained in:
@@ -1104,6 +1104,59 @@ struct XBoxZone
|
||||
ZeroMemory(this);
|
||||
}
|
||||
|
||||
bool Init(
|
||||
string _symbol,
|
||||
ENUM_TIMEFRAMES _period,
|
||||
double _upper,
|
||||
double _lower,
|
||||
datetime _from,
|
||||
datetime _to,
|
||||
ENUM_X_DIRECTION _dir,
|
||||
string _type = "",
|
||||
datetime _at = NULL //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
// Validate ...
|
||||
result = IsXValid(_symbol) &&
|
||||
IsXValid(_period) &&
|
||||
_upper > 0 &&
|
||||
_lower > 0 &&
|
||||
_upper > _lower &&
|
||||
IsXValid(_from) &&
|
||||
IsXValid(_to) &&
|
||||
_from < _to &&
|
||||
HasDirection(_dir);
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
this.to = _to;
|
||||
this.at = _at;
|
||||
this.dir = _dir;
|
||||
this.from = _from;
|
||||
this.type = _type;
|
||||
this.lower = _lower;
|
||||
this.upper = _upper;
|
||||
this.symbol = _symbol;
|
||||
this.period = _period;
|
||||
|
||||
//
|
||||
result = IsValid();
|
||||
if (!result)
|
||||
{
|
||||
Clean();
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean Special Props ...
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user