This commit is contained in:
2024-05-27 17:41:32 +03:30
parent 72dc9737f9
commit 54160e7f99
6 changed files with 677 additions and 22 deletions
+153
View File
@@ -5289,4 +5289,157 @@ struct X121MarketCycleDescriptor
}
};
//
// Custom Draws ...
//
// Custom Struct Draws ...
bool DrawSupRes(
XOHCLSupRes &item, // Struct item to Draw ...
XDrawSpecifications &supSpecs, // Supports specs ...
XDrawSpecifications &resSpecs, // Resistances specs ...
long chartID = 0,
int subWindow = 0,
string prefix = "SupRes" //
)
{
//
bool result = false;
//
result = item.IsValid();
if (!result)
{
return result;
}
//
datetime cTime = TimeCurrent();
datetime pTime = TimeCurrent() - PeriodSeconds(PERIOD_M10);
//
// Support ...
int supCount = item.CountSupports();
bool canDrawSups = IsValidSize(supCount) && supSpecs.draw;
if (canDrawSups)
{
//
for (int i = 0; i < supCount; i++)
{
//
double iSup = item.sup[i];
//
string supName = prefix + "_" + "Sup_" + ToString(iSup);
//
DrawTrendLine(
chartID,
supName,
subWindow,
pTime,
iSup,
cTime,
iSup,
supSpecs.clr,
supSpecs.style,
supSpecs.width,
supSpecs.back,
supSpecs.selection,
supSpecs.rayRight,
supSpecs.hidden,
supSpecs.zOrder //
);
//
if (IsValid(supSpecs.label))
{
//
DrawText(
chartID,
supName + "_lbl",
subWindow,
cTime,
iSup,
supSpecs.label,
supSpecs.labelFont,
supSpecs.labelFontSize,
supSpecs.labelColor,
supSpecs.labelAngel,
supSpecs.labelAnchor,
supSpecs.back,
supSpecs.selection,
supSpecs.hidden,
supSpecs.zOrder //
);
}
}
}
//
// Resistance ...
int resCount = item.CountResistances();
bool canDrawRess = IsValidSize(supCount) && supSpecs.draw;
if (canDrawRess)
{
//
for (int i = 0; i < resCount; i++)
{
//
double iRes = item.res[i];
//
string resName = prefix + "_" + "Res_" + ToString(iRes);
//
DrawTrendLine(
chartID,
resName,
subWindow,
pTime,
iRes,
cTime,
iRes,
resSpecs.clr,
resSpecs.style,
resSpecs.width,
resSpecs.back,
resSpecs.selection,
resSpecs.rayRight,
resSpecs.hidden,
resSpecs.zOrder //
);
//
if (IsValid(resSpecs.label))
{
//
DrawText(
chartID,
resName + "_lbl",
subWindow,
cTime,
iRes,
resSpecs.label,
resSpecs.labelFont,
resSpecs.labelFontSize,
resSpecs.labelColor,
resSpecs.labelAngel,
resSpecs.labelAnchor,
resSpecs.back,
resSpecs.selection,
resSpecs.hidden,
resSpecs.zOrder //
);
}
}
}
//
result = canDrawSups || canDrawRess;
//
return result;
}
//