3237 lines
75 KiB
Plaintext
3237 lines
75 KiB
Plaintext
///////////////////////////////////////////////////////
|
|
//
|
|
// SaherElm IT Center MQL5 Helper Class Library
|
|
// ----------------------------------------------
|
|
// Name: XSCXPVHelper
|
|
// 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.xhelper.class.mq5"
|
|
|
|
//
|
|
// Definitions ...
|
|
|
|
//
|
|
enum ENUM_XPV_BUFFERS
|
|
{
|
|
//
|
|
// Peaks and Vales ...
|
|
XPV_PEAKS_LINE = 0,
|
|
XPV_VALES_LINE = 1,
|
|
//
|
|
// Support and Resistances ...
|
|
XPV_RESISTANCE_LINE = 2,
|
|
XPV_SUPPORT_LINE = 4,
|
|
//
|
|
// Fibonacci ...
|
|
XPV_FIB_1_LINE = 6,
|
|
XPV_FIB_2_LINE = 8,
|
|
XPV_FIB_3_LINE = 10,
|
|
XPV_FIB_4_LINE = 12,
|
|
XPV_FIB_5_LINE = 14,
|
|
//
|
|
// Short ...
|
|
XPV_SC_HH_LINE = 16,
|
|
XPV_SC_LL_LINE = 18,
|
|
//
|
|
// Medium ...
|
|
XPV_MC_HH_LINE = 20,
|
|
XPV_MC_LL_LINE = 22,
|
|
//
|
|
// Long ...
|
|
XPV_LC_HH_LINE = 24,
|
|
XPV_LC_LL_LINE = 26,
|
|
//
|
|
// Hind ...
|
|
XPV_HC_HH_LINE = 28,
|
|
XPV_HC_LL_LINE = 30,
|
|
};
|
|
|
|
//
|
|
// Input Models ...
|
|
struct XPVInputs
|
|
{
|
|
//
|
|
// Props ...
|
|
|
|
//
|
|
// Makret Cycles ...
|
|
|
|
//
|
|
// 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
|
|
|
|
//
|
|
// Fibonacci ...
|
|
double fiboLevel1; // Fibio 1st Level
|
|
double fiboLevel2; // Fibio 2st Level
|
|
double fiboLevel3; // Fibio 3rd Level
|
|
double fiboLevel4; // Fibio 4th Level
|
|
double fiboLevel5; // Fibio 5th Level
|
|
|
|
//
|
|
// Boundary Detection Modes ...
|
|
ENUM_SERIESMODE hhMode; // Highest High Calculation Method
|
|
ENUM_SERIESMODE llMode; // Lowest Low Calculation Method
|
|
|
|
//
|
|
// Presentation ...
|
|
bool showPeaksAndVales; // Show Peaks and Vales
|
|
bool showLevels; // Show Levels
|
|
bool showConsolidations; // Show Consolidations
|
|
bool showFibo1Levels; // Show Fibo 1st Level
|
|
bool showFibo2Levels; // Show Fibo 2nd Level
|
|
bool showFibo3Levels; // Show Fibo 3rd Level
|
|
bool showFibo4Levels; // Show Fibo 4th Level
|
|
bool showFibo5Levels; // Show Fibo 5th Level
|
|
|
|
//
|
|
// Constructor(s) ...
|
|
XPVInputs()
|
|
{
|
|
//
|
|
Clean();
|
|
}
|
|
|
|
//
|
|
// Tools ...
|
|
|
|
//
|
|
// Clean ...
|
|
void Clean()
|
|
{
|
|
//
|
|
// Makret Cycles ...
|
|
|
|
//
|
|
// 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;
|
|
|
|
//
|
|
// Fibonacci ...
|
|
fiboLevel1 = 0;
|
|
fiboLevel2 = 0;
|
|
fiboLevel3 = 0;
|
|
fiboLevel4 = 0;
|
|
fiboLevel5 = 0;
|
|
|
|
//
|
|
// Boundary Detection Modes ...
|
|
hhMode = MODE_HIGH;
|
|
llMode = MODE_LOW;
|
|
|
|
//
|
|
// Presentation ...
|
|
showPeaksAndVales = false;
|
|
showLevels = false;
|
|
showConsolidations = false;
|
|
showFibo1Levels = false;
|
|
showFibo2Levels = false;
|
|
showFibo3Levels = false;
|
|
showFibo4Levels = false;
|
|
showFibo5Levels = false;
|
|
}
|
|
|
|
//
|
|
// Default ...
|
|
void Default()
|
|
{
|
|
//
|
|
// Makret Cycles ...
|
|
|
|
//
|
|
// 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;
|
|
|
|
//
|
|
// Fibonacci ...
|
|
fiboLevel1 = 0.236;
|
|
fiboLevel2 = 0.382;
|
|
fiboLevel3 = 0.5;
|
|
fiboLevel4 = 0.618;
|
|
fiboLevel5 = 0.764;
|
|
|
|
//
|
|
// Boundary Detection Modes ...
|
|
hhMode = MODE_HIGH;
|
|
llMode = MODE_LOW;
|
|
|
|
//
|
|
// Presentation ...
|
|
showPeaksAndVales = true;
|
|
showLevels = false;
|
|
showConsolidations = false;
|
|
showFibo1Levels = true;
|
|
showFibo2Levels = true;
|
|
showFibo3Levels = true;
|
|
showFibo4Levels = true;
|
|
showFibo5Levels = true;
|
|
}
|
|
|
|
//
|
|
// Validate ...
|
|
bool IsValid()
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
result =
|
|
//
|
|
IsValid(scMethod, scPeriod) &&
|
|
IsValid(mcMethod, mcPeriod) &&
|
|
IsValid(lcMethod, lcPeriod) &&
|
|
IsValid(hcMethod, hcPeriod)
|
|
//
|
|
;
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Retrieve MAx Length ...
|
|
int Max()
|
|
{
|
|
//
|
|
int result = 0;
|
|
|
|
//
|
|
result = MathMax(result, 0);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
};
|
|
|
|
//
|
|
// Conditions ...
|
|
struct XPVConditions
|
|
{
|
|
//
|
|
// Common ...
|
|
string symbol;
|
|
ENUM_TIMEFRAMES period;
|
|
datetime time;
|
|
|
|
//
|
|
// Buffers ...
|
|
double peaks[];
|
|
double vales[];
|
|
double resistances[];
|
|
double supports[];
|
|
double fib1s[];
|
|
double fib2s[];
|
|
double fib3s[];
|
|
double fib4s[];
|
|
double fib5s[];
|
|
double sCHHs[];
|
|
double sCLLs[];
|
|
double mCHHs[];
|
|
double mCLLs[];
|
|
double lCHHs[];
|
|
double lCLLs[];
|
|
double hCHHs[];
|
|
double hCLLs[];
|
|
|
|
//
|
|
// Conditions ...
|
|
|
|
//
|
|
bool isNewPeak;
|
|
bool isNewPeakOverLast;
|
|
bool isNewPeakUnderLast;
|
|
|
|
//
|
|
bool isNewVale;
|
|
bool isNewValeOverLast;
|
|
bool isNewValeUnderLast;
|
|
|
|
//
|
|
bool isFiboIncreased;
|
|
bool isFiboDecreased;
|
|
bool isFiboSectionChanged;
|
|
|
|
//
|
|
// SC ...
|
|
|
|
//
|
|
bool isSCBullish;
|
|
bool isSCHHBullish;
|
|
bool isSCLLBullish;
|
|
bool isSCSwitchedToBullish;
|
|
bool isSCHHSwitchedToBullish;
|
|
bool isSCLLSwitchedToBullish;
|
|
|
|
//
|
|
bool isSCBearish;
|
|
bool isSCHHBearish;
|
|
bool isSCLLBearish;
|
|
bool isSCSwitchedToBearish;
|
|
bool isSCHHSwitchedToBearish;
|
|
bool isSCLLSwitchedToBeraish;
|
|
|
|
//
|
|
// MC ...
|
|
|
|
//
|
|
bool isMCBullish;
|
|
bool isMCHHBullish;
|
|
bool isMCLLBullish;
|
|
bool isMCSwitchedToBullish;
|
|
bool isMCHHSwitchedToBullish;
|
|
bool isMCLLSwitchedToBullish;
|
|
|
|
//
|
|
bool isMCBearish;
|
|
bool isMCHHBearish;
|
|
bool isMCLLBearish;
|
|
bool isMCSwitchedToBearish;
|
|
bool isMCHHSwitchedToBearish;
|
|
bool isMCLLSwitchedToBeraish;
|
|
|
|
//
|
|
// LC ...
|
|
|
|
//
|
|
bool isLCBullish;
|
|
bool isLCHHBullish;
|
|
bool isLCLLBullish;
|
|
bool isLCSwitchedToBullish;
|
|
bool isLCHHSwitchedToBullish;
|
|
bool isLCLLSwitchedToBullish;
|
|
//
|
|
bool isLCBearish;
|
|
bool isLCHHBearish;
|
|
bool isLCLLBearish;
|
|
bool isLCSwitchedToBearish;
|
|
bool isLCHHSwitchedToBearish;
|
|
bool isLCLLSwitchedToBeraish;
|
|
|
|
//
|
|
// HC ...
|
|
|
|
//
|
|
bool isHCBullish;
|
|
bool isHCHHBullish;
|
|
bool isHCLLBullish;
|
|
bool isHCSwitchedToBullish;
|
|
bool isHCHHSwitchedToBullish;
|
|
bool isHCLLSwitchedToBullish;
|
|
|
|
//
|
|
bool isHCBearish;
|
|
bool isHCHHBearish;
|
|
bool isHCLLBearish;
|
|
bool isHCSwitchedToBearish;
|
|
bool isHCHHSwitchedToBearish;
|
|
bool isHCLLSwitchedToBeraish;
|
|
|
|
//
|
|
// Fibonachi Conditions ...
|
|
|
|
//
|
|
bool isCloseOverFib1;
|
|
bool isCloseOverFib2;
|
|
bool isCloseOverFib3;
|
|
bool isCloseOverFib4;
|
|
bool isCloseOverFib5;
|
|
|
|
//
|
|
bool isCloseUnderFib1;
|
|
bool isCloseUnderFib2;
|
|
bool isCloseUnderFib3;
|
|
bool isCloseUnderFib4;
|
|
bool isCloseUnderFib5;
|
|
|
|
//
|
|
bool isCloseCrossedOverFib1;
|
|
bool isCloseCrossedOverFib2;
|
|
bool isCloseCrossedOverFib3;
|
|
bool isCloseCrossedOverFib4;
|
|
bool isCloseCrossedOverFib5;
|
|
|
|
//
|
|
bool isCloseCrossedUnderFib1;
|
|
bool isCloseCrossedUnderFib2;
|
|
bool isCloseCrossedUnderFib3;
|
|
bool isCloseCrossedUnderFib4;
|
|
bool isCloseCrossedUnderFib5;
|
|
|
|
//
|
|
void Clean()
|
|
{
|
|
//
|
|
Clean(peaks);
|
|
Clean(vales);
|
|
Clean(resistances);
|
|
Clean(supports);
|
|
Clean(fib1s);
|
|
Clean(fib2s);
|
|
Clean(fib3s);
|
|
Clean(fib4s);
|
|
Clean(fib5s);
|
|
Clean(sCHHs);
|
|
Clean(sCLLs);
|
|
Clean(mCHHs);
|
|
Clean(mCLLs);
|
|
Clean(lCHHs);
|
|
Clean(lCLLs);
|
|
Clean(hCHHs);
|
|
Clean(hCLLs);
|
|
|
|
//
|
|
ArraySetAsSeries(peaks, true);
|
|
ArraySetAsSeries(vales, true);
|
|
ArraySetAsSeries(resistances, true);
|
|
ArraySetAsSeries(supports, true);
|
|
ArraySetAsSeries(fib1s, true);
|
|
ArraySetAsSeries(fib2s, true);
|
|
ArraySetAsSeries(fib3s, true);
|
|
ArraySetAsSeries(fib4s, true);
|
|
ArraySetAsSeries(fib5s, true);
|
|
ArraySetAsSeries(sCHHs, true);
|
|
ArraySetAsSeries(sCLLs, true);
|
|
ArraySetAsSeries(mCHHs, true);
|
|
ArraySetAsSeries(mCLLs, true);
|
|
ArraySetAsSeries(lCHHs, true);
|
|
ArraySetAsSeries(lCLLs, true);
|
|
ArraySetAsSeries(hCHHs, true);
|
|
ArraySetAsSeries(hCLLs, true);
|
|
|
|
//
|
|
isNewPeak = false;
|
|
isNewPeakOverLast = false;
|
|
isNewPeakUnderLast = false;
|
|
isNewVale = false;
|
|
isNewValeOverLast = false;
|
|
isNewValeUnderLast = false;
|
|
isFiboIncreased = false;
|
|
isFiboDecreased = false;
|
|
isFiboSectionChanged = false;
|
|
isCloseOverFib1 = false;
|
|
isCloseOverFib2 = false;
|
|
isCloseOverFib3 = false;
|
|
isCloseOverFib4 = false;
|
|
isCloseOverFib5 = false;
|
|
isCloseUnderFib1 = false;
|
|
isCloseUnderFib2 = false;
|
|
isCloseUnderFib3 = false;
|
|
isCloseUnderFib4 = false;
|
|
isCloseUnderFib5 = false;
|
|
isCloseCrossedOverFib1 = false;
|
|
isCloseCrossedOverFib2 = false;
|
|
isCloseCrossedOverFib3 = false;
|
|
isCloseCrossedOverFib4 = false;
|
|
isCloseCrossedOverFib5 = false;
|
|
isCloseCrossedUnderFib1 = false;
|
|
isCloseCrossedUnderFib2 = false;
|
|
isCloseCrossedUnderFib3 = false;
|
|
isCloseCrossedUnderFib4 = false;
|
|
isCloseCrossedUnderFib5 = false;
|
|
isSCBullish = false;
|
|
isSCHHBullish = false;
|
|
isSCLLBullish = false;
|
|
isSCSwitchedToBullish = false;
|
|
isSCHHSwitchedToBullish = false;
|
|
isSCLLSwitchedToBullish = false;
|
|
isSCBearish = false;
|
|
isSCHHBearish = false;
|
|
isSCLLBearish = false;
|
|
isSCSwitchedToBearish = false;
|
|
isSCHHSwitchedToBearish = false;
|
|
isSCLLSwitchedToBeraish = false;
|
|
isMCBullish = false;
|
|
isMCHHBullish = false;
|
|
isMCLLBullish = false;
|
|
isMCSwitchedToBullish = false;
|
|
isMCHHSwitchedToBullish = false;
|
|
isMCLLSwitchedToBullish = false;
|
|
isMCBearish = false;
|
|
isMCHHBearish = false;
|
|
isMCLLBearish = false;
|
|
isMCSwitchedToBearish = false;
|
|
isMCHHSwitchedToBearish = false;
|
|
isMCLLSwitchedToBeraish = false;
|
|
isLCBullish = false;
|
|
isLCHHBullish = false;
|
|
isLCLLBullish = false;
|
|
isLCSwitchedToBullish = false;
|
|
isLCHHSwitchedToBullish = false;
|
|
isLCLLSwitchedToBullish = false;
|
|
isLCBearish = false;
|
|
isLCHHBearish = false;
|
|
isLCLLBearish = false;
|
|
isLCSwitchedToBearish = false;
|
|
isLCHHSwitchedToBearish = false;
|
|
isLCLLSwitchedToBeraish = false;
|
|
isHCBullish = false;
|
|
isHCHHBullish = false;
|
|
isHCLLBullish = false;
|
|
isHCSwitchedToBullish = false;
|
|
isHCHHSwitchedToBullish = false;
|
|
isHCLLSwitchedToBullish = false;
|
|
isHCBearish = false;
|
|
isHCHHBearish = false;
|
|
isHCLLBearish = false;
|
|
isHCSwitchedToBearish = false;
|
|
isHCHHSwitchedToBearish = false;
|
|
isHCLLSwitchedToBeraish = false;
|
|
}
|
|
|
|
//
|
|
void GenerateScore(
|
|
double &bullishScore,
|
|
double &bearishScore //
|
|
)
|
|
{
|
|
//
|
|
bullishScore = 0;
|
|
bearishScore = 0;
|
|
|
|
//
|
|
if (isNewPeak)
|
|
{
|
|
}
|
|
if (isNewPeakOverLast)
|
|
{
|
|
}
|
|
if (isNewPeakUnderLast)
|
|
{
|
|
}
|
|
|
|
//
|
|
if (isNewVale)
|
|
{
|
|
}
|
|
if (isNewValeOverLast)
|
|
{
|
|
}
|
|
if (isNewValeUnderLast)
|
|
{
|
|
}
|
|
|
|
//
|
|
if (isFiboIncreased)
|
|
{
|
|
}
|
|
if (isFiboDecreased)
|
|
{
|
|
}
|
|
if (isFiboSectionChanged)
|
|
{
|
|
}
|
|
|
|
//
|
|
if (isSCBullish)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isSCHHBullish)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isSCLLBullish)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isSCSwitchedToBullish)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isSCHHSwitchedToBullish)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isSCLLSwitchedToBullish)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
|
|
//
|
|
if (isSCBearish)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isSCHHBearish)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isSCLLBearish)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isSCSwitchedToBearish)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isSCHHSwitchedToBearish)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isSCLLSwitchedToBeraish)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
|
|
//
|
|
if (isMCBullish)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isMCHHBullish)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isMCLLBullish)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isMCSwitchedToBullish)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isMCHHSwitchedToBullish)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isMCLLSwitchedToBullish)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
|
|
//
|
|
if (isMCBearish)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isMCHHBearish)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isMCLLBearish)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isMCSwitchedToBearish)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isMCHHSwitchedToBearish)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isMCLLSwitchedToBeraish)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
|
|
//
|
|
if (isLCBullish)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isLCHHBullish)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isLCLLBullish)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isLCSwitchedToBullish)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isLCHHSwitchedToBullish)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isLCLLSwitchedToBullish)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
|
|
//
|
|
if (isLCBearish)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isLCHHBearish)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isLCLLBearish)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isLCSwitchedToBearish)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isLCHHSwitchedToBearish)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isLCLLSwitchedToBeraish)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
|
|
if (isHCBullish)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isHCHHBullish)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isHCLLBullish)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isHCSwitchedToBullish)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isHCHHSwitchedToBullish)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
if (isHCLLSwitchedToBullish)
|
|
{
|
|
bullishScore++;
|
|
}
|
|
|
|
//
|
|
if (isHCBearish)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isHCHHBearish)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isHCLLBearish)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isHCSwitchedToBearish)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isHCHHSwitchedToBearish)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
if (isHCLLSwitchedToBeraish)
|
|
{
|
|
bearishScore++;
|
|
}
|
|
}
|
|
|
|
//
|
|
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("isNewPeak", isNewPeak, ignoreFalseConditions, separator) +
|
|
ToString("isNewPeakOverLast", isNewPeakOverLast, ignoreFalseConditions, separator) +
|
|
ToString("isNewPeakUnderLast", isNewPeakUnderLast, ignoreFalseConditions, separator) +
|
|
ToString("isNewVale", isNewVale, ignoreFalseConditions, separator) +
|
|
ToString("isNewValeOverLast", isNewValeOverLast, ignoreFalseConditions, separator) +
|
|
ToString("isNewValeUnderLast", isNewValeUnderLast, ignoreFalseConditions, separator) +
|
|
ToString("isFiboIncreased", isFiboIncreased, ignoreFalseConditions, separator) +
|
|
ToString("isFiboDecreased", isFiboDecreased, ignoreFalseConditions, separator) +
|
|
ToString("isFiboSectionChanged", isFiboSectionChanged, ignoreFalseConditions, separator) +
|
|
ToString("isCloseOverFib1", isCloseOverFib1, ignoreFalseConditions, separator) +
|
|
ToString("isCloseOverFib2", isCloseOverFib2, ignoreFalseConditions, separator) +
|
|
ToString("isCloseOverFib3", isCloseOverFib3, ignoreFalseConditions, separator) +
|
|
ToString("isCloseOverFib4", isCloseOverFib4, ignoreFalseConditions, separator) +
|
|
ToString("isCloseOverFib5", isCloseOverFib5, ignoreFalseConditions, separator) +
|
|
ToString("isCloseUnderFib1", isCloseUnderFib1, ignoreFalseConditions, separator) +
|
|
ToString("isCloseUnderFib2", isCloseUnderFib2, ignoreFalseConditions, separator) +
|
|
ToString("isCloseUnderFib3", isCloseUnderFib3, ignoreFalseConditions, separator) +
|
|
ToString("isCloseUnderFib4", isCloseUnderFib4, ignoreFalseConditions, separator) +
|
|
ToString("isCloseUnderFib5", isCloseUnderFib5, ignoreFalseConditions, separator) +
|
|
ToString("isCloseCrossedOverFib1", isCloseCrossedOverFib1, ignoreFalseConditions, separator) +
|
|
ToString("isCloseCrossedOverFib2", isCloseCrossedOverFib2, ignoreFalseConditions, separator) +
|
|
ToString("isCloseCrossedOverFib3", isCloseCrossedOverFib3, ignoreFalseConditions, separator) +
|
|
ToString("isCloseCrossedOverFib4", isCloseCrossedOverFib4, ignoreFalseConditions, separator) +
|
|
ToString("isCloseCrossedOverFib5", isCloseCrossedOverFib5, ignoreFalseConditions, separator) +
|
|
ToString("isCloseCrossedUnderFib1", isCloseCrossedUnderFib1, ignoreFalseConditions, separator) +
|
|
ToString("isCloseCrossedUnderFib2", isCloseCrossedUnderFib2, ignoreFalseConditions, separator) +
|
|
ToString("isCloseCrossedUnderFib3", isCloseCrossedUnderFib3, ignoreFalseConditions, separator) +
|
|
ToString("isCloseCrossedUnderFib4", isCloseCrossedUnderFib4, ignoreFalseConditions, separator) +
|
|
ToString("isCloseCrossedUnderFib5", isCloseCrossedUnderFib5, ignoreFalseConditions, separator) +
|
|
ToString("isSCBullish", isSCBullish, ignoreFalseConditions, separator) +
|
|
ToString("isSCHHBullish", isSCHHBullish, ignoreFalseConditions, separator) +
|
|
ToString("isSCLLBullish", isSCLLBullish, ignoreFalseConditions, separator) +
|
|
ToString("isSCSwitchedToBullish", isSCSwitchedToBullish, ignoreFalseConditions, separator) +
|
|
ToString("isSCHHSwitchedToBullish", isSCHHSwitchedToBullish, ignoreFalseConditions, separator) +
|
|
ToString("isSCLLSwitchedToBullish", isSCLLSwitchedToBullish, ignoreFalseConditions, separator) +
|
|
ToString("isSCBearish", isSCBearish, ignoreFalseConditions, separator) +
|
|
ToString("isSCHHBearish", isSCHHBearish, ignoreFalseConditions, separator) +
|
|
ToString("isSCLLBearish", isSCLLBearish, ignoreFalseConditions, separator) +
|
|
ToString("isSCSwitchedToBearish", isSCSwitchedToBearish, ignoreFalseConditions, separator) +
|
|
ToString("isSCHHSwitchedToBearish", isSCHHSwitchedToBearish, ignoreFalseConditions, separator) +
|
|
ToString("isSCLLSwitchedToBeraish", isSCLLSwitchedToBeraish, ignoreFalseConditions, separator) +
|
|
ToString("isMCBullish", isMCBullish, ignoreFalseConditions, separator) +
|
|
ToString("isMCHHBullish", isMCHHBullish, ignoreFalseConditions, separator) +
|
|
ToString("isMCLLBullish", isMCLLBullish, ignoreFalseConditions, separator) +
|
|
ToString("isMCSwitchedToBullish", isMCSwitchedToBullish, ignoreFalseConditions, separator) +
|
|
ToString("isMCHHSwitchedToBullish", isMCHHSwitchedToBullish, ignoreFalseConditions, separator) +
|
|
ToString("isMCLLSwitchedToBullish", isMCLLSwitchedToBullish, ignoreFalseConditions, separator) +
|
|
ToString("isMCBearish", isMCBearish, ignoreFalseConditions, separator) +
|
|
ToString("isMCHHBearish", isMCHHBearish, ignoreFalseConditions, separator) +
|
|
ToString("isMCLLBearish", isMCLLBearish, ignoreFalseConditions, separator) +
|
|
ToString("isMCSwitchedToBearish", isMCSwitchedToBearish, ignoreFalseConditions, separator) +
|
|
ToString("isMCHHSwitchedToBearish", isMCHHSwitchedToBearish, ignoreFalseConditions, separator) +
|
|
ToString("isMCLLSwitchedToBeraish", isMCLLSwitchedToBeraish, ignoreFalseConditions, separator) +
|
|
ToString("isLCBullish", isLCBullish, ignoreFalseConditions, separator) +
|
|
ToString("isLCHHBullish", isLCHHBullish, ignoreFalseConditions, separator) +
|
|
ToString("isLCLLBullish", isLCLLBullish, ignoreFalseConditions, separator) +
|
|
ToString("isLCSwitchedToBullish", isLCSwitchedToBullish, ignoreFalseConditions, separator) +
|
|
ToString("isLCHHSwitchedToBullish", isLCHHSwitchedToBullish, ignoreFalseConditions, separator) +
|
|
ToString("isLCLLSwitchedToBullish", isLCLLSwitchedToBullish, ignoreFalseConditions, separator) +
|
|
ToString("isLCBearish", isLCBearish, ignoreFalseConditions, separator) +
|
|
ToString("isLCHHBearish", isLCHHBearish, ignoreFalseConditions, separator) +
|
|
ToString("isLCLLBearish", isLCLLBearish, ignoreFalseConditions, separator) +
|
|
ToString("isLCSwitchedToBearish", isLCSwitchedToBearish, ignoreFalseConditions, separator) +
|
|
ToString("isLCHHSwitchedToBearish", isLCHHSwitchedToBearish, ignoreFalseConditions, separator) +
|
|
ToString("isLCLLSwitchedToBeraish", isLCLLSwitchedToBeraish, ignoreFalseConditions, separator) +
|
|
ToString("isHCBullish", isHCBullish, ignoreFalseConditions, separator) +
|
|
ToString("isHCHHBullish", isHCHHBullish, ignoreFalseConditions, separator) +
|
|
ToString("isHCLLBullish", isHCLLBullish, ignoreFalseConditions, separator) +
|
|
ToString("isHCSwitchedToBullish", isHCSwitchedToBullish, ignoreFalseConditions, separator) +
|
|
ToString("isHCHHSwitchedToBullish", isHCHHSwitchedToBullish, ignoreFalseConditions, separator) +
|
|
ToString("isHCLLSwitchedToBullish", isHCLLSwitchedToBullish, ignoreFalseConditions, separator) +
|
|
ToString("isHCBearish", isHCBearish, ignoreFalseConditions, separator) +
|
|
ToString("isHCHHBearish", isHCHHBearish, ignoreFalseConditions, separator) +
|
|
ToString("isHCLLBearish", isHCLLBearish, ignoreFalseConditions, separator) +
|
|
ToString("isHCSwitchedToBearish", isHCSwitchedToBearish, ignoreFalseConditions, separator) +
|
|
ToString("isHCHHSwitchedToBearish", isHCHHSwitchedToBearish, ignoreFalseConditions, separator) +
|
|
ToString("isHCLLSwitchedToBeraish", isHCLLSwitchedToBeraish, ignoreFalseConditions, separator) +
|
|
//
|
|
""
|
|
//
|
|
;
|
|
|
|
//
|
|
result =
|
|
//
|
|
"[" + GetTag() + "]" + separator +
|
|
(onlyConditions
|
|
? ""
|
|
: commonStr) +
|
|
(!includeScores
|
|
? ""
|
|
: scoresStr) +
|
|
" " + separator +
|
|
(onlyCommons
|
|
? ""
|
|
: conditionsStr) +
|
|
""
|
|
//
|
|
;
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
string GetTag()
|
|
{
|
|
return "XPV";
|
|
}
|
|
};
|
|
|
|
//
|
|
// Class ...
|
|
class XSCXPVHelper : public XSCBaseHelper
|
|
{
|
|
//
|
|
// Public ...
|
|
public:
|
|
//
|
|
// Props ...
|
|
|
|
//
|
|
// Constructors ...
|
|
XSCXPVHelper() : XSCBaseHelper(_Symbol, _Period)
|
|
{
|
|
}
|
|
|
|
//
|
|
// Deconstructor ...
|
|
~XSCXPVHelper()
|
|
{
|
|
//
|
|
Clean(fib1Buffer);
|
|
Clean(fib2Buffer);
|
|
Clean(fib3Buffer);
|
|
Clean(fib4Buffer);
|
|
Clean(fib5Buffer);
|
|
Clean(scHHBuffer);
|
|
Clean(scLLBuffer);
|
|
Clean(mcHHBuffer);
|
|
Clean(mcLLBuffer);
|
|
Clean(lcHHBuffer);
|
|
Clean(lcLLBuffer);
|
|
Clean(hcHHBuffer);
|
|
Clean(hcLLBuffer);
|
|
Clean(peaksBuffer);
|
|
Clean(valesBuffer);
|
|
Clean(supportBuffer);
|
|
Clean(resistanceBuffer);
|
|
}
|
|
|
|
//
|
|
// Tools ...
|
|
bool Init(
|
|
string symbol, // Trading Symbol
|
|
ENUM_TIMEFRAMES period, // Trading Period
|
|
XPVInputs &inputs // Inputs
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
mSymbol = symbol;
|
|
mPeriod = period;
|
|
|
|
//
|
|
result = inputs.IsValid();
|
|
if (!result)
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
mInputs = inputs;
|
|
|
|
//
|
|
ArraySetAsSeries(peaksBuffer, true);
|
|
ArraySetAsSeries(valesBuffer, true);
|
|
ArraySetAsSeries(resistanceBuffer, true);
|
|
ArraySetAsSeries(supportBuffer, true);
|
|
ArraySetAsSeries(fib1Buffer, true);
|
|
ArraySetAsSeries(fib2Buffer, true);
|
|
ArraySetAsSeries(fib3Buffer, true);
|
|
ArraySetAsSeries(fib4Buffer, true);
|
|
ArraySetAsSeries(fib5Buffer, true);
|
|
ArraySetAsSeries(scHHBuffer, true);
|
|
ArraySetAsSeries(scLLBuffer, true);
|
|
ArraySetAsSeries(mcHHBuffer, true);
|
|
ArraySetAsSeries(mcLLBuffer, true);
|
|
ArraySetAsSeries(lcHHBuffer, true);
|
|
ArraySetAsSeries(lcLLBuffer, true);
|
|
ArraySetAsSeries(hcHHBuffer, true);
|
|
ArraySetAsSeries(hcLLBuffer, true);
|
|
|
|
//
|
|
mHandler = iCustom(
|
|
mSymbol,
|
|
mPeriod,
|
|
"x-saherelm.xpv",
|
|
//
|
|
// Inputs ...
|
|
//
|
|
// Makret Cycles ...
|
|
"",
|
|
//
|
|
// Short ...
|
|
"",
|
|
mInputs.scMethod, // How to Find Period
|
|
mInputs.scPeriod, // Time Period
|
|
//
|
|
// Medium ...
|
|
"",
|
|
mInputs.mcMethod, // How to Find Period
|
|
mInputs.mcPeriod, // Time Period
|
|
//
|
|
// Long ...
|
|
"",
|
|
mInputs.lcMethod, // How to Find Period
|
|
mInputs.lcPeriod, // Time Period
|
|
//
|
|
// Hind ...
|
|
"",
|
|
mInputs.hcMethod, // How to Find Period
|
|
mInputs.hcPeriod, // Time Period
|
|
//
|
|
// Fibonacci ...
|
|
"",
|
|
mInputs.fiboLevel1, // Fibio 1st Level
|
|
mInputs.fiboLevel2, // Fibio 2st Level
|
|
mInputs.fiboLevel3, // Fibio 3rd Level
|
|
mInputs.fiboLevel4, // Fibio 4th Level
|
|
mInputs.fiboLevel5, // Fibio 5th Level
|
|
//
|
|
// Boundary Detection Modes ...
|
|
"",
|
|
mInputs.hhMode, // Highest High Calculation Method
|
|
mInputs.llMode, // Lowest Low Calculation Method
|
|
//
|
|
// Presentation ...
|
|
"",
|
|
mInputs.showPeaksAndVales, // Show Peaks and Vales
|
|
mInputs.showLevels, // Show Levels
|
|
mInputs.showConsolidations, // Show Consolidations
|
|
mInputs.showFibo1Levels, // Show Fibo 1st Level
|
|
mInputs.showFibo2Levels, // Show Fibo 2nd Level
|
|
mInputs.showFibo3Levels, // Show Fibo 3rd Level
|
|
mInputs.showFibo4Levels, // Show Fibo 4th Level
|
|
mInputs.showFibo5Levels // Show Fibo 5th Level
|
|
//
|
|
);
|
|
result = mHandler != INVALID_HANDLE;
|
|
if (!result)
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Inputs ...
|
|
|
|
//
|
|
XPVInputs GetInputs()
|
|
{
|
|
return mInputs;
|
|
}
|
|
|
|
//
|
|
bool SetInputs(
|
|
XPVInputs &inputs // Configs
|
|
)
|
|
{
|
|
//
|
|
return Init(
|
|
mSymbol,
|
|
mPeriod,
|
|
inputs
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// Buffers ...
|
|
|
|
//
|
|
// 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];
|
|
}
|
|
|
|
//
|
|
// Copy Required Items ...
|
|
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
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
bool IsSamePeak(
|
|
int barIndex, // Start Bar Index
|
|
int verifier = 71 // Number of Verifiers
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
return IsSame(
|
|
peaksBuffer,
|
|
verifier,
|
|
barIndex //
|
|
);
|
|
}
|
|
|
|
//
|
|
// 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];
|
|
}
|
|
|
|
//
|
|
// Copy Required Items ...
|
|
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
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
bool IsSameVale(
|
|
int barIndex, // Start Bar Index
|
|
int verifier = 71 // Number of Verifiers
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
return IsSame(
|
|
valesBuffer,
|
|
verifier,
|
|
barIndex //
|
|
);
|
|
}
|
|
|
|
//
|
|
// Resistance ...
|
|
|
|
//
|
|
double GetResistance(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
int count = ArraySize(resistanceBuffer);
|
|
if (barIndex >= count)
|
|
{
|
|
barIndex = count - 1;
|
|
}
|
|
|
|
//
|
|
return resistanceBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Items ...
|
|
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,
|
|
resistanceBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// Support ...
|
|
|
|
//
|
|
double GetSupport(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
int count = ArraySize(supportBuffer);
|
|
if (barIndex >= count)
|
|
{
|
|
barIndex = count - 1;
|
|
}
|
|
|
|
//
|
|
return supportBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Items ...
|
|
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,
|
|
supportBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
// Fibonacci ...
|
|
|
|
//
|
|
// Level 1 ...
|
|
|
|
//
|
|
double GetFib1(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
int count = ArraySize(fib1Buffer);
|
|
if (barIndex >= count)
|
|
{
|
|
barIndex = count - 1;
|
|
}
|
|
|
|
//
|
|
return fib1Buffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Items ...
|
|
int CopyFib1(
|
|
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,
|
|
fib1Buffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
bool IsSameFib1(
|
|
int barIndex, // Start Bar Index
|
|
int verifier = 71 // Number of Verifiers
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
return IsSame(
|
|
fib1Buffer,
|
|
verifier,
|
|
barIndex //
|
|
);
|
|
}
|
|
|
|
//
|
|
// Level 2 ...
|
|
|
|
//
|
|
double GetFib2(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
int count = ArraySize(fib2Buffer);
|
|
if (barIndex >= count)
|
|
{
|
|
barIndex = count - 1;
|
|
}
|
|
|
|
//
|
|
return fib2Buffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Items ...
|
|
int CopyFib2(
|
|
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,
|
|
fib2Buffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
bool IsSameFib2(
|
|
int barIndex, // Start Bar Index
|
|
int verifier = 71 // Number of Verifiers
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
return IsSame(
|
|
fib2Buffer,
|
|
verifier,
|
|
barIndex //
|
|
);
|
|
}
|
|
|
|
//
|
|
// Level 3 ...
|
|
|
|
//
|
|
double GetFib3(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
int count = ArraySize(fib3Buffer);
|
|
if (barIndex >= count)
|
|
{
|
|
barIndex = count - 1;
|
|
}
|
|
|
|
//
|
|
return fib3Buffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Items ...
|
|
int CopyFib3(
|
|
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,
|
|
fib3Buffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
bool IsSameFib3(
|
|
int barIndex, // Start Bar Index
|
|
int verifier = 71 // Number of Verifiers
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
return IsSame(
|
|
fib3Buffer,
|
|
verifier,
|
|
barIndex //
|
|
);
|
|
}
|
|
|
|
//
|
|
// Level 4 ...
|
|
|
|
//
|
|
double GetFib4(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
int count = ArraySize(fib4Buffer);
|
|
if (barIndex >= count)
|
|
{
|
|
barIndex = count - 1;
|
|
}
|
|
|
|
//
|
|
return fib4Buffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Items ...
|
|
int CopyFib4(
|
|
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,
|
|
fib4Buffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
bool IsSameFib4(
|
|
int barIndex, // Start Bar Index
|
|
int verifier = 71 // Number of Verifiers
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
return IsSame(
|
|
fib4Buffer,
|
|
verifier,
|
|
barIndex //
|
|
);
|
|
}
|
|
|
|
//
|
|
// Level 5 ...
|
|
|
|
//
|
|
double GetFib5(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
int count = ArraySize(fib5Buffer);
|
|
if (barIndex >= count)
|
|
{
|
|
barIndex = count - 1;
|
|
}
|
|
|
|
//
|
|
return fib5Buffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Items ...
|
|
int CopyFib5(
|
|
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,
|
|
fib5Buffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
bool IsSameFib5(
|
|
int barIndex, // Start Bar Index
|
|
int verifier = 71 // Number of Verifiers
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
return IsSame(
|
|
fib5Buffer,
|
|
verifier,
|
|
barIndex //
|
|
);
|
|
}
|
|
|
|
//
|
|
// Cycles ...
|
|
|
|
//
|
|
// Short ...
|
|
|
|
//
|
|
// HH ...
|
|
|
|
//
|
|
double GetSCHH(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
int count = ArraySize(scHHBuffer);
|
|
if (barIndex >= count)
|
|
{
|
|
barIndex = count - 1;
|
|
}
|
|
|
|
//
|
|
return scHHBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Items ...
|
|
int CopySCHH(
|
|
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,
|
|
scHHBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
bool IsSameSCHH(
|
|
int barIndex, // Start Bar Index
|
|
int verifier = 71 // Number of Verifiers
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
return IsSame(
|
|
scHHBuffer,
|
|
verifier,
|
|
barIndex //
|
|
);
|
|
}
|
|
|
|
//
|
|
// LL ...
|
|
|
|
//
|
|
double GetSCLL(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
int count = ArraySize(scLLBuffer);
|
|
if (barIndex >= count)
|
|
{
|
|
barIndex = count - 1;
|
|
}
|
|
|
|
//
|
|
return scLLBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Items ...
|
|
int CopySCLL(
|
|
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,
|
|
scLLBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
bool IsSameSCLL(
|
|
int barIndex, // Start Bar Index
|
|
int verifier = 71 // Number of Verifiers
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
return IsSame(
|
|
scLLBuffer,
|
|
verifier,
|
|
barIndex //
|
|
);
|
|
}
|
|
|
|
//
|
|
// Medium ...
|
|
|
|
//
|
|
// HH ...
|
|
|
|
//
|
|
double GetMCHH(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
int count = ArraySize(mcHHBuffer);
|
|
if (barIndex >= count)
|
|
{
|
|
barIndex = count - 1;
|
|
}
|
|
|
|
//
|
|
return mcHHBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Items ...
|
|
int CopyMCHH(
|
|
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,
|
|
mcHHBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
bool IsSameMCHH(
|
|
int barIndex, // Start Bar Index
|
|
int verifier = 71 // Number of Verifiers
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
return IsSame(
|
|
mcHHBuffer,
|
|
verifier,
|
|
barIndex //
|
|
);
|
|
}
|
|
|
|
//
|
|
// LL ...
|
|
|
|
//
|
|
double GetMCLL(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
int count = ArraySize(mcLLBuffer);
|
|
if (barIndex >= count)
|
|
{
|
|
barIndex = count - 1;
|
|
}
|
|
|
|
//
|
|
return mcLLBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Items ...
|
|
int CopyMCLL(
|
|
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,
|
|
mcLLBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
bool IsSameMCLL(
|
|
int barIndex, // Start Bar Index
|
|
int verifier = 71 // Number of Verifiers
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
return IsSame(
|
|
mcLLBuffer,
|
|
verifier,
|
|
barIndex //
|
|
);
|
|
}
|
|
|
|
//
|
|
// Long ...
|
|
|
|
//
|
|
// HH ...
|
|
|
|
//
|
|
double GetLCHH(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
int count = ArraySize(lcHHBuffer);
|
|
if (barIndex >= count)
|
|
{
|
|
barIndex = count - 1;
|
|
}
|
|
|
|
//
|
|
return lcHHBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Items ...
|
|
int CopyLCHH(
|
|
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,
|
|
lcHHBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
bool IsSameLCHH(
|
|
int barIndex, // Start Bar Index
|
|
int verifier = 71 // Number of Verifiers
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
return IsSame(
|
|
lcHHBuffer,
|
|
verifier,
|
|
barIndex //
|
|
);
|
|
}
|
|
|
|
//
|
|
// LL ...
|
|
|
|
//
|
|
double GetLCLL(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
int count = ArraySize(lcLLBuffer);
|
|
if (barIndex >= count)
|
|
{
|
|
barIndex = count - 1;
|
|
}
|
|
|
|
//
|
|
return lcLLBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Items ...
|
|
int CopyLCLL(
|
|
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,
|
|
lcLLBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
bool IsSameLCLL(
|
|
int barIndex, // Start Bar Index
|
|
int verifier = 71 // Number of Verifiers
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
return IsSame(
|
|
lcLLBuffer,
|
|
verifier,
|
|
barIndex //
|
|
);
|
|
}
|
|
|
|
//
|
|
// Hind ...
|
|
|
|
//
|
|
// HH ...
|
|
|
|
//
|
|
double GetHCHH(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
int count = ArraySize(hcHHBuffer);
|
|
if (barIndex >= count)
|
|
{
|
|
barIndex = count - 1;
|
|
}
|
|
|
|
//
|
|
return hcHHBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Items ...
|
|
int CopyHCHH(
|
|
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,
|
|
hcHHBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
bool IsSameHCHH(
|
|
int barIndex, // Start Bar Index
|
|
int verifier = 71 // Number of Verifiers
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
return IsSame(
|
|
hcHHBuffer,
|
|
verifier,
|
|
barIndex //
|
|
);
|
|
}
|
|
|
|
//
|
|
// LL ...
|
|
|
|
//
|
|
double GetHCLL(
|
|
int barIndex // Bar Index
|
|
)
|
|
{
|
|
//
|
|
if (barIndex < 0)
|
|
{
|
|
barIndex = 0;
|
|
}
|
|
|
|
//
|
|
Calculate();
|
|
|
|
//
|
|
int count = ArraySize(hcLLBuffer);
|
|
if (barIndex >= count)
|
|
{
|
|
barIndex = count - 1;
|
|
}
|
|
|
|
//
|
|
return hcLLBuffer[barIndex];
|
|
}
|
|
|
|
//
|
|
// Copy Required Items ...
|
|
int CopyHCLL(
|
|
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,
|
|
hcLLBuffer,
|
|
buffer,
|
|
forceClean
|
|
//
|
|
);
|
|
}
|
|
|
|
//
|
|
bool IsSameHCLL(
|
|
int barIndex, // Start Bar Index
|
|
int verifier = 71 // Number of Verifiers
|
|
)
|
|
{
|
|
//
|
|
// Update Calculations ...
|
|
Calculate();
|
|
|
|
//
|
|
return IsSame(
|
|
hcLLBuffer,
|
|
verifier,
|
|
barIndex //
|
|
);
|
|
}
|
|
|
|
//
|
|
bool GetConditions(
|
|
XPVConditions &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;
|
|
|
|
//
|
|
// Buffers ...
|
|
|
|
//
|
|
CopyPeak(
|
|
zIndex,
|
|
loopback,
|
|
conditions.peaks //
|
|
);
|
|
|
|
//
|
|
CopyVale(
|
|
zIndex,
|
|
loopback,
|
|
conditions.vales //
|
|
);
|
|
|
|
//
|
|
CopySupport(
|
|
zIndex,
|
|
loopback,
|
|
conditions.supports //
|
|
);
|
|
|
|
//
|
|
CopyResistance(
|
|
zIndex,
|
|
loopback,
|
|
conditions.resistances //
|
|
);
|
|
|
|
//
|
|
CopyFib1(
|
|
zIndex,
|
|
loopback,
|
|
conditions.fib1s //
|
|
);
|
|
|
|
//
|
|
CopyFib2(
|
|
zIndex,
|
|
loopback,
|
|
conditions.fib2s //
|
|
);
|
|
|
|
//
|
|
CopyFib3(
|
|
zIndex,
|
|
loopback,
|
|
conditions.fib3s //
|
|
);
|
|
|
|
//
|
|
CopyFib4(
|
|
zIndex,
|
|
loopback,
|
|
conditions.fib4s //
|
|
);
|
|
|
|
//
|
|
CopyFib5(
|
|
zIndex,
|
|
loopback,
|
|
conditions.fib5s //
|
|
);
|
|
|
|
//
|
|
CopySCHH(
|
|
zIndex,
|
|
loopback,
|
|
conditions.sCHHs //
|
|
);
|
|
|
|
//
|
|
CopySCLL(
|
|
zIndex,
|
|
loopback,
|
|
conditions.sCLLs //
|
|
);
|
|
|
|
//
|
|
CopyMCHH(
|
|
zIndex,
|
|
loopback,
|
|
conditions.mCHHs //
|
|
);
|
|
|
|
//
|
|
CopyMCLL(
|
|
zIndex,
|
|
loopback,
|
|
conditions.mCLLs //
|
|
);
|
|
|
|
//
|
|
CopyLCHH(
|
|
zIndex,
|
|
loopback,
|
|
conditions.lCHHs //
|
|
);
|
|
|
|
//
|
|
CopyLCLL(
|
|
zIndex,
|
|
loopback,
|
|
conditions.lCLLs //
|
|
);
|
|
|
|
//
|
|
CopyHCHH(
|
|
zIndex,
|
|
loopback,
|
|
conditions.hCHHs //
|
|
);
|
|
|
|
//
|
|
CopyHCLL(
|
|
zIndex,
|
|
loopback,
|
|
conditions.hCLLs //
|
|
);
|
|
|
|
//
|
|
// Conditions ...
|
|
|
|
//
|
|
bool isNewPeak = conditions.peaks[cIndex] != conditions.peaks[pIndex];
|
|
bool isNewPeakOverLast = isNewPeak &&
|
|
conditions.peaks[cIndex] > conditions.peaks[pIndex];
|
|
bool isNewPeakUnderLast = isNewPeak &&
|
|
conditions.peaks[cIndex] < conditions.peaks[pIndex];
|
|
|
|
//
|
|
bool isNewVale = conditions.vales[cIndex] != conditions.vales[pIndex];
|
|
bool isNewValeOverLast = isNewVale &&
|
|
conditions.vales[cIndex] > conditions.vales[pIndex];
|
|
bool isNewValeUnderLast = isNewVale &&
|
|
conditions.vales[cIndex] < conditions.vales[pIndex];
|
|
|
|
//
|
|
bool isFiboIncreased =
|
|
//
|
|
conditions.fib1s[cIndex] > conditions.fib1s[pIndex] &&
|
|
conditions.fib2s[cIndex] > conditions.fib2s[pIndex] &&
|
|
conditions.fib3s[cIndex] > conditions.fib3s[pIndex] &&
|
|
conditions.fib4s[cIndex] > conditions.fib4s[pIndex] &&
|
|
conditions.fib5s[cIndex] > conditions.fib5s[pIndex]
|
|
//
|
|
;
|
|
bool isFiboDecreased =
|
|
//
|
|
conditions.fib1s[cIndex] < conditions.fib1s[pIndex] &&
|
|
conditions.fib2s[cIndex] < conditions.fib2s[pIndex] &&
|
|
conditions.fib3s[cIndex] < conditions.fib3s[pIndex] &&
|
|
conditions.fib4s[cIndex] < conditions.fib4s[pIndex] &&
|
|
conditions.fib5s[cIndex] < conditions.fib5s[pIndex]
|
|
//
|
|
;
|
|
bool isFiboSectionChanged =
|
|
//
|
|
(isFiboDecreased &&
|
|
isNewPeakUnderLast)
|
|
//
|
|
||
|
|
//
|
|
(isFiboIncreased &&
|
|
isNewValeOverLast)
|
|
//
|
|
;
|
|
|
|
//
|
|
// SC ...
|
|
|
|
//
|
|
bool isSCHHBullish = conditions.sCHHs[cIndex] > conditions.sCHHs[pIndex];
|
|
bool isSCLLBullish = conditions.sCLLs[cIndex] > conditions.sCLLs[pIndex];
|
|
|
|
//
|
|
bool isSCHHBullishPrev = conditions.sCHHs[pIndex] > conditions.sCHHs[ppIndex];
|
|
bool isSCLLBullishPrev = conditions.sCLLs[pIndex] > conditions.sCLLs[ppIndex];
|
|
|
|
//
|
|
bool isSCBullish = isSCHHBullish &&
|
|
isSCLLBullish;
|
|
|
|
//
|
|
bool isSCBullishPrev = isSCHHBullishPrev &&
|
|
isSCLLBullishPrev;
|
|
|
|
//
|
|
bool isSCHHSwitchedToBullish = isSCHHBullish &&
|
|
!isSCHHBullishPrev;
|
|
bool isSCLLSwitchedToBullish = isSCLLBullish &&
|
|
!isSCLLBullishPrev;
|
|
|
|
//
|
|
bool isSCHHBearish = conditions.sCHHs[cIndex] < conditions.sCHHs[pIndex];
|
|
bool isSCLLBearish = conditions.sCLLs[cIndex] < conditions.sCLLs[pIndex];
|
|
|
|
//
|
|
bool isSCHHBearishPrev = conditions.sCHHs[pIndex] < conditions.sCHHs[ppIndex];
|
|
bool isSCLLBearishPrev = conditions.sCLLs[pIndex] < conditions.sCLLs[ppIndex];
|
|
|
|
//
|
|
bool isSCBearish = isSCHHBearish &&
|
|
isSCLLBearish;
|
|
|
|
//
|
|
bool isSCBearishPrev = isSCHHBearishPrev &&
|
|
isSCLLBearishPrev;
|
|
|
|
//
|
|
bool isSCHHSwitchedToBearish = isSCHHBearish &&
|
|
!isSCHHBearishPrev;
|
|
bool isSCLLSwitchedToBeraish = isSCLLBearish &&
|
|
!isSCLLBearishPrev;
|
|
|
|
//
|
|
bool isSCSwitchedToBullish =
|
|
//
|
|
(isSCHHSwitchedToBullish &&
|
|
!isSCLLBearish)
|
|
//
|
|
||
|
|
//
|
|
(isSCLLSwitchedToBullish &&
|
|
!isSCHHBearish)
|
|
//
|
|
;
|
|
|
|
//
|
|
bool isSCSwitchedToBearish =
|
|
//
|
|
(isSCHHSwitchedToBearish &&
|
|
!isSCLLBullish)
|
|
//
|
|
||
|
|
//
|
|
(isSCLLSwitchedToBeraish &&
|
|
!isSCHHBullish)
|
|
//
|
|
;
|
|
|
|
//
|
|
// MC ...
|
|
|
|
//
|
|
bool isMCHHBullish = conditions.mCHHs[cIndex] > conditions.mCHHs[pIndex];
|
|
bool isMCLLBullish = conditions.mCLLs[cIndex] > conditions.mCLLs[pIndex];
|
|
|
|
//
|
|
bool isMCHHBullishPrev = conditions.mCHHs[pIndex] > conditions.mCHHs[ppIndex];
|
|
bool isMCLLBullishPrev = conditions.mCLLs[pIndex] > conditions.mCLLs[ppIndex];
|
|
|
|
//
|
|
bool isMCBullish = isMCHHBullish &&
|
|
isMCLLBullish;
|
|
|
|
//
|
|
bool isMCBullishPrev = isMCHHBullishPrev &&
|
|
isMCLLBullishPrev;
|
|
|
|
//
|
|
bool isMCHHSwitchedToBullish = isMCHHBullish &&
|
|
!isMCHHBullishPrev;
|
|
bool isMCLLSwitchedToBullish = isMCLLBullish &&
|
|
!isMCLLBullishPrev;
|
|
|
|
//
|
|
bool isMCHHBearish = conditions.mCHHs[cIndex] < conditions.mCHHs[pIndex];
|
|
bool isMCLLBearish = conditions.mCLLs[cIndex] < conditions.mCLLs[pIndex];
|
|
|
|
//
|
|
bool isMCHHBearishPrev = conditions.mCHHs[pIndex] < conditions.mCHHs[ppIndex];
|
|
bool isMCLLBearishPrev = conditions.mCLLs[pIndex] < conditions.mCLLs[ppIndex];
|
|
|
|
//
|
|
bool isMCBearish = isMCHHBearish &&
|
|
isMCLLBearish;
|
|
|
|
//
|
|
bool isMCBearishPrev = isMCHHBearishPrev &&
|
|
isMCLLBearishPrev;
|
|
|
|
//
|
|
bool isMCHHSwitchedToBearish = isMCHHBearish &&
|
|
!isMCHHBearishPrev;
|
|
bool isMCLLSwitchedToBeraish = isMCLLBearish &&
|
|
!isMCLLBearishPrev;
|
|
|
|
//
|
|
bool isMCSwitchedToBullish =
|
|
//
|
|
(isMCHHSwitchedToBullish &&
|
|
!isMCLLBearish)
|
|
//
|
|
||
|
|
//
|
|
(isMCLLSwitchedToBullish &&
|
|
!isMCHHBearish)
|
|
//
|
|
;
|
|
|
|
//
|
|
bool isMCSwitchedToBearish =
|
|
//
|
|
(isMCHHSwitchedToBearish &&
|
|
!isMCLLBullish)
|
|
//
|
|
||
|
|
//
|
|
(isMCLLSwitchedToBeraish &&
|
|
!isMCHHBullish)
|
|
//
|
|
;
|
|
|
|
//
|
|
// LC ...
|
|
|
|
//
|
|
bool isLCHHBullish = conditions.lCHHs[cIndex] > conditions.lCHHs[pIndex];
|
|
bool isLCLLBullish = conditions.lCLLs[cIndex] > conditions.lCLLs[pIndex];
|
|
|
|
//
|
|
bool isLCHHBullishPrev = conditions.lCHHs[pIndex] > conditions.lCHHs[ppIndex];
|
|
bool isLCLLBullishPrev = conditions.lCLLs[pIndex] > conditions.lCLLs[ppIndex];
|
|
|
|
//
|
|
bool isLCBullish = isLCHHBullish &&
|
|
isLCLLBullish;
|
|
|
|
//
|
|
bool isLCBullishPrev = isLCHHBullishPrev &&
|
|
isLCLLBullishPrev;
|
|
|
|
//
|
|
bool isLCHHSwitchedToBullish = isLCHHBullish &&
|
|
!isLCHHBullishPrev;
|
|
bool isLCLLSwitchedToBullish = isLCLLBullish &&
|
|
!isLCLLBullishPrev;
|
|
|
|
//
|
|
bool isLCHHBearish = conditions.lCHHs[cIndex] < conditions.lCHHs[pIndex];
|
|
bool isLCLLBearish = conditions.lCLLs[cIndex] < conditions.lCLLs[pIndex];
|
|
|
|
//
|
|
bool isLCHHBearishPrev = conditions.lCHHs[pIndex] < conditions.lCHHs[ppIndex];
|
|
bool isLCLLBearishPrev = conditions.lCLLs[pIndex] < conditions.lCLLs[ppIndex];
|
|
|
|
//
|
|
bool isLCBearish = isLCHHBearish &&
|
|
isLCLLBearish;
|
|
|
|
//
|
|
bool isLCBearishPrev = isLCHHBearishPrev &&
|
|
isLCLLBearishPrev;
|
|
|
|
//
|
|
bool isLCHHSwitchedToBearish = isLCHHBearish &&
|
|
!isLCHHBearishPrev;
|
|
bool isLCLLSwitchedToBeraish = isLCLLBearish &&
|
|
!isLCLLBearishPrev;
|
|
|
|
//
|
|
bool isLCSwitchedToBullish =
|
|
//
|
|
(isLCHHSwitchedToBullish &&
|
|
!isLCLLBearish)
|
|
//
|
|
||
|
|
//
|
|
(isLCLLSwitchedToBullish &&
|
|
!isLCHHBearish)
|
|
//
|
|
;
|
|
|
|
//
|
|
bool isLCSwitchedToBearish =
|
|
//
|
|
(isLCHHSwitchedToBearish &&
|
|
!isLCLLBullish)
|
|
//
|
|
||
|
|
//
|
|
(isLCLLSwitchedToBeraish &&
|
|
!isLCHHBullish)
|
|
//
|
|
;
|
|
|
|
//
|
|
// HC ...
|
|
|
|
//
|
|
bool isHCHHBullish = conditions.hCHHs[cIndex] > conditions.hCHHs[pIndex];
|
|
bool isHCLLBullish = conditions.hCLLs[cIndex] > conditions.hCLLs[pIndex];
|
|
|
|
//
|
|
bool isHCHHBullishPrev = conditions.hCHHs[pIndex] > conditions.hCHHs[ppIndex];
|
|
bool isHCLLBullishPrev = conditions.hCLLs[pIndex] > conditions.hCLLs[ppIndex];
|
|
|
|
//
|
|
bool isHCBullish = isHCHHBullish &&
|
|
isHCLLBullish;
|
|
|
|
//
|
|
bool isHCBullishPrev = isHCHHBullishPrev &&
|
|
isHCLLBullishPrev;
|
|
|
|
//
|
|
bool isHCHHSwitchedToBullish = isHCHHBullish &&
|
|
!isHCHHBullishPrev;
|
|
bool isHCLLSwitchedToBullish = isHCLLBullish &&
|
|
!isHCLLBullishPrev;
|
|
|
|
//
|
|
bool isHCHHBearish = conditions.hCHHs[cIndex] < conditions.hCHHs[pIndex];
|
|
bool isHCLLBearish = conditions.hCLLs[cIndex] < conditions.hCLLs[pIndex];
|
|
|
|
//
|
|
bool isHCHHBearishPrev = conditions.hCHHs[pIndex] < conditions.hCHHs[ppIndex];
|
|
bool isHCLLBearishPrev = conditions.hCLLs[pIndex] < conditions.hCLLs[ppIndex];
|
|
|
|
//
|
|
bool isHCBearish = isHCHHBearish &&
|
|
isHCLLBearish;
|
|
|
|
//
|
|
bool isHCBearishPrev = isHCHHBearishPrev &&
|
|
isHCLLBearishPrev;
|
|
|
|
//
|
|
bool isHCHHSwitchedToBearish = isHCHHBearish &&
|
|
!isHCHHBearishPrev;
|
|
bool isHCLLSwitchedToBeraish = isHCLLBearish &&
|
|
!isHCLLBearishPrev;
|
|
|
|
//
|
|
bool isHCSwitchedToBullish =
|
|
//
|
|
(isHCHHSwitchedToBullish &&
|
|
!isHCLLBearish)
|
|
//
|
|
||
|
|
//
|
|
(isHCLLSwitchedToBullish &&
|
|
!isHCHHBearish)
|
|
//
|
|
;
|
|
|
|
//
|
|
bool isHCSwitchedToBearish =
|
|
//
|
|
(isHCHHSwitchedToBearish &&
|
|
!isHCLLBullish)
|
|
//
|
|
||
|
|
//
|
|
(isHCLLSwitchedToBeraish &&
|
|
!isHCHHBullish)
|
|
//
|
|
;
|
|
|
|
//
|
|
// Define Bars For Calculations ...
|
|
|
|
//
|
|
XOHCL cBar;
|
|
result = cBar.Init(
|
|
mSymbol,
|
|
mPeriod,
|
|
cIndex //
|
|
);
|
|
if (!result)
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
XOHCL pBar;
|
|
result = pBar.Init(
|
|
mSymbol,
|
|
mPeriod,
|
|
pIndex //
|
|
);
|
|
if (!result)
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
bool isCloseOverFib1 = cBar.close > conditions.fib1s[cIndex];
|
|
bool isCloseOverFib1Prev = pBar.close > conditions.fib1s[pIndex];
|
|
|
|
//
|
|
bool isCloseOverFib2 = cBar.close > conditions.fib2s[cIndex];
|
|
bool isCloseOverFib2Prev = pBar.close > conditions.fib2s[pIndex];
|
|
|
|
//
|
|
bool isCloseOverFib3 = cBar.close > conditions.fib3s[cIndex];
|
|
bool isCloseOverFib3Prev = pBar.close > conditions.fib3s[pIndex];
|
|
|
|
//
|
|
bool isCloseOverFib4 = cBar.close > conditions.fib4s[cIndex];
|
|
bool isCloseOverFib4Prev = pBar.close > conditions.fib4s[pIndex];
|
|
|
|
//
|
|
bool isCloseOverFib5 = cBar.close > conditions.fib5s[cIndex];
|
|
bool isCloseOverFib5Prev = pBar.close > conditions.fib5s[pIndex];
|
|
|
|
//
|
|
bool isCloseUnderFib1 = cBar.close < conditions.fib1s[cIndex];
|
|
bool isCloseUnderFib1Prev = pBar.close < conditions.fib1s[pIndex];
|
|
|
|
//
|
|
bool isCloseUnderFib2 = cBar.close < conditions.fib2s[cIndex];
|
|
bool isCloseUnderFib2Prev = pBar.close < conditions.fib2s[pIndex];
|
|
|
|
//
|
|
bool isCloseUnderFib3 = cBar.close < conditions.fib3s[cIndex];
|
|
bool isCloseUnderFib3Prev = pBar.close < conditions.fib3s[pIndex];
|
|
|
|
//
|
|
bool isCloseUnderFib4 = cBar.close < conditions.fib4s[cIndex];
|
|
bool isCloseUnderFib4Prev = pBar.close < conditions.fib4s[pIndex];
|
|
|
|
//
|
|
bool isCloseUnderFib5 = cBar.close < conditions.fib5s[cIndex];
|
|
bool isCloseUnderFib5Prev = pBar.close < conditions.fib5s[pIndex];
|
|
|
|
//
|
|
bool isCloseCrossedOverFib1 = isCloseOverFib1 &&
|
|
!isCloseOverFib1Prev;
|
|
bool isCloseCrossedOverFib2 = isCloseOverFib2 &&
|
|
!isCloseOverFib2Prev;
|
|
bool isCloseCrossedOverFib3 = isCloseOverFib3 &&
|
|
!isCloseOverFib3Prev;
|
|
bool isCloseCrossedOverFib4 = isCloseOverFib4 &&
|
|
!isCloseOverFib4Prev;
|
|
bool isCloseCrossedOverFib5 = isCloseOverFib5 &&
|
|
!isCloseOverFib5Prev;
|
|
|
|
//
|
|
bool isCloseCrossedUnderFib1 = isCloseUnderFib1 &&
|
|
!isCloseUnderFib1Prev;
|
|
bool isCloseCrossedUnderFib2 = isCloseUnderFib2 &&
|
|
!isCloseUnderFib2Prev;
|
|
bool isCloseCrossedUnderFib3 = isCloseUnderFib3 &&
|
|
!isCloseUnderFib3Prev;
|
|
bool isCloseCrossedUnderFib4 = isCloseUnderFib4 &&
|
|
!isCloseUnderFib4Prev;
|
|
bool isCloseCrossedUnderFib5 = isCloseUnderFib5 &&
|
|
!isCloseUnderFib5Prev;
|
|
|
|
//
|
|
conditions.isNewPeak = isNewPeak;
|
|
conditions.isNewPeakOverLast = isNewPeakOverLast;
|
|
conditions.isNewPeakUnderLast = isNewPeakUnderLast;
|
|
conditions.isNewVale = isNewVale;
|
|
conditions.isNewValeOverLast = isNewValeOverLast;
|
|
conditions.isNewValeUnderLast = isNewValeUnderLast;
|
|
conditions.isFiboIncreased = isFiboIncreased;
|
|
conditions.isFiboDecreased = isFiboDecreased;
|
|
conditions.isFiboSectionChanged = isFiboSectionChanged;
|
|
conditions.isCloseOverFib1 = isCloseOverFib1;
|
|
conditions.isCloseOverFib2 = isCloseOverFib2;
|
|
conditions.isCloseOverFib3 = isCloseOverFib3;
|
|
conditions.isCloseOverFib4 = isCloseOverFib4;
|
|
conditions.isCloseOverFib5 = isCloseOverFib5;
|
|
conditions.isCloseUnderFib1 = isCloseUnderFib1;
|
|
conditions.isCloseUnderFib2 = isCloseUnderFib2;
|
|
conditions.isCloseUnderFib3 = isCloseUnderFib3;
|
|
conditions.isCloseUnderFib4 = isCloseUnderFib4;
|
|
conditions.isCloseUnderFib5 = isCloseUnderFib5;
|
|
conditions.isCloseCrossedOverFib1 = isCloseCrossedOverFib1;
|
|
conditions.isCloseCrossedOverFib2 = isCloseCrossedOverFib2;
|
|
conditions.isCloseCrossedOverFib3 = isCloseCrossedOverFib3;
|
|
conditions.isCloseCrossedOverFib4 = isCloseCrossedOverFib4;
|
|
conditions.isCloseCrossedOverFib5 = isCloseCrossedOverFib5;
|
|
conditions.isCloseCrossedUnderFib1 = isCloseCrossedUnderFib1;
|
|
conditions.isCloseCrossedUnderFib2 = isCloseCrossedUnderFib2;
|
|
conditions.isCloseCrossedUnderFib3 = isCloseCrossedUnderFib3;
|
|
conditions.isCloseCrossedUnderFib4 = isCloseCrossedUnderFib4;
|
|
conditions.isCloseCrossedUnderFib5 = isCloseCrossedUnderFib5;
|
|
conditions.isSCBullish = isSCBullish;
|
|
conditions.isSCHHBullish = isSCHHBullish;
|
|
conditions.isSCLLBullish = isSCLLBullish;
|
|
conditions.isSCSwitchedToBullish = isSCSwitchedToBullish;
|
|
conditions.isSCHHSwitchedToBullish = isSCHHSwitchedToBullish;
|
|
conditions.isSCLLSwitchedToBullish = isSCLLSwitchedToBullish;
|
|
conditions.isSCBearish = isSCBearish;
|
|
conditions.isSCHHBearish = isSCHHBearish;
|
|
conditions.isSCLLBearish = isSCLLBearish;
|
|
conditions.isSCSwitchedToBearish = isSCSwitchedToBearish;
|
|
conditions.isSCHHSwitchedToBearish = isSCHHSwitchedToBearish;
|
|
conditions.isSCLLSwitchedToBeraish = isSCLLSwitchedToBeraish;
|
|
conditions.isMCBullish = isMCBullish;
|
|
conditions.isMCHHBullish = isMCHHBullish;
|
|
conditions.isMCLLBullish = isMCLLBullish;
|
|
conditions.isMCSwitchedToBullish = isMCSwitchedToBullish;
|
|
conditions.isMCHHSwitchedToBullish = isMCHHSwitchedToBullish;
|
|
conditions.isMCLLSwitchedToBullish = isMCLLSwitchedToBullish;
|
|
conditions.isMCBearish = isMCBearish;
|
|
conditions.isMCHHBearish = isMCHHBearish;
|
|
conditions.isMCLLBearish = isMCLLBearish;
|
|
conditions.isMCSwitchedToBearish = isMCSwitchedToBearish;
|
|
conditions.isMCHHSwitchedToBearish = isMCHHSwitchedToBearish;
|
|
conditions.isMCLLSwitchedToBeraish = isMCLLSwitchedToBeraish;
|
|
conditions.isLCBullish = isLCBullish;
|
|
conditions.isLCHHBullish = isLCHHBullish;
|
|
conditions.isLCLLBullish = isLCLLBullish;
|
|
conditions.isLCSwitchedToBullish = isLCSwitchedToBullish;
|
|
conditions.isLCHHSwitchedToBullish = isLCHHSwitchedToBullish;
|
|
conditions.isLCLLSwitchedToBullish = isLCLLSwitchedToBullish;
|
|
conditions.isLCBearish = isLCBearish;
|
|
conditions.isLCHHBearish = isLCHHBearish;
|
|
conditions.isLCLLBearish = isLCLLBearish;
|
|
conditions.isLCSwitchedToBearish = isLCSwitchedToBearish;
|
|
conditions.isLCHHSwitchedToBearish = isLCHHSwitchedToBearish;
|
|
conditions.isLCLLSwitchedToBeraish = isLCLLSwitchedToBeraish;
|
|
conditions.isHCBullish = isHCBullish;
|
|
conditions.isHCHHBullish = isHCHHBullish;
|
|
conditions.isHCLLBullish = isHCLLBullish;
|
|
conditions.isHCSwitchedToBullish = isHCSwitchedToBullish;
|
|
conditions.isHCHHSwitchedToBullish = isHCHHSwitchedToBullish;
|
|
conditions.isHCLLSwitchedToBullish = isHCLLSwitchedToBullish;
|
|
conditions.isHCBearish = isHCBearish;
|
|
conditions.isHCHHBearish = isHCHHBearish;
|
|
conditions.isHCLLBearish = isHCLLBearish;
|
|
conditions.isHCSwitchedToBearish = isHCSwitchedToBearish;
|
|
conditions.isHCHHSwitchedToBearish = isHCHHSwitchedToBearish;
|
|
conditions.isHCLLSwitchedToBeraish = isHCLLSwitchedToBeraish;
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Protected ...
|
|
protected:
|
|
//
|
|
// Private ...
|
|
private:
|
|
//
|
|
// Props ...
|
|
XPVInputs mInputs; // Inputs ...
|
|
|
|
//
|
|
// Buffers ...
|
|
double peaksBuffer[];
|
|
double valesBuffer[];
|
|
double resistanceBuffer[];
|
|
double supportBuffer[];
|
|
double fib1Buffer[];
|
|
double fib2Buffer[];
|
|
double fib3Buffer[];
|
|
double fib4Buffer[];
|
|
double fib5Buffer[];
|
|
double scHHBuffer[];
|
|
double scLLBuffer[];
|
|
double mcHHBuffer[];
|
|
double mcLLBuffer[];
|
|
double lcHHBuffer[];
|
|
double lcLLBuffer[];
|
|
double hcHHBuffer[];
|
|
double hcLLBuffer[];
|
|
|
|
//
|
|
// Tools ...
|
|
|
|
//
|
|
// Calculate Values Until Now ...
|
|
void Calculate()
|
|
{
|
|
//
|
|
int totalBars = CountBars();
|
|
if (totalBars > 1000)
|
|
{
|
|
totalBars = 1000;
|
|
}
|
|
|
|
//
|
|
// Peaks and Vales ...
|
|
|
|
//
|
|
// Peaks Buffer ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
XPV_PEAKS_LINE,
|
|
0,
|
|
totalBars,
|
|
peaksBuffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// Vales Buffer ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
XPV_VALES_LINE,
|
|
0,
|
|
totalBars,
|
|
valesBuffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// Support and Resistances ...
|
|
|
|
//
|
|
// Resistances Buffer ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
XPV_RESISTANCE_LINE,
|
|
0,
|
|
totalBars,
|
|
resistanceBuffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// Supports Buffer ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
XPV_SUPPORT_LINE,
|
|
0,
|
|
totalBars,
|
|
supportBuffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// Fibonacci ...
|
|
|
|
//
|
|
// Level 1 Buffer ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
XPV_FIB_1_LINE,
|
|
0,
|
|
totalBars,
|
|
fib1Buffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// Level 2 Buffer ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
XPV_FIB_2_LINE,
|
|
0,
|
|
totalBars,
|
|
fib2Buffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// Level 3 Buffer ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
XPV_FIB_3_LINE,
|
|
0,
|
|
totalBars,
|
|
fib3Buffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// Level 4 Buffer ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
XPV_FIB_4_LINE,
|
|
0,
|
|
totalBars,
|
|
fib4Buffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// Level 5 Buffer ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
XPV_FIB_5_LINE,
|
|
0,
|
|
totalBars,
|
|
fib5Buffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// Cycles ...
|
|
|
|
//
|
|
// Short ...
|
|
|
|
//
|
|
// HH ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
XPV_SC_HH_LINE,
|
|
0,
|
|
totalBars,
|
|
scHHBuffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// LL ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
XPV_SC_LL_LINE,
|
|
0,
|
|
totalBars,
|
|
scLLBuffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// Medium ...
|
|
|
|
//
|
|
// HH ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
XPV_MC_HH_LINE,
|
|
0,
|
|
totalBars,
|
|
mcHHBuffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// LL ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
XPV_MC_LL_LINE,
|
|
0,
|
|
totalBars,
|
|
mcLLBuffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// Long ...
|
|
|
|
//
|
|
// HH ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
XPV_LC_HH_LINE,
|
|
0,
|
|
totalBars,
|
|
lcHHBuffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// LL ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
XPV_LC_LL_LINE,
|
|
0,
|
|
totalBars,
|
|
lcLLBuffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// Hind ...
|
|
|
|
//
|
|
// HH ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
XPV_HC_HH_LINE,
|
|
0,
|
|
totalBars,
|
|
hcHHBuffer
|
|
//
|
|
);
|
|
|
|
//
|
|
// LL ...
|
|
CopyBuffer(
|
|
mHandler,
|
|
XPV_HC_LL_LINE,
|
|
0,
|
|
totalBars,
|
|
hcLLBuffer
|
|
//
|
|
);
|
|
}
|
|
};
|
|
|
|
//
|
|
// Tools ... |