This commit is contained in:
2025-04-24 09:09:22 +03:30
parent cd932c7648
commit e85a4afb69
6 changed files with 816 additions and 161 deletions
+65 -63
View File
@@ -1427,41 +1427,6 @@ void CalculateBuffers(
low,
tickVolume //
);
//
int swingBarIndex = bar_index;
if (bar_index < swingLength)
{
swingBarIndex = bar_index + swingLength;
}
// //
// // Calcultae Swing High and Low and Trends ...
// CalculateSwingsAndTrend(
// swingBarIndex,
// prevCalculated,
// ratesTotal,
// open,
// high,
// close,
// low,
// tickVolume //
// );
//
if (bar_index < swingLength)
{
//
// for (int i = bar_index; i < bar_index + swingLength; i++)
// {
// //
// trendBuffer[i] = lTrend;
// swingLowsBuffer[i] = lSwingLow;
// swingHighsBuffer[i] = lSwingHigh;
// trendStateBuffer[i] = lTrendState;
// trendColorBuffer[i] = lTrendColor;
// }
}
}
else
{
@@ -2002,6 +1967,11 @@ void CalculateValues(
//
// Calculate KI / Color ...
double lastKI =
isFirstBar
? emptyValue
: kiBuffer[lastBarIndex];
double iKI = lastKI;
if (isInited)
{
//
@@ -2009,46 +1979,78 @@ void CalculateValues(
double iHHKI = iBar.FindHighest(kiLength, MODE_HIGH);
//
double iKI = (iHHKI + iLLKI) / 2;
kiBuffer[bar_index] = iKI;
//
double iKIState = neuturalState;
double iKIColor = neuturalColorIDX;
if (iClose > iKI)
iKI = (iHHKI + iLLKI) / 2;
if (iLLKI == 0 || iHHKI == 0)
{
//
iKIState = bullishState;
iKIColor =
!showKI
? hideColorIDX
: bullishColorIDX;
iKI = lastKI;
}
else if (iClose < iKI)
{
//
iKIState = bearishState;
iKIColor =
!showKI
? hideColorIDX
: bearishColorIDX;
}
kiStateBuffer[bar_index] = iKIState;
kiColorBuffer[bar_index] = iKIColor;
}
else
{
iKI = lastKI;
}
kiBuffer[bar_index] = iKI;
//
double iKIState = neuturalState;
double iKIColor = neuturalColorIDX;
if (iClose > iKI)
{
//
iKIState = bullishState;
iKIColor =
!showKI
? hideColorIDX
: bullishColorIDX;
}
else if (iClose < iKI)
{
//
iKIState = bearishState;
iKIColor =
!showKI
? hideColorIDX
: bearishColorIDX;
}
kiStateBuffer[bar_index] = iKIState;
kiColorBuffer[bar_index] = iKIColor;
//
// Calculate PV Gold ...
double lastPeakGold =
isFirstBar
? emptyValue
: peakGoldenBuffer[lastBarIndex];
double lastValeGold =
isFirstBar
? emptyValue
: valeGoldenBuffer[lastBarIndex];
double iPeakGold = lastPeakGold;
double iValeGold = lastValeGold;
if (isInited)
{
//
double iPeakGold = iBar.FindHighest(mHCLength, MODE_CLOSE);
peakGoldenBuffer[bar_index] = iPeakGold;
iPeakGold = iBar.FindHighest(mHCLength, MODE_CLOSE);
if (iPeakGold == 0)
{
iPeakGold = lastPeakGold;
}
//
double iValeGold = iBar.FindLowest(mHCLength, MODE_CLOSE);
valeGoldenBuffer[bar_index] = iValeGold;
iValeGold = iBar.FindLowest(mHCLength, MODE_CLOSE);
if (iValeGold == 0)
{
iValeGold = lastValeGold;
}
}
else
{
//
iPeakGold = lastPeakGold;
iValeGold = lastValeGold;
}
peakGoldenBuffer[bar_index] = iPeakGold;
valeGoldenBuffer[bar_index] = iValeGold;
//
// Calculate Swings ...