last ...
This commit is contained in:
@@ -925,6 +925,70 @@ class XCX121XKIHelperParser : XCBase
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
bool IsVolatilitySwitchdToHigh(int barIndex = 0)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
// Normalize ...
|
||||
barIndex = NormalizeBarIndex(barIndex);
|
||||
|
||||
//
|
||||
// Validate ...
|
||||
result = IsValid();
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
double atr = helper.GetATR(barIndex);
|
||||
double atrPrev = helper.GetATR(barIndex + 1);
|
||||
double atrMa = helper.GetATRSmoothed(barIndex);
|
||||
double atrMaPrev = helper.GetATRSmoothed(barIndex + 1);
|
||||
|
||||
//
|
||||
result =
|
||||
atr > atrMa &&
|
||||
atrPrev <= atrMaPrev;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
bool IsVolatilitySwitchdToLow(int barIndex = 0)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
// Normalize ...
|
||||
barIndex = NormalizeBarIndex(barIndex);
|
||||
|
||||
//
|
||||
// Validate ...
|
||||
result = IsValid();
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
double atr = helper.GetATR(barIndex);
|
||||
double atrPrev = helper.GetATR(barIndex + 1);
|
||||
double atrMa = helper.GetATRSmoothed(barIndex);
|
||||
double atrMaPrev = helper.GetATRSmoothed(barIndex + 1);
|
||||
|
||||
//
|
||||
result =
|
||||
atr < atrMa &&
|
||||
atrPrev >= atrMaPrev;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
// #endregion
|
||||
|
||||
// #region RSI ...
|
||||
@@ -1251,7 +1315,7 @@ class XCX121XKIHelperParser : XCBase
|
||||
// MA crossover bullish ...
|
||||
double maFastNow = helper.GetMAFast(barIndex);
|
||||
double maSlowNow = helper.GetMASlow(barIndex);
|
||||
bool maOk = maFastNow > maSlowNow;
|
||||
bool maOk = maFastNow > maSlowNow;
|
||||
|
||||
//
|
||||
result = rsiFlip && (atrOk || maOk);
|
||||
|
||||
Reference in New Issue
Block a user