last working ...
This commit is contained in:
@@ -5983,6 +5983,70 @@ struct XDirectionShift
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Get Bar Index of Direction Shift ...
|
||||
int Index()
|
||||
{
|
||||
//
|
||||
int result = -1;
|
||||
|
||||
//
|
||||
// Validate ...
|
||||
if (!IsValid())
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Retrieve Bar Index ...
|
||||
result = GetBarIndex(
|
||||
symbol,
|
||||
period,
|
||||
at //
|
||||
);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Get At Bar ...
|
||||
bool AtBar(XOHCL &bar)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
// Normalize ...
|
||||
bar.Clean();
|
||||
|
||||
//
|
||||
// Validate ...
|
||||
result = IsValid();
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
int idx = Index();
|
||||
if (IsValidIndex(idx))
|
||||
{
|
||||
//
|
||||
result = bar.Init(
|
||||
symbol,
|
||||
period,
|
||||
idx //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
result = bar.IsValid();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Check Same ...
|
||||
bool IsSameAs(XDirectionShift &item)
|
||||
|
||||
Reference in New Issue
Block a user