Files
MQL5Data/XCATBEA/Libraries/xcatbea.x-poi.extensions.lib.mq5
T

84 lines
1.5 KiB
Plaintext

///////////////////////////////////////////////////////
//
// 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;
}