last ...
This commit is contained in:
@@ -743,6 +743,59 @@ class XCX121XSTRHelper : public XCBaseHelper
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
double GetLastSTR(
|
||||
ENUM_X_DIRECTION dir,
|
||||
int barIndex = 0 //
|
||||
)
|
||||
{
|
||||
//
|
||||
double result = 0;
|
||||
|
||||
//
|
||||
if (barIndex < 0)
|
||||
{
|
||||
barIndex = 0;
|
||||
}
|
||||
|
||||
//
|
||||
if (!HasDirection(dir))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
int index = barIndex;
|
||||
bool isBullish = IsBullish(dir);
|
||||
|
||||
//
|
||||
bool canContinue = true;
|
||||
while (canContinue)
|
||||
{
|
||||
//
|
||||
double iStr = GetSTR(index);
|
||||
double iState = GetSTRState(index);
|
||||
|
||||
//
|
||||
canContinue =
|
||||
isBullish
|
||||
? iState < 0
|
||||
: iState > 0;
|
||||
if (!canContinue)
|
||||
{
|
||||
//
|
||||
result = iStr;
|
||||
break;
|
||||
}
|
||||
|
||||
//
|
||||
index++;
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
bool GetConditions(
|
||||
X121XSTRConditions &conditions, //
|
||||
|
||||
Reference in New Issue
Block a user