last works ...
This commit is contained in:
@@ -1345,6 +1345,74 @@ struct XOHCL
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
bool BarAt(
|
||||
int index,
|
||||
XOHCL &bar //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
bar.Clean();
|
||||
|
||||
//
|
||||
result = IsValid();
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
if (index < 0)
|
||||
{
|
||||
index = 0;
|
||||
}
|
||||
|
||||
//
|
||||
result = bar.Init(
|
||||
symbol,
|
||||
period,
|
||||
index //
|
||||
);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
bool BarIn(
|
||||
ENUM_TIMEFRAMES _period,
|
||||
XOHCL &bar //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
bar.Clean();
|
||||
|
||||
//
|
||||
result = IsValid() &&
|
||||
IsSpecifiedValid(_period);
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
int index = Index(_period);
|
||||
result = bar.Init(
|
||||
symbol,
|
||||
_period,
|
||||
index //
|
||||
);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Find Current Bar Index on Chart ...
|
||||
int Index()
|
||||
@@ -1370,6 +1438,58 @@ struct XOHCL
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
int Index(datetime value)
|
||||
{
|
||||
//
|
||||
int result = -1;
|
||||
|
||||
//
|
||||
value = NormalizeTime(value);
|
||||
|
||||
//
|
||||
result = IsValid();
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
result = iBarShift(
|
||||
symbol,
|
||||
period,
|
||||
value //
|
||||
);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
int Index(ENUM_TIMEFRAMES value)
|
||||
{
|
||||
//
|
||||
int result = -1;
|
||||
|
||||
//
|
||||
result = IsValid() &&
|
||||
IsSpecifiedValid(value);
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
result = iBarShift(
|
||||
symbol,
|
||||
value,
|
||||
time //
|
||||
);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
bool GetNextBar(XOHCL &bar)
|
||||
{
|
||||
|
||||
@@ -683,6 +683,24 @@ class XCBarZone : public XCZone
|
||||
return result;
|
||||
}
|
||||
|
||||
ENUM_TIMEFRAMES GetPeriod() {
|
||||
//
|
||||
ENUM_TIMEFRAMES result = NULL;
|
||||
|
||||
//
|
||||
XOHCL bar;
|
||||
bool isFilled = FillBar(bar);
|
||||
if (!isFilled) {
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
result = bar.period;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set From Date ...
|
||||
*
|
||||
@@ -1003,6 +1021,24 @@ class XCTwoBarZone : public XCZone
|
||||
return result;
|
||||
}
|
||||
|
||||
ENUM_TIMEFRAMES GetPeriod() {
|
||||
//
|
||||
ENUM_TIMEFRAMES result = NULL;
|
||||
|
||||
//
|
||||
XOHCL bar;
|
||||
bool isFilled = FillStartBar(bar);
|
||||
if (!isFilled) {
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
result = bar.period;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Overrides ...
|
||||
|
||||
@@ -1202,6 +1238,24 @@ class XCSwing : public XCBasePOI
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
ENUM_TIMEFRAMES GetPeriod() {
|
||||
//
|
||||
ENUM_TIMEFRAMES result = NULL;
|
||||
|
||||
//
|
||||
XOHCL bar;
|
||||
bool isFilled = FillBar(bar);
|
||||
if (!isFilled) {
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
result = bar.period;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check Swing High or not ...
|
||||
|
||||
Reference in New Issue
Block a user