This commit is contained in:
2025-02-09 09:31:34 +03:30
parent 8799d7713d
commit 42fec0e906
9 changed files with 1830 additions and 1785 deletions
+11 -2
View File
@@ -384,7 +384,10 @@ struct XTick
*
* @return ( bool )
*/
bool Init(string _symbol)
bool Init(
string _symbol,
ENUM_TIMEFRAMES _volumePeriod = NULL //
)
{
//
bool result = false;
@@ -401,7 +404,13 @@ struct XTick
double _bid = GetBid(_symbol);
double _ask = GetAsk(_symbol);
double _spread = GetSpread(_symbol);
long _volume = iTickVolume(_symbol, PERIOD_M1, 0);
//
long _volume = 0;
if (IsValid(_volumePeriod))
{
_volume = iTickVolume(_symbol, _volumePeriod, 0);
}
//
result = Init(
+13 -7
View File
@@ -4263,12 +4263,13 @@ class XCTicksZone : public XCTwoBarZone
*/
bool Init(
XOHCL &startBar,
XOHCL &endBar //
XOHCL &endBar,
ENUM_TIMEFRAMES forPeriod = NULL //
)
{
//
bool result = false;
//
result = endBar.IsValid() &&
startBar.IsValid();
@@ -4277,6 +4278,11 @@ class XCTicksZone : public XCTwoBarZone
return result;
}
//
if (!IsSpecifiedValid(forPeriod)) {
forPeriod = endBar.period;
}
//
// Calculate Start and End Time ...
datetime from = startBar.time;
@@ -4308,7 +4314,7 @@ class XCTicksZone : public XCTwoBarZone
// Ticks Volumes ...
int ticksVolumeCount = CopyTickVolume(
symbol,
PERIOD_M1,
forPeriod,
from,
to,
mTickVolumes //
@@ -4465,12 +4471,12 @@ class XCTicksZone : public XCTwoBarZone
datetime to1M = (datetime)((int)endBar.time + PeriodSeconds(period) - 60);
int to1MIndex = iBarShift(
symbol,
PERIOD_M1,
forPeriod,
to1M //
);
int from1MIndex = iBarShift(
symbol,
PERIOD_M1,
forPeriod,
from //
);
for (int i = from1MIndex; i > to1MIndex; i--)
@@ -4479,7 +4485,7 @@ class XCTicksZone : public XCTwoBarZone
XOHCL iBar;
bool isInited = iBar.Init(
symbol,
PERIOD_M1,
forPeriod,
i //
);
if (!isInited)
@@ -4488,7 +4494,7 @@ class XCTicksZone : public XCTwoBarZone
}
ulong iVolume = iTickVolume(
symbol,
PERIOD_M1,
forPeriod,
i //
);