This commit is contained in:
2024-10-26 19:48:36 +03:30
parent ce1db83914
commit 5f9a14bf7d
5 changed files with 1631 additions and 333 deletions
+97
View File
@@ -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;
}