926 lines
18 KiB
Plaintext
926 lines
18 KiB
Plaintext
/////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// SaherElm IT Center MQL5 XCHLH Oscillator Helper for Signal Providers
|
|
// --------------------------------------------------------------------------
|
|
//
|
|
// 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
|
|
|
|
//
|
|
// Includes ...
|
|
#include "..\Libraries\x-saherelm.log.lib.mq5"
|
|
#include "..\Libraries\x-saherelm.common.lib.mq5"
|
|
|
|
//
|
|
// START Enum Definitions ...
|
|
//
|
|
|
|
//
|
|
// XCHLH Hot States ...
|
|
enum ENUM_X_XCHLH_HOT_STATES
|
|
{
|
|
X_XCHLH_HOT_HH = 1,
|
|
X_XCHLH_NEUTURAL = 0,
|
|
X_XCHLH_HOT_LL = -1,
|
|
};
|
|
|
|
//
|
|
// XCHLH Signal Calculation Types ...
|
|
enum ENUM_X_XCHLH_SIGNAL_TYPES
|
|
{
|
|
X_XCHLH_AVG_SIGNAL,
|
|
X_XCHLH_DELTA_SIGNAL,
|
|
};
|
|
|
|
//
|
|
// XCHLH Buffer Lines ...
|
|
enum ENUM_X_XCHLH_BUFFER_LINES
|
|
{
|
|
X_XCHLH_LC_HH_LINE = 0,
|
|
X_XCHLH_LC_LL_LINE = 1,
|
|
X_XCHLH_MC_HH_LINE = 2,
|
|
X_XCHLH_MC_LL_LINE = 3,
|
|
X_XCHLH_SC_HH_LINE = 4,
|
|
X_XCHLH_SC_LL_LINE = 5,
|
|
X_XCHLH_SIGNAL_T_LINE = 6,
|
|
X_XCHLH_SIGNAL_B_LINE = 7,
|
|
X_XCHLH_HOT_STATE_LINE = 8,
|
|
};
|
|
|
|
//
|
|
// END Enum Definitions ...
|
|
//
|
|
|
|
//
|
|
// START Inputs ...
|
|
//
|
|
|
|
//
|
|
input group "XCHLH Oscillator";
|
|
|
|
//
|
|
// Signal Calculations ...
|
|
input group "XCHLH Signal Calculations";
|
|
input ENUM_X_XCHLH_SIGNAL_TYPES xCHLHSignalType = X_XCHLH_AVG_SIGNAL; // Signal Method
|
|
|
|
//
|
|
// Common ...
|
|
input group "XCHLH Hot Areas";
|
|
input bool xCHLHDrawHotAreas = false; // Draw Hot Areas Symbol
|
|
input uchar xCHLHHotHHArrowCode = 234; // Hot HH Arrow Code
|
|
input color xCHLHHotHHArrowColor = clrAqua; // Hot HH Arrow Color
|
|
input uchar xCHLHHotLLArrowCode = 233; // Hot LL Arrow Code
|
|
input color xCHLHHotLLArrowColor = clrFuchsia; // Hot LL Arrow Color
|
|
|
|
//
|
|
// LC Inputs ...
|
|
input group "XCHLH Long Cycle";
|
|
input group "XCHLH LC Market";
|
|
input int xCHLHLcLength = 288; // Length
|
|
input double xCHLHLcThresholdInPips = 0.3; // Threshold In Pips
|
|
input ENUM_SERIESMODE xCHLHLcHHMode = MODE_HIGH; // Highest High Calculation Method
|
|
input ENUM_SERIESMODE xCHLHLcLLMode = MODE_LOW; // Lowest Low Calculation Method
|
|
input group "XCHLH LC Style";
|
|
input int xCHLHLcDrawWidth = 1; // Draw Width
|
|
input ENUM_DRAW_TYPE xCHLHLcDrawType = DRAW_LINE; // Draw Type
|
|
input ENUM_LINE_STYLE xCHLHLcDrawStyle = STYLE_DOT; // Draw Style
|
|
input color xCHLHLcHHColor = clrAqua; // Highest High Color
|
|
input color xCHLHLcLLColor = clrFuchsia; // Lowest Low Color
|
|
input group "XCHLH LC Drawings";
|
|
input bool xCHLHLcDrawHH = true; // Draw Highest High
|
|
input bool xCHLHLcDrawLL = true; // Draw Lowest Low
|
|
|
|
//
|
|
// MC Inputs ...
|
|
input group "XCHLH Medium Cycle";
|
|
input group "XCHLH MC Market";
|
|
input int xCHLHMcLength = 72; // Length
|
|
input double xCHLHMcThresholdInPips = 0.3; // Threshold In Pips
|
|
input ENUM_SERIESMODE xCHLHMcHHMode = MODE_HIGH; // Highest High Calculation Method
|
|
input ENUM_SERIESMODE xCHLHMcLLMode = MODE_LOW; // Lowest Low Calculation Method
|
|
input group "XCHLH MC Style";
|
|
input int xCHLHMcDrawWidth = 1; // Draw Width
|
|
input ENUM_DRAW_TYPE xCHLHMcDrawType = DRAW_LINE; // Draw Type
|
|
input ENUM_LINE_STYLE xCHLHMcDrawStyle = STYLE_DOT; // Draw Style
|
|
input color xCHLHMcHHColor = clrLime; // Highest High Color
|
|
input color xCHLHMcLLColor = clrRed; // Lowest Low Color
|
|
input group "XCHLH MC Drawings";
|
|
input bool xCHLHMcDrawHH = true; // Draw Highest High
|
|
input bool xCHLHMcDrawLL = true; // Draw Lowest Low
|
|
|
|
//
|
|
// SC Inputs ...
|
|
input group "XCHLH Short Cycle";
|
|
input group "XCHLH SC Market";
|
|
input int xCHLHScLength = 7; // Length
|
|
input double xCHLHScThresholdInPips = 0.3; // Threshold In Pips
|
|
input ENUM_SERIESMODE xCHLHScHHMode = MODE_HIGH; // Highest High Calculation Method
|
|
input ENUM_SERIESMODE xCHLHScLLMode = MODE_LOW; // Lowest Low Calculation Method
|
|
input group "XCHLH SC Style";
|
|
input int xCHLHScDrawWidth = 1; // Draw Width
|
|
input ENUM_DRAW_TYPE xCHLHScDrawType = DRAW_LINE; // Draw Type
|
|
input ENUM_LINE_STYLE xCHLHScDrawStyle = STYLE_DOT; // Draw Style
|
|
input color xCHLHScHHColor = clrLightBlue; // Highest High Color
|
|
input color xCHLHScLLColor = clrLightSalmon; // Lowest Low Color
|
|
input group "XCHLH SC Drawings";
|
|
input bool xCHLHScDrawHH = true; // Draw Highest High
|
|
input bool xCHLHScDrawLL = true; // Draw Lowest Low
|
|
|
|
//
|
|
// END Inputs ...
|
|
//
|
|
|
|
//
|
|
// START Definitions ...
|
|
//
|
|
|
|
int xCHLHHandler = INVALID_HANDLE;
|
|
double xCHLHLcHHBuffer[];
|
|
double xCHLHLcLLBuffer[];
|
|
double xCHLHMcHHBuffer[];
|
|
double xCHLHMcLLBuffer[];
|
|
double xCHLHScHHBuffer[];
|
|
double xCHLHScLLBuffer[];
|
|
double xCHLHSignalTBuffer[];
|
|
double xCHLHSignalBBuffer[];
|
|
|
|
//
|
|
// END Definitions ...
|
|
//
|
|
|
|
//
|
|
// START Handler Functions ...
|
|
//
|
|
|
|
//
|
|
// Init Oscillators ...
|
|
bool XCHLHInitHandlers()
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
// Initialize Indicator/Oscillator Handlers ...
|
|
ResetLastError();
|
|
|
|
//
|
|
// XCHLH Handler ...
|
|
ArraySetAsSeries(xCHLHLcHHBuffer, true);
|
|
ArraySetAsSeries(xCHLHLcLLBuffer, true);
|
|
ArraySetAsSeries(xCHLHMcHHBuffer, true);
|
|
ArraySetAsSeries(xCHLHMcLLBuffer, true);
|
|
ArraySetAsSeries(xCHLHScHHBuffer, true);
|
|
ArraySetAsSeries(xCHLHScLLBuffer, true);
|
|
ArraySetAsSeries(xCHLHSignalTBuffer, true);
|
|
ArraySetAsSeries(xCHLHSignalBBuffer, true);
|
|
xCHLHHandler = iCustom(
|
|
_Symbol,
|
|
_Period,
|
|
"x-saherelm.xchlh.oscillator",
|
|
//
|
|
// Inputs ...
|
|
//
|
|
// Signal Calculations ...
|
|
"",
|
|
xCHLHSignalType,
|
|
//
|
|
// Commons ...
|
|
"",
|
|
xCHLHDrawHotAreas,
|
|
xCHLHHotHHArrowCode,
|
|
xCHLHHotHHArrowColor,
|
|
xCHLHHotLLArrowCode,
|
|
xCHLHHotLLArrowColor,
|
|
//
|
|
// LC ...
|
|
"",
|
|
"",
|
|
xCHLHLcLength,
|
|
xCHLHLcThresholdInPips,
|
|
xCHLHLcHHMode,
|
|
xCHLHLcLLMode,
|
|
"",
|
|
xCHLHLcDrawWidth,
|
|
xCHLHLcDrawType,
|
|
xCHLHLcDrawStyle,
|
|
xCHLHLcHHColor,
|
|
xCHLHLcLLColor,
|
|
"",
|
|
xCHLHLcDrawHH,
|
|
xCHLHLcDrawLL,
|
|
//
|
|
// MC ...
|
|
"",
|
|
"",
|
|
xCHLHMcLength,
|
|
xCHLHMcThresholdInPips,
|
|
xCHLHMcHHMode,
|
|
xCHLHMcLLMode,
|
|
"",
|
|
xCHLHMcDrawWidth,
|
|
xCHLHMcDrawType,
|
|
xCHLHMcDrawStyle,
|
|
xCHLHMcHHColor,
|
|
xCHLHMcLLColor,
|
|
"",
|
|
xCHLHMcDrawHH,
|
|
xCHLHMcDrawLL,
|
|
//
|
|
// SC ...
|
|
"",
|
|
"",
|
|
xCHLHScLength,
|
|
xCHLHScThresholdInPips,
|
|
xCHLHScHHMode,
|
|
xCHLHScLLMode,
|
|
"",
|
|
xCHLHScDrawWidth,
|
|
xCHLHScDrawType,
|
|
xCHLHScDrawStyle,
|
|
xCHLHScHHColor,
|
|
xCHLHScLLColor,
|
|
"",
|
|
xCHLHScDrawHH,
|
|
xCHLHScDrawLL);
|
|
if (xCHLHHandler == INVALID_HANDLE)
|
|
{
|
|
//
|
|
LogMessage("failed to Initialize XCHLH Indicator: " + (string)GetLastError());
|
|
return result;
|
|
}
|
|
|
|
//
|
|
result = true;
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Release Oscillators ...
|
|
void XCHLHReleaseHandlers()
|
|
{
|
|
IndicatorRelease(xCHLHHandler);
|
|
}
|
|
|
|
//
|
|
// Handle Reading Buffers ...
|
|
void XCHLHReadBuffers(
|
|
int xCHLHItemsPerTick // Number Of Reading Buffer Items Per Tick
|
|
)
|
|
{
|
|
//
|
|
// XCHLH LC HH Buffer ...
|
|
CopyBuffer(
|
|
xCHLHHandler,
|
|
X_XCHLH_LC_HH_LINE,
|
|
0,
|
|
xCHLHItemsPerTick,
|
|
xCHLHLcHHBuffer);
|
|
|
|
//
|
|
// XCHLH LC LL Buffer ...
|
|
CopyBuffer(
|
|
xCHLHHandler,
|
|
X_XCHLH_LC_LL_LINE,
|
|
0,
|
|
xCHLHItemsPerTick,
|
|
xCHLHLcLLBuffer);
|
|
|
|
//
|
|
// XCHLH MC HH Buffer ...
|
|
CopyBuffer(
|
|
xCHLHHandler,
|
|
X_XCHLH_MC_HH_LINE,
|
|
0,
|
|
xCHLHItemsPerTick,
|
|
xCHLHMcHHBuffer);
|
|
|
|
//
|
|
// XCHLH MC LL Buffer ...
|
|
CopyBuffer(
|
|
xCHLHHandler,
|
|
X_XCHLH_MC_LL_LINE,
|
|
0,
|
|
xCHLHItemsPerTick,
|
|
xCHLHMcLLBuffer);
|
|
|
|
//
|
|
// XCHLH SC HH Buffer ...
|
|
CopyBuffer(
|
|
xCHLHHandler,
|
|
X_XCHLH_SC_HH_LINE,
|
|
0,
|
|
xCHLHItemsPerTick,
|
|
xCHLHScHHBuffer);
|
|
|
|
//
|
|
// XCHLH SC LL Buffer ...
|
|
CopyBuffer(
|
|
xCHLHHandler,
|
|
X_XCHLH_SC_LL_LINE,
|
|
0,
|
|
xCHLHItemsPerTick,
|
|
xCHLHScLLBuffer);
|
|
|
|
//
|
|
// XCHLH Signal T Buffer ...
|
|
CopyBuffer(
|
|
xCHLHHandler,
|
|
X_XCHLH_SIGNAL_T_LINE,
|
|
0,
|
|
xCHLHItemsPerTick,
|
|
xCHLHSignalTBuffer);
|
|
|
|
//
|
|
// XCHLH Signal B Buffer ...
|
|
CopyBuffer(
|
|
xCHLHHandler,
|
|
X_XCHLH_SIGNAL_B_LINE,
|
|
0,
|
|
xCHLHItemsPerTick,
|
|
xCHLHSignalBBuffer);
|
|
}
|
|
|
|
//
|
|
// END Handler Funcions ...
|
|
//
|
|
|
|
//
|
|
// START Signal Related Conditions ...
|
|
//
|
|
|
|
//
|
|
// XCHLH Long Conditions ...
|
|
bool XCHLHHasLongConditions(
|
|
int xCHLHItemsPerTick // Number Of Reading Buffer Items Per Tick
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
bool isSignalBCrossedOverLCLL = XCHLHIsSignalBCrossedOverLCLL(1);
|
|
|
|
//
|
|
result =
|
|
//
|
|
isSignalBCrossedOverLCLL
|
|
//
|
|
;
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// XCHLH Close Long Conditions ...
|
|
bool XCHLHHasLongCloseConditions(
|
|
int xCHLHItemsPerTick // Number Of Reading Buffer Items Per Tick
|
|
) {
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
bool isSignalBCrossedOverSignalT = XCHLHIsSignalBCrossedOverSignalT(1);
|
|
|
|
//
|
|
result =
|
|
//
|
|
isSignalBCrossedOverSignalT
|
|
//
|
|
;
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// XCHLH Short Conditions ...
|
|
bool XCHLHHasShortConditions(
|
|
int xCHLHItemsPerTick // Number Of Reading Buffer Items Per Tick
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
bool isSignalBCrossedUnderSignalT = XCHLHIsSignalBCrossedUnderSignalT(1);
|
|
|
|
//
|
|
result =
|
|
//
|
|
isSignalBCrossedUnderSignalT
|
|
//
|
|
;
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// XCHLH Close Short Conditions ...
|
|
bool XCHLHHasShortCloseConditions(
|
|
int xCHLHItemsPerTick // Number Of Reading Buffer Items Per Tick
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
bool isSignalBCrossedUnderLCLL = XCHLHIsSignalBCrossedUnderLCLL(1);
|
|
|
|
//
|
|
result =
|
|
//
|
|
isSignalBCrossedUnderLCLL
|
|
//
|
|
;
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// END Signal Related Conditions ...
|
|
//
|
|
|
|
//
|
|
// START XCHLH Custom Functions ...
|
|
//
|
|
|
|
//
|
|
// Check Signal B Crossed Over LC LL ...
|
|
bool XCHLHIsSignalBCrossedOverLCLL(
|
|
int bar_index // Specified Bar Index ...
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
// Validate Args ...
|
|
if (!XCHLHIsValidBufferSizes(bar_index + 2))
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
result = IsCrossOver(
|
|
xCHLHSignalBBuffer,
|
|
xCHLHLcLLBuffer,
|
|
bar_index);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Check Signal B Over LC LL ...
|
|
bool XCHLHIsSignalBOverLCLL(
|
|
int bar_index // Specified Bar Index ...
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
// Validate Args ...
|
|
if (!XCHLHIsValidBufferSizes(bar_index + 2))
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
result = IsOver(
|
|
xCHLHSignalBBuffer,
|
|
xCHLHLcLLBuffer,
|
|
bar_index);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Check Signal B Crossed Under LC LL ...
|
|
bool XCHLHIsSignalBCrossedUnderLCLL(
|
|
int bar_index // Specified Bar Index ...
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
// Validate Args ...
|
|
if (!XCHLHIsValidBufferSizes(bar_index + 2))
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
result = IsCrossUnder(
|
|
xCHLHSignalBBuffer,
|
|
xCHLHLcLLBuffer,
|
|
bar_index);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Check Signal B Under LC LL ...
|
|
bool XCHLHIsSignalBUnderLCLL(
|
|
int bar_index // Specified Bar Index ...
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
// Validate Args ...
|
|
if (!XCHLHIsValidBufferSizes(bar_index + 2))
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
result = IsUnder(
|
|
xCHLHSignalBBuffer,
|
|
xCHLHLcLLBuffer,
|
|
bar_index);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Check Signal B Crossed Over Signal T ...
|
|
bool XCHLHIsSignalBCrossedOverSignalT(
|
|
int bar_index // Specified Bar Index ...
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
// Validate Args ...
|
|
if (!XCHLHIsValidBufferSizes(bar_index + 2))
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
result = IsCrossOver(
|
|
xCHLHSignalBBuffer,
|
|
xCHLHSignalTBuffer,
|
|
bar_index);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Check Signal B Over Signal T ...
|
|
bool XCHLHIsSignalBOverSignalT(
|
|
int bar_index // Specified Bar Index ...
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
// Validate Args ...
|
|
if (!XCHLHIsValidBufferSizes(bar_index + 2))
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
result = IsOver(
|
|
xCHLHSignalBBuffer,
|
|
xCHLHSignalTBuffer,
|
|
bar_index);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Check Signal B Crossed Under Signal T ...
|
|
bool XCHLHIsSignalBCrossedUnderSignalT(
|
|
int bar_index // Specified Bar Index ...
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
// Validate Args ...
|
|
if (!XCHLHIsValidBufferSizes(bar_index + 2))
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
result = IsCrossUnder(
|
|
xCHLHSignalBBuffer,
|
|
xCHLHSignalTBuffer,
|
|
bar_index);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Check Signal B Under Signal T ...
|
|
bool XCHLHIsSignalBUnderSignalT(
|
|
int bar_index // Specified Bar Index ...
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
// Validate Args ...
|
|
if (!XCHLHIsValidBufferSizes(bar_index + 2))
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
result = IsUnder(
|
|
xCHLHSignalBBuffer,
|
|
xCHLHSignalTBuffer,
|
|
bar_index);
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Check LC and MC has Same HH ...
|
|
bool XCHLHIsLCMCHasSameHH(
|
|
int bar_index // Specified Bar Index ...
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
// Validate Args ...
|
|
if (!XCHLHIsValidBufferSizes(bar_index + 1))
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double lcValue = xCHLHLcHHBuffer[bar_index];
|
|
double mcValue = xCHLHMcHHBuffer[bar_index];
|
|
|
|
//
|
|
result = lcValue == mcValue;
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Check LC and MC has Same LL ...
|
|
bool XCHLHIsLCMCHasSameLL(
|
|
int bar_index // Specified Bar Index ...
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
// Validate Args ...
|
|
if (!XCHLHIsValidBufferSizes(bar_index + 1))
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double lcValue = xCHLHLcLLBuffer[bar_index];
|
|
double mcValue = xCHLHMcLLBuffer[bar_index];
|
|
|
|
//
|
|
result = lcValue == mcValue;
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Check LC and SC has Same HH ...
|
|
bool XCHLHIsLCSCHasSameHH(
|
|
int bar_index // Specified Bar Index ...
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
// Validate Args ...
|
|
if (!XCHLHIsValidBufferSizes(bar_index + 1))
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double lcValue = xCHLHLcHHBuffer[bar_index];
|
|
double scValue = xCHLHScHHBuffer[bar_index];
|
|
|
|
//
|
|
result = lcValue == scValue;
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Check LC and SC has Same LL ...
|
|
bool XCHLHIsLCSCHasSameLL(
|
|
int bar_index // Specified Bar Index ...
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
// Validate Args ...
|
|
if (!XCHLHIsValidBufferSizes(bar_index + 1))
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double lcValue = xCHLHLcLLBuffer[bar_index];
|
|
double scValue = xCHLHScLLBuffer[bar_index];
|
|
|
|
//
|
|
result = lcValue == scValue;
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Check MC and SC has Same HH ...
|
|
bool XCHLHIsMCSCHasSameHH(
|
|
int bar_index // Specified Bar Index ...
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
// Validate Args ...
|
|
if (!XCHLHIsValidBufferSizes(bar_index + 1))
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double mcValue = xCHLHMcHHBuffer[bar_index];
|
|
double scValue = xCHLHScHHBuffer[bar_index];
|
|
|
|
//
|
|
result = mcValue == scValue;
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Check MC and SC has Same LL ...
|
|
bool XCHLHIsMCSCHasSameLL(
|
|
int bar_index // Specified Bar Index ...
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
// Validate Args ...
|
|
if (!XCHLHIsValidBufferSizes(bar_index + 1))
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double mcValue = xCHLHMcLLBuffer[bar_index];
|
|
double scValue = xCHLHScLLBuffer[bar_index];
|
|
|
|
//
|
|
result = mcValue == scValue;
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Check Is Same Highest Highs ...
|
|
bool XCHLHIsSameHHs(
|
|
int bar_index // Specified Bar Index ...
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
// Validate Args ...
|
|
if (!XCHLHIsValidBufferSizes(bar_index + 1))
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double lcValue = xCHLHLcHHBuffer[bar_index];
|
|
double mcValue = xCHLHMcHHBuffer[bar_index];
|
|
double scValue = xCHLHScHHBuffer[bar_index];
|
|
|
|
//
|
|
result =
|
|
//
|
|
lcValue == mcValue &&
|
|
mcValue == scValue
|
|
//
|
|
;
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Check Is Same Lowest Lows ...
|
|
bool XCHLHIsSameLLs(
|
|
int bar_index // Specified Bar Index ...
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
// Validate Args ...
|
|
if (!XCHLHIsValidBufferSizes(bar_index + 1))
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
double lcValue = xCHLHLcLLBuffer[bar_index];
|
|
double mcValue = xCHLHMcLLBuffer[bar_index];
|
|
double scValue = xCHLHScLLBuffer[bar_index];
|
|
|
|
//
|
|
result =
|
|
//
|
|
lcValue == mcValue &&
|
|
mcValue == scValue
|
|
//
|
|
;
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Check and Validate Buffer Sizes ...
|
|
bool XCHLHIsValidBufferSizes(
|
|
int size // Specified Min Size
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
result =
|
|
//
|
|
ArraySize(xCHLHLcHHBuffer) > size &&
|
|
ArraySize(xCHLHLcLLBuffer) > size &&
|
|
//
|
|
ArraySize(xCHLHMcHHBuffer) > size &&
|
|
ArraySize(xCHLHMcLLBuffer) > size &&
|
|
//
|
|
ArraySize(xCHLHScHHBuffer) > size &&
|
|
ArraySize(xCHLHScLLBuffer) > size;
|
|
|
|
//
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// END XCHLH Custom Functions ...
|
|
//
|