This commit is contained in:
2025-08-27 19:46:21 +03:30
parent a08e067236
commit 068394f629
6 changed files with 1766 additions and 19 deletions
+298 -19
View File
@@ -114,23 +114,23 @@ struct XOM1Inputs
{
//
// Calculations ...
scMethod = X_PERIOD_AUTO; // How to Find Short Period
scPeriod = NULL; // Short Period
mcMethod = X_PERIOD_AUTO; // How to Find Medium Period
mcPeriod = NULL; // Medium Period
lcMethod = X_PERIOD_AUTO; // How to Find Long Period
lcPeriod = NULL; // Long Period
hcMethod = X_PERIOD_AUTO; // How to Find Hind Period
hcPeriod = NULL; // Hind Period
upperMode = MODE_HIGH; // Peak Method
lowerMode = MODE_LOW; // Vale Method
upperZoneLevel = X_FIBO_LEVEL_618; // Upper Zone Level
lowerZoneLevel = X_FIBO_LEVEL_764; // Lower Zone Level
double sarStep = 0.02; // SAR Step
double sarMax = 0.2; // SAR Maximum
ENUM_MA_METHOD maMethod = MODE_EMA; // MA Method
ENUM_APPLIED_PRICE maAppliedTo = PRICE_CLOSE; // MA Applied To
int maLength = 10; // MA Length
scMethod = X_PERIOD_AUTO; // How to Find Short Period
scPeriod = NULL; // Short Period
mcMethod = X_PERIOD_AUTO; // How to Find Medium Period
mcPeriod = NULL; // Medium Period
lcMethod = X_PERIOD_AUTO; // How to Find Long Period
lcPeriod = NULL; // Long Period
hcMethod = X_PERIOD_AUTO; // How to Find Hind Period
hcPeriod = NULL; // Hind Period
upperMode = MODE_HIGH; // Peak Method
lowerMode = MODE_LOW; // Vale Method
upperZoneLevel = X_FIBO_LEVEL_618; // Upper Zone Level
lowerZoneLevel = X_FIBO_LEVEL_764; // Lower Zone Level
sarStep = 0.02; // SAR Step
sarMax = 0.2; // SAR Maximum
maMethod = MODE_EMA; // MA Method
maAppliedTo = PRICE_CLOSE; // MA Applied To
maLength = 10; // MA Length
//
// Presentation ...
@@ -203,6 +203,24 @@ struct XOM1Conditions
//
// Buffers ...
double maBuffer[];
double maColorBuffer[];
double maStateBuffer[];
double sarBuffer[];
double sarColorBuffer[];
double sarStateBuffer[];
double peakBuffer[];
double valeBuffer[];
double fiboUpperBuffer[];
double fiboLowerBuffer[];
double sHHBuffer[];
double sLLBuffer[];
double mHHBuffer[];
double mLLBuffer[];
double lHHBuffer[];
double lLLBuffer[];
double hHHBuffer[];
double hLLBuffer[];
//
// Conditions ...
@@ -236,12 +254,52 @@ struct XOM1Conditions
//
SpecifiedClean(bars);
//
SpecifiedClean(maBuffer);
SpecifiedClean(maColorBuffer);
SpecifiedClean(maStateBuffer);
SpecifiedClean(sarBuffer);
SpecifiedClean(sarColorBuffer);
SpecifiedClean(sarStateBuffer);
SpecifiedClean(peakBuffer);
SpecifiedClean(valeBuffer);
SpecifiedClean(fiboUpperBuffer);
SpecifiedClean(fiboLowerBuffer);
SpecifiedClean(sHHBuffer);
SpecifiedClean(sLLBuffer);
SpecifiedClean(mHHBuffer);
SpecifiedClean(mLLBuffer);
SpecifiedClean(lHHBuffer);
SpecifiedClean(lLLBuffer);
SpecifiedClean(hHHBuffer);
SpecifiedClean(hLLBuffer);
//
// Conditions ...
//
ArraySetAsSeries(bars, true);
//
ArraySetAsSeries(maBuffer, true);
ArraySetAsSeries(maColorBuffer, true);
ArraySetAsSeries(maStateBuffer, true);
ArraySetAsSeries(sarBuffer, true);
ArraySetAsSeries(sarColorBuffer, true);
ArraySetAsSeries(sarStateBuffer, true);
ArraySetAsSeries(peakBuffer, true);
ArraySetAsSeries(valeBuffer, true);
ArraySetAsSeries(fiboUpperBuffer, true);
ArraySetAsSeries(fiboLowerBuffer, true);
ArraySetAsSeries(sHHBuffer, true);
ArraySetAsSeries(sLLBuffer, true);
ArraySetAsSeries(mHHBuffer, true);
ArraySetAsSeries(mLLBuffer, true);
ArraySetAsSeries(lHHBuffer, true);
ArraySetAsSeries(lLLBuffer, true);
ArraySetAsSeries(hHHBuffer, true);
ArraySetAsSeries(hLLBuffer, true);
//
ZeroMemory(this);
}
@@ -398,6 +456,8 @@ class XCXOM1Helper : public XCBaseHelper
mInputs.lcPeriod,
mInputs.hcMethod,
mInputs.hcPeriod,
mInputs.upperMode,
mInputs.lowerMode,
mInputs.upperZoneLevel,
mInputs.lowerZoneLevel,
mInputs.sarStep,
@@ -469,8 +529,8 @@ class XCXOM1Helper : public XCBaseHelper
//
bool GetConditions(
XOM1Conditions &conditions, //
int barIndex = 0, //
int loopback = 5 //
int barIndex = 0, //
int loopback = 5 //
)
{
//
@@ -527,6 +587,118 @@ class XCXOM1Helper : public XCBaseHelper
//
// Buffers ...
//
CopyMA(
zIndex,
loopback,
conditions.maBuffer //
);
//
CopyMAState(
zIndex,
loopback,
conditions.maStateBuffer //
);
//
CopySar(
zIndex,
loopback,
conditions.sarBuffer //
);
//
CopySarState(
zIndex,
loopback,
conditions.sarStateBuffer //
);
//
CopyPeak(
zIndex,
loopback,
conditions.peakBuffer //
);
//
CopyVale(
zIndex,
loopback,
conditions.valeBuffer //
);
//
CopyFiboUpper(
zIndex,
loopback,
conditions.fiboUpperBuffer //
);
//
CopyFiboLower(
zIndex,
loopback,
conditions.fiboLowerBuffer //
);
//
CopySHH(
zIndex,
loopback,
conditions.sHHBuffer //
);
//
CopySLL(
zIndex,
loopback,
conditions.sLLBuffer //
);
//
CopyMHH(
zIndex,
loopback,
conditions.mHHBuffer //
);
//
CopyMLL(
zIndex,
loopback,
conditions.mLLBuffer //
);
//
CopyLHH(
zIndex,
loopback,
conditions.lHHBuffer //
);
//
CopyLLL(
zIndex,
loopback,
conditions.lLLBuffer //
);
//
CopyHHH(
zIndex,
loopback,
conditions.hHHBuffer //
);
//
CopyHLL(
zIndex,
loopback,
conditions.hLLBuffer //
);
//
// Conditions ...
@@ -849,6 +1021,113 @@ class XCXOM1Helper : public XCBaseHelper
);
}
//
// FIBO Zone ...
//
// FIBO Upper ...
//
double GetFiboUpper(
int barIndex // Bar Index
)
{
//
if (barIndex < 0)
{
barIndex = 0;
}
//
Calculate(barIndex);
//
int count = ArraySize(fiboUpperBuffer);
if (barIndex >= count)
{
barIndex = count - 1;
}
//
return fiboUpperBuffer[barIndex];
}
//
int CopyFiboUpper(
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,
fiboUpperBuffer,
buffer,
forceClean
//
);
}
//
// FIBO Lower ...
//
double GetFiboLower(
int barIndex // Bar Index
)
{
//
if (barIndex < 0)
{
barIndex = 0;
}
//
Calculate(barIndex);
//
int count = ArraySize(fiboLowerBuffer);
if (barIndex >= count)
{
barIndex = count - 1;
}
//
return fiboLowerBuffer[barIndex];
}
//
int CopyFiboLower(
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,
fiboLowerBuffer,
buffer,
forceClean
//
);
}
//
// CYCLES Range ...