last works on clearify POI(s) ...

This commit is contained in:
2025-03-17 04:04:05 +03:30
parent 3b31c36541
commit a1f3289bb6
12 changed files with 10754 additions and 2086 deletions
+162 -17
View File
@@ -8,10 +8,10 @@
#property version "1.00"
//
// #include "../Classes/x-saherelm.x-poi.class.mq5"
// #include "../Classes/x-saherelm.x-poi.drawer.class.mq5"
// #include "../Libraries/x-saherelm.x-poi.extensions.lib.mq5"
// #include "../Libraries/x-saherelm.x-poi.state.lib.mq5"
#include "../Classes/x-saherelm.x-poi.class.mq5"
#include "../Classes/x-saherelm.x-poi.drawer.class.mq5"
#include "../Libraries/x-saherelm.x-poi.extensions.lib.mq5"
#include "../Libraries/x-saherelm.x-poi.state.lib.mq5"
//
#include "../Classes/x-saherelm.x-bar.analyser.class.mq5"
@@ -20,16 +20,16 @@
// Global Variables ...
//
// XCPOIDrawer *mPOIDrawer;
XCPOIDrawer *mPOIDrawer;
//
// XCPOIDetector *mPOIDetector;
XCPOIDetector *mPOIDetector;
XBarTracker mBarTracker;
XCBarAnalyser *mBarAnalyser;
//
bool useDetector = false;
bool useBarAnalyser = true;
bool useDetector = true;
bool useBarAnalyser = false;
//+------------------------------------------------------------------+
//| Expert initialization function |
@@ -37,13 +37,13 @@ bool useBarAnalyser = true;
int OnInit()
{
//
// mPOIDetector = new XCPOIDetector(
// _Symbol,
// _Period //
// );
mPOIDetector = new XCPOIDetector(
_Symbol,
_Period //
);
//
// mPOIDrawer = new XCPOIDrawer();
mPOIDrawer = new XCPOIDrawer();
//
mBarAnalyser = new XCBarAnalyser();
@@ -128,18 +128,23 @@ void DetectBarAnalyser()
}
//
// Check Big Change in Price ...
int rootIDX = -1;
XOHCL selectedBar;
ENUM_X_DIRECTION dir;
bool isBigChange = mBarAnalyser.IsBigChange(
//
// Check Big Change in Price ...
bool isBigChange = mBarAnalyser.IsSharp(
zBar, // Bar ...
dir, // Change Direction ...
rootIDX, // Change Root IDX ...
X_PRICE_CLOSE, // Price Change Type ...
true, // Force Use Body for Range Calculation ...
1.0 // Range Extend Multiplier ...
);
if (isBigChange)
{
// Print("Big Price Change Detected: ", ToString(dir));
Print("Big Price Change Detected: ", ToString(dir));
}
//
@@ -147,6 +152,7 @@ void DetectBarAnalyser()
bool isSpike = mBarAnalyser.IsSpike(
zBar, // Bar ...
dir, // Change Direction ...
rootIDX, // Root Index ...
X_PRICE_CLOSE, // Price Change Type ...
true, // Force Use Body for Range Calculation ...
1.0, // Range Extend Multiplier ...
@@ -154,7 +160,7 @@ void DetectBarAnalyser()
);
if (isSpike)
{
// Print("Spike Detected: ", ToString(dir));
Print("Spike Detected: ", ToString(dir));
}
//
@@ -212,6 +218,81 @@ void DetectBarAnalyser()
Print(ToString(dir), " Pullback Detected ...");
}
//
// Check Swing Pattern ...
bool isSwing = mBarAnalyser.IsSwing(
cBar,
dir //
);
if (isSwing)
{
Print(ToString(dir), " Swing Detected ...");
}
//
// Check Swing Pattern ...
bool isRejected = mBarAnalyser.IsRejected(
cBar,
dir //
);
if (isRejected)
{
Print(ToString(dir), " Rejected Detected ...");
}
//
// Check Support ...
bool isSupport = mBarAnalyser.HasSupport(
cBar,
selectedBar //
);
if (isSupport)
{
Print(ToString(dir), " Support Detected ...");
}
//
// Check Resistance ...
bool isResistance = mBarAnalyser.HasResistance(
cBar,
selectedBar //
);
if (isResistance)
{
Print(ToString(dir), " Resistance Detected ...");
}
//
// Check Fair Value Gap ...
XOHCL toBar;
XOHCL fromBar;
bool hasFVG = mBarAnalyser.HasFairValueGap(
zBar,
fromBar,
toBar,
dir,
3 //
);
if (hasFVG)
{
Print(ToString(dir), " FairValueGap Detected ...");
}
//
// Check Order Block ...
bool hasOB = mBarAnalyser.HasOrderBlock(
zBar,
selectedBar,
dir,
true,
true,
true //
);
if (hasOB)
{
Print(ToString(dir), " OrderBlock Detected ...");
}
//
// Cleanup Resources ...
@@ -230,6 +311,70 @@ void DetectPOIState()
{
return;
}
//
if (!mBarTracker.IsNewBar())
{
return;
}
//
ENUM_XPOI_EVENTS poiEvents[];
XPOIStateEvents poiEventNotifier;
mPOIDetector.Update(
poiEvents,
0 //
);
poiEventNotifier.Init(poiEvents);
//
XPOIState state;
mPOIDetector.GetState(state);
//
bool showBullishPOIs = true;
bool showBearishPOIs = true;
//
XCBaseObject *stateObjects[];
mPOIDrawer.DrawState(
state,
stateObjects,
//
// Bullish ...
showBullishPOIs && false, // SwingLows
showBullishPOIs && true, // DemandZones
showBullishPOIs && true, // SupportZones
showBullishPOIs && true, // BullishSharps
showBullishPOIs && false, // BullishSpikes
showBullishPOIs && true, // BullishMomentums
showBullishPOIs && true, // BullishRejections
showBullishPOIs && true, // BullishOrderBlocks
showBullishPOIs && true, // BullishFairValueGaps
showBullishPOIs && true, // BullishConsolidationZones
//
// Bearish ...
showBearishPOIs && false, // SwingHighs
showBearishPOIs && true, // SupplyZones
showBearishPOIs && true, // BearishSharps
showBearishPOIs && false, // BearishSpikes
showBearishPOIs && true, // ResistanceZones
showBearishPOIs && true, // BearishMomentums
showBearishPOIs && true, // BearishRejections
showBearishPOIs && true, // BearishOrderBlocks
showBearishPOIs && true, // BearishFairValueGaps
showBearishPOIs && true // BearishConsolidationZones
);
//
if (poiEventNotifier.hasNewSwing)
{
Print("Swing ...");
}
//
Clean(poiEvents);
poiEventNotifier.Clean();
}
//