add POI Detector and Drawer for XCATB classes ...
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
///////////////////////////////////////////////////////
|
||||
//
|
||||
// SaherElm IT Center MQL5 Library
|
||||
// -------------------------------------------------
|
||||
// Name: XCATBEAPOIExtension Lib
|
||||
// Description: Library for Adding Extensions on
|
||||
// XCATBEA POI(s) ...
|
||||
//
|
||||
//
|
||||
// Maintainer:
|
||||
// ------------
|
||||
// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com)
|
||||
//
|
||||
//////////////////////////////////////////////////////
|
||||
//
|
||||
// Global Properties ...
|
||||
#property library
|
||||
#property copyright "Copyright 2023, SaherElm IT Center"
|
||||
#property link "https://saherelm.ir"
|
||||
#property version "1.00"
|
||||
#property description "SaherElm Extensions Library for XCATBEA POI(s)"
|
||||
#property strict
|
||||
|
||||
//
|
||||
// Imports ...
|
||||
#include "../Classes/xcatbea.x-poi.detector.class.mq5";
|
||||
|
||||
//
|
||||
// Extensions ...
|
||||
|
||||
//
|
||||
int ExtractPivots(
|
||||
XBoxZone &extracted[],
|
||||
ENUM_XCATB_PIVOTS type,
|
||||
XBoxZone &source[] //
|
||||
)
|
||||
{
|
||||
//
|
||||
int result = 0;
|
||||
|
||||
//
|
||||
Clean(extracted);
|
||||
|
||||
//
|
||||
bool has =
|
||||
IsValid(type) &&
|
||||
HasChild(source);
|
||||
if (!has)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
int count = ArraySize(source);
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XBoxZone iBox = source[i];
|
||||
|
||||
//
|
||||
ENUM_XCATB_PIVOTS iType = GetPivotType(iBox);
|
||||
|
||||
//
|
||||
has = iType == type;
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
AddRef(
|
||||
iBox,
|
||||
extracted //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
iBox.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
result = ArraySize(extracted);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
Reference in New Issue
Block a user