This commit is contained in:
2025-05-05 12:16:36 +03:30
parent eeda9917dc
commit 83242e6d1e
7 changed files with 6317 additions and 168 deletions
+219 -35
View File
@@ -49,20 +49,22 @@ enum ENUM_X121_XCA_BUFFERS
X121_XCA_FIBO_L1_LINE = 14,
X121_XCA_FIBO_L2_LINE = 15,
X121_XCA_FIBO_L3_LINE = 16,
X121_XCA_SAR_LINE = 17,
X121_XCA_TREND_LINE = 18,
X121_XCA_KI_LINE = 20,
X121_XCA_SWING_LOW_LINE = 22,
X121_XCA_SWING_HIGH_LINE = 23,
X121_XCA_TKI_LINE = 24,
X121_XCA_VIDYA_LINE = 26,
X121_XCA_MAH_LINE = 28,
X121_XCA_MAL_LINE = 29,
X121_XCA_MAC_LINE = 30,
X121_XCA_TREND_STATE_LINE = 31,
X121_XCA_KI_STATE_LINE = 32,
X121_XCA_TKI_STATE_LINE = 33,
X121_XCA_VIDYA_STATE_LINE = 34,
X121_XCA_FIBO_L4_LINE = 17,
X121_XCA_FIBO_L5_LINE = 18,
X121_XCA_SAR_LINE = 19,
X121_XCA_TREND_LINE = 20,
X121_XCA_KI_LINE = 22,
X121_XCA_SWING_LOW_LINE = 24,
X121_XCA_SWING_HIGH_LINE = 25,
X121_XCA_TKI_LINE = 26,
X121_XCA_VIDYA_LINE = 28,
X121_XCA_MAH_LINE = 30,
X121_XCA_MAL_LINE = 31,
X121_XCA_MAC_LINE = 32,
X121_XCA_TREND_STATE_LINE = 33,
X121_XCA_KI_STATE_LINE = 34,
X121_XCA_TKI_STATE_LINE = 35,
X121_XCA_VIDYA_STATE_LINE = 36,
};
//
@@ -106,6 +108,8 @@ struct X121XCAInputs
ENUM_X_FIBO_LEVELS fiboLevel1; // Fibo Level 1
ENUM_X_FIBO_LEVELS fiboLevel2; // Fibo Level 2
ENUM_X_FIBO_LEVELS fiboLevel3; // Fibo Level 3
ENUM_X_FIBO_LEVELS fiboLevel4; // Fibo Level 4
ENUM_X_FIBO_LEVELS fiboLevel5; // Fibo Level 5
//
// Sar Detection ...
@@ -155,13 +159,17 @@ struct X121XCAInputs
bool showFiboLevel1; // Show Fibo Level 1
bool showFiboLevel2; // Show Fibo Level 2
bool showFiboLevel3; // Show Fibo Level 3
bool showFiboLevel4; // Show Fibo Level 4
bool showFiboLevel5; // Show Fibo Level 5
bool showPeaksAndVales; // Show Peaks And Vales
bool showPeakAndValeGolden; // Show Peak and Vale Golden
bool showSupportAndResistance; // Show Support and Resistance
bool showShortCycle; // Show Short Cycle
bool showMediumCycle; // Show Medium Cycle
bool showLongCycle; // Show Long Cycle
bool showHindCycle; // Show Hind Cycle
//
bool showShortCycle; // Show Short Cycle
bool showMediumCycle; // Show Medium Cycle
bool showLongCycle; // Show Long Cycle
bool showHindCycle; // Show Hind Cycle
//
int sarArrowCode; // Parabolic Sar Arrow Code
@@ -216,8 +224,10 @@ struct X121XCAInputs
//
// Fibo Levels ...
fiboLevel1 = X_FIBO_LEVEL_236; // Fibo Level 1
fiboLevel2 = X_FIBO_LEVEL_500; // Fibo Level 2
fiboLevel3 = X_FIBO_LEVEL_764; // Fibo Level 3
fiboLevel2 = X_FIBO_LEVEL_382; // Fibo Level 2
fiboLevel3 = X_FIBO_LEVEL_500; // Fibo Level 3
fiboLevel4 = X_FIBO_LEVEL_618; // Fibo Level 4
fiboLevel5 = X_FIBO_LEVEL_764; // Fibo Level 5
//
// Sar Detection ...
@@ -267,13 +277,17 @@ struct X121XCAInputs
showFiboLevel1 = false; // Show Fibo Level 1
showFiboLevel2 = false; // Show Fibo Level 2
showFiboLevel3 = false; // Show Fibo Level 3
showFiboLevel4 = false; // Show Fibo Level 4
showFiboLevel5 = false; // Show Fibo Level 5
showPeaksAndVales = false; // Show Peaks And Vales
showPeakAndValeGolden = false; // Show Peak and Vale Golden
showSupportAndResistance = false; // Show Support and Resistance
showShortCycle = false; // Show Short Cycle
showMediumCycle = false; // Show Medium Cycle
showLongCycle = false; // Show Long Cycle
showHindCycle = false; // Show Hind Cycle
//
showShortCycle = false; // Show Short Cycle
showMediumCycle = false; // Show Medium Cycle
showLongCycle = false; // Show Long Cycle
showHindCycle = false; // Show Hind Cycle
//
sarArrowCode = 0; // Parabolic Sar Arrow Code
@@ -321,8 +335,10 @@ struct X121XCAInputs
//
// Fibo Levels ...
fiboLevel1 = X_FIBO_LEVEL_236; // Fibo Level 1
fiboLevel2 = X_FIBO_LEVEL_500; // Fibo Level 2
fiboLevel3 = X_FIBO_LEVEL_764; // Fibo Level 3
fiboLevel2 = X_FIBO_LEVEL_382; // Fibo Level 2
fiboLevel3 = X_FIBO_LEVEL_500; // Fibo Level 3
fiboLevel4 = X_FIBO_LEVEL_618; // Fibo Level 4
fiboLevel5 = X_FIBO_LEVEL_764; // Fibo Level 5
//
// Sar Detection ...
@@ -367,13 +383,17 @@ struct X121XCAInputs
showFiboLevel1 = true; // Show Fibo Level 1
showFiboLevel2 = true; // Show Fibo Level 2
showFiboLevel3 = true; // Show Fibo Level 3
showFiboLevel4 = true; // Show Fibo Level 4
showFiboLevel5 = true; // Show Fibo Level 5
showPeaksAndVales = true; // Show Peaks And Vales
showPeakAndValeGolden = true; // Show Peak and Vale Golden
showSupportAndResistance = true; // Show Support and Resistance
showShortCycle = true; // Show Short Cycle
showMediumCycle = true; // Show Medium Cycle
showLongCycle = true; // Show Long Cycle
showHindCycle = true; // Show Hind Cycle
//
showShortCycle = true; // Show Short Cycle
showMediumCycle = true; // Show Medium Cycle
showLongCycle = true; // Show Long Cycle
showHindCycle = true; // Show Hind Cycle
//
sarArrowCode = 159; // Parabolic Sar Arrow Code
@@ -475,6 +495,8 @@ struct X121XCAConditions
double fiboLevel1Buffer[];
double fiboLevel2Buffer[];
double fiboLevel3Buffer[];
double fiboLevel4Buffer[];
double fiboLevel5Buffer[];
double trendStateBuffer[];
//
@@ -776,6 +798,8 @@ struct X121XCAConditions
Clean(fiboLevel1Buffer);
Clean(fiboLevel2Buffer);
Clean(fiboLevel3Buffer);
Clean(fiboLevel4Buffer);
Clean(fiboLevel5Buffer);
Clean(vidyaStateBuffer);
Clean(trendStateBuffer);
@@ -809,6 +833,8 @@ struct X121XCAConditions
ArraySetAsSeries(fiboLevel1Buffer, true);
ArraySetAsSeries(fiboLevel2Buffer, true);
ArraySetAsSeries(fiboLevel3Buffer, true);
ArraySetAsSeries(fiboLevel4Buffer, true);
ArraySetAsSeries(fiboLevel5Buffer, true);
ArraySetAsSeries(vidyaStateBuffer, true);
ArraySetAsSeries(trendStateBuffer, true);
@@ -1778,6 +1804,8 @@ class XCX121XCAHelper : public XCBaseHelper
Clean(fiboLevel1Buffer);
Clean(fiboLevel2Buffer);
Clean(fiboLevel3Buffer);
Clean(fiboLevel4Buffer);
Clean(fiboLevel5Buffer);
Clean(trendStateBuffer);
Clean(vidyaStateBuffer);
}
@@ -1834,6 +1862,8 @@ class XCX121XCAHelper : public XCBaseHelper
ArraySetAsSeries(fiboLevel1Buffer, true);
ArraySetAsSeries(fiboLevel2Buffer, true);
ArraySetAsSeries(fiboLevel3Buffer, true);
ArraySetAsSeries(fiboLevel4Buffer, true);
ArraySetAsSeries(fiboLevel5Buffer, true);
ArraySetAsSeries(vidyaStateBuffer, true);
ArraySetAsSeries(trendStateBuffer, true);
@@ -1865,6 +1895,8 @@ class XCX121XCAHelper : public XCBaseHelper
mInputs.fiboLevel1,
mInputs.fiboLevel2,
mInputs.fiboLevel3,
mInputs.fiboLevel4,
mInputs.fiboLevel5,
"", // Sar Detection ...
mInputs.sarStep,
mInputs.sarMax,
@@ -1896,13 +1928,15 @@ class XCX121XCAHelper : public XCBaseHelper
mInputs.showFiboLevel1,
mInputs.showFiboLevel2,
mInputs.showFiboLevel3,
mInputs.showFiboLevel4,
mInputs.showFiboLevel5,
mInputs.showPeaksAndVales,
mInputs.showPeakAndValeGolden,
mInputs.showSupportAndResistance,
mInputs.showShortCycle,
mInputs.showMediumCycle,
mInputs.showLongCycle,
mInputs.showHindCycle // ,
mInputs.showSupportAndResistance //
// mInputs.showShortCycle,
// mInputs.showMediumCycle,
// mInputs.showLongCycle,
// mInputs.showHindCycle // ,
//
// mInputs.sarArrowCode,
// mInputs.peakArrowCode,
@@ -3574,6 +3608,110 @@ class XCX121XCAHelper : public XCBaseHelper
);
}
//
// FIBO Level 4 ...
//
double GetFiboLevel4(
int barIndex // Bar Index
)
{
//
if (barIndex < 0)
{
barIndex = 0;
}
//
Calculate(barIndex);
//
int count = ArraySize(fiboLevel4Buffer);
if (barIndex >= count)
{
barIndex = count - 1;
}
//
return fiboLevel4Buffer[barIndex];
}
//
int CopyFiboLevel4(
int start, // Start
int count, // Number of Items for read
double &buffer[], // Dest Buffer
bool forceClean = true // Force To Clean buffer
)
{
//
// Update Calculations ...
Calculate(start);
//
// Copy Items ...
return Copy(
0,
count,
fiboLevel4Buffer,
buffer,
forceClean
//
);
}
//
// FIBO Level 5 ...
//
double GetFiboLevel5(
int barIndex // Bar Index
)
{
//
if (barIndex < 0)
{
barIndex = 0;
}
//
Calculate(barIndex);
//
int count = ArraySize(fiboLevel5Buffer);
if (barIndex >= count)
{
barIndex = count - 1;
}
//
return fiboLevel5Buffer[barIndex];
}
//
int CopyFiboLevel5(
int start, // Start
int count, // Number of Items for read
double &buffer[], // Dest Buffer
bool forceClean = true // Force To Clean buffer
)
{
//
// Update Calculations ...
Calculate(start);
//
// Copy Items ...
return Copy(
0,
count,
fiboLevel5Buffer,
buffer,
forceClean
//
);
}
//
void Free() override
{
@@ -3866,6 +4004,20 @@ class XCX121XCAHelper : public XCBaseHelper
conditions.fiboLevel3Buffer //
);
//
CopyFiboLevel4(
zIndex,
loopback,
conditions.fiboLevel4Buffer //
);
//
CopyFiboLevel5(
zIndex,
loopback,
conditions.fiboLevel5Buffer //
);
//
// Conditions ...
@@ -4566,6 +4718,8 @@ class XCX121XCAHelper : public XCBaseHelper
double fiboLevel1Buffer[];
double fiboLevel2Buffer[];
double fiboLevel3Buffer[];
double fiboLevel4Buffer[];
double fiboLevel5Buffer[];
double vidyaStateBuffer[];
double trendStateBuffer[];
@@ -4852,6 +5006,24 @@ class XCX121XCAHelper : public XCBaseHelper
fiboLevel3Buffer //
);
//
CopyBuffer(
mHandler,
X121_XCA_FIBO_L4_LINE,
barIndex,
maxRequiredBars,
fiboLevel4Buffer //
);
//
CopyBuffer(
mHandler,
X121_XCA_FIBO_L5_LINE,
barIndex,
maxRequiredBars,
fiboLevel5Buffer //
);
//
CopyBuffer(
mHandler,
@@ -5047,6 +5219,18 @@ class XCX121XCAHelper : public XCBaseHelper
maxAllowed //
);
//
CleanupArray(
fiboLevel4Buffer,
maxAllowed //
);
//
CleanupArray(
fiboLevel5Buffer,
maxAllowed //
);
//
CleanupArray(
trendStateBuffer,