some cleanups, refactor unnecessary requirements, implement rejected checkers and also counters ...

ass support for PV and KISuperSlow and MASuper Slow in KI Indicator and also Helper and implement them in BackTester ...
This commit is contained in:
2026-01-07 04:27:38 +03:30
parent 0788de9660
commit 31232dffef
9 changed files with 5354 additions and 1965 deletions
+303 -19
View File
@@ -31,18 +31,23 @@ enum ENUM_X121_XKI_BUFFERS
// KI Fast ...
X121_XKI_KI_FAST_LINE = 0,
X121_XKI_KI_FAST_COLOR_LINE = 1,
X121_XKI_KI_FAST_STATE_LINE = 10,
X121_XKI_KI_FAST_STATE_LINE = 15,
//
// KI Slow ...
X121_XKI_KI_SLOW_LINE = 8,
X121_XKI_KI_SLOW_COLOR_LINE = 9,
X121_XKI_KI_SLOW_STATE_LINE = 17,
X121_XKI_KI_SLOW_STATE_LINE = 22,
//
// KI Super Slow ...
X121_XKI_KI_SUPER_SLOW_LINE = 10,
X121_XKI_KI_SUPER_SLOW_COLOR_LINE = 11,
X121_XKI_KI_SUPER_SLOW_STATE_LINE = 24,
//
// KI Wave ...
X121_XKI_KI_WAVE_LINE = 2,
X121_XKI_KI_WAVE_RAW_LINE = 15,
X121_XKI_KI_WAVE_RAW_LINE = 20,
X121_XKI_KI_WAVE_COLOR_LINE = 3,
X121_XKI_KI_WAVE_STATE_LINE = 16,
X121_XKI_KI_WAVE_STATE_LINE = 21,
//
// Upper/Lower ...
X121_XKI_KI_UPPER_LINE = 4,
@@ -51,15 +56,20 @@ enum ENUM_X121_XKI_BUFFERS
// MA Fast/Slow ...
X121_XKI_MA_FAST_LINE = 6,
X121_XKI_MA_SLOW_LINE = 7,
X121_XKI_MA_SUPER_SLOW_LINE = 12,
//
// PV ...
X121_XKI_PEAK_LINE = 13,
X121_XKI_VALE_LINE = 14,
//
// ATR ...
X121_XKI_ATR_LINE = 11,
X121_XKI_ATR_SMOOTHED_LINE = 18,
X121_XKI_ATR_RAW_UPPER_LINE = 12,
X121_XKI_ATR_RAW_LOWER_LINE = 13,
X121_XKI_ATR_LINE = 16,
X121_XKI_ATR_SMOOTHED_LINE = 23,
X121_XKI_ATR_RAW_UPPER_LINE = 17,
X121_XKI_ATR_RAW_LOWER_LINE = 18,
//
// RSI ...
X121_XKI_RSI_LINE = 14,
X121_XKI_RSI_LINE = 19,
};
// #endregion
@@ -70,8 +80,10 @@ struct X121XKIInputs
// #region Calculations ...
int kiFastLength; // KI Fast Length
int kiSlowLength; // KI Slow Length
int kiSuperSlowLength; // KI Super Slow Length
int maFastLength; // MA Fast Length
int maSlowLength; // MA Slow Length
int maSuperSlowLength; // MA Super Slow Length
ENUM_MA_METHOD maMethod; // MA Mode
ENUM_APPLIED_PRICE maAppliedTo; // MA Applied To
int rsiLength; // RSI Length
@@ -88,16 +100,23 @@ struct X121XKIInputs
// #endregion
// #region Presentations ...
bool showKIFast; // Show KI
bool showKISlow; // Show Slow
bool showMaFast; // Show Ma Fast
bool showMaSlow; // Show MA Slow
bool showKIWave; // Show KI Wave
bool showKIUpper; // Show KI Upper
bool showKILower; // Show KI Lower
bool showPV; // Show PV
bool showKIFast; // Show KI
bool showKISlow; // Show KI Slow
bool showKISuperSlow; // Show KI Super Slow
bool showMaFast; // Show Ma Fast
bool showMaSlow; // Show MA Slow
bool showMaSuperSlow; // Show MA Super Slow
bool showKIWave; // Show KI Wave
bool showKIUpper; // Show KI Upper
bool showKILower; // Show KI Lower
//
int startCalculationForLastBars; // Calculate Last n Bars
//
int peakArrowCode; // Peaks Arrow Code
int valeArrowCode; // Vales Arrow Code
// #endregion
// #endregion
@@ -124,8 +143,10 @@ struct X121XKIInputs
// Calculations ...
kiFastLength = 26;
kiSlowLength = 104;
maFastLength = 9;
maSlowLength = 26;
kiSuperSlowLength = 208;
maFastLength = 26;
maSlowLength = 104;
maSuperSlowLength = 208;
maMethod = MODE_EMA;
maAppliedTo = PRICE_CLOSE;
rsiLength = 14;
@@ -142,16 +163,23 @@ struct X121XKIInputs
//
// Presentations ...
showPV = true;
showKIFast = true;
showKISlow = true;
showKISuperSlow = true;
showMaFast = true;
showMaSlow = true;
showMaSuperSlow = true;
showKIWave = true;
showKIUpper = true;
showKILower = true;
//
startCalculationForLastBars = 1500;
//
peakArrowCode = 159;
valeArrowCode = 159;
}
//
@@ -160,10 +188,13 @@ struct X121XKIInputs
{
//
// Presentations ...
showPV = false;
showKIFast = false;
showKISlow = false;
showKISuperSlow = false;
showMaFast = false;
showMaSlow = false;
showMaSuperSlow = false;
showKIWave = false;
showKIUpper = false;
showKILower = false;
@@ -182,6 +213,12 @@ struct X121XKIInputs
// KI ...
kiFastLength >= 5 &&
kiSlowLength > kiFastLength &&
kiSuperSlowLength > kiSlowLength &&
//
// MA ...
maFastLength >= 2 &&
maSlowLength > maFastLength &&
maSuperSlowLength > maSlowLength &&
//
// ATR ...
atrLength >= 5 &&
@@ -219,12 +256,18 @@ struct X121XKIConditions
double kiSlowBuffer[];
double kiSlowColorBuffer[];
double kiSlowStateBuffer[];
double kiSuperSlowBuffer[];
double kiSuperSlowColorBuffer[];
double kiSuperSlowStateBuffer[];
double kiWaveBuffer[];
double kiWaveColorBuffer[];
double kiUpperBuffer[];
double kiLowerBuffer[];
double maFastBuffer[];
double maSlowBuffer[];
double maSuperSlowBuffer[];
double peakBuffer[];
double valeBuffer[];
double atrBuffer[];
double atrSmoothedBuffer[];
double atrRawUpperBuffer[];
@@ -265,12 +308,18 @@ struct X121XKIConditions
XClean(kiSlowBuffer);
XClean(kiSlowColorBuffer);
XClean(kiSlowStateBuffer);
XClean(kiSuperSlowBuffer);
XClean(kiSuperSlowColorBuffer);
XClean(kiSuperSlowStateBuffer);
XClean(kiWaveBuffer);
XClean(kiWaveColorBuffer);
XClean(kiUpperBuffer);
XClean(kiLowerBuffer);
XClean(maFastBuffer);
XClean(maSlowBuffer);
XClean(maSuperSlowBuffer);
XClean(peakBuffer);
XClean(valeBuffer);
XClean(atrBuffer);
XClean(atrSmoothedBuffer);
XClean(atrRawUpperBuffer);
@@ -286,12 +335,18 @@ struct X121XKIConditions
ArraySetAsSeries(kiSlowBuffer, true);
ArraySetAsSeries(kiSlowColorBuffer, true);
ArraySetAsSeries(kiSlowStateBuffer, true);
ArraySetAsSeries(kiSuperSlowBuffer, true);
ArraySetAsSeries(kiSuperSlowColorBuffer, true);
ArraySetAsSeries(kiSuperSlowStateBuffer, true);
ArraySetAsSeries(kiWaveBuffer, true);
ArraySetAsSeries(kiWaveColorBuffer, true);
ArraySetAsSeries(kiUpperBuffer, true);
ArraySetAsSeries(kiLowerBuffer, true);
ArraySetAsSeries(maFastBuffer, true);
ArraySetAsSeries(maSlowBuffer, true);
ArraySetAsSeries(maSuperSlowBuffer, true);
ArraySetAsSeries(peakBuffer, true);
ArraySetAsSeries(valeBuffer, true);
ArraySetAsSeries(atrBuffer, true);
ArraySetAsSeries(atrSmoothedBuffer, true);
ArraySetAsSeries(atrRawUpperBuffer, true);
@@ -368,8 +423,10 @@ class XCX121XKIHelper : public XCBaseHelper
"", // Calculation ...
mInputs.kiFastLength,
mInputs.kiSlowLength,
mInputs.kiSuperSlowLength,
mInputs.maFastLength,
mInputs.maSlowLength,
mInputs.maSuperSlowLength,
mInputs.maMethod,
mInputs.maAppliedTo,
mInputs.rsiLength,
@@ -384,14 +441,19 @@ class XCX121XKIHelper : public XCBaseHelper
mInputs.atrUpperPriceType,
mInputs.atrLowerPriceType,
"", // Presentation ...
mInputs.showPV,
mInputs.showKIFast,
mInputs.showKISlow,
mInputs.showKISuperSlow,
mInputs.showMaFast,
mInputs.showMaSlow,
mInputs.showMaSuperSlow,
mInputs.showKIWave,
mInputs.showKIUpper,
mInputs.showKILower,
mInputs.startCalculationForLastBars //
mInputs.startCalculationForLastBars,
mInputs.peakArrowCode,
mInputs.valeArrowCode //
);
result = mHandler != INVALID_HANDLE;
if (!result)
@@ -506,6 +568,21 @@ class XCX121XKIHelper : public XCBaseHelper
loopback,
conditions.kiSlowStateBuffer //
);
CopyKISuperSlow(
zIndex,
loopback,
conditions.kiSuperSlowBuffer //
);
CopyKISuperSlowColor(
zIndex,
loopback,
conditions.kiSuperSlowColorBuffer //
);
CopyKISuperSlowState(
zIndex,
loopback,
conditions.kiSuperSlowStateBuffer //
);
CopyKIWave(
zIndex,
loopback,
@@ -546,6 +623,21 @@ class XCX121XKIHelper : public XCBaseHelper
loopback,
conditions.maSlowBuffer //
);
CopyMASuperSlow(
zIndex,
loopback,
conditions.maSuperSlowBuffer //
);
CopyPeak(
zIndex,
loopback,
conditions.peakBuffer //
);
CopyVale(
zIndex,
loopback,
conditions.valeBuffer //
);
CopyRSI(
zIndex,
loopback,
@@ -771,6 +863,102 @@ class XCX121XKIHelper : public XCBaseHelper
}
// #endregion
// #region KI Super Slow ...
//
double GetKISuperSlow(
int barIndex // Bar Index
)
{
//
return ReadValue(
(int)X121_XKI_KI_SUPER_SLOW_LINE,
barIndex //
);
}
//
int CopyKISuperSlow(
int start, // Start
int count, // Number of Items for read
double &buffer[], // Dest Buffer
bool asSeries = true // As Series Flag
)
{
//
return ReadValues(
buffer,
(int)X121_XKI_KI_SUPER_SLOW_LINE,
start,
count,
asSeries //
);
}
// #endregion
// #region KI Super Slow Color ...
//
double GetKISuperSlowColor(
int barIndex // Bar Index
)
{
//
return ReadValue(
(int)X121_XKI_KI_SUPER_SLOW_COLOR_LINE,
barIndex //
);
}
//
int CopyKISuperSlowColor(
int start, // Start
int count, // Number of Items for read
double &buffer[], // Dest Buffer
bool asSeries = true // As Series Flag
)
{
//
return ReadValues(
buffer,
(int)X121_XKI_KI_SUPER_SLOW_COLOR_LINE,
start,
count,
asSeries //
);
}
// #endregion
// #region KI Super Slow State ...
//
double GetKISuperSlowState(
int barIndex // Bar Index
)
{
//
return ReadValue(
(int)X121_XKI_KI_SUPER_SLOW_STATE_LINE,
barIndex //
);
}
//
int CopyKISuperSlowState(
int start, // Start
int count, // Number of Items for read
double &buffer[], // Dest Buffer
bool asSeries = true // As Series Flag
)
{
//
return ReadValues(
buffer,
(int)X121_XKI_KI_SUPER_SLOW_STATE_LINE,
start,
count,
asSeries //
);
}
// #endregion
// #region KI Wave ...
//
double GetKIWave(
@@ -1027,6 +1215,102 @@ class XCX121XKIHelper : public XCBaseHelper
}
// #endregion
// #region MA Super Slow ...
//
double GetMASuperSlow(
int barIndex // Bar Index
)
{
//
return ReadValue(
(int)X121_XKI_MA_SUPER_SLOW_LINE,
barIndex //
);
}
//
int CopyMASuperSlow(
int start, // Start
int count, // Number of Items for read
double &buffer[], // Dest Buffer
bool asSeries = true // As Series Flag
)
{
//
return ReadValues(
buffer,
(int)X121_XKI_MA_SUPER_SLOW_LINE,
start,
count,
asSeries //
);
}
// #endregion
// #region Peak ...
//
double GetPeak(
int barIndex // Bar Index
)
{
//
return ReadValue(
(int)X121_XKI_PEAK_LINE,
barIndex //
);
}
//
int CopyPeak(
int start, // Start
int count, // Number of Items for read
double &buffer[], // Dest Buffer
bool asSeries = true // As Series Flag
)
{
//
return ReadValues(
buffer,
(int)X121_XKI_PEAK_LINE,
start,
count,
asSeries //
);
}
// #endregion
// #region Vale ...
//
double GetVale(
int barIndex // Bar Index
)
{
//
return ReadValue(
(int)X121_XKI_VALE_LINE,
barIndex //
);
}
//
int CopyVale(
int start, // Start
int count, // Number of Items for read
double &buffer[], // Dest Buffer
bool asSeries = true // As Series Flag
)
{
//
return ReadValues(
buffer,
(int)X121_XKI_VALE_LINE,
start,
count,
asSeries //
);
}
// #endregion
// #region RSI ...
//
double GetRSI(