last works on xki ...

This commit is contained in:
2025-12-30 21:38:58 +03:30
parent 5850164aab
commit b1731af03c
8 changed files with 6662 additions and 66 deletions
+181 -48
View File
@@ -28,16 +28,21 @@
enum ENUM_X121_XKI_BUFFERS
{
//
// KI ...
X121_XKI_KI_LINE = 0,
X121_XKI_KI_COLOR_LINE = 1,
X121_XKI_KI_STATE_LINE = 8,
// KI Fast ...
X121_XKI_KI_FAST_LINE = 0,
X121_XKI_KI_FAST_COLOR_LINE = 1,
X121_XKI_KI_FAST_STATE_LINE = 10,
//
// KI Slow ...
X121_XKI_KI_SLOW_LINE = 8,
X121_XKI_KI_SLOW_COLOR_LINE = 9,
X121_XKI_KI_SLOW_STATE_LINE = 17,
//
// KI Wave ...
X121_XKI_KI_WAVE_LINE = 2,
X121_XKI_KI_WAVE_RAW_LINE = 13,
X121_XKI_KI_WAVE_RAW_LINE = 15,
X121_XKI_KI_WAVE_COLOR_LINE = 3,
X121_XKI_KI_WAVE_STATE_LINE = 14,
X121_XKI_KI_WAVE_STATE_LINE = 16,
//
// Upper/Lower ...
X121_XKI_KI_UPPER_LINE = 4,
@@ -48,12 +53,12 @@ enum ENUM_X121_XKI_BUFFERS
X121_XKI_MA_SLOW_LINE = 7,
//
// ATR ...
X121_XKI_ATR_LINE = 9,
X121_XKI_ATR_RAW_UPPER_LINE = 10,
X121_XKI_ATR_RAW_LOWER_LINE = 11,
X121_XKI_ATR_LINE = 11,
X121_XKI_ATR_RAW_UPPER_LINE = 12,
X121_XKI_ATR_RAW_LOWER_LINE = 13,
//
// RSI ...
X121_XKI_RSI_LINE = 12,
X121_XKI_RSI_LINE = 14,
};
// #endregion
@@ -62,7 +67,8 @@ struct X121XKIInputs
{
// #region Props ...
// #region Calculations ...
int kiLength; // KI Length
int kiFastLength; // KI Fast Length
int kiSlowLength; // KI Slow Length
int maFastLength; // MA Fast Length
int maSlowLength; // MA Slow Length
ENUM_MA_METHOD maMethod; // MA Mode
@@ -81,7 +87,8 @@ struct X121XKIInputs
// #endregion
// #region Presentations ...
bool showKI; // Show KI
bool showKIFast; // Show KI
bool showKISlow; // Show Slow
bool showMaFast; // Show Ma Fast
bool showMaSlow; // Show MA Slow
bool showKIWave; // Show KI Wave
@@ -114,7 +121,8 @@ struct X121XKIInputs
{
//
// Calculations ...
kiLength = 26;
kiFastLength = 26;
kiSlowLength = 104;
maFastLength = 9;
maSlowLength = 26;
maMethod = MODE_EMA;
@@ -133,7 +141,8 @@ struct X121XKIInputs
//
// Presentations ...
showKI = true;
showKIFast = true;
showKISlow = true;
showMaFast = true;
showMaSlow = true;
showKIWave = true;
@@ -150,7 +159,8 @@ struct X121XKIInputs
{
//
// Presentations ...
showKI = false;
showKIFast = false;
showKISlow = false;
showMaFast = false;
showMaSlow = false;
showKIWave = false;
@@ -169,7 +179,8 @@ struct X121XKIInputs
result =
//
// KI ...
kiLength >= 5 &&
kiFastLength >= 5 &&
kiSlowLength > kiFastLength &&
//
// ATR ...
atrLength >= 5 &&
@@ -201,15 +212,18 @@ struct X121XKIConditions
// #endregion
// #region Buffers ...
double kiBuffer[];
double kiColorBuffer[];
double kiFastBuffer[];
double kiFastColorBuffer[];
double kiFastStateBuffer[];
double kiSlowBuffer[];
double kiSlowColorBuffer[];
double kiSlowStateBuffer[];
double kiWaveBuffer[];
double kiWaveColorBuffer[];
double kiUpperBuffer[];
double kiLowerBuffer[];
double maFastBuffer[];
double maSlowBuffer[];
double kiStateBuffer[];
double atrBuffer[];
double atrRawUpperBuffer[];
double atrRawLowerBuffer[];
@@ -243,15 +257,18 @@ struct X121XKIConditions
// Buffers ...
//
XClean(kiBuffer);
XClean(kiColorBuffer);
XClean(kiFastBuffer);
XClean(kiFastColorBuffer);
XClean(kiFastStateBuffer);
XClean(kiSlowBuffer);
XClean(kiSlowColorBuffer);
XClean(kiSlowStateBuffer);
XClean(kiWaveBuffer);
XClean(kiWaveColorBuffer);
XClean(kiUpperBuffer);
XClean(kiLowerBuffer);
XClean(maFastBuffer);
XClean(maSlowBuffer);
XClean(kiStateBuffer);
XClean(atrBuffer);
XClean(atrRawUpperBuffer);
XClean(atrRawLowerBuffer);
@@ -260,15 +277,18 @@ struct X121XKIConditions
XClean(kiWaveStateBuffer);
//
ArraySetAsSeries(kiBuffer, true);
ArraySetAsSeries(kiColorBuffer, true);
ArraySetAsSeries(kiFastBuffer, true);
ArraySetAsSeries(kiFastColorBuffer, true);
ArraySetAsSeries(kiFastStateBuffer, true);
ArraySetAsSeries(kiSlowBuffer, true);
ArraySetAsSeries(kiSlowColorBuffer, true);
ArraySetAsSeries(kiSlowStateBuffer, true);
ArraySetAsSeries(kiWaveBuffer, true);
ArraySetAsSeries(kiWaveColorBuffer, true);
ArraySetAsSeries(kiUpperBuffer, true);
ArraySetAsSeries(kiLowerBuffer, true);
ArraySetAsSeries(maFastBuffer, true);
ArraySetAsSeries(maSlowBuffer, true);
ArraySetAsSeries(kiStateBuffer, true);
ArraySetAsSeries(atrBuffer, true);
ArraySetAsSeries(atrRawUpperBuffer, true);
ArraySetAsSeries(atrRawLowerBuffer, true);
@@ -342,7 +362,8 @@ class XCX121XKIHelper : public XCBaseHelper
mPeriod,
"x-saherelm.x121.xki",
"", // Calculation ...
mInputs.kiLength,
mInputs.kiFastLength,
mInputs.kiSlowLength,
mInputs.maFastLength,
mInputs.maSlowLength,
mInputs.maMethod,
@@ -359,7 +380,8 @@ class XCX121XKIHelper : public XCBaseHelper
mInputs.atrUpperPriceType,
mInputs.atrLowerPriceType,
"", // Presentation ...
mInputs.showKI,
mInputs.showKIFast,
mInputs.showKISlow,
mInputs.showMaFast,
mInputs.showMaSlow,
mInputs.showKIWave,
@@ -450,20 +472,35 @@ class XCX121XKIHelper : public XCBaseHelper
int zIndex = barIndex;
// #region Reading Buffers ...
CopyKI(
CopyKIFast(
zIndex,
loopback,
conditions.kiBuffer //
conditions.kiFastBuffer //
);
CopyKIColor(
CopyKIFastColor(
zIndex,
loopback,
conditions.kiColorBuffer //
conditions.kiFastColorBuffer //
);
CopyKIState(
CopyKIFastState(
zIndex,
loopback,
conditions.kiStateBuffer //
conditions.kiFastStateBuffer //
);
CopyKISlow(
zIndex,
loopback,
conditions.kiSlowBuffer //
);
CopyKISlowColor(
zIndex,
loopback,
conditions.kiSlowColorBuffer //
);
CopyKISlowState(
zIndex,
loopback,
conditions.kiSlowStateBuffer //
);
CopyKIWave(
zIndex,
@@ -533,21 +570,21 @@ class XCX121XKIHelper : public XCBaseHelper
// #endregion
// #region Buffer Readers ...
// #region KI ...
// #region KI Fast ...
//
double GetKI(
double GetKIFast(
int barIndex // Bar Index
)
{
//
return ReadValue(
(int)X121_XKI_KI_LINE,
(int)X121_XKI_KI_FAST_LINE,
barIndex //
);
}
//
int CopyKI(
int CopyKIFast(
int start, // Start
int count, // Number of Items for read
double &buffer[], // Dest Buffer
@@ -557,7 +594,7 @@ class XCX121XKIHelper : public XCBaseHelper
//
return ReadValues(
buffer,
(int)X121_XKI_KI_LINE,
(int)X121_XKI_KI_FAST_LINE,
start,
count,
asSeries //
@@ -565,21 +602,21 @@ class XCX121XKIHelper : public XCBaseHelper
}
// #endregion
// #region KI Color ...
// #region KI Fast Color ...
//
double GetKIColor(
double GetKIFastColor(
int barIndex // Bar Index
)
{
//
return ReadValue(
(int)X121_XKI_KI_COLOR_LINE,
(int)X121_XKI_KI_FAST_COLOR_LINE,
barIndex //
);
}
//
int CopyKIColor(
int CopyKIFastColor(
int start, // Start
int count, // Number of Items for read
double &buffer[], // Dest Buffer
@@ -589,7 +626,7 @@ class XCX121XKIHelper : public XCBaseHelper
//
return ReadValues(
buffer,
(int)X121_XKI_KI_COLOR_LINE,
(int)X121_XKI_KI_FAST_COLOR_LINE,
start,
count,
asSeries //
@@ -597,21 +634,21 @@ class XCX121XKIHelper : public XCBaseHelper
}
// #endregion
// #region KI State ...
// #region KI Fast State ...
//
double GetKIState(
double GetKIFastState(
int barIndex // Bar Index
)
{
//
return ReadValue(
(int)X121_XKI_KI_STATE_LINE,
(int)X121_XKI_KI_FAST_STATE_LINE,
barIndex //
);
}
//
int CopyKIState(
int CopyKIFastState(
int start, // Start
int count, // Number of Items for read
double &buffer[], // Dest Buffer
@@ -621,7 +658,103 @@ class XCX121XKIHelper : public XCBaseHelper
//
return ReadValues(
buffer,
(int)X121_XKI_KI_STATE_LINE,
(int)X121_XKI_KI_FAST_STATE_LINE,
start,
count,
asSeries //
);
}
// #endregion
// #region KI Slow ...
//
double GetKISlow(
int barIndex // Bar Index
)
{
//
return ReadValue(
(int)X121_XKI_KI_SLOW_LINE,
barIndex //
);
}
//
int CopyKISlow(
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_SLOW_LINE,
start,
count,
asSeries //
);
}
// #endregion
// #region KI Slow Color ...
//
double GetKISlowColor(
int barIndex // Bar Index
)
{
//
return ReadValue(
(int)X121_XKI_KI_SLOW_COLOR_LINE,
barIndex //
);
}
//
int CopyKISlowColor(
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_SLOW_COLOR_LINE,
start,
count,
asSeries //
);
}
// #endregion
// #region KI Slow State ...
//
double GetKISlowState(
int barIndex // Bar Index
)
{
//
return ReadValue(
(int)X121_XKI_KI_SLOW_STATE_LINE,
barIndex //
);
}
//
int CopyKISlowState(
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_SLOW_STATE_LINE,
start,
count,
asSeries //