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
File diff suppressed because it is too large Load Diff
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
File diff suppressed because it is too large Load Diff
+119 -44
View File
@@ -2557,36 +2557,131 @@ struct XPatternAnalysisConfig
// //
}; };
//
// Anaysis Draw Config Models ...
struct XPivotAnalysisDrawConfig
{
//
// Props ...
//
// Drawing Flags ...
bool drawSupport;
bool drawResistance;
//
bool drawPeakTrend;
bool drawValeTrend;
bool rayLeftTrends;
bool rayRightTrends;
//
bool drawPivots;
//
// Drawing Configs ...
XPOIDrawConfig drawConfig;
//
// Constructor ...
XPivotAnalysisDrawConfig()
{
Clean();
}
//
// Tools ...
/**
* This function fulfills the will of the developer
*/
void Clean()
{
//
// Drawing Flags ...
//
drawPivots = false;
drawSupport = false;
drawPeakTrend = false;
drawValeTrend = false;
rayLeftTrends = false;
rayRightTrends = false;
drawResistance = false;
//
// Drawing Configs ...
drawConfig.Clean();
//
ZeroMemory(this);
}
/**
* Default Configurations ...
*/
void Default()
{
//
// Drawing Flags ...
//
drawPivots = false;
drawSupport = true;
drawPeakTrend = false;
drawValeTrend = false;
rayLeftTrends = true;
rayRightTrends = true;
drawResistance = true;
//
// Drawing Configs ...
drawConfig.Default();
}
/**
* No Draw Abilioty ...
*/
void Off()
{
//
drawPivots = false;
drawSupport = false;
drawPeakTrend = false;
drawValeTrend = false;
drawResistance = false;
}
/**
* Full Draw Abilioty ...
*/
void Full()
{
//
drawPivots = true;
drawSupport = true;
drawPeakTrend = true;
drawValeTrend = true;
drawResistance = true;
}
//
};
struct XPatternAnalysisDrawConfig struct XPatternAnalysisDrawConfig
{ {
// //
// Props ... // Props ...
//
int zonesWidth;
bool fillZones;
int arrowsWidth;
bool ignoreZonesAt;
int arrowsThreshold;
ENUM_LINE_STYLE zonesStyle;
//
int bullishArrow;
int bearishArrow;
//
color bullishColor;
color bearishColor;
//
ENUM_X_PRICE arrowValePriceType;
ENUM_X_PRICE arrowPeakPriceType;
// //
ENUM_X_BAR_PATTERN allowedDraws[]; // Allowed Draw Patterns ENUM_X_BAR_PATTERN allowedDraws[]; // Allowed Draw Patterns
ENUM_X_BAR_PATTERN allowedDrawZones[]; // Allowed Draw Pattern Zones ENUM_X_BAR_PATTERN allowedDrawZones[]; // Allowed Draw Pattern Zones
ENUM_X_BAR_PATTERN allowedDrawPivots[]; // Allowed Draw Pattern Pivots ENUM_X_BAR_PATTERN allowedDrawPivots[]; // Allowed Draw Pattern Pivots
//
XPOIDrawConfig drawConfig;
// //
// Constructor ... // Constructor ...
XPatternAnalysisDrawConfig() XPatternAnalysisDrawConfig()
@@ -2603,18 +2698,8 @@ struct XPatternAnalysisDrawConfig
void Clean() void Clean()
{ {
// //
arrowsWidth = 0; // Drawing Configs ...
zonesWidth = 0; drawConfig.Clean();
bullishArrow = 0;
bearishArrow = 0;
fillZones = false;
arrowsThreshold = 0;
ignoreZonesAt = false;
bullishColor = CLR_NONE;
bearishColor = CLR_NONE;
zonesStyle = STYLE_SOLID;
arrowValePriceType = X_PRICE_NONE;
arrowPeakPriceType = X_PRICE_NONE;
// //
XClean(allowedDraws); XClean(allowedDraws);
@@ -2628,18 +2713,8 @@ struct XPatternAnalysisDrawConfig
void Default() void Default()
{ {
// //
zonesWidth = 1; // Drawing Configs ...
arrowsWidth = 1; drawConfig.Default();
arrowsThreshold = 2;
bullishArrow = 159;
bearishArrow = 159;
fillZones = false;
ignoreZonesAt = true;
bullishColor = clrAqua;
zonesStyle = STYLE_SOLID;
bearishColor = clrMagenta;
arrowValePriceType = X_PRICE_LOW;
arrowPeakPriceType = X_PRICE_HIGH;
// //
FullDraw(); FullDraw();
+84
View File
@@ -1570,4 +1570,88 @@ struct XDirectionShift
} }
}; };
struct XPOIDrawConfig
{
//
// Props ...
//
color bullishColor;
color bearishColor;
//
int arrowsWidth;
int bullishArrow;
int bearishArrow;
int arrowsThreshold;
ENUM_X_PRICE arrowsValePriceType;
ENUM_X_PRICE arrowsPeakPriceType;
//
int zonesWidth;
bool zonesFill;
bool ignoreZonesAt;
ENUM_LINE_STYLE zonesStyle;
//
// Constructor ...
XPOIDrawConfig()
{
Clean();
}
//
// Tools ...
/**
* Cleanup ...
*/
void Clean()
{
//
bullishColor = CLR_NONE;
bearishColor = CLR_NONE;
//
arrowsWidth = 0;
bullishArrow = 0;
bearishArrow = 0;
arrowsThreshold = 0;
arrowsValePriceType = X_PRICE_NONE;
arrowsPeakPriceType = X_PRICE_NONE;
//
zonesWidth = 1;
zonesFill = false;
ignoreZonesAt = true;
zonesStyle = STYLE_SOLID;
}
/**
* Default Config ...
*/
void Default()
{
//
bullishColor = clrAqua;
bearishColor = clrMagenta;
//
arrowsWidth = 1;
bullishArrow = 159;
bearishArrow = 159;
arrowsThreshold = 5;
arrowsValePriceType = X_PRICE_LOW;
arrowsPeakPriceType = X_PRICE_HIGH;
//
zonesWidth = 1;
zonesFill = true;
ignoreZonesAt = true;
zonesStyle = STYLE_SOLID;
}
//
};
// //
File diff suppressed because it is too large Load Diff
@@ -367,8 +367,8 @@ class XCXFIMAPOIDetector : public XCMarketPatternDetector
*/ */
void AnalyseMarket( void AnalyseMarket(
XOHCL &forBar, XOHCL &forBar,
XFIMAMarketStructure &structure, XFIMAMarketStructure &structure // ,
XFIMAPatternDetectorConfig &config // //XFIMAPatternDetectorConfig &config //
) )
{ {
// // // //
+43 -53
View File
@@ -29,56 +29,6 @@
// //
// Definitions ... // Definitions ...
/**
* Configure Market Structure Detection ...
**/
struct XFIMAPatternDetectorConfig
{
//
// Props ...
//
// Constructor ...
XFIMAPatternDetectorConfig()
{
Clean();
}
//
// Tools ...
/**
* Cleanup Model ...
*/
void Clean()
{
ZeroMemory(this);
}
/**
* Default Model ...
*/
void Default()
{
}
/**
* Full Detection Model ...
*/
void FullDetect()
{
}
/**
* Default Config, by turn off all detecting flags ...
*/
void OffDetectors()
{
}
//
};
/** /**
* XFIMA Base Market Structure ... * XFIMA Base Market Structure ...
* AnalyseMarket result ... * AnalyseMarket result ...
@@ -86,7 +36,22 @@ struct XFIMAPatternDetectorConfig
struct XFIMAMarketStructure struct XFIMAMarketStructure
{ {
// //
XOHCL bar; XOHCL bar; // Spacified Start Bar for Analysing ...
int length; // Loopback Length for Analyse Structure ...
//
XPivotAnalysis pvAnalysis; // PV Pivot Analysis Result ...
XPivotAnalysis zgAnalysis; // ZG Pivot Analysis Result ...
XPivotAnalysis barsPivotsAnalysis; // Bars Pivot Analysis Result ...
//
XPatternAnalysis barsAnalysis[]; // Anaysed Bars ...
XPatternAnalysisConfig barsAnalysisConfig; // Bars Analyser Config ...
//
// Configure Pivots Detection ...
int requiredPivots; // Required Extracted Pivots for Analysis ...
// //
// Constructor ... // Constructor ...
@@ -99,17 +64,41 @@ struct XFIMAMarketStructure
// Tools ... // Tools ...
/** /**
* Cleanup Model ... * Cleanup ...
*/ */
void Clean() void Clean()
{ {
//
bar.Clean();
length = 0;
//
pvAnalysis.Clean();
zgAnalysis.Clean();
XClean(barsAnalysis);
barsAnalysisConfig.Clean();
// //
ZeroMemory(this); ZeroMemory(this);
} }
/**
* Validate ...
*
* @return ( bool )
*/
bool IsValid()
{
// //
// Checker Functions ... bool result = false;
//
result = bar.IsValid() &&
length > 0;
//
return result;
}
// //
}; };
@@ -121,6 +110,7 @@ struct XFIMAMarketStructureDrawerConfig
{ {
// //
// Props ... // Props ...
XPatternAnalysisDrawConfig barAnalysisDrawConfig;
// //
// Constructor ... // Constructor ...
+2 -2
View File
@@ -1,8 +1,8 @@
@echo off @echo off
@REM set METAEDITOR="C:\Program Files\MetaTrader 5 General\MetaEditor64.exe" @REM set METAEDITOR="C:\Program Files\MetaTrader 5 General\MetaEditor64.exe"
@REM set METAEDITOR="C:\Program Files\MetaTrader 5 Main\MetaEditor64.exe" set METAEDITOR="C:\Program Files\MetaTrader 5 Main\MetaEditor64.exe"
set METAEDITOR="C:\Program Files\MetaTrader 5 General\MetaEditor64.exe" @REM set METAEDITOR="C:\Program Files\MetaTrader 5 General\MetaEditor64.exe"
set "LOGFILE=%~dpn1.log" set "LOGFILE=%~dpn1.log"
if "%~1"=="" ( if "%~1"=="" (