last ...
This commit is contained in:
@@ -1851,6 +1851,222 @@ class XCX121Helper : public XCBaseHelper
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
//
|
||||
double GetHigherPeak(
|
||||
double peak, // Peak Source
|
||||
int barIndex = 0, // Bar Index
|
||||
int loopback = 576 // Max Allowed Loopback
|
||||
)
|
||||
{
|
||||
//
|
||||
double result = 0;
|
||||
|
||||
//
|
||||
if (barIndex < 0)
|
||||
{
|
||||
barIndex = 0;
|
||||
}
|
||||
|
||||
//
|
||||
if (loopback < 576)
|
||||
{
|
||||
loopback = 576;
|
||||
}
|
||||
|
||||
//
|
||||
if (peak <= 0)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
double iValue = 0;
|
||||
int index = barIndex;
|
||||
bool canContinue = true;
|
||||
while (canContinue)
|
||||
{
|
||||
//
|
||||
iValue = GetPeak(index);
|
||||
if (iValue > peak)
|
||||
{
|
||||
//
|
||||
result = iValue;
|
||||
break;
|
||||
}
|
||||
|
||||
//
|
||||
canContinue = index < barIndex + loopback;
|
||||
index++;
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
double GetLowerPeak(
|
||||
double peak, // Peak Source
|
||||
int barIndex = 0, // Bar Index
|
||||
int loopback = 576 // Max Allowed Loopback
|
||||
)
|
||||
{
|
||||
//
|
||||
double result = 0;
|
||||
|
||||
//
|
||||
if (barIndex < 0)
|
||||
{
|
||||
barIndex = 0;
|
||||
}
|
||||
|
||||
//
|
||||
if (loopback < 576)
|
||||
{
|
||||
loopback = 576;
|
||||
}
|
||||
|
||||
//
|
||||
if (peak <= 0)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
double iValue = 0;
|
||||
int index = barIndex;
|
||||
bool canContinue = true;
|
||||
while (canContinue)
|
||||
{
|
||||
//
|
||||
iValue = GetPeak(index);
|
||||
if (iValue < peak)
|
||||
{
|
||||
//
|
||||
result = iValue;
|
||||
break;
|
||||
}
|
||||
|
||||
//
|
||||
canContinue = index < barIndex + loopback;
|
||||
index++;
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
double GetHigherVale(
|
||||
double vale, // Vale Source
|
||||
int barIndex = 0, // Bar Index
|
||||
int loopback = 576 // Max Allowed Loopback
|
||||
)
|
||||
{
|
||||
//
|
||||
double result = 0;
|
||||
|
||||
//
|
||||
if (barIndex < 0)
|
||||
{
|
||||
barIndex = 0;
|
||||
}
|
||||
|
||||
//
|
||||
if (loopback < 576)
|
||||
{
|
||||
loopback = 576;
|
||||
}
|
||||
|
||||
//
|
||||
if (vale <= 0)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
double iValue = 0;
|
||||
int index = barIndex;
|
||||
bool canContinue = true;
|
||||
while (canContinue)
|
||||
{
|
||||
//
|
||||
iValue = GetVale(index);
|
||||
if (iValue > vale)
|
||||
{
|
||||
//
|
||||
result = iValue;
|
||||
break;
|
||||
}
|
||||
|
||||
//
|
||||
canContinue = index > barIndex + loopback;
|
||||
index++;
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
double GetLowerVale(
|
||||
double vale, // Vale Source
|
||||
int barIndex = 0, // Bar Index
|
||||
int loopback = 576 // Max Allowed Loopback
|
||||
)
|
||||
{
|
||||
//
|
||||
double result = 0;
|
||||
|
||||
//
|
||||
if (barIndex < 0)
|
||||
{
|
||||
barIndex = 0;
|
||||
}
|
||||
|
||||
//
|
||||
if (loopback < 576)
|
||||
{
|
||||
loopback = 576;
|
||||
}
|
||||
|
||||
//
|
||||
if (vale <= 0)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
double iValue = 0;
|
||||
int index = barIndex;
|
||||
bool canContinue = true;
|
||||
while (canContinue)
|
||||
{
|
||||
//
|
||||
iValue = GetVale(index);
|
||||
if (iValue < vale)
|
||||
{
|
||||
//
|
||||
result = iValue;
|
||||
break;
|
||||
}
|
||||
|
||||
//
|
||||
canContinue = index > barIndex + loopback;
|
||||
index++;
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
//
|
||||
double GetLowestPeak(
|
||||
int barIndex,
|
||||
@@ -1872,6 +2088,12 @@ class XCX121Helper : public XCBaseHelper
|
||||
barIndex = 0;
|
||||
}
|
||||
|
||||
//
|
||||
if (loopback < 576)
|
||||
{
|
||||
loopback = 576;
|
||||
}
|
||||
|
||||
//
|
||||
Calculate();
|
||||
|
||||
@@ -1921,6 +2143,12 @@ class XCX121Helper : public XCBaseHelper
|
||||
barIndex = 0;
|
||||
}
|
||||
|
||||
//
|
||||
if (loopback < 576)
|
||||
{
|
||||
loopback = 576;
|
||||
}
|
||||
|
||||
//
|
||||
Calculate();
|
||||
|
||||
@@ -1970,6 +2198,12 @@ class XCX121Helper : public XCBaseHelper
|
||||
barIndex = 0;
|
||||
}
|
||||
|
||||
//
|
||||
if (loopback < 576)
|
||||
{
|
||||
loopback = 576;
|
||||
}
|
||||
|
||||
//
|
||||
Calculate();
|
||||
|
||||
@@ -2019,6 +2253,12 @@ class XCX121Helper : public XCBaseHelper
|
||||
barIndex = 0;
|
||||
}
|
||||
|
||||
//
|
||||
if (loopback < 576)
|
||||
{
|
||||
loopback = 576;
|
||||
}
|
||||
|
||||
//
|
||||
Calculate();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user