last works on XFIMA ...

This commit is contained in:
2025-10-09 02:06:30 +03:30
parent d963ce8acf
commit 430d822d3e
12 changed files with 7605 additions and 3910 deletions
File diff suppressed because it is too large Load Diff
@@ -1772,4 +1772,178 @@ class XCXFIMAPOIDrawer : public XCPOIDrawer
//
};
/**
* Draw Pivot Analysis ...
*
* @param analysis: XPivotAnalysis, referece Specified Pivot Analysis ...
* @param object: XCPivotAnalysisObject, pointer reference for Drawn Object ...
* @param drawTrends: Specified to Draw Trends or not ...
* @param drawZones: Specified to Draw Support and Resistance Zones or not ...
* @param drawPivots: Specified to Draw Pivots or not ...
* @param peakArrow: int, Specified Arrow Code for Peak Pivots ...
* @param valeArrow: int, Specified Arrow Code for Vale Pivots ...
* @param threshold: int, distance between price and arrow in Point ...
*
* @return ( bool )
*/
bool DrawPivotAnalysis(
XPivotAnalysis &analysis,
XCPivotAnalysisObject *&object,
bool drawTrends = true,
bool drawZones = true,
bool drawPivots = true,
int peakArrow = 159,
int valeArrow = 159,
int threshold = 5 //
)
{
//
bool result = false;
//
// Prepare ...
object = NULL;
//
// Normalize ...
//
// Validate ...
result = analysis.IsValid() &&
analysis.IsAnalysed();
if (!result)
{
return result;
}
//
object = new XCPivotAnalysisObject();
result = object.Create(
ChartIdentification(),
SubWindowIdentification(),
analysis,
drawTrends,
drawZones,
drawPivots,
peakArrow,
valeArrow,
threshold //
);
if (result)
{
//
ApplyPivotAnalysisStyle(
object,
analysis //
);
}
//
return result;
}
/**
* Apply Specified Style to Specified Object ...
*
* @param object: CChartObject, pointer reference of Object ...
* @param model: XPivotAnalysis, referece to access requirements ...
*/
void ApplyPivotAnalysisStyle(
XCPivotAnalysisObject *&object,
XPivotAnalysis &model //
)
{
//
// Validate ...
bool has = model.IsValid() &&
model.IsAnalysed() &&
object != NULL;
if (!has)
{
return;
}
//
XPOIStyle style;
//
// Support ...
style = defaultBullishStyle;
object.SupportColor(style.clr);
object.SupportWidth(style.width);
object.SupportStyle(style.style);
//
// Resistance ...
style = defaultBearishStyle;
object.ResistanceColor(style.clr);
object.ResistanceWidth(style.width);
object.ResistanceStyle(style.style);
//
// Upper ...
if (model.IsPeakAnalysed())
{
//
GetStyle(
style,
model.peakDir //
);
if (!HasDirection(model.peakDir))
{
//
style.Default();
style.clr = clrGray;
}
//
object.UpperColor(style.clr);
object.UpperWidth(style.width);
object.UpperStyle(style.style);
object.UpperRayLeft(false);
object.UpperRayRight(true);
}
//
// Lower ...
if (model.IsValeAnalysed())
{
//
GetStyle(
style,
model.valeDir //
);
if (!HasDirection(model.valeDir))
{
//
style.Default();
style.clr = clrGray;
}
//
object.LowerColor(style.clr);
object.LowerWidth(style.width);
object.LowerStyle(style.style);
object.UpperRayLeft(false);
object.LowerRayRight(true);
}
//
// Peak Pivots ...
style = defaultBearishStyle;
object.PeaksColor(style.clr);
object.PeaksWidth(style.width);
object.PeaksAnchor(ANCHOR_BOTTOM);
//
// Vale Pivots ...
style = defaultBullishStyle;
object.ValesColor(style.clr);
object.ValesWidth(style.width);
object.ValesAnchor(ANCHOR_TOP);
//
style.Clean();
}
//
File diff suppressed because it is too large Load Diff