2900 lines
56 KiB
Plaintext
2900 lines
56 KiB
Plaintext
///////////////////////////////////////////////////////
|
|
//
|
|
// SaherElm IT Center MQL5 Helper Class Library
|
|
// ----------------------------------------------
|
|
// Name: XCX121XPVHelper
|
|
// Description: provides all Indicator
|
|
// Helper requirements ...
|
|
//
|
|
//
|
|
// Maintainer:
|
|
// ------------
|
|
// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com)
|
|
//
|
|
//////////////////////////////////////////////////////
|
|
//
|
|
// Global Properties ...
|
|
#property library
|
|
#property copyright "Copyright 2023, SaherElm IT Center"
|
|
#property link "https://www.saherelm.ir"
|
|
#property version "1.00"
|
|
#property strict
|
|
|
|
//
|
|
// Imports ...
|
|
#include "../Classes/x-saherelm.x-helper.class.mq5"
|
|
|
|
//
|
|
// Definitions ...
|
|
|
|
//
|
|
// Definitions ...
|
|
enum ENUM_X121_XPV_BUFFERS
|
|
{
|
|
//
|
|
X121_XPV_PEAK_LINE = 0,
|
|
X121_XPV_VALE_LINE = 1,
|
|
X121_XPV_SAR_LINE = 2,
|
|
X121_XPV_PEAK_GOLDEN_ZONE_LINE = 3,
|
|
X121_XPV_VALE_GOLDEN_ZONE_LINE = 4,
|
|
X121_XPV_SUPPORT_LINE = 5,
|
|
X121_XPV_RESISTANCE_LINE = 6,
|
|
X121_XPV_C_HH_LINE = 7,
|
|
X121_XPV_C_LL_LINE = 8,
|
|
X121_XPV_S_HH_LINE = 9,
|
|
X121_XPV_S_LL_LINE = 10,
|
|
X121_XPV_M_HH_LINE = 11,
|
|
X121_XPV_M_LL_LINE = 12,
|
|
X121_XPV_L_HH_LINE = 13,
|
|
X121_XPV_L_LL_LINE = 14,
|
|
X121_XPV_H_HH_LINE = 15,
|
|
X121_XPV_H_LL_LINE = 16,
|
|
X121_XPV_FRACTALS_UPPER_LINE = 17,
|
|
X121_XPV_FRACTALS_LOWER_LINE = 18,
|
|
};
|
|
|
|
//
|
|
// Input Models ...
|
|
struct X121XPVInputs
|
|
{
|
|
//
|
|
// Props ...
|
|
|
|
//
|
|
// Short ...
|
|
ENUM_X_PERIOD_METHOD scMethod; // How to Find Period
|
|
ENUM_TIMEFRAMES scPeriod; // Time Period
|
|
|
|
//
|
|
// Medium ...
|
|
ENUM_X_PERIOD_METHOD mcMethod; // How to Find Period
|
|
ENUM_TIMEFRAMES mcPeriod; // Time Period
|
|
|
|
//
|
|
// Long ...
|
|
ENUM_X_PERIOD_METHOD lcMethod; // How to Find Period
|
|
ENUM_TIMEFRAMES lcPeriod; // Time Period
|
|
|
|
//
|
|
// Hind ...
|
|
ENUM_X_PERIOD_METHOD hcMethod; // How to Find Period
|
|
ENUM_TIMEFRAMES hcPeriod; // Time Period
|
|
|
|
//
|
|
// Boundary Detection ...
|
|
ENUM_SERIESMODE hhMode; // Highest High Calculation Method
|
|
ENUM_SERIESMODE llMode; // Lowest Low Calculation Method
|
|
ENUM_X_FIBO_LEVELS goldenZoneLevel; // Golden Zone Detection
|
|
|
|
//
|
|
// Parabolic Sar Detection ...
|
|
double sarStep; // Step
|
|
double sarMax; // Maximum
|
|
|
|
//
|
|
int startCalculationForLastBars; // Calculate Last n Bars
|
|
|
|
//
|
|
int sarArrowCode; // Parabolic Sar Arrow Code
|
|
int peaksArrowCode; // Peaks Arrow Code
|
|
int valesArrowCode; // Vales Arrow Code
|
|
int supportsArrowCode; // Supports Arrow Code
|
|
int resistancesArrowCode; // Resistances Arrow Code
|
|
|
|
//
|
|
bool showSar; // Show Parabolic Sar
|
|
bool showPeaks; // Show Peaks
|
|
bool showVales; // Show Vales
|
|
bool showGoldenZones; // Show Golden Zones
|
|
bool showSupports; // Show Supports
|
|
bool showResistances; // Show Resistances
|
|
|
|
//
|
|
// Constructor(s) ...
|
|
X121XPVInputs()
|
|
{
|
|
//
|
|
Clean();
|
|
}
|
|
|
|
//
|
|
// Tools ...
|
|
|
|
//
|
|
// Clean ...
|
|
void Clean()
|
|
{
|
|
//
|
|
// Short ...
|
|
scMethod = X_PERIOD_NOTHING;
|
|
scPeriod = NULL;
|
|
|
|
//
|
|
// Medium ...
|
|
mcMethod = X_PERIOD_NOTHING;
|
|
mcPeriod = NULL;
|
|
|
|
//
|
|
// Long ...
|
|
lcMethod = X_PERIOD_NOTHING;
|
|
lcPeriod = NULL;
|
|
|
|
//
|
|
// Hind ...
|
|
hcMethod = X_PERIOD_NOTHING;
|
|
hcPeriod = NULL;
|
|
|
|
//
|
|
// Boundary Detection ...
|
|
hhMode = MODE_HIGH;
|
|
llMode = MODE_LOW;
|
|
goldenZoneLevel = X_FIBO_LEVEL_382;
|
|
|
|
//
|
|
sarStep = 0;
|
|
sarMax = 0;
|
|
|
|
//
|
|
startCalculationForLastBars = 0;
|
|
|
|
//
|
|
sarArrowCode = 0;
|
|
peaksArrowCode = 0;
|
|
valesArrowCode = 0;
|
|
supportsArrowCode = 0;
|
|
resistancesArrowCode = 0;
|
|
|
|
//
|
|
showSar = false;
|
|
showPeaks = false;
|
|
showVales = false;
|
|
showGoldenZones = false;
|
|
showSupports = false;
|
|
showResistances = false;
|
|
|
|
//
|
|
ZeroMemory(this);
|
|
}
|
|
|
|
//
|
|
// Default ...
|
|
void Default()
|
|
{
|
|
//
|
|
// Short ...
|
|
scMethod = X_PERIOD_AUTO;
|
|
scPeriod = NULL;
|
|
|
|
//
|
|
// Medium ...
|
|
mcMethod = X_PERIOD_AUTO;
|
|
mcPeriod = NULL;
|
|
|
|
//
|
|
// Long ...
|
|
lcMethod = X_PERIOD_AUTO;
|
|
lcPeriod = NULL;
|
|
|
|
//
|
|
// Hind ...
|
|
hcMethod = X_PERIOD_AUTO;
|
|
hcPeriod = NULL;
|
|
|
|
//
|
|
// Boundary Detection ...
|
|
hhMode = MODE_HIGH;
|
|
llMode = MODE_LOW;
|
|
goldenZoneLevel = X_FIBO_LEVEL_382;
|
|
|
|
//
|
|
sarStep = 0.02;
|
|
sarMax = 0.2;
|
|
|
|
//
|
|
startCalculationForLastBars = 1000;
|
|
|
|
//
|
|
sarArrowCode = 159;
|
|
peaksArrowCode = 159;
|
|
valesArrowCode = 159;
|
|
supportsArrowCode = 159;
|
|
resistancesArrowCode = 159;
|
|
|
|
//
|
|
showSar = true;
|
|
showPeaks = true;
|
|
showVales = true;
|
|
showGoldenZones = true;
|
|
showSupports = true;
|
|
showResistances = true;
|
|
}
|
|
|
|
//
|
|
// Validate ...
|
|
bool IsValid()
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
result =
|
|
//
|
|
// SAR ...
|
|
sarMax > 0 &&
|
|
sarStep > 0 &&
|
|
sarMax > sarStep &&
|
|
//
|
|
// XPV ...
|
|
(IsValid(scMethod, scPeriod) &&
|
|
IsValid(mcMethod, mcPeriod) &&
|
|
IsValid(lcMethod, lcPeriod) &&
|
|
IsValid(hcMethod, hcPeriod))
|
|
//
|
|
;
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Retrieve MAx Length ...
|
|
int Max()
|
|
{
|
|
//
|
|
int result = 0;
|
|
|
|
//
|
|
result = MathMax(1, 1);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
};
|
|
|
|
//
|
|
// Conditions ...
|
|
struct X121XPVConditions
|
|
{
|
|
//
|
|
// Common ...
|
|
string symbol;
|
|
ENUM_TIMEFRAMES period;
|
|
datetime time;
|
|
|
|
//
|
|
// Buffers ...
|
|
double peaksBuffer[];
|
|
double valesBuffer[];
|
|
double peaksGoldenBuffer[];
|
|
double valesGoldenBuffer[];
|
|
double supportsBuffer[];
|
|
double resistancesBuffer[];
|
|
double sarBuffer[];
|
|
double cHHBuffer[];
|
|
double cLLBuffer[];
|
|
double sHHBuffer[];
|
|
double sLLBuffer[];
|
|
double mHHBuffer[];
|
|
double mLLBuffer[];
|
|
double lHHBuffer[];
|
|
double lLLBuffer[];
|
|
double hHHBuffer[];
|
|
double hLLBuffer[];
|
|
double fractalsUpperBuffer[];
|
|
double fractalsLowerBuffer[];
|
|
|
|
//
|
|
// Conditions ...
|
|
|
|
//
|
|
// SAR ...
|
|
|
|
//
|
|
bool isSarBullish;
|
|
bool isSarBearish;
|
|
|
|
//
|
|
bool isSarSwitchedToBullish;
|
|
bool isSarSwitchedToBearish;
|
|
|
|
//
|
|
// XPV ...
|
|
|
|
//
|
|
bool isNewPeak;
|
|
bool isNewPeakOverLast;
|
|
bool isNewPeakUnderLast;
|
|
bool isRejectedPrevPeak;
|
|
bool isBreakedUpPrevPeak;
|
|
|
|
//
|
|
bool isNewVale;
|
|
bool isNewValeOverLast;
|
|
bool isNewValeUnderLast;
|
|
bool isRejectedPrevVale;
|
|
bool isBreakedDownPrevVale;
|
|
|
|
//
|
|
// Constructor ...
|
|
X121XPVConditions()
|
|
{
|
|
Clean();
|
|
}
|
|
|
|
//
|
|
// Tools ...
|
|
|
|
/**
|
|
* Cleaning Up ...
|
|
*/
|
|
void Clean()
|
|
{
|
|
//
|
|
// Commons ...
|
|
symbol = NULL;
|
|
period = NULL;
|
|
time = NULL;
|
|
|
|
//
|
|
// Buffers ...
|
|
|
|
//
|
|
Clean(peaksBuffer);
|
|
Clean(valesBuffer);
|
|
Clean(peaksGoldenBuffer);
|
|
Clean(valesGoldenBuffer);
|
|
Clean(supportsBuffer);
|
|
Clean(resistancesBuffer);
|
|
Clean(sarBuffer);
|
|
Clean(cHHBuffer);
|
|
Clean(cLLBuffer);
|
|
Clean(sHHBuffer);
|
|
Clean(sLLBuffer);
|
|
Clean(mHHBuffer);
|
|
Clean(mLLBuffer);
|
|
Clean(lHHBuffer);
|
|
Clean(lLLBuffer);
|
|
Clean(hHHBuffer);
|
|
Clean(hLLBuffer);
|
|
Clean(fractalsUpperBuffer);
|
|
Clean(fractalsLowerBuffer);
|
|
|
|
//
|
|
// Clean(bullishTrendBuffer);
|
|
// Clean(bearishTrendBuffer);
|
|
|
|
//
|
|
ArraySetAsSeries(peaksBuffer, true);
|
|
ArraySetAsSeries(valesBuffer, true);
|
|
ArraySetAsSeries(peaksGoldenBuffer, true);
|
|
ArraySetAsSeries(valesGoldenBuffer, true);
|
|
ArraySetAsSeries(supportsBuffer, true);
|
|
ArraySetAsSeries(resistancesBuffer, true);
|
|
ArraySetAsSeries(sarBuffer, true);
|
|
ArraySetAsSeries(cHHBuffer, true);
|
|
ArraySetAsSeries(cLLBuffer, true);
|
|
ArraySetAsSeries(sHHBuffer, true);
|
|
ArraySetAsSeries(sLLBuffer, true);
|
|
ArraySetAsSeries(mHHBuffer, true);
|
|
ArraySetAsSeries(mLLBuffer, true);
|
|
ArraySetAsSeries(lHHBuffer, true);
|
|
ArraySetAsSeries(lLLBuffer, true);
|
|
ArraySetAsSeries(hHHBuffer, true);
|
|
ArraySetAsSeries(hLLBuffer, true);
|
|
ArraySetAsSeries(fractalsUpperBuffer, true);
|
|
ArraySetAsSeries(fractalsLowerBuffer, true);
|
|
|
|
//
|
|
// Conditions ...
|
|
|
|
//
|
|
isSarBullish = false;
|
|
isSarBearish = false;
|
|
|
|
//
|
|
isSarSwitchedToBullish = false;
|
|
isSarSwitchedToBearish = false;
|
|
|
|
//
|
|
isNewPeak = false;
|
|
isNewPeakOverLast = false;
|
|
isNewPeakUnderLast = false;
|
|
isRejectedPrevPeak = false;
|
|
isBreakedUpPrevPeak = false;
|
|
|
|
//
|
|
isNewVale = false;
|
|
isNewValeOverLast = false;
|
|
isNewValeUnderLast = false;
|
|
isRejectedPrevVale = false;
|
|
isBreakedDownPrevVale = false;
|
|
|
|
//
|
|
ZeroMemory(this);
|
|
}
|
|
|
|
/**
|
|
* Generate Conditions Scores ...
|
|
*
|
|
* @param bullishScore: Double, Directional Scores Reference ...
|
|
* @param bearishScore: Double, Directional Scores Reference ...
|
|
*/
|
|
void GenerateScore(
|
|
double &bullishScore,
|
|
double &bearishScore //
|
|
)
|
|
{
|
|
//
|
|
bullishScore = 0;
|
|
bearishScore = 0;
|
|
|
|
//
|
|
// TODO: Implement if Required ...
|
|
}
|
|
|
|
/**
|
|
* Generate Summary String for Represent Conditions State ...
|
|
*
|
|
* @param onlyCommons: Boolean, Just Generate Only Commons Conditions ...
|
|
* @param onlyConditions: Boolean, Just Generate Only Conditions ...
|
|
* @param includeScores: Boolean, Attach Scores Representations on Result ...
|
|
* @param ignoreFalseConditions: Boolean, Ignore False Conditions on Result ...
|
|
* @param separator: String, Separate Lines ...
|
|
*
|
|
* @return ( string )
|
|
*/
|
|
string GenerateSummary(
|
|
bool onlyCommons = false,
|
|
bool onlyConditions = false,
|
|
bool includeScores = true,
|
|
bool ignoreFalseConditions = true,
|
|
string separator = "\n" //
|
|
)
|
|
{
|
|
//
|
|
string result = NULL;
|
|
|
|
//
|
|
double bullishScore = 0;
|
|
double bearishScore = 0;
|
|
GenerateScore(
|
|
bullishScore,
|
|
bearishScore //
|
|
);
|
|
|
|
//
|
|
string scoresStr =
|
|
//
|
|
"Scores: " + separator +
|
|
"---------------" + separator +
|
|
"Bullish: " + ToString(bullishScore) + separator +
|
|
"Bearish: " + ToString(bearishScore) + separator +
|
|
""
|
|
//
|
|
;
|
|
|
|
//
|
|
string commonStr = GenerateSpecifiedCommonSummary(
|
|
this,
|
|
separator,
|
|
includeScores //
|
|
);
|
|
|
|
//
|
|
string conditionsStr =
|
|
//
|
|
ToString("isSarBullish", isSarBullish, ignoreFalseConditions, separator) +
|
|
ToString("isSarBearish", isSarBearish, ignoreFalseConditions, separator) +
|
|
ToString("isSarSwitchedToBullish", isSarSwitchedToBullish, ignoreFalseConditions, separator) +
|
|
ToString("isSarSwitchedToBearish", isSarSwitchedToBearish, ignoreFalseConditions, separator) +
|
|
ToString("isNewPeak", isNewPeak, ignoreFalseConditions, separator) +
|
|
ToString("isNewPeakOverLast", isNewPeakOverLast, ignoreFalseConditions, separator) +
|
|
ToString("isNewPeakUnderLast", isNewPeakUnderLast, ignoreFalseConditions, separator) +
|
|
ToString("isRejectedPrevPeak", isRejectedPrevPeak, ignoreFalseConditions, separator) +
|
|
ToString("isBreakedUpPrevPeak", isBreakedUpPrevPeak, ignoreFalseConditions, separator) +
|
|
ToString("isNewVale", isNewVale, ignoreFalseConditions, separator) +
|
|
ToString("isNewValeOverLast", isNewValeOverLast, ignoreFalseConditions, separator) +
|
|
ToString("isNewValeUnderLast", isNewValeUnderLast, ignoreFalseConditions, separator) +
|
|
ToString("isRejectedPrevVale", isRejectedPrevVale, ignoreFalseConditions, separator) +
|
|
ToString("isBreakedDownPrevVale", isBreakedDownPrevVale, ignoreFalseConditions, separator) +
|
|
//
|
|
""
|
|
//
|
|
;
|
|
|
|
//
|
|
result =
|
|
//
|
|
"[" + GetTag() + "]" + separator +
|
|
(onlyConditions
|
|
? ""
|
|
: commonStr) +
|
|
(!includeScores
|
|
? ""
|
|
: scoresStr) +
|
|
" " + separator +
|
|
(onlyCommons
|
|
? ""
|
|
: conditionsStr) +
|
|
""
|
|
//
|
|
;
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
/**
|
|
* Retrieve nique Tag Identifier ...
|
|
*
|
|
* @return ( string )
|
|
*/
|
|
string GetTag()
|
|
{
|
|
return GetTypeName(this);
|
|
}
|
|
|
|
//
|
|
};
|
|
|
|
//
|
|
// Class ...
|
|
class XCX121XPVHelper : public XCBaseHelper
|
|
{
|
|
//
|
|
// Public ...
|
|
public:
|
|
//
|
|
// Props ...
|
|
|
|
//
|
|
// Constructors ...
|
|
XCX121XPVHelper()
|
|
: XCBaseHelper(_Symbol, _Period)
|
|
{
|
|
}
|
|
|
|
//
|
|
// Deconstructor ...
|
|
~XCX121XPVHelper()
|
|
{
|
|
//
|
|
mInputs.Clean();
|
|
|
|
//
|
|
Clean(peaksBuffer);
|
|
Clean(valesBuffer);
|
|
Clean(peaksGoldenBuffer);
|
|
Clean(valesGoldenBuffer);
|
|
Clean(supportsBuffer);
|
|
Clean(resistancesBuffer);
|
|
Clean(sarBuffer);
|
|
Clean(cHHBuffer);
|
|
Clean(cLLBuffer);
|
|
Clean(sHHBuffer);
|
|
Clean(sLLBuffer);
|
|
Clean(mHHBuffer);
|
|
Clean(mLLBuffer);
|
|
Clean(lHHBuffer);
|
|
Clean(lLLBuffer);
|
|
Clean(hHHBuffer);
|
|
Clean(hLLBuffer);
|
|
Clean(fractalsUpperBuffer);
|
|
Clean(fractalsLowerBuffer);
|
|
}
|
|
|
|
//
|
|
// Tools ...
|
|
bool Init(
|
|
string symbol, // Trading Symbol
|
|
ENUM_TIMEFRAMES period, // Trading Period
|
|
X121XPVInputs &inputs // Inputs
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
mSymbol = symbol;
|
|
mPeriod = period;
|
|
|
|
//
|
|
result = inputs.IsValid();
|
|
if (!result)
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
ArraySetAsSeries(peaksBuffer, true);
|
|
ArraySetAsSeries(valesBuffer, true);
|
|
ArraySetAsSeries(peaksGoldenBuffer, true);
|
|
ArraySetAsSeries(valesGoldenBuffer, true);
|
|
ArraySetAsSeries(supportsBuffer, true);
|
|
ArraySetAsSeries(resistancesBuffer, true);
|
|
ArraySetAsSeries(sarBuffer, true);
|
|
ArraySetAsSeries(cHHBuffer, true);
|
|
ArraySetAsSeries(cLLBuffer, true);
|
|
ArraySetAsSeries(sHHBuffer, true);
|
|
ArraySetAsSeries(sLLBuffer, true);
|
|
ArraySetAsSeries(mHHBuffer, true);
|
|
ArraySetAsSeries(mLLBuffer, true);
|
|
ArraySetAsSeries(lHHBuffer, true);
|
|
ArraySetAsSeries(lLLBuffer, true);
|
|
ArraySetAsSeries(hHHBuffer, true);
|
|
ArraySetAsSeries(hLLBuffer, true);
|
|
ArraySetAsSeries(fractalsUpperBuffer, true);
|
|
ArraySetAsSeries(fractalsLowerBuffer, true);
|
|
|
|
//
|
|
mInputs = inputs;
|
|
|
|
//
|
|
mHandler = iCustom(
|
|
mSymbol,
|
|
mPeriod,
|
|
"x-saherelm.x121.xpv",
|
|
//
|
|
// Inputs ...
|
|
//
|
|
// Market ...
|
|
"",
|
|
//
|
|
// Short ...
|
|
"",
|
|
mInputs.scMethod,
|
|
mInputs.scPeriod,
|
|
//
|
|
// Medium ...
|
|
"",
|
|
mInputs.mcMethod,
|
|
mInputs.mcPeriod,
|
|
//
|
|
// Long ...
|
|
"",
|
|
mInputs.lcMethod,
|
|
mInputs.lcPeriod,
|
|
//
|
|
// Hind ...
|
|
"",
|
|
mInputs.hcMethod,
|
|
mInputs.hcPeriod,
|
|
//
|
|
// Boundary Detection ...
|
|
"",
|
|
mInputs.hhMode,
|
|
mInputs.llMode,
|
|
mInputs.goldenZoneLevel,
|
|
//
|
|
// SAr Detection ...
|
|
"",
|
|
mInputs.sarStep,
|
|
mInputs.sarMax,
|
|
//
|
|
// Presentation ...
|
|
"",
|
|
//
|
|
mInputs.startCalculationForLastBars,
|
|
mInputs.sarArrowCode,
|
|
mInputs.peaksArrowCode,
|
|
mInputs.valesArrowCode,
|
|
mInputs.supportsArrowCode,
|
|
mInputs.resistancesArrowCode,
|
|
//
|
|
mInputs.showSar,
|
|
mInputs.showPeaks,
|
|
mInputs.showVales,
|
|
mInputs.showGoldenZones,
|
|
mInputs.showSupports,
|
|
mInputs.showResistances
|
|
//
|
|
);
|
|
result = mHandler != INVALID_HANDLE;
|
|
if (!result)
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Inputs ...
|
|
|
|
//
|
|
X121XPVInputs GetInputs()
|
|
{
|
|
return mInputs;
|
|
}
|
|
|
|
//
|
|
bool SetInputs(
|
|
X121XPVInputs &inputs // Configs
|
|
)
|
|
{
|
|
//
|
|
return Init(
|
|
mSymbol,
|
|
mPeriod,
|
|
inputs
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// Readers ...
|
|
|
|
//
|
|
// SAR ...
|
|
|
|
//
|
|
double GetSar(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
int count = ArraySize(sarBuffer);
|
|
if (barIndex >= count)
|
|
{
|
|
barIndex = count - 1;
|
|
}
|
|
|
|
//
|
|
return sarBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
int CopySar(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
sarBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// PV ...
|
|
|
|
//
|
|
// PEAKS ...
|
|
|
|
//
|
|
double GetPeak(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
int count = ArraySize(peaksBuffer);
|
|
if (barIndex >= count)
|
|
{
|
|
barIndex = count - 1;
|
|
}
|
|
|
|
//
|
|
return peaksBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
int CopyPeak(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
peaksBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// VALES ...
|
|
|
|
//
|
|
double GetVale(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
int count = ArraySize(valesBuffer);
|
|
if (barIndex >= count)
|
|
{
|
|
barIndex = count - 1;
|
|
}
|
|
|
|
//
|
|
return valesBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
int CopyVale(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
valesBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// SUPPORTS ...
|
|
|
|
//
|
|
double GetSupport(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
int count = ArraySize(supportsBuffer);
|
|
if (barIndex >= count)
|
|
{
|
|
barIndex = count - 1;
|
|
}
|
|
|
|
//
|
|
return supportsBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
int CopySupport(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
supportsBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// RESISTANCES ...
|
|
|
|
//
|
|
double GetResistance(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
int count = ArraySize(resistancesBuffer);
|
|
if (barIndex >= count)
|
|
{
|
|
barIndex = count - 1;
|
|
}
|
|
|
|
//
|
|
return resistancesBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
int CopyResistance(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
resistancesBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// GOLDEN PEAKS ...
|
|
|
|
//
|
|
double GetPeakGoldenZone(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
int count = ArraySize(peaksGoldenBuffer);
|
|
if (barIndex >= count)
|
|
{
|
|
barIndex = count - 1;
|
|
}
|
|
|
|
//
|
|
return peaksGoldenBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
int CopyPeakGoldenZone(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
peaksGoldenBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// GOLDEN VALES ...
|
|
|
|
//
|
|
double GetValeGoldenZone(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
int count = ArraySize(valesGoldenBuffer);
|
|
if (barIndex >= count)
|
|
{
|
|
barIndex = count - 1;
|
|
}
|
|
|
|
//
|
|
return valesGoldenBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
int CopyValeGoldenZone(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
valesGoldenBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
//
|
|
//
|
|
|
|
//
|
|
double GetHigherPeak(
|
|
int &index, // Bar Index
|
|
double peak, // Peak Source
|
|
int barIndex = 0, // Bar Index
|
|
int loopback = 576 // Max Allowed Loopback
|
|
)
|
|
{
|
|
//
|
|
double result = 0;
|
|
|
|
//
|
|
index = -1;
|
|
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
if (loopback < 576)
|
|
{
|
|
loopback = 576;
|
|
}
|
|
|
|
//
|
|
if (peak <= 0)
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double iValue = 0;
|
|
int sIndex = barIndex;
|
|
bool canContinue = true;
|
|
while (canContinue)
|
|
{
|
|
//
|
|
iValue = GetPeak(sIndex);
|
|
if (iValue > peak)
|
|
{
|
|
//
|
|
index = sIndex;
|
|
result = iValue;
|
|
break;
|
|
}
|
|
|
|
//
|
|
canContinue = sIndex < barIndex + loopback;
|
|
sIndex++;
|
|
}
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double GetLowerPeak(
|
|
int &index, // Bar Index
|
|
double peak, // Peak Source
|
|
int barIndex = 0, // Bar Index
|
|
int loopback = 576 // Max Allowed Loopback
|
|
)
|
|
{
|
|
//
|
|
double result = 0;
|
|
|
|
//
|
|
index = -1;
|
|
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
if (loopback < 576)
|
|
{
|
|
loopback = 576;
|
|
}
|
|
|
|
//
|
|
if (peak <= 0)
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double iValue = 0;
|
|
int sIndex = barIndex;
|
|
bool canContinue = true;
|
|
while (canContinue)
|
|
{
|
|
//
|
|
iValue = GetPeak(sIndex);
|
|
if (iValue < peak)
|
|
{
|
|
//
|
|
index = sIndex;
|
|
result = iValue;
|
|
break;
|
|
}
|
|
|
|
//
|
|
canContinue = sIndex < barIndex + loopback;
|
|
sIndex++;
|
|
}
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double GetHigherVale(
|
|
int &index, // Bar Index
|
|
double vale, // Vale Source
|
|
int barIndex = 0, // Bar Index
|
|
int loopback = 576 // Max Allowed Loopback
|
|
)
|
|
{
|
|
//
|
|
double result = 0;
|
|
|
|
//
|
|
index = -1;
|
|
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
if (loopback < 576)
|
|
{
|
|
loopback = 576;
|
|
}
|
|
|
|
//
|
|
if (vale <= 0)
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double iValue = 0;
|
|
int sIndex = barIndex;
|
|
bool canContinue = true;
|
|
while (canContinue)
|
|
{
|
|
//
|
|
iValue = GetVale(sIndex);
|
|
if (iValue > vale)
|
|
{
|
|
//
|
|
index = sIndex;
|
|
result = iValue;
|
|
break;
|
|
}
|
|
|
|
//
|
|
canContinue = sIndex < barIndex + loopback;
|
|
sIndex++;
|
|
}
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double GetLowerVale(
|
|
int &index, // Bar Index
|
|
double vale, // Vale Source
|
|
int barIndex = 0, // Bar Index
|
|
int loopback = 576 // Max Allowed Loopback
|
|
)
|
|
{
|
|
//
|
|
double result = 0;
|
|
|
|
//
|
|
index = -1;
|
|
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
if (loopback < 576)
|
|
{
|
|
loopback = 576;
|
|
}
|
|
|
|
//
|
|
if (vale <= 0)
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double iValue = 0;
|
|
int sIndex = barIndex;
|
|
bool canContinue = true;
|
|
while (canContinue)
|
|
{
|
|
//
|
|
iValue = GetVale(sIndex);
|
|
if (iValue < vale)
|
|
{
|
|
//
|
|
index = sIndex;
|
|
result = iValue;
|
|
break;
|
|
}
|
|
|
|
//
|
|
canContinue = sIndex < barIndex + loopback;
|
|
sIndex++;
|
|
}
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// CURRENT ...
|
|
|
|
//
|
|
// HH ...
|
|
|
|
//
|
|
double GetCHH(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
int count = ArraySize(cHHBuffer);
|
|
if (barIndex >= count)
|
|
{
|
|
barIndex = count - 1;
|
|
}
|
|
|
|
//
|
|
return cHHBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
int CopyCHH(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
cHHBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// LL ...
|
|
|
|
//
|
|
double GetCLL(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
int count = ArraySize(cLLBuffer);
|
|
if (barIndex >= count)
|
|
{
|
|
barIndex = count - 1;
|
|
}
|
|
|
|
//
|
|
return cLLBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
int CopyCLL(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
cLLBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// SHORT ...
|
|
|
|
//
|
|
// HH ...
|
|
|
|
//
|
|
double GetSHH(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
int count = ArraySize(sHHBuffer);
|
|
if (barIndex >= count)
|
|
{
|
|
barIndex = count - 1;
|
|
}
|
|
|
|
//
|
|
return sHHBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
int CopySHH(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
sHHBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// LL ...
|
|
|
|
//
|
|
double GetSLL(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
int count = ArraySize(sLLBuffer);
|
|
if (barIndex >= count)
|
|
{
|
|
barIndex = count - 1;
|
|
}
|
|
|
|
//
|
|
return sLLBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
int CopySLL(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
sLLBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// MEDIUM ...
|
|
|
|
//
|
|
// HH ...
|
|
|
|
//
|
|
double GetMHH(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
int count = ArraySize(mHHBuffer);
|
|
if (barIndex >= count)
|
|
{
|
|
barIndex = count - 1;
|
|
}
|
|
|
|
//
|
|
return mHHBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
int CopyMHH(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
mHHBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// LL ...
|
|
|
|
//
|
|
double GetMLL(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
int count = ArraySize(mLLBuffer);
|
|
if (barIndex >= count)
|
|
{
|
|
barIndex = count - 1;
|
|
}
|
|
|
|
//
|
|
return mLLBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
int CopyMLL(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
mLLBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// LONG ...
|
|
|
|
//
|
|
// HH ...
|
|
|
|
//
|
|
double GetLHH(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
int count = ArraySize(lHHBuffer);
|
|
if (barIndex >= count)
|
|
{
|
|
barIndex = count - 1;
|
|
}
|
|
|
|
//
|
|
return lHHBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
int CopyLHH(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
lHHBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// LL ...
|
|
|
|
//
|
|
double GetLLL(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
int count = ArraySize(lLLBuffer);
|
|
if (barIndex >= count)
|
|
{
|
|
barIndex = count - 1;
|
|
}
|
|
|
|
//
|
|
return lLLBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
int CopyLLL(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
lLLBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// HIND ...
|
|
|
|
//
|
|
// HH ...
|
|
|
|
//
|
|
double GetHHH(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
int count = ArraySize(hHHBuffer);
|
|
if (barIndex >= count)
|
|
{
|
|
barIndex = count - 1;
|
|
}
|
|
|
|
//
|
|
return hHHBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
int CopyHHH(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
hHHBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// LL ...
|
|
|
|
//
|
|
double GetHLL(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
int count = ArraySize(hLLBuffer);
|
|
if (barIndex >= count)
|
|
{
|
|
barIndex = count - 1;
|
|
}
|
|
|
|
//
|
|
return hLLBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
int CopyHLL(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
hLLBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// FRACTALS Upper ...
|
|
|
|
//
|
|
double GetFractalsUpper(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
int count = ArraySize(fractalsUpperBuffer);
|
|
if (barIndex >= count)
|
|
{
|
|
barIndex = count - 1;
|
|
}
|
|
|
|
//
|
|
return fractalsUpperBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
int CopyFractalsUpper(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
fractalsUpperBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// FRACTALS Lower ...
|
|
|
|
//
|
|
double GetFractalsLower(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
int count = ArraySize(fractalsLowerBuffer);
|
|
if (barIndex >= count)
|
|
{
|
|
barIndex = count - 1;
|
|
}
|
|
|
|
//
|
|
return fractalsLowerBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
int CopyFractalsLower(
|
|
int start, // Start
|
|
int count, // Number of Items for read
|
|
double &buffer[], // Dest Buffer
|
|
bool forceClean = true // Force To Clean buffer
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
// Copy Items ...
|
|
return Copy(
|
|
start,
|
|
count,
|
|
fractalsLowerBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// Tools Function ...
|
|
|
|
//
|
|
double GetLowestPeak(
|
|
int barIndex,
|
|
int &index,
|
|
double &vale,
|
|
int loopback = 576 //
|
|
)
|
|
{
|
|
//
|
|
double result = 0;
|
|
|
|
//
|
|
index = -1;
|
|
vale = 0;
|
|
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
if (loopback < 576)
|
|
{
|
|
loopback = 576;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
for (int i = 0; i < barIndex + loopback; i++)
|
|
{
|
|
//
|
|
double iPeak = GetPeak(i);
|
|
if (iPeak == 0)
|
|
{
|
|
break;
|
|
}
|
|
|
|
//
|
|
if (iPeak > 0 && (result == 0 ||
|
|
result >= iPeak))
|
|
{
|
|
//
|
|
index = i;
|
|
result = iPeak;
|
|
vale = GetVale(index);
|
|
}
|
|
}
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double GetHighestPeak(
|
|
int barIndex,
|
|
int &index,
|
|
double &vale,
|
|
int loopback = 576 //
|
|
)
|
|
{
|
|
//
|
|
double result = 0;
|
|
|
|
//
|
|
index = -1;
|
|
vale = 0;
|
|
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
if (loopback < 576)
|
|
{
|
|
loopback = 576;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
for (int i = 0; i < barIndex + loopback; i++)
|
|
{
|
|
//
|
|
double iPeak = GetPeak(i);
|
|
if (iPeak == 0)
|
|
{
|
|
break;
|
|
}
|
|
|
|
//
|
|
if (iPeak > 0 && (result == 0 ||
|
|
result <= iPeak))
|
|
{
|
|
//
|
|
index = i;
|
|
result = iPeak;
|
|
vale = GetVale(index);
|
|
}
|
|
}
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double GetLowestVale(
|
|
int barIndex,
|
|
int &index,
|
|
double &peak,
|
|
int loopback = 576 //
|
|
)
|
|
{
|
|
//
|
|
double result = 0;
|
|
|
|
//
|
|
index = -1;
|
|
peak = 0;
|
|
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
if (loopback < 576)
|
|
{
|
|
loopback = 576;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
for (int i = 0; i < barIndex + loopback; i++)
|
|
{
|
|
//
|
|
double iPeak = GetVale(i);
|
|
if (iPeak == 0)
|
|
{
|
|
break;
|
|
}
|
|
|
|
//
|
|
if (iPeak > 0 && (result == 0 ||
|
|
result >= iPeak))
|
|
{
|
|
//
|
|
index = i;
|
|
result = iPeak;
|
|
peak = GetPeak(index);
|
|
}
|
|
}
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double GetHighestVale(
|
|
int barIndex,
|
|
int &index,
|
|
double &peak,
|
|
int loopback = 576 //
|
|
)
|
|
{
|
|
//
|
|
double result = 0;
|
|
|
|
//
|
|
index = -1;
|
|
peak = 0;
|
|
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
if (loopback < 576)
|
|
{
|
|
loopback = 576;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
for (int i = 0; i < barIndex + loopback; i++)
|
|
{
|
|
//
|
|
double iPeak = GetVale(i);
|
|
if (iPeak == 0)
|
|
{
|
|
break;
|
|
}
|
|
|
|
//
|
|
if (iPeak > 0 && (result == 0 ||
|
|
result <= iPeak))
|
|
{
|
|
//
|
|
index = i;
|
|
result = iPeak;
|
|
peak = GetPeak(index);
|
|
}
|
|
}
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
void Free() override
|
|
{
|
|
Cleanup(10);
|
|
}
|
|
|
|
//
|
|
bool GetConditions(
|
|
X121XPVConditions &conditions, //
|
|
int barIndex = 0, //
|
|
int loopback = 5 //
|
|
)
|
|
{
|
|
//
|
|
bool result = true;
|
|
|
|
//
|
|
if (loopback < 5)
|
|
{
|
|
loopback = 5;
|
|
}
|
|
|
|
//
|
|
conditions.Clean();
|
|
|
|
//
|
|
conditions.symbol = mSymbol;
|
|
conditions.period = mPeriod;
|
|
conditions.time = TimeCurrent();
|
|
|
|
//
|
|
int zIndex = barIndex;
|
|
int cIndex = zIndex + 1;
|
|
int pIndex = cIndex + 1;
|
|
int ppIndex = pIndex + 1;
|
|
|
|
//
|
|
XOHCL zBar;
|
|
result = zBar.Init(
|
|
mSymbol,
|
|
mPeriod,
|
|
zIndex //
|
|
);
|
|
if (!result)
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
XOHCL cBar;
|
|
result = cBar.Init(
|
|
mSymbol,
|
|
mPeriod,
|
|
cIndex //
|
|
);
|
|
if (!result)
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
XOHCL pBar;
|
|
result = pBar.Init(
|
|
mSymbol,
|
|
mPeriod,
|
|
pIndex //
|
|
);
|
|
if (!result)
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Buffers ...
|
|
|
|
//
|
|
CopySar(
|
|
zIndex,
|
|
loopback,
|
|
conditions.sarBuffer //
|
|
);
|
|
|
|
//
|
|
CopyPeak(
|
|
zIndex,
|
|
loopback,
|
|
conditions.peaksBuffer //
|
|
);
|
|
|
|
//
|
|
CopyVale(
|
|
zIndex,
|
|
loopback,
|
|
conditions.valesBuffer //
|
|
);
|
|
|
|
//
|
|
CopySupport(
|
|
zIndex,
|
|
loopback,
|
|
conditions.supportsBuffer //
|
|
);
|
|
|
|
//
|
|
CopyResistance(
|
|
zIndex,
|
|
loopback,
|
|
conditions.resistancesBuffer //
|
|
);
|
|
|
|
//
|
|
CopyPeakGoldenZone(
|
|
zIndex,
|
|
loopback,
|
|
conditions.peaksGoldenBuffer //
|
|
);
|
|
|
|
//
|
|
CopyValeGoldenZone(
|
|
zIndex,
|
|
loopback,
|
|
conditions.valesGoldenBuffer //
|
|
);
|
|
|
|
//
|
|
CopyCHH(
|
|
zIndex,
|
|
loopback,
|
|
conditions.cHHBuffer //
|
|
);
|
|
|
|
//
|
|
CopyCLL(
|
|
zIndex,
|
|
loopback,
|
|
conditions.cLLBuffer //
|
|
);
|
|
|
|
//
|
|
CopySHH(
|
|
zIndex,
|
|
loopback,
|
|
conditions.sHHBuffer //
|
|
);
|
|
|
|
//
|
|
CopySLL(
|
|
zIndex,
|
|
loopback,
|
|
conditions.sLLBuffer //
|
|
);
|
|
|
|
//
|
|
CopyMHH(
|
|
zIndex,
|
|
loopback,
|
|
conditions.mHHBuffer //
|
|
);
|
|
|
|
//
|
|
CopyMLL(
|
|
zIndex,
|
|
loopback,
|
|
conditions.mLLBuffer //
|
|
);
|
|
|
|
//
|
|
CopyLHH(
|
|
zIndex,
|
|
loopback,
|
|
conditions.lHHBuffer //
|
|
);
|
|
|
|
//
|
|
CopyLLL(
|
|
zIndex,
|
|
loopback,
|
|
conditions.lLLBuffer //
|
|
);
|
|
|
|
//
|
|
CopyHHH(
|
|
zIndex,
|
|
loopback,
|
|
conditions.hHHBuffer //
|
|
);
|
|
|
|
//
|
|
CopyHLL(
|
|
zIndex,
|
|
loopback,
|
|
conditions.hLLBuffer //
|
|
);
|
|
|
|
//
|
|
CopyFractalsUpper(
|
|
zIndex,
|
|
loopback,
|
|
conditions.fractalsUpperBuffer //
|
|
);
|
|
|
|
//
|
|
CopyFractalsLower(
|
|
zIndex,
|
|
loopback,
|
|
conditions.fractalsLowerBuffer //
|
|
);
|
|
|
|
//
|
|
// Conditions ...
|
|
|
|
//
|
|
int cIDX = 1;
|
|
int pIDX = cIDX + 1;
|
|
|
|
//
|
|
// SAR ...
|
|
|
|
//
|
|
bool isSarBullish = conditions.sarBuffer[cIDX] < cBar.low;
|
|
bool isSarBullishPrev = conditions.sarBuffer[pIDX] < pBar.low;
|
|
|
|
//
|
|
bool isSarBearish = conditions.sarBuffer[cIDX] > cBar.high;
|
|
bool isSarBearishPrev = conditions.sarBuffer[pIDX] > pBar.high;
|
|
|
|
//
|
|
bool isSarSwitchedToBullish = isSarBullish &&
|
|
!isSarBullishPrev;
|
|
bool isSarSwitchedToBearish = isSarBearish &&
|
|
!isSarBearishPrev;
|
|
|
|
//
|
|
// XPV ...
|
|
|
|
//
|
|
bool isNewPeak = conditions.peaksBuffer[cIDX] != conditions.peaksBuffer[pIDX];
|
|
bool isNewPeakOverLast = isNewPeak &&
|
|
conditions.peaksBuffer[cIDX] > conditions.peaksBuffer[pIDX];
|
|
bool isNewPeakUnderLast = isNewPeak &&
|
|
conditions.peaksBuffer[cIDX] < conditions.peaksBuffer[pIDX];
|
|
bool isRejectedPrevPeak = IsBarReject(
|
|
conditions.peaksBuffer[pIDX],
|
|
X_DIRECTION_BEARISH,
|
|
cBar //
|
|
);
|
|
bool isBreakedUpPrevPeak = IsBarBreak(
|
|
conditions.peaksBuffer[pIDX],
|
|
X_DIRECTION_BULLISH,
|
|
cBar //
|
|
);
|
|
|
|
//
|
|
bool isNewVale = conditions.valesBuffer[cIDX] != conditions.valesBuffer[pIDX];
|
|
bool isNewValeOverLast = isNewVale &&
|
|
conditions.valesBuffer[cIDX] > conditions.valesBuffer[pIDX];
|
|
bool isNewValeUnderLast = isNewVale &&
|
|
conditions.valesBuffer[cIDX] < conditions.valesBuffer[pIDX];
|
|
bool isRejectedPrevVale = IsBarReject(
|
|
conditions.valesBuffer[pIDX],
|
|
X_DIRECTION_BULLISH,
|
|
cBar //
|
|
);
|
|
bool isBreakedDownPrevVale = IsBarBreak(
|
|
conditions.valesBuffer[pIDX],
|
|
X_DIRECTION_BEARISH,
|
|
cBar //
|
|
);
|
|
|
|
//
|
|
conditions.isSarBullish = isSarBullish;
|
|
conditions.isSarBearish = isSarBearish;
|
|
conditions.isSarSwitchedToBullish = isSarSwitchedToBullish;
|
|
conditions.isSarSwitchedToBearish = isSarSwitchedToBearish;
|
|
conditions.isNewPeak = isNewPeak;
|
|
conditions.isNewPeakOverLast = isNewPeakOverLast;
|
|
conditions.isNewPeakUnderLast = isNewPeakUnderLast;
|
|
conditions.isRejectedPrevPeak = isRejectedPrevPeak;
|
|
conditions.isBreakedUpPrevPeak = isBreakedUpPrevPeak;
|
|
conditions.isNewVale = isNewVale;
|
|
conditions.isNewValeOverLast = isNewValeOverLast;
|
|
conditions.isNewValeUnderLast = isNewValeUnderLast;
|
|
conditions.isRejectedPrevVale = isRejectedPrevVale;
|
|
conditions.isBreakedDownPrevVale = isBreakedDownPrevVale;
|
|
|
|
//
|
|
Cleanup();
|
|
|
|
//
|
|
zBar.Clean();
|
|
cBar.Clean();
|
|
pBar.Clean();
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Protected ...
|
|
protected:
|
|
//
|
|
// Private ...
|
|
private:
|
|
//
|
|
// Props ...
|
|
X121XPVInputs mInputs; // Inputs ...
|
|
|
|
//
|
|
// Buffers ...
|
|
double peaksBuffer[];
|
|
double valesBuffer[];
|
|
double supportsBuffer[];
|
|
double resistancesBuffer[];
|
|
double peaksGoldenBuffer[];
|
|
double valesGoldenBuffer[];
|
|
double sarBuffer[];
|
|
double cHHBuffer[];
|
|
double cLLBuffer[];
|
|
double sHHBuffer[];
|
|
double sLLBuffer[];
|
|
double mHHBuffer[];
|
|
double mLLBuffer[];
|
|
double lHHBuffer[];
|
|
double lLLBuffer[];
|
|
double hHHBuffer[];
|
|
double hLLBuffer[];
|
|
double fractalsUpperBuffer[];
|
|
double fractalsLowerBuffer[];
|
|
|
|
//
|
|
void Calculate(
|
|
int maxRequiredBars = 100 //
|
|
)
|
|
{
|
|
//
|
|
// Buffers ...
|
|
|
|
//
|
|
// SAR ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
X121_XPV_SAR_LINE,
|
|
0,
|
|
maxRequiredBars,
|
|
sarBuffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// XPV ...
|
|
|
|
//
|
|
// PEAKS ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
X121_XPV_PEAK_LINE,
|
|
0,
|
|
maxRequiredBars,
|
|
peaksBuffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// VALES ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
X121_XPV_VALE_LINE,
|
|
0,
|
|
maxRequiredBars,
|
|
valesBuffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// SUPPORTS ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
X121_XPV_SUPPORT_LINE,
|
|
0,
|
|
maxRequiredBars,
|
|
supportsBuffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// RESISTANCES ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
X121_XPV_RESISTANCE_LINE,
|
|
0,
|
|
maxRequiredBars,
|
|
resistancesBuffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// GOLDEN PEAKS ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
X121_XPV_PEAK_GOLDEN_ZONE_LINE,
|
|
0,
|
|
maxRequiredBars,
|
|
peaksGoldenBuffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// GOLDEN VALES ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
X121_XPV_VALE_GOLDEN_ZONE_LINE,
|
|
0,
|
|
maxRequiredBars,
|
|
valesGoldenBuffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// CURRENT ...
|
|
|
|
//
|
|
// HH ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
X121_XPV_C_HH_LINE,
|
|
0,
|
|
maxRequiredBars,
|
|
cHHBuffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// LL ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
X121_XPV_C_LL_LINE,
|
|
0,
|
|
maxRequiredBars,
|
|
cLLBuffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// SHORT ...
|
|
|
|
//
|
|
// HH ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
X121_XPV_S_HH_LINE,
|
|
0,
|
|
maxRequiredBars,
|
|
sHHBuffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// LL ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
X121_XPV_S_LL_LINE,
|
|
0,
|
|
maxRequiredBars,
|
|
sLLBuffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// MEDIUM ...
|
|
|
|
//
|
|
// HH ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
X121_XPV_M_HH_LINE,
|
|
0,
|
|
maxRequiredBars,
|
|
mHHBuffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// LL ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
X121_XPV_M_LL_LINE,
|
|
0,
|
|
maxRequiredBars,
|
|
mLLBuffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// LONG ...
|
|
|
|
//
|
|
// HH ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
X121_XPV_L_HH_LINE,
|
|
0,
|
|
maxRequiredBars,
|
|
lHHBuffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// LL ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
X121_XPV_L_LL_LINE,
|
|
0,
|
|
maxRequiredBars,
|
|
lLLBuffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// HIND ...
|
|
|
|
//
|
|
// HH ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
X121_XPV_H_HH_LINE,
|
|
0,
|
|
maxRequiredBars,
|
|
hHHBuffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// LL ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
X121_XPV_H_LL_LINE,
|
|
0,
|
|
maxRequiredBars,
|
|
hLLBuffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// FRACTALS Upper ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
X121_XPV_FRACTALS_UPPER_LINE,
|
|
0,
|
|
maxRequiredBars,
|
|
fractalsUpperBuffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// FRACTALS Lower ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
X121_XPV_FRACTALS_LOWER_LINE,
|
|
0,
|
|
maxRequiredBars,
|
|
fractalsLowerBuffer
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
void Cleanup(
|
|
int maxAllowed = 100 //
|
|
)
|
|
{
|
|
//
|
|
CleanupArray(
|
|
peaksBuffer,
|
|
maxAllowed //
|
|
);
|
|
|
|
//
|
|
CleanupArray(
|
|
valesBuffer,
|
|
maxAllowed //
|
|
);
|
|
|
|
//
|
|
CleanupArray(
|
|
peaksGoldenBuffer,
|
|
maxAllowed //
|
|
);
|
|
|
|
//
|
|
CleanupArray(
|
|
valesGoldenBuffer,
|
|
maxAllowed //
|
|
);
|
|
|
|
//
|
|
CleanupArray(
|
|
supportsBuffer,
|
|
maxAllowed //
|
|
);
|
|
|
|
//
|
|
CleanupArray(
|
|
resistancesBuffer,
|
|
maxAllowed //
|
|
);
|
|
|
|
//
|
|
CleanupArray(
|
|
sarBuffer,
|
|
maxAllowed //
|
|
);
|
|
|
|
//
|
|
CleanupArray(
|
|
cHHBuffer,
|
|
maxAllowed //
|
|
);
|
|
|
|
//
|
|
CleanupArray(
|
|
cLLBuffer,
|
|
maxAllowed //
|
|
);
|
|
|
|
//
|
|
CleanupArray(
|
|
sHHBuffer,
|
|
maxAllowed //
|
|
);
|
|
|
|
//
|
|
CleanupArray(
|
|
sLLBuffer,
|
|
maxAllowed //
|
|
);
|
|
|
|
//
|
|
CleanupArray(
|
|
mHHBuffer,
|
|
maxAllowed //
|
|
);
|
|
|
|
//
|
|
CleanupArray(
|
|
mLLBuffer,
|
|
maxAllowed //
|
|
);
|
|
|
|
//
|
|
CleanupArray(
|
|
lHHBuffer,
|
|
maxAllowed //
|
|
);
|
|
|
|
//
|
|
CleanupArray(
|
|
lLLBuffer,
|
|
maxAllowed //
|
|
);
|
|
|
|
//
|
|
CleanupArray(
|
|
hHHBuffer,
|
|
maxAllowed //
|
|
);
|
|
|
|
//
|
|
CleanupArray(
|
|
hLLBuffer,
|
|
maxAllowed //
|
|
);
|
|
|
|
//
|
|
CleanupArray(
|
|
fractalsUpperBuffer,
|
|
maxAllowed //
|
|
);
|
|
|
|
//
|
|
CleanupArray(
|
|
fractalsLowerBuffer,
|
|
maxAllowed //
|
|
);
|
|
|
|
//
|
|
}
|
|
|
|
//
|
|
};
|
|
|
|
//
|
|
// Tools ... |