complete supply and demand zones ...

This commit is contained in:
2024-11-13 18:42:16 +03:30
parent 797917e30a
commit a4fb541557
4 changed files with 794 additions and 28 deletions
+36 -2
View File
@@ -1286,11 +1286,13 @@ class XCSupplyZone : public XCBarZone
* Initialize POI ...
*
* @param bar: XOHCL instance ...
* @param range: Integer, Detection Range ...
*
* @return ( bool )
*/
bool Init(
XOHCL &bar //
XOHCL &bar,
int range = 0 //
)
{
//
@@ -1317,6 +1319,21 @@ class XCSupplyZone : public XCBarZone
//
result = IsValid();
if (result &&
range > 0)
{
//
datetime time = bar.time;
int periodSeconds = PeriodSeconds(bar.period);
//
datetime from = (datetime)((int)time - (range * periodSeconds));
datetime to = (datetime)((int)time + (range * periodSeconds));
//
From(from);
To(to);
}
//
return result;
@@ -1379,11 +1396,13 @@ class XCDemandZone : public XCBarZone
* Initialize POI ...
*
* @param bar: XOHCL instance ...
* @param range: Integer, Detection Range ...
*
* @return ( bool )
*/
bool Init(
XOHCL &bar //
XOHCL &bar,
int range = 0 //
)
{
//
@@ -1410,6 +1429,21 @@ class XCDemandZone : public XCBarZone
//
result = IsValid();
if (result &&
range > 0)
{
//
datetime time = bar.time;
int periodSeconds = PeriodSeconds(bar.period);
//
datetime from = (datetime)((int)time - (range * periodSeconds));
datetime to = (datetime)((int)time + (range * periodSeconds));
//
From(from);
To(to);
}
//
return result;