This commit is contained in:
2026-01-09 22:41:21 +03:30
parent 2829430c0c
commit 41fb71d63d
4 changed files with 4346 additions and 427 deletions
@@ -114,7 +114,7 @@ class XCX121XKIHelperParser : XCBase
//
barIndex = NormalizeBarIndex(barIndex);
XOHCL result;
result.Init(symbol, period);
result.Init(symbol, period, barIndex);
return result;
}
@@ -171,153 +171,22 @@ class XCX121XKIHelperParser : XCBase
DECLARE_CROSSING_COMPARATOR_FUNCTIONS("KI", "Slow", "SuperSlow", helper.GetKISlow, helper.GetKISuperSlow, NormalizeBarIndex, GetPoints);
DECLARE_CROSSING_COMPARATOR_FUNCTIONS("MA", "Slow", "SuperSlow", helper.GetMASlow, helper.GetMASuperSlow, NormalizeBarIndex, GetPoints);
// #region PV ...
bool IsPeakSameAsLast(
int barIndex = 0,
double tolerance = 2 //
)
{
//
bool result = false;
//
DECLARE_VALUE_COMPARATOR_FUNCTIONS("Peak", helper.GetPeak, NormalizeBarIndex, GetPoints);
DECLARE_VALUE_COMPARATOR_FUNCTIONS("Vale", helper.GetVale, NormalizeBarIndex, GetPoints);
//
barIndex = NormalizeBarIndex(barIndex);
//
DECLARE_VALUE_COMPARATOR_FUNCTIONS("ATR", helper.GetATR, NormalizeBarIndex, GetPoints);
DECLARE_VALUE_COMPARATOR_FUNCTIONS("ATRSmoothed", helper.GetATRSmoothed, NormalizeBarIndex, GetPoints);
//
result =
IsValid() &&
IsSame(
helper.GetPeak(barIndex),
helper.GetPeak(barIndex + 1),
GetPoints(symbol) * tolerance //
);
//
DECLARE_VALUE_COMPARATOR_FUNCTIONS("RSI", helper.GetRSI, NormalizeBarIndex, GetPoints);
DECLARE_VALUE_COMPARATOR_FUNCTIONS("RSISmoothed", helper.GetRSISmoothed, NormalizeBarIndex, GetPoints);
//
return result;
}
//
//
//
bool IsPeakOverLast(
int barIndex = 0,
double tolerance = 2 //
)
{
//
bool result = false;
//
barIndex = NormalizeBarIndex(barIndex);
//
result =
IsValid() &&
IsOver(
helper.GetPeak(barIndex),
helper.GetPeak(barIndex + 1),
GetPoints(symbol) * tolerance //
);
//
return result;
}
bool IsPeakUnderLast(
int barIndex = 0,
double tolerance = 2 //
)
{
//
bool result = false;
//
barIndex = NormalizeBarIndex(barIndex);
//
result =
IsValid() &&
IsUnder(
helper.GetPeak(barIndex),
helper.GetPeak(barIndex + 1),
GetPoints(symbol) * tolerance //
);
//
return result;
}
bool IsValeSameAsLast(
int barIndex = 0,
double tolerance = 2 //
)
{
//
bool result = false;
//
barIndex = NormalizeBarIndex(barIndex);
//
result =
IsValid() &&
IsSame(
helper.GetVale(barIndex),
helper.GetVale(barIndex + 1),
GetPoints(symbol) * tolerance //
);
//
return result;
}
bool IsValeOverLast(
int barIndex = 0,
double tolerance = 2 //
)
{
//
bool result = false;
//
barIndex = NormalizeBarIndex(barIndex);
//
result =
IsValid() &&
IsOver(
helper.GetVale(barIndex),
helper.GetVale(barIndex + 1),
GetPoints(symbol) * tolerance //
);
//
return result;
}
bool IsValeUnderLast(
int barIndex = 0,
double tolerance = 2 //
)
{
//
bool result = false;
//
barIndex = NormalizeBarIndex(barIndex);
//
result =
IsValid() &&
IsUnder(
helper.GetVale(barIndex),
helper.GetVale(barIndex + 1),
GetPoints(symbol) * tolerance //
);
//
return result;
}
// #endregion
// #region ATR ...
bool IsATRBreakoutUp(
int barIndex = 0,
ENUM_X_PRICE priceType = X_PRICE_CLOSE //
@@ -394,186 +263,6 @@ class XCX121XKIHelperParser : XCBase
return result;
}
bool IsATROverLast(
int barIndex = 0,
double tolerance = 2 //
)
{
//
bool result = false;
//
barIndex = NormalizeBarIndex(barIndex);
//
result =
IsValid() &&
IsOver(
helper.GetATR(barIndex),
helper.GetATR(barIndex + 1),
GetPoints(symbol) * tolerance //
);
//
return result;
}
bool IsATRUnderLast(
int barIndex = 0,
double tolerance = 2 //
)
{
//
bool result = false;
//
barIndex = NormalizeBarIndex(barIndex);
//
result =
IsValid() &&
IsUnder(
helper.GetATR(barIndex),
helper.GetATR(barIndex + 1),
GetPoints(symbol) * tolerance //
);
//
return result;
}
bool IsATRSwitchedOverLast(
int barIndex = 0,
double tolerance = 2 //
)
{
//
bool result = false;
//
barIndex = NormalizeBarIndex(barIndex);
//
result =
IsValid() &&
IsATROverLast(barIndex, tolerance) &&
!IsATROverLast(barIndex + 1, tolerance);
//
return result;
}
bool IsATRSwitchedUnderLast(
int barIndex = 0,
double tolerance = 2 //
)
{
//
bool result = false;
//
barIndex = NormalizeBarIndex(barIndex);
//
result =
IsValid() &&
IsATRUnderLast(barIndex, tolerance) &&
!IsATRUnderLast(barIndex + 1, tolerance);
//
return result;
}
bool IsATRSmoothedOverLast(
int barIndex = 0,
double tolerance = 2 //
)
{
//
bool result = false;
//
barIndex = NormalizeBarIndex(barIndex);
//
result =
IsValid() &&
IsOver(
helper.GetATRSmoothed(barIndex),
helper.GetATRSmoothed(barIndex + 1),
GetPoints(symbol) * tolerance //
);
//
return result;
}
bool IsATRSmoothedUnderLast(
int barIndex = 0,
double tolerance = 2 //
)
{
//
bool result = false;
//
barIndex = NormalizeBarIndex(barIndex);
//
result =
IsValid() &&
IsUnder(
helper.GetATRSmoothed(barIndex),
helper.GetATRSmoothed(barIndex + 1),
GetPoints(symbol) * tolerance //
);
//
return result;
}
bool IsATRSmoothedSwitchedOverLast(
int barIndex = 0,
double tolerance = 2 //
)
{
//
bool result = false;
//
barIndex = NormalizeBarIndex(barIndex);
//
result =
IsValid() &&
IsATRSmoothedOverLast(barIndex, tolerance) &&
!IsATRSmoothedOverLast(barIndex + 1, tolerance);
//
return result;
}
bool IsATRSmoothedSwitchedUnderLast(
int barIndex = 0,
double tolerance = 2 //
)
{
//
bool result = false;
//
barIndex = NormalizeBarIndex(barIndex);
//
result =
IsValid() &&
IsATRSmoothedUnderLast(barIndex, tolerance) &&
!IsATRSmoothedUnderLast(barIndex + 1, tolerance);
//
return result;
}
bool IsVolatilityHigh(int barIndex = 0)
{
//
@@ -689,9 +378,7 @@ class XCX121XKIHelperParser : XCBase
//
return result;
}
// #endregion
// #region RSI ...
bool IsRSIBullish(
int barIndex = 0,
double threshold = 55,
@@ -714,8 +401,8 @@ class XCX121XKIHelperParser : XCBase
}
//
result = helper.GetRSI(barIndex) > threshold + (GetPoints(symbol) * tolerance) ||
helper.GetRSI(barIndex) > threshold - (GetPoints(symbol) * tolerance);
result = helper.GetRSI(barIndex) > threshold + (GetXPoints(symbol) * tolerance) ||
helper.GetRSI(barIndex) > threshold - (GetXPoints(symbol) * tolerance);
//
return result;
@@ -773,8 +460,8 @@ class XCX121XKIHelperParser : XCBase
}
//
result = helper.GetRSI(barIndex) < threshold + (GetPoints(symbol) * tolerance) ||
helper.GetRSI(barIndex) < threshold - (GetPoints(symbol) * tolerance);
result = helper.GetRSI(barIndex) < threshold + (GetXPoints(symbol) * tolerance) ||
helper.GetRSI(barIndex) < threshold - (GetXPoints(symbol) * tolerance);
//
return result;
@@ -880,96 +567,6 @@ class XCX121XKIHelperParser : XCBase
return result;
}
bool IsRSIOverLast(
int barIndex = 0,
double tolerance = 2 //
)
{
//
bool result = false;
//
barIndex = NormalizeBarIndex(barIndex);
//
result =
IsValid() &&
IsOver(
helper.GetRSI(barIndex),
helper.GetRSI(barIndex + 1),
GetPoints(symbol) * tolerance //
);
//
return result;
}
bool IsRSISwitchedOverLast(
int barIndex = 0,
double tolerance = 2 //
)
{
//
bool result = false;
//
barIndex = NormalizeBarIndex(barIndex);
//
result =
IsValid() &&
IsRSIOverLast(barIndex, tolerance) &&
!IsRSIOverLast(barIndex + 1, tolerance);
//
return result;
}
bool IsRSIUnderLast(
int barIndex = 0,
double tolerance = 2 //
)
{
//
bool result = false;
//
barIndex = NormalizeBarIndex(barIndex);
//
result =
IsValid() &&
IsUnder(
helper.GetRSI(barIndex),
helper.GetRSI(barIndex + 1),
GetPoints(symbol) * tolerance //
);
//
return result;
}
bool IsRSISwitchedUnderLast(
int barIndex = 0,
double tolerance = 2 //
)
{
//
bool result = false;
//
barIndex = NormalizeBarIndex(barIndex);
//
result =
IsValid() &&
IsRSIUnderLast(barIndex, tolerance) &&
!IsRSIUnderLast(barIndex + 1, tolerance);
//
return result;
}
bool IsRSIOverbought(
int barIndex = 0,
double threshold = 70,
@@ -992,8 +589,8 @@ class XCX121XKIHelperParser : XCBase
}
//
result = helper.GetRSI(barIndex) > threshold + (GetPoints(symbol) * tolerance) ||
helper.GetRSI(barIndex) > threshold - (GetPoints(symbol) * tolerance);
result = helper.GetRSI(barIndex) > threshold + (GetXPoints(symbol) * tolerance) ||
helper.GetRSI(barIndex) > threshold - (GetXPoints(symbol) * tolerance);
//
return result;
@@ -1021,8 +618,8 @@ class XCX121XKIHelperParser : XCBase
}
//
result = helper.GetRSI(barIndex) < threshold + (GetPoints(symbol) * tolerance) ||
helper.GetRSI(barIndex) < threshold - (GetPoints(symbol) * tolerance);
result = helper.GetRSI(barIndex) < threshold + (GetXPoints(symbol) * tolerance) ||
helper.GetRSI(barIndex) < threshold - (GetXPoints(symbol) * tolerance);
//
return result;
@@ -1115,7 +712,6 @@ class XCX121XKIHelperParser : XCBase
//
return result;
}
// #endregion
//
// Protected ...
@@ -2233,7 +2233,7 @@ class XCX121XKIPOIDetector : public XCMarketPatternDetector
{
//
// Bullish ...
bool hasBullish = kiParser.IsMACrossoverSwitchedToBullish(i);
bool hasBullish = kiParser.IsMAFastCrossedOverSlow(i);
has = hasBullish && isBullish;
if (has)
{
@@ -2263,7 +2263,7 @@ class XCX121XKIPOIDetector : public XCMarketPatternDetector
//
// Bearish ...
bool hasBearish = kiParser.IsMACrossoverSwitchedToBearish(i);
bool hasBearish = kiParser.IsMAFastCrossedUnderSlow(i);
has = hasBearish && isBearish;
if (has)
{