last ...
This commit is contained in:
@@ -191,6 +191,101 @@ enum ENUM_X_MARKET_CYCLES
|
||||
//
|
||||
// Structs ...
|
||||
|
||||
//
|
||||
// Model Specified Ticks Info ...
|
||||
struct XTick
|
||||
{
|
||||
//
|
||||
string symbol; // Symbol ...
|
||||
datetime time; // Time ...
|
||||
double bid; // Bid ...
|
||||
double ask; // Ask ...
|
||||
|
||||
//
|
||||
// Constructor ...
|
||||
void XTick()
|
||||
{
|
||||
Clean();
|
||||
}
|
||||
|
||||
//
|
||||
// Tools Functions ...
|
||||
|
||||
/**
|
||||
* Initial ...
|
||||
*
|
||||
* @param _symbol: Symbol ...
|
||||
* @param _time: Time ...
|
||||
* @param _bid: Bid Price ...
|
||||
* @param _ask: Ask Price ...
|
||||
*/
|
||||
bool Init(
|
||||
string _symbol,
|
||||
datetime _time,
|
||||
double _bid,
|
||||
double _ask //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
result = IsValid(_symbol) &&
|
||||
IsValid(_time) &&
|
||||
_bid > 0 &&
|
||||
_ask > 0;
|
||||
if (!result) {
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
symbol = _symbol;
|
||||
time = _time;
|
||||
bid = _bid;
|
||||
ask = _ask;
|
||||
|
||||
//
|
||||
result = IsValid();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleanup ...
|
||||
*/
|
||||
void Clean()
|
||||
{
|
||||
//
|
||||
bid = 0;
|
||||
ask = 0;
|
||||
time = NULL;
|
||||
symbol = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate ...
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool IsValid()
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
result = IsValid(symbol) &&
|
||||
IsValid(time) &&
|
||||
bid > 0 &&
|
||||
ask > 0;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
};
|
||||
|
||||
//
|
||||
// Model a Bar Remains Time ...
|
||||
struct XBarRemainsTime
|
||||
@@ -1125,6 +1220,8 @@ struct XOHCL
|
||||
int destSeconds = PeriodSeconds(smallerPeriod);
|
||||
if (destSeconds >= sourceSeconds)
|
||||
{
|
||||
//
|
||||
result = time;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user