complete supply and demand zones ...
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user