last ...
This commit is contained in:
+57
-116
@@ -13,6 +13,7 @@
|
||||
// Include Common Library ...
|
||||
#include "../Libraries/x-saherelm.common.lib.mq5"
|
||||
#include "../XCAEA/Helpers/xcaea.helper.mq5"
|
||||
#include "../XCAEA/Libraries/xcaea.trigger.block.lib.mq5"
|
||||
|
||||
//
|
||||
// Variables ...
|
||||
@@ -20,6 +21,7 @@ XCAEAInputs eaInputs;
|
||||
XCXCAEAHelper *eaHelper;
|
||||
XBarTracker eaBarTraker;
|
||||
|
||||
//
|
||||
CArrayObj eaObjects;
|
||||
|
||||
//+------------------------------------------------------------------+
|
||||
@@ -44,6 +46,7 @@ int OnInit()
|
||||
|
||||
//
|
||||
// we Can make Show all requirements here ...
|
||||
eaInputs.caInputs.showSar = true;
|
||||
|
||||
//
|
||||
eaHelper = new XCXCAEAHelper();
|
||||
@@ -67,14 +70,14 @@ int OnInit()
|
||||
void OnDeinit(const int reason)
|
||||
{
|
||||
//
|
||||
eaObjects.Clear();
|
||||
// eaObjects.Clear();
|
||||
|
||||
//
|
||||
eaBarTraker.Clean();
|
||||
|
||||
//
|
||||
// delete eaHelper;
|
||||
// ZeroMemory(eaHelper);
|
||||
delete eaHelper;
|
||||
ZeroMemory(eaHelper);
|
||||
}
|
||||
|
||||
//+------------------------------------------------------------------+
|
||||
@@ -120,126 +123,67 @@ void OnTick()
|
||||
}
|
||||
|
||||
//
|
||||
// Here Do What we Want ...
|
||||
XOHCL swingBar;
|
||||
XBoxZone ob;
|
||||
XBoxZone fvg;
|
||||
XBoxZone trigger;
|
||||
XBoxZone liquidity;
|
||||
has = eaHelper
|
||||
.barAnalyser
|
||||
.IsTrigger(
|
||||
cBar,
|
||||
trigger,
|
||||
ob,
|
||||
fvg,
|
||||
liquidity,
|
||||
swingBar,
|
||||
10 //
|
||||
);
|
||||
// Define Trigger Block ...
|
||||
XTriggerBlock tb;
|
||||
XCAEATriggerBlockConfiguration tbConfig;
|
||||
|
||||
//
|
||||
// Configure Detector ...
|
||||
|
||||
//
|
||||
// Validation ...
|
||||
tbConfig.maxAllowedRange = 0.0;
|
||||
tbConfig.minAllowedBlockEdgeLength = 7;
|
||||
|
||||
//
|
||||
// Validation ...
|
||||
tbConfig.forceFVGBarType = true;
|
||||
tbConfig.forceHasSwingBar = true;
|
||||
tbConfig.forceOBOppositBar = true;
|
||||
tbConfig.forceHasLiquidity = false;
|
||||
tbConfig.forceGapBarBreakout = true;
|
||||
tbConfig.forceHasReversalLiquidity = true;
|
||||
|
||||
//
|
||||
// Filters ...
|
||||
tbConfig.filterBasedOnSar = true;
|
||||
tbConfig.filterBasedOnADX = true;
|
||||
tbConfig.filterBasedOnRSI = true;
|
||||
tbConfig.filterBasedOnTrend = true;
|
||||
tbConfig.filterBasedOnScores = true;
|
||||
tbConfig.filterBasedOnVolumes = true;
|
||||
|
||||
//
|
||||
// Do Detection ...
|
||||
has = DetectTriggerBlock(
|
||||
tb,
|
||||
eaHelper,
|
||||
tbConfig,
|
||||
zBar.Index(),
|
||||
10 //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
bool isBullish = trigger.IsBullish();
|
||||
CArrayObj *tObjects;
|
||||
tObjects = new CArrayObj();
|
||||
|
||||
//
|
||||
// ob.to = zBar.time;
|
||||
// fvg.to = zBar.time;
|
||||
trigger.to = zBar.time;
|
||||
liquidity.to = zBar.time;
|
||||
|
||||
//
|
||||
// Draw OB ...
|
||||
XCBoxObject *iOBObj;
|
||||
has = eaHelper.poiDrawer.DrawBox(
|
||||
ob,
|
||||
iOBObj //
|
||||
has = DrawTriggerBlock(
|
||||
tb,
|
||||
tObjects,
|
||||
eaHelper,
|
||||
zBar.time //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
eaObjects.Add(iOBObj);
|
||||
}
|
||||
ZeroMemory(iOBObj);
|
||||
|
||||
//
|
||||
// Draw FVG ...
|
||||
XCBoxObject *iFVGObj;
|
||||
has = eaHelper.poiDrawer.DrawBox(
|
||||
fvg,
|
||||
iFVGObj //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
// Style Object ...
|
||||
color clr =
|
||||
isBullish
|
||||
? clrAqua
|
||||
: clrMagenta;
|
||||
iFVGObj.BoxWidth(2);
|
||||
iFVGObj.BoxColor(clr);
|
||||
iFVGObj.BoxStyle(STYLE_SOLID);
|
||||
|
||||
//
|
||||
// Store Object ...
|
||||
eaObjects.Add(iFVGObj);
|
||||
}
|
||||
ZeroMemory(iFVGObj);
|
||||
|
||||
//
|
||||
// Draw Trigger ...
|
||||
XCBoxObject *iTriggerObj;
|
||||
has = eaHelper.poiDrawer.DrawBox(
|
||||
trigger,
|
||||
iTriggerObj //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
eaObjects.Add(iTriggerObj);
|
||||
}
|
||||
ZeroMemory(iTriggerObj);
|
||||
|
||||
//
|
||||
// Draw Liquidity ...
|
||||
XCBoxObject *iLiqObj;
|
||||
has = eaHelper.poiDrawer.DrawBox(
|
||||
liquidity,
|
||||
iLiqObj //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
eaObjects.Add(iLiqObj);
|
||||
}
|
||||
ZeroMemory(iLiqObj);
|
||||
|
||||
//
|
||||
// Draw Swing Bar ...
|
||||
color swingColor =
|
||||
isBullish
|
||||
? clrAqua
|
||||
: clrMagenta;
|
||||
ENUM_X_PRICE swingPType =
|
||||
isBullish
|
||||
? X_PRICE_LOW
|
||||
: X_PRICE_HIGH;
|
||||
|
||||
//
|
||||
XCBarArrowObject *swingObj;
|
||||
has = eaHelper.poiDrawer.CreateBarArrow(
|
||||
swingBar,
|
||||
swingObj,
|
||||
swingPType,
|
||||
159,
|
||||
swingColor //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
eaObjects.Add(swingObj);
|
||||
AddObjects(tObjects, eaObjects);
|
||||
}
|
||||
|
||||
//
|
||||
Print("Trigger Box Detected ...");
|
||||
Print("Trigger Block Detected ...");
|
||||
}
|
||||
tb.Clean();
|
||||
|
||||
//
|
||||
// Do What we Want ...
|
||||
@@ -250,11 +194,8 @@ void OnTick()
|
||||
// Cleanup Resources ...
|
||||
|
||||
//
|
||||
ob.Clean();
|
||||
fvg.Clean();
|
||||
tb.Clean();
|
||||
zBar.Clean();
|
||||
cBar.Clean();
|
||||
trigger.Clean();
|
||||
swingBar.Clean();
|
||||
liquidity.Clean();
|
||||
tbConfig.Clean();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user