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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user