last works ...

This commit is contained in:
2025-04-09 04:47:56 +03:30
parent 5eab321741
commit 031c5f3462
13 changed files with 5541 additions and 557 deletions
+37 -1
View File
@@ -172,7 +172,7 @@ struct X121Conditions
string symbol;
ENUM_TIMEFRAMES period;
datetime time;
//
// XCC ...
@@ -356,9 +356,13 @@ struct X121Conditions
//
double strBuffer[];
double strUpBuffer[];
double strMidBuffer[];
double strDownBuffer[];
double strPriceBuffer[];
double strStateBuffer[];
double strSMLowBuffer[];
double strSMHighBuffer[];
double strMidStateBuffer[];
//
// Conditions ...
@@ -774,9 +778,13 @@ struct X121Conditions
//
Clean(strBuffer);
Clean(strUpBuffer);
Clean(strMidBuffer);
Clean(strDownBuffer);
Clean(strPriceBuffer);
Clean(strStateBuffer);
Clean(strSMLowBuffer);
Clean(strSMHighBuffer);
Clean(strMidStateBuffer);
//
// Set As Series ...
@@ -784,9 +792,13 @@ struct X121Conditions
//
ArraySetAsSeries(strBuffer, true);
ArraySetAsSeries(strUpBuffer, true);
ArraySetAsSeries(strMidBuffer, true);
ArraySetAsSeries(strDownBuffer, true);
ArraySetAsSeries(strPriceBuffer, true);
ArraySetAsSeries(strStateBuffer, true);
ArraySetAsSeries(strSMLowBuffer, true);
ArraySetAsSeries(strSMHighBuffer, true);
ArraySetAsSeries(strMidStateBuffer, true);
//
// Conditions ...
@@ -2771,6 +2783,12 @@ class XCX121Helper : public XCBase
conditions.strBuffer //
);
//
Copy(
xstrConditions.strMidBuffer,
conditions.strMidBuffer //
);
//
Copy(
xstrConditions.strUpBuffer,
@@ -2795,6 +2813,24 @@ class XCX121Helper : public XCBase
conditions.strStateBuffer //
);
//
Copy(
xstrConditions.strSMLowBuffer,
conditions.strSMLowBuffer //
);
//
Copy(
xstrConditions.strSMHighBuffer,
conditions.strSMHighBuffer //
);
//
Copy(
xstrConditions.strMidStateBuffer,
conditions.strMidStateBuffer //
);
//
// Conditions ...
+340 -14
View File
@@ -35,9 +35,13 @@ enum ENUM_X121_XSTR_BUFFERS
X121_XSTR_LINE = 0,
X121_XSTR_UP_LINE = 2,
X121_XSTR_DOWN_LINE = 3,
X121_XSTR_ATR_LINE = 4,
X121_XSTR_PRICE_LINE = 5,
X121_XSTR_STATE_LINE = 6,
X121_XSTR_HSM_LINE = 4,
X121_XSTR_LSM_LINE = 5,
X121_XSTR_MID_LINE = 6,
X121_XSTR_MID_STATE_LINE = 7,
X121_XSTR_ATR_LINE = 8,
X121_XSTR_PRICE_LINE = 9,
X121_XSTR_STATE_LINE = 10,
};
//
@@ -49,12 +53,16 @@ struct X121XSTRInputs
int strLength; // Length
double strMultiplier; // Multiplier
ENUM_MA_METHOD strBoundaryMode; // Boundary Mode
ENUM_APPLIED_PRICE strAppliedTo; // Applied To
//
bool showStr; // Show Upper Zone
bool showStrUpper; // Show Str Upper
bool showStrLower; // Show Str Lower
bool showStr; // Show Str
bool showStrMid; // Show Str Mid
bool showStrUpper; // Show Str Upper
bool showStrLower; // Show Str Lower
bool showStrSMLow; // Show Str SM Low
bool showStrSMHigh; // Show Str SM High
//
// Constructor(s) ...
@@ -74,12 +82,16 @@ struct X121XSTRInputs
//
strLength = 0;
strMultiplier = 0.0;
strBoundaryMode = MODE_SMA;
strAppliedTo = PRICE_MEDIAN;
//
showStr = false;
showStrMid = false;
showStrUpper = false;
showStrLower = false;
showStrSMLow = false;
showStrSMHigh = false;
//
ZeroMemory(this);
@@ -92,12 +104,16 @@ struct X121XSTRInputs
//
strLength = 14;
strMultiplier = 3.0;
strBoundaryMode = MODE_SMA;
strAppliedTo = PRICE_CLOSE;
//
showStr = true;
showStrMid = true;
showStrUpper = true;
showStrLower = true;
showStrSMLow = true;
showStrSMHigh = true;
}
//
@@ -148,10 +164,14 @@ struct X121XSTRConditions
// Buffers ...
double strBuffer[];
double atrBuffer[];
double strPriceBuffer[];
double strUpBuffer[];
double strMidBuffer[];
double strDownBuffer[];
double strPriceBuffer[];
double strStateBuffer[];
double strSMLowBuffer[];
double strSMHighBuffer[];
double strMidStateBuffer[];
//
// Conditions ...
@@ -194,18 +214,26 @@ struct X121XSTRConditions
//
Clean(strBuffer);
Clean(atrBuffer);
Clean(strPriceBuffer);
Clean(strUpBuffer);
Clean(strMidBuffer);
Clean(strDownBuffer);
Clean(strPriceBuffer);
Clean(strStateBuffer);
Clean(strSMLowBuffer);
Clean(strSMHighBuffer);
Clean(strMidStateBuffer);
//
ArraySetAsSeries(strBuffer, true);
ArraySetAsSeries(atrBuffer, true);
ArraySetAsSeries(strPriceBuffer, true);
ArraySetAsSeries(strUpBuffer, true);
ArraySetAsSeries(strMidBuffer, true);
ArraySetAsSeries(strDownBuffer, true);
ArraySetAsSeries(strPriceBuffer, true);
ArraySetAsSeries(strStateBuffer, true);
ArraySetAsSeries(strSMLowBuffer, true);
ArraySetAsSeries(strSMHighBuffer, true);
ArraySetAsSeries(strMidStateBuffer, true);
//
// Conditions ...
@@ -419,10 +447,14 @@ class XCX121XSTRHelper : public XCBaseHelper
//
ArraySetAsSeries(strBuffer, true);
ArraySetAsSeries(atrBuffer, true);
ArraySetAsSeries(strPriceBuffer, true);
ArraySetAsSeries(strUpBuffer, true);
ArraySetAsSeries(strMidBuffer, true);
ArraySetAsSeries(strDownBuffer, true);
ArraySetAsSeries(strPriceBuffer, true);
ArraySetAsSeries(strStateBuffer, true);
ArraySetAsSeries(strSMLowBuffer, true);
ArraySetAsSeries(strSMHighBuffer, true);
ArraySetAsSeries(strMidStateBuffer, true);
//
mInputs = inputs;
@@ -439,13 +471,17 @@ class XCX121XSTRHelper : public XCBaseHelper
"",
mInputs.strLength,
mInputs.strMultiplier,
mInputs.strBoundaryMode,
mInputs.strAppliedTo,
//
// Presentation ...
"",
mInputs.showStr,
mInputs.showStrMid,
mInputs.showStrUpper,
mInputs.showStrLower
mInputs.showStrLower,
mInputs.showStrSMLow,
mInputs.showStrSMHigh
//
);
result = mHandler != INVALID_HANDLE;
@@ -634,6 +670,104 @@ class XCX121XSTRHelper : public XCBaseHelper
);
}
//
double GetSTRMid(
int barIndex // Bar Index
)
{
//
if (barIndex < 0)
{
barIndex = 0;
}
//
Calculate(barIndex);
//
int count = ArraySize(strMidBuffer);
if (barIndex >= count)
{
barIndex = count - 1;
}
//
return strMidBuffer[barIndex];
}
//
int CopySTRMid(
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,
strMidBuffer,
buffer,
forceClean
//
);
}
//
double GetSTRMidState(
int barIndex // Bar Index
)
{
//
if (barIndex < 0)
{
barIndex = 0;
}
//
Calculate(barIndex);
//
int count = ArraySize(strMidStateBuffer);
if (barIndex >= count)
{
barIndex = count - 1;
}
//
return strMidStateBuffer[barIndex];
}
//
int CopySTRMidState(
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,
strMidStateBuffer,
buffer,
forceClean
//
);
}
//
double GetSTRPrice(
int barIndex // Bar Index
@@ -781,6 +915,104 @@ class XCX121XSTRHelper : public XCBaseHelper
);
}
//
double GetSTRSMLow(
int barIndex // Bar Index
)
{
//
if (barIndex < 0)
{
barIndex = 0;
}
//
Calculate(barIndex);
//
int count = ArraySize(strSMLowBuffer);
if (barIndex >= count)
{
barIndex = count - 1;
}
//
return strSMLowBuffer[barIndex];
}
//
int CopySTRSMLow(
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,
strSMLowBuffer,
buffer,
forceClean
//
);
}
//
double GetSTRSMHigh(
int barIndex // Bar Index
)
{
//
if (barIndex < 0)
{
barIndex = 0;
}
//
Calculate(barIndex);
//
int count = ArraySize(strSMHighBuffer);
if (barIndex >= count)
{
barIndex = count - 1;
}
//
return strSMHighBuffer[barIndex];
}
//
int CopySTRSMHigh(
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,
strSMHighBuffer,
buffer,
forceClean
//
);
}
//
double GetLastSTR(
ENUM_X_DIRECTION dir,
@@ -930,6 +1162,20 @@ class XCX121XSTRHelper : public XCBaseHelper
conditions.strStateBuffer //
);
//
CopySTRMid(
zIndex,
loopback,
conditions.strMidBuffer //
);
//
CopySTRMidState(
zIndex,
loopback,
conditions.strMidStateBuffer //
);
//
CopySTRPrice(
zIndex,
@@ -951,6 +1197,20 @@ class XCX121XSTRHelper : public XCBaseHelper
conditions.strDownBuffer //
);
//
CopySTRSMLow(
zIndex,
loopback,
conditions.strSMLowBuffer //
);
//
CopySTRSMHigh(
zIndex,
loopback,
conditions.strSMHighBuffer //
);
//
// Conditions ...
@@ -1004,10 +1264,14 @@ class XCX121XSTRHelper : public XCBaseHelper
// Buffers ...
double strBuffer[];
double atrBuffer[];
double strPriceBuffer[];
double strUpBuffer[];
double strMidBuffer[];
double strDownBuffer[];
double strPriceBuffer[];
double strStateBuffer[];
double strSMLowBuffer[];
double strSMHighBuffer[];
double strMidStateBuffer[];
//
void Calculate(
@@ -1044,6 +1308,26 @@ class XCX121XSTRHelper : public XCBaseHelper
//
);
//
CopyBuffer(
mHandler,
X121_XSTR_MID_LINE,
barIndex,
maxRequiredBars,
strMidBuffer
//
);
//
CopyBuffer(
mHandler,
X121_XSTR_MID_STATE_LINE,
barIndex,
maxRequiredBars,
strMidStateBuffer
//
);
//
// Price ...
CopyBuffer(
@@ -1077,6 +1361,26 @@ class XCX121XSTRHelper : public XCBaseHelper
//
);
//
CopyBuffer(
mHandler,
X121_XSTR_LSM_LINE,
barIndex,
maxRequiredBars,
strSMLowBuffer
//
);
//
CopyBuffer(
mHandler,
X121_XSTR_HSM_LINE,
barIndex,
maxRequiredBars,
strSMHighBuffer
//
);
//
// ATR ...
@@ -1110,13 +1414,13 @@ class XCX121XSTRHelper : public XCBaseHelper
//
CleanupArray(
strPriceBuffer,
strUpBuffer,
maxAllowed //
);
//
CleanupArray(
strUpBuffer,
strMidBuffer,
maxAllowed //
);
@@ -1126,6 +1430,12 @@ class XCX121XSTRHelper : public XCBaseHelper
maxAllowed //
);
//
CleanupArray(
strPriceBuffer,
maxAllowed //
);
//
CleanupArray(
strStateBuffer,
@@ -1133,6 +1443,22 @@ class XCX121XSTRHelper : public XCBaseHelper
);
//
CleanupArray(
strSMLowBuffer,
maxAllowed //
);
//
CleanupArray(
strSMHighBuffer,
maxAllowed //
);
//
CleanupArray(
strMidStateBuffer,
maxAllowed //
);
}
//