last works ...
This commit is contained in:
@@ -480,6 +480,437 @@ class XCXFIMAPOIDetector : public XCMarketPatternDetector
|
||||
ZeroMemory(barAnalyser);
|
||||
}
|
||||
|
||||
//
|
||||
// Testers ...
|
||||
|
||||
/**
|
||||
* Analyse Market based on Specified Bar ...
|
||||
*
|
||||
* @param forBar: XOHCL, reference Specified Bar for Analyse Market ...
|
||||
* @param structure: XFIMAMarketStructure, reference to holds result ...
|
||||
* @param config: XFIMAPatternDetectorConfig, reference to Configure Detector ...
|
||||
*/
|
||||
void AnalyseMarket(
|
||||
XOHCL &forBar,
|
||||
XFIMAMarketStructure &structure,
|
||||
XFIMAPatternDetectorConfig &config //
|
||||
)
|
||||
{
|
||||
//
|
||||
// Prepare ...
|
||||
structure.Clean();
|
||||
|
||||
//
|
||||
// Validate ...
|
||||
if (!forBar.IsValid())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
// Do Analysis ...
|
||||
|
||||
//
|
||||
structure.bar = forBar;
|
||||
|
||||
//
|
||||
bool has = false;
|
||||
ENUM_X_DIRECTION iDir = X_DIRECTION_NONE;
|
||||
|
||||
//
|
||||
// Detecting POI Based on Config ...
|
||||
|
||||
//
|
||||
// Order Block ...
|
||||
if (config.detectOB)
|
||||
{
|
||||
//
|
||||
bool isOB = HasOB(
|
||||
forBar,
|
||||
iDir,
|
||||
structure.ob,
|
||||
config.obLoopback //
|
||||
);
|
||||
bool isBullishOB = isOB &&
|
||||
IsSpecifiedBullish(iDir);
|
||||
bool isBearishOB = isOB &&
|
||||
IsSpecifiedBearish(iDir);
|
||||
if (!isOB)
|
||||
{
|
||||
structure.ob.Clean();
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Fair Value Gap ...
|
||||
if (config.detectFVG)
|
||||
{
|
||||
//
|
||||
bool isFVG = HasFVG(
|
||||
forBar,
|
||||
iDir,
|
||||
structure.fvg,
|
||||
config.fvgLoopback //
|
||||
);
|
||||
bool isBullishOB = isFVG &&
|
||||
IsSpecifiedBullish(iDir);
|
||||
bool isBearishOB = isFVG &&
|
||||
IsSpecifiedBearish(iDir);
|
||||
if (!isFVG)
|
||||
{
|
||||
structure.fvg.Clean();
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Checking Momentum Bar ...
|
||||
if (config.detectMomentum)
|
||||
{
|
||||
//
|
||||
bool isMomentum = IsMomentumBar(
|
||||
forBar,
|
||||
iDir,
|
||||
config.momentumBarRangeLength,
|
||||
config.momentumBarApprovedMultiplier //
|
||||
);
|
||||
bool isBullishMomentum = isMomentum &&
|
||||
IsSpecifiedBullish(iDir);
|
||||
bool isBearishMomentum = isMomentum &&
|
||||
IsSpecifiedBearish(iDir);
|
||||
if (isMomentum)
|
||||
{
|
||||
structure.momentumDir = iDir;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Checking Engulfed Bar ...
|
||||
if (config.detectEngulfed)
|
||||
{
|
||||
//
|
||||
bool isEngulfed = IsEngulfedBar(
|
||||
forBar,
|
||||
iDir //
|
||||
);
|
||||
bool isBullishEngulfed = isEngulfed &&
|
||||
IsSpecifiedBullish(iDir);
|
||||
bool isBearishEngulfed = isEngulfed &&
|
||||
IsSpecifiedBearish(iDir);
|
||||
if (isEngulfed)
|
||||
{
|
||||
structure.engulfedDir = iDir;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Checking TruGaped Bar ...
|
||||
if (config.detectTrueGaped)
|
||||
{
|
||||
//
|
||||
bool isTrueGaped = IsTrueGapedBar(
|
||||
forBar,
|
||||
iDir,
|
||||
config.truwGapApprovedPointMultiplier //
|
||||
);
|
||||
bool isBullishTrueGaped = isTrueGaped &&
|
||||
IsSpecifiedBullish(iDir);
|
||||
bool isBearishTrueGaped = isTrueGaped &&
|
||||
IsSpecifiedBearish(iDir);
|
||||
if (isTrueGaped)
|
||||
{
|
||||
structure.trueGapedDir = iDir;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Checking Pinned Bar ...
|
||||
if (config.detectPinned)
|
||||
{
|
||||
//
|
||||
bool isPinned = IsPinnedBar(
|
||||
forBar,
|
||||
iDir,
|
||||
config.pinnedBaarShadowApprovedMultiplier,
|
||||
config.pinnedBarMinimumPinBarRangeMultiplier,
|
||||
config.pinnedBarForceDirection //
|
||||
);
|
||||
bool isBullishPinned = isPinned &&
|
||||
IsSpecifiedBullish(iDir);
|
||||
bool isBearishPinned = isPinned &&
|
||||
IsSpecifiedBearish(iDir);
|
||||
if (isPinned)
|
||||
{
|
||||
structure.pinnedDir = iDir;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Checking Star Pattern ...
|
||||
if (config.detectStarPattern)
|
||||
{
|
||||
//
|
||||
bool isStarPattern = IsStartPattern(
|
||||
forBar,
|
||||
iDir //
|
||||
);
|
||||
bool isBullishStarPattern = isStarPattern &&
|
||||
IsSpecifiedBullish(iDir);
|
||||
bool isBearishStarPattern = isStarPattern &&
|
||||
IsSpecifiedBearish(iDir);
|
||||
if (isStarPattern)
|
||||
{
|
||||
structure.starPatternDir = iDir;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Checking Piercing Pattern ...
|
||||
if (config.detectPiercingPattern)
|
||||
{
|
||||
//
|
||||
bool isPiercingPattern = IsPiercingPattern(
|
||||
forBar,
|
||||
iDir //
|
||||
);
|
||||
bool isBullishPiercingPattern = isPiercingPattern &&
|
||||
IsSpecifiedBullish(iDir);
|
||||
bool isBearishPiercingPattern = isPiercingPattern &&
|
||||
IsSpecifiedBearish(iDir);
|
||||
if (isPiercingPattern)
|
||||
{
|
||||
structure.piercingPatternDir = iDir;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Checking Rising Pattern ...
|
||||
if (config.detectRisingPattern)
|
||||
{
|
||||
//
|
||||
bool isRisingPattern = IsRisingPattern(
|
||||
forBar,
|
||||
iDir //
|
||||
);
|
||||
bool isBullishRisingPattern = isRisingPattern &&
|
||||
IsSpecifiedBullish(iDir);
|
||||
bool isBearishRisingPattern = isRisingPattern &&
|
||||
IsSpecifiedBearish(iDir);
|
||||
if (isRisingPattern)
|
||||
{
|
||||
structure.risingPatternDir = iDir;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Checking Flag Pattern ...
|
||||
if (config.detectFlagPattern)
|
||||
{
|
||||
//
|
||||
XOHCL swingBar;
|
||||
bool isFlagPattern = IsFlagPattern(
|
||||
forBar,
|
||||
iDir,
|
||||
swingBar,
|
||||
config.flagPatternMinimumPullbackBars //
|
||||
);
|
||||
bool isBullishFlagPattern = isFlagPattern &&
|
||||
IsSpecifiedBullish(iDir);
|
||||
bool isBearishFlagPattern = isFlagPattern &&
|
||||
IsSpecifiedBearish(iDir);
|
||||
if (isFlagPattern)
|
||||
{
|
||||
//
|
||||
structure.flagSwing = swingBar;
|
||||
structure.flagPatternDir = iDir;
|
||||
}
|
||||
swingBar.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
// Detect SignalKey Bar Pattern ...
|
||||
if (config.detectSignalKeyBarPattern)
|
||||
{
|
||||
//
|
||||
bool isSignalKeyBar = IsSignalKeyBarPattern(
|
||||
forBar,
|
||||
iDir,
|
||||
config.signalKeyBarShadowApprovedMultiplier,
|
||||
config.signalKeyBarMinimumPinBarRangeMultiplier,
|
||||
config.signalKeyBarForceDirection //
|
||||
);
|
||||
bool isBullishSignalKeyBar = isSignalKeyBar &&
|
||||
IsSpecifiedBullish(iDir);
|
||||
bool isBearishSignalKeyBar = isSignalKeyBar &&
|
||||
IsSpecifiedBearish(iDir);
|
||||
if (isSignalKeyBar)
|
||||
{
|
||||
structure.signalKeyBarPatternDir = iDir;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Detect Swing Trend ...
|
||||
if (config.detectSwingTrend)
|
||||
{
|
||||
//
|
||||
XOHCL swings[];
|
||||
bool hasSwingTrend = HasSwingTrend(
|
||||
forBar,
|
||||
iDir,
|
||||
swings,
|
||||
config.trendingNumberOfSwings,
|
||||
config.trendingSwingShoulders //
|
||||
);
|
||||
bool hasBullishSwingTrend = hasSwingTrend &&
|
||||
IsSpecifiedBullish(iDir);
|
||||
bool hasBearishSwingTrend = hasSwingTrend &&
|
||||
IsSpecifiedBearish(iDir);
|
||||
if (hasSwingTrend)
|
||||
{
|
||||
//
|
||||
Copy(
|
||||
swings,
|
||||
structure.trendSwings //
|
||||
);
|
||||
structure.trendDir = iDir;
|
||||
}
|
||||
SpecifiedClean(swings);
|
||||
}
|
||||
|
||||
//
|
||||
// Detect Supports ...
|
||||
if (config.detectSupports)
|
||||
{
|
||||
//
|
||||
XOHCL support;
|
||||
bool hasSupport = HasSupport(
|
||||
forBar,
|
||||
support,
|
||||
config.supportAndResistanceValidationLength,
|
||||
config.supportAndResistanceMaxAllowedLoopback //
|
||||
);
|
||||
if (hasSupport)
|
||||
{
|
||||
//
|
||||
XBoxZone supportBox;
|
||||
has = ToSupportBox(support, supportBox);
|
||||
if (has)
|
||||
{
|
||||
structure.support = supportBox;
|
||||
}
|
||||
|
||||
//
|
||||
supportBox.Clean();
|
||||
}
|
||||
support.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
// Detect Resistance ...
|
||||
if (config.detectResistance)
|
||||
{
|
||||
//
|
||||
XOHCL resistance;
|
||||
bool hasResistance = HasResistance(
|
||||
forBar,
|
||||
resistance,
|
||||
config.supportAndResistanceValidationLength,
|
||||
config.supportAndResistanceMaxAllowedLoopback //
|
||||
);
|
||||
if (hasResistance)
|
||||
{
|
||||
//
|
||||
XBoxZone resistanceBox;
|
||||
has = ToResistanceBox(resistance, resistanceBox);
|
||||
if (has)
|
||||
{
|
||||
structure.resistance = resistanceBox;
|
||||
}
|
||||
|
||||
//
|
||||
resistanceBox.Clean();
|
||||
}
|
||||
resistance.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
// Analysers ...
|
||||
|
||||
//
|
||||
// Analyse Based on PV ...
|
||||
if (config.analyseFIMAPVPivots)
|
||||
{
|
||||
//
|
||||
XPivotAnalysis analysis;
|
||||
has = AnalysePVPivots(
|
||||
analysis, // Result ...
|
||||
forBar.Index(), // Bar Index ...
|
||||
config.numberOfRequiredPivotsForAnalysis, // Required Number of Pivots ...
|
||||
config.maxAllowedLoopbackLengthForAnalysis, // Max Allowed Loopback ...
|
||||
config.pvPivotsValidationLength // Validation Length ...
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
structure.pvAnalysis = analysis;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Analyse Based on MA ...
|
||||
if (config.analyseFIMAMAPivots)
|
||||
{
|
||||
//
|
||||
XPivotAnalysis analysis;
|
||||
has = AnalyseMAPivots(
|
||||
analysis, // Result ...
|
||||
forBar.Index(), // Bar Index ...
|
||||
config.numberOfRequiredPivotsForAnalysis, // Required Number of Pivots ...
|
||||
config.maxAllowedLoopbackLengthForAnalysis, // Max Allowed Loopback ...
|
||||
config.pvPivotsValidationLength // Validation Length ...
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
structure.maAnalysis = analysis;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Analyse Based on SAR ...
|
||||
if (config.analyseFIMASARPivots)
|
||||
{
|
||||
//
|
||||
XPivotAnalysis analysis;
|
||||
has = AnalyseSARPivots(
|
||||
analysis, // Result ...
|
||||
forBar.Index(), // Bar Index ...
|
||||
config.numberOfRequiredPivotsForAnalysis, // Required Number of Pivots ...
|
||||
config.maxAllowedLoopbackLengthForAnalysis // Max Allowed Loopback ...
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
structure.sarAnalysis = analysis;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Analyse Based on ZigZag ...
|
||||
if (config.analyseFIMAZigZagPivots)
|
||||
{
|
||||
//
|
||||
XPivotAnalysis analysis;
|
||||
has = AnalyseZigZagPivots(
|
||||
analysis, // Result ...
|
||||
forBar.Index(), // Bar Index ...
|
||||
config.numberOfRequiredPivotsForAnalysis, // Required Number of Pivots ...
|
||||
config.maxAllowedLoopbackLengthForAnalysis // Max Allowed Loopback ...
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
structure.zigzagAnalysis = analysis;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Protected ...
|
||||
protected:
|
||||
|
||||
@@ -33,6 +33,112 @@ class XCXFIMAPOIDrawer : public XCPOIDrawer
|
||||
public:
|
||||
//
|
||||
|
||||
void DrawMarketStructure(
|
||||
XFIMAMarketStructure &structure,
|
||||
XFIMAMarketStructureDrawerConfig &config,
|
||||
CArrayObj *&objects //
|
||||
)
|
||||
{
|
||||
//
|
||||
// Prepare ...
|
||||
objects.Clear();
|
||||
|
||||
//
|
||||
// Apply Drawing Methods ...
|
||||
|
||||
//
|
||||
if (config.drawOB)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
if (config.drawFVG)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
if (config.drawSupports)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
if (config.drawResistance)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
if (config.drawSwingTrend)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
if (config.drawStarPattern)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
if (config.drawFlagPattern)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
if (config.drawRisingPattern)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
if (config.drawPiercingPattern)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
if (config.drawSignalKeyBarPattern)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
if (config.drawPinned)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
if (config.drawMomentum)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
if (config.drawEngulfed)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
if (config.drawTrueGaped)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
if (config.drawFIMAPVPivotsAnalysis)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
if (config.drawFIMAMAPivotsAnalysis)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
if (config.drawFIMASARPivotsAnalysis)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
if (config.drawFIMAZigZagPivotsAnalysis)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
}
|
||||
|
||||
//
|
||||
};
|
||||
|
||||
|
||||
@@ -24,10 +24,460 @@
|
||||
// Imports ...
|
||||
#include "../../Classes/x-saherelm.x-cobject.class.mq5"
|
||||
#include "../../Helpers/x-saherelm.xfima.helper.mq5"
|
||||
#include "../../Libraries/x-saherelm.x-pivot.analysis.lib.mq5"
|
||||
|
||||
//
|
||||
// Definitions ...
|
||||
|
||||
//
|
||||
// Structs ...
|
||||
/**
|
||||
* Configure Market Structure Detection ...
|
||||
**/
|
||||
struct XFIMAPatternDetectorConfig
|
||||
{
|
||||
//
|
||||
// Props ...
|
||||
|
||||
//
|
||||
// Flags ...
|
||||
|
||||
//
|
||||
bool detectSupports;
|
||||
bool detectResistance;
|
||||
|
||||
//
|
||||
bool detectSwingTrend;
|
||||
|
||||
//
|
||||
bool detectOB;
|
||||
bool detectFVG;
|
||||
|
||||
//
|
||||
bool detectStarPattern;
|
||||
bool detectFlagPattern;
|
||||
bool detectRisingPattern;
|
||||
bool detectPiercingPattern;
|
||||
bool detectSignalKeyBarPattern;
|
||||
|
||||
//
|
||||
bool detectPinned;
|
||||
bool detectMomentum;
|
||||
bool detectEngulfed;
|
||||
bool detectTrueGaped;
|
||||
|
||||
//
|
||||
bool analyseFIMAPVPivots;
|
||||
bool analyseFIMAMAPivots;
|
||||
bool analyseFIMASARPivots;
|
||||
bool analyseFIMAZigZagPivots;
|
||||
|
||||
//
|
||||
// Configs ...
|
||||
|
||||
//
|
||||
// OB / FVG ...
|
||||
int obLoopback;
|
||||
int fvgLoopback;
|
||||
|
||||
//
|
||||
// Trending ...
|
||||
int trendingNumberOfSwings;
|
||||
int trendingSwingShoulders;
|
||||
|
||||
//
|
||||
// Support and Resistance ...
|
||||
int supportAndResistanceValidationLength;
|
||||
int supportAndResistanceMaxAllowedLoopback;
|
||||
|
||||
//
|
||||
// TrueGap ...
|
||||
double truwGapApprovedPointMultiplier;
|
||||
|
||||
//
|
||||
// Flag Pattern ...
|
||||
int flagPatternMinimumPullbackBars;
|
||||
|
||||
//
|
||||
// Momentum Bar ...
|
||||
int momentumBarRangeLength;
|
||||
double momentumBarApprovedMultiplier;
|
||||
|
||||
//
|
||||
// Pinned Bar ...
|
||||
double pinnedBaarShadowApprovedMultiplier;
|
||||
double pinnedBarMinimumPinBarRangeMultiplier;
|
||||
bool pinnedBarForceDirection;
|
||||
|
||||
//
|
||||
// SignalKey Bar ...
|
||||
double signalKeyBarShadowApprovedMultiplier;
|
||||
double signalKeyBarMinimumPinBarRangeMultiplier;
|
||||
bool signalKeyBarForceDirection;
|
||||
|
||||
//
|
||||
// Analyser ...
|
||||
int pvPivotsValidationLength;
|
||||
int maPivotsValidationLength;
|
||||
int numberOfRequiredPivotsForAnalysis;
|
||||
int maxAllowedLoopbackLengthForAnalysis;
|
||||
|
||||
//
|
||||
// Constructor ...
|
||||
XFIMAPatternDetectorConfig()
|
||||
{
|
||||
Clean();
|
||||
}
|
||||
|
||||
//
|
||||
// Tools ...
|
||||
|
||||
/**
|
||||
* Cleanup Model ...
|
||||
*/
|
||||
void Clean()
|
||||
{
|
||||
//
|
||||
detectOB = false;
|
||||
detectFVG = false;
|
||||
detectSupports = false;
|
||||
detectResistance = false;
|
||||
detectSwingTrend = false;
|
||||
detectStarPattern = false;
|
||||
detectFlagPattern = false;
|
||||
detectRisingPattern = false;
|
||||
detectPiercingPattern = false;
|
||||
detectSignalKeyBarPattern = false;
|
||||
detectPinned = false;
|
||||
detectMomentum = false;
|
||||
detectEngulfed = false;
|
||||
detectTrueGaped = false;
|
||||
analyseFIMAPVPivots = false;
|
||||
analyseFIMAMAPivots = false;
|
||||
analyseFIMASARPivots = false;
|
||||
analyseFIMAZigZagPivots = false;
|
||||
|
||||
//
|
||||
obLoopback = 0;
|
||||
fvgLoopback = 0;
|
||||
trendingNumberOfSwings = 0;
|
||||
trendingSwingShoulders = 0;
|
||||
supportAndResistanceValidationLength = 0;
|
||||
supportAndResistanceMaxAllowedLoopback = 0;
|
||||
truwGapApprovedPointMultiplier = 0;
|
||||
flagPatternMinimumPullbackBars = 0;
|
||||
momentumBarRangeLength = 0;
|
||||
momentumBarApprovedMultiplier = 0;
|
||||
pinnedBaarShadowApprovedMultiplier = 0;
|
||||
pinnedBarMinimumPinBarRangeMultiplier = 0;
|
||||
pinnedBarForceDirection = false;
|
||||
signalKeyBarShadowApprovedMultiplier = 0;
|
||||
signalKeyBarMinimumPinBarRangeMultiplier = 0;
|
||||
signalKeyBarForceDirection = false;
|
||||
pvPivotsValidationLength = 0;
|
||||
maPivotsValidationLength = 0;
|
||||
numberOfRequiredPivotsForAnalysis = 0;
|
||||
maxAllowedLoopbackLengthForAnalysis = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Default Model ...
|
||||
*/
|
||||
void Default()
|
||||
{
|
||||
//
|
||||
// OB / FVG ...
|
||||
detectOB = true;
|
||||
detectFVG = true;
|
||||
|
||||
//
|
||||
// Support and Resistances ...
|
||||
detectSupports = true;
|
||||
detectResistance = true;
|
||||
detectSwingTrend = true;
|
||||
|
||||
//
|
||||
// Patterns ...
|
||||
detectStarPattern = false;
|
||||
detectFlagPattern = false;
|
||||
detectRisingPattern = false;
|
||||
detectPiercingPattern = false;
|
||||
detectSignalKeyBarPattern = false;
|
||||
|
||||
//
|
||||
// Bars ...
|
||||
detectPinned = false;
|
||||
detectMomentum = false;
|
||||
detectEngulfed = false;
|
||||
detectTrueGaped = false;
|
||||
|
||||
//
|
||||
// Analysers ...
|
||||
analyseFIMAPVPivots = false;
|
||||
analyseFIMAMAPivots = false;
|
||||
analyseFIMASARPivots = false;
|
||||
analyseFIMAZigZagPivots = false;
|
||||
|
||||
//
|
||||
// OB / FVg ...
|
||||
obLoopback = 5;
|
||||
fvgLoopback = 5;
|
||||
|
||||
//
|
||||
// Trending ...
|
||||
trendingNumberOfSwings = 3;
|
||||
trendingSwingShoulders = 7;
|
||||
|
||||
//
|
||||
// Support and Resistance ...
|
||||
supportAndResistanceValidationLength = 21;
|
||||
supportAndResistanceMaxAllowedLoopback = 1500;
|
||||
|
||||
//
|
||||
// TrueGap ...
|
||||
truwGapApprovedPointMultiplier = 1;
|
||||
|
||||
//
|
||||
// Flag Pattern ...
|
||||
flagPatternMinimumPullbackBars = 3;
|
||||
|
||||
//
|
||||
// Momentum Bar ...
|
||||
momentumBarRangeLength = 3;
|
||||
momentumBarApprovedMultiplier = 2;
|
||||
|
||||
//
|
||||
// Pinned Bar ...
|
||||
pinnedBaarShadowApprovedMultiplier = 3;
|
||||
pinnedBarMinimumPinBarRangeMultiplier = 4;
|
||||
pinnedBarForceDirection = false;
|
||||
|
||||
//
|
||||
// SignalKey Bar ...
|
||||
signalKeyBarShadowApprovedMultiplier = 3;
|
||||
signalKeyBarMinimumPinBarRangeMultiplier = 4;
|
||||
signalKeyBarForceDirection = false;
|
||||
|
||||
//
|
||||
// Length ...
|
||||
pvPivotsValidationLength = 10;
|
||||
maPivotsValidationLength = 0;
|
||||
numberOfRequiredPivotsForAnalysis = 50;
|
||||
maxAllowedLoopbackLengthForAnalysis = 1500;
|
||||
}
|
||||
|
||||
//
|
||||
};
|
||||
|
||||
/**
|
||||
* XFIMA Base Market Structure ...
|
||||
* AnalyseMarket result ...
|
||||
**/
|
||||
struct XFIMAMarketStructure
|
||||
{
|
||||
//
|
||||
XOHCL bar;
|
||||
|
||||
//
|
||||
XBoxZone ob;
|
||||
XBoxZone fvg;
|
||||
XBoxZone support;
|
||||
XBoxZone resistance;
|
||||
|
||||
//
|
||||
// Analysis ...
|
||||
XPivotAnalysis pvAnalysis;
|
||||
XPivotAnalysis maAnalysis;
|
||||
XPivotAnalysis sarAnalysis;
|
||||
XPivotAnalysis zigzagAnalysis;
|
||||
|
||||
//
|
||||
ENUM_X_DIRECTION pinnedDir;
|
||||
ENUM_X_DIRECTION momentumDir;
|
||||
ENUM_X_DIRECTION engulfedDir;
|
||||
ENUM_X_DIRECTION trueGapedDir;
|
||||
|
||||
//
|
||||
XOHCL flagSwing;
|
||||
ENUM_X_DIRECTION flagPatternDir;
|
||||
|
||||
//
|
||||
XOHCL trendSwings[];
|
||||
ENUM_X_DIRECTION trendDir;
|
||||
|
||||
//
|
||||
ENUM_X_DIRECTION starPatternDir;
|
||||
ENUM_X_DIRECTION risingPatternDir;
|
||||
ENUM_X_DIRECTION piercingPatternDir;
|
||||
ENUM_X_DIRECTION signalKeyBarPatternDir;
|
||||
|
||||
//
|
||||
// Constructor ...
|
||||
XFIMAMarketStructure()
|
||||
{
|
||||
Clean();
|
||||
}
|
||||
|
||||
//
|
||||
// Tools ...
|
||||
|
||||
/**
|
||||
* Cleanup Model ...
|
||||
*/
|
||||
void Clean()
|
||||
{
|
||||
//
|
||||
ob.Clean();
|
||||
fvg.Clean();
|
||||
support.Clean();
|
||||
resistance.Clean();
|
||||
|
||||
//
|
||||
bar.Clean();
|
||||
flagSwing.Clean();
|
||||
|
||||
//
|
||||
pvAnalysis.Clean();
|
||||
maAnalysis.Clean();
|
||||
sarAnalysis.Clean();
|
||||
zigzagAnalysis.Clean();
|
||||
|
||||
//
|
||||
trendDir = X_DIRECTION_NONE;
|
||||
pinnedDir = X_DIRECTION_NONE;
|
||||
momentumDir = X_DIRECTION_NONE;
|
||||
engulfedDir = X_DIRECTION_NONE;
|
||||
trueGapedDir = X_DIRECTION_NONE;
|
||||
flagPatternDir = X_DIRECTION_NONE;
|
||||
starPatternDir = X_DIRECTION_NONE;
|
||||
risingPatternDir = X_DIRECTION_NONE;
|
||||
piercingPatternDir = X_DIRECTION_NONE;
|
||||
signalKeyBarPatternDir = X_DIRECTION_NONE;
|
||||
|
||||
//
|
||||
SpecifiedClean(trendSwings);
|
||||
}
|
||||
|
||||
//
|
||||
// Checker Functions ...
|
||||
|
||||
//
|
||||
};
|
||||
|
||||
/**
|
||||
* Configure Market Structure Drawer ...
|
||||
**/
|
||||
struct XFIMAMarketStructureDrawerConfig
|
||||
{
|
||||
//
|
||||
// Props ...
|
||||
|
||||
//
|
||||
bool drawSupports;
|
||||
bool drawResistance;
|
||||
|
||||
//
|
||||
bool drawSwingTrend;
|
||||
|
||||
//
|
||||
bool drawOB;
|
||||
bool drawFVG;
|
||||
|
||||
//
|
||||
bool drawStarPattern;
|
||||
bool drawFlagPattern;
|
||||
bool drawRisingPattern;
|
||||
bool drawPiercingPattern;
|
||||
bool drawSignalKeyBarPattern;
|
||||
|
||||
//
|
||||
bool drawPinned;
|
||||
bool drawMomentum;
|
||||
bool drawEngulfed;
|
||||
bool drawTrueGaped;
|
||||
|
||||
//
|
||||
bool drawFIMAPVPivotsAnalysis;
|
||||
bool drawFIMAPVPivotsAnalysisPivots;
|
||||
|
||||
//
|
||||
bool drawFIMAMAPivotsAnalysis;
|
||||
bool drawFIMAMAPivotsAnalysisPivots;
|
||||
|
||||
//
|
||||
bool drawFIMASARPivotsAnalysis;
|
||||
bool drawFIMASARPivotsAnalysisPivots;
|
||||
|
||||
//
|
||||
bool drawFIMAZigZagPivotsAnalysis;
|
||||
bool drawFIMAZigZagPivotsAnalysisPivots;
|
||||
|
||||
//
|
||||
// Constructor ...
|
||||
XFIMAMarketStructureDrawerConfig()
|
||||
{
|
||||
Clean();
|
||||
}
|
||||
|
||||
//
|
||||
// Tools ...
|
||||
|
||||
/**
|
||||
* Cleanup Model ...
|
||||
*/
|
||||
void Clean()
|
||||
{
|
||||
//
|
||||
drawOB = false;
|
||||
drawFVG = false;
|
||||
drawPinned = false;
|
||||
drawMomentum = false;
|
||||
drawSupports = false;
|
||||
drawEngulfed = false;
|
||||
drawTrueGaped = false;
|
||||
drawResistance = false;
|
||||
drawSwingTrend = false;
|
||||
drawStarPattern = false;
|
||||
drawFlagPattern = false;
|
||||
drawRisingPattern = false;
|
||||
drawPiercingPattern = false;
|
||||
drawSignalKeyBarPattern = false;
|
||||
drawFIMAPVPivotsAnalysis = false;
|
||||
drawFIMAMAPivotsAnalysis = false;
|
||||
drawFIMASARPivotsAnalysis = false;
|
||||
drawFIMAZigZagPivotsAnalysis = false;
|
||||
drawFIMAPVPivotsAnalysisPivots = false;
|
||||
drawFIMAMAPivotsAnalysisPivots = false;
|
||||
drawFIMASARPivotsAnalysisPivots = false;
|
||||
drawFIMAZigZagPivotsAnalysisPivots = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Default Model ...
|
||||
*/
|
||||
void Default()
|
||||
{
|
||||
drawOB = true;
|
||||
drawFVG = true;
|
||||
drawPinned = true;
|
||||
drawMomentum = true;
|
||||
drawSupports = true;
|
||||
drawEngulfed = true;
|
||||
drawTrueGaped = true;
|
||||
drawResistance = true;
|
||||
drawSwingTrend = true;
|
||||
drawStarPattern = true;
|
||||
drawFlagPattern = true;
|
||||
drawRisingPattern = true;
|
||||
drawPiercingPattern = true;
|
||||
drawSignalKeyBarPattern = true;
|
||||
drawFIMAPVPivotsAnalysis = true;
|
||||
drawFIMAMAPivotsAnalysis = true;
|
||||
drawFIMASARPivotsAnalysis = true;
|
||||
drawFIMAZigZagPivotsAnalysis = true;
|
||||
drawFIMAPVPivotsAnalysisPivots = false;
|
||||
drawFIMAMAPivotsAnalysisPivots = false;
|
||||
drawFIMASARPivotsAnalysisPivots = false;
|
||||
drawFIMAZigZagPivotsAnalysisPivots = false;
|
||||
}
|
||||
|
||||
//
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user