refactor all requirements for draw and detect pois and also add Fima Helper, Parser Class Implementations for Separation of Concerns ...

This commit is contained in:
2025-10-24 05:03:31 +03:30
parent d63c5596fc
commit 0b0cd70049
21 changed files with 25191 additions and 8447 deletions
+129 -5
View File
@@ -5384,11 +5384,8 @@ class XCSession : public XCFromToZone
//
};
//
template <typename T>
bool ToBox(
T *&source[],
@@ -6307,7 +6304,6 @@ void SpecifiedUpdateTo(
}
}
/**
* Check a Box is Used or not ...
*
@@ -6682,7 +6678,6 @@ bool IsBoxPlaceValidForBar(
return result;
}
/**
* Check Source Box is Below Dest ...
*
@@ -7056,3 +7051,132 @@ bool HasInsideBox(
//
return result;
}
/////////////////////////////////////////////
//
// Analyse Bar Patterns ...
if (result && config.analyseBarPatterns)
{
//
// Try to Detect Bars Analysis ...
int fromIndex = -1;
if (!IsXValid(fromTime))
{
fromIndex = barIndex + config.loopback;
}
else
{
fromIndex = GetBarIndex(
symbol,
period,
fromTime //
);
}
result = IsValidIndex(fromIndex);
if (result)
{
//
fromIndex = MathMin(fromIndex, barIndex + config.requiredPivots);
//
for (int i = barIndex; i < fromIndex; i++)
{
//
tmpBar.Clean();
tmpBarAnalysis.Clean();
result = structure.bar.BarAt(i, tmpBar);
result = result &&
AnalyseBarPatterns(
tmpBar,
tmpBarAnalysis,
config.barsAnalysisConfig //
);
if (!result)
{
break;
}
//
AddRef(
tmpBarAnalysis,
structure.barsAnalysis //
);
}
}
}
////////////////////////////////////////////////
/**
* Draw Specified Market Structure Based on Given Configs ...
*
* @param structure: XFIMAMarketStructure, reference to Provide Specifid Market Structure ...
* @param config: XFIMAMarketStructureDrawerConfig, reference to Provide Drawing Configurations ...
*/
void DrawMarketStructure(
XFIMAMarketStructure &structure,
XFIMAMarketStructureDrawerConfig &config //
)
{
//
// Validate ...
bool has = structure.IsValid();
if (!has)
{
return;
}
//
// PV Analysis ...
if (config.drawPVAnalysis)
{
//
has = structure.pvAnalysis.IsValid();
if (has)
{
//
DrawPivotAnalysis(
structure.pvAnalysis,
config.pivotAnalysisDrawConfig //
);
}
}
//
// ZG Analysis ...
if (config.drawZGAnalysis)
{
//
has = structure.zgAnalysis.IsValid();
if (has)
{
//
DrawPivotAnalysis(
structure.zgAnalysis,
config.pivotAnalysisDrawConfig //
);
}
}
//
// Bars Analysis ...
if (config.drawBarsAnalysis)
{
//
int count = ArraySize(structure.barsAnalysis);
has = IsValidSize(count);
if (has)
{
//
for (int i = 0; i < count; i++)
{
//
DrawPatternAnalysis(
structure.barsAnalysis[i],
config.barAnalysisDrawConfig //
);
}
}
}
}