last works on helpers classes ...
This commit is contained in:
@@ -30,7 +30,21 @@
|
||||
//
|
||||
enum ENUM_XCHLH_BUFFERS
|
||||
{
|
||||
XCHLH_MAIN_LINE = 0
|
||||
//
|
||||
// LC ...
|
||||
XCHLH_LC_HH_LINE = 0,
|
||||
XCHLH_LC_LL_LINE = 1,
|
||||
//
|
||||
// MC ...
|
||||
XCHLH_MC_HH_LINE = 2,
|
||||
XCHLH_MC_LL_LINE = 3,
|
||||
//
|
||||
// SC ...
|
||||
XCHLH_SC_HH_LINE = 4,
|
||||
XCHLH_SC_LL_LINE = 5,
|
||||
//
|
||||
// Hot State ...
|
||||
XCHLH_HOT_STATE_LINE = 6
|
||||
};
|
||||
|
||||
//
|
||||
@@ -39,7 +53,66 @@ struct XXCHLHInputs
|
||||
{
|
||||
//
|
||||
// Props ...
|
||||
string tmp;
|
||||
|
||||
//
|
||||
// Hot Areas ...
|
||||
bool drawHotAreas; // Draw Hot Areas Symbol
|
||||
uchar hotHHArrowCode; // Hot HH Arrow Code
|
||||
color hotHHArrowColor; // Hot HH Arrow Color
|
||||
uchar hotLLArrowCode; // Hot LL Arrow Code
|
||||
color hotLLArrowColor; // Hot LL Arrow Color
|
||||
|
||||
//
|
||||
// Long Cycle ...
|
||||
// LC Market ...
|
||||
int lcLength; // Length
|
||||
double lcThresholdInPips; // Threshold In Pips
|
||||
ENUM_SERIESMODE lcHHMode; // Highest High Calculation Method
|
||||
ENUM_SERIESMODE lcLLMode; // Lowest Low Calculation Method
|
||||
//
|
||||
// LC Style ...
|
||||
int lcDrawWidth; // Draw Width
|
||||
ENUM_DRAW_TYPE lcDrawType; // Draw Type
|
||||
ENUM_LINE_STYLE lcDrawStyle; // Draw Style
|
||||
color lcHHColor; // Highest High Color
|
||||
color lcLLColor; // Lowest Low Color
|
||||
// LC Drawings ...
|
||||
bool lcDrawHH; // Draw Highest High
|
||||
bool lcDrawLL; // Draw Lowest Low
|
||||
|
||||
//
|
||||
// Medium Cycle ...
|
||||
// MC Market ...
|
||||
int mcLength; // Length
|
||||
double mcThresholdInPips; // Threshold In Pips
|
||||
ENUM_SERIESMODE mcHHMode; // Highest High Calculation Method
|
||||
ENUM_SERIESMODE mcLLMode; // Lowest Low Calculation Method
|
||||
// MC Style ...
|
||||
int mcDrawWidth; // Draw Width
|
||||
ENUM_DRAW_TYPE mcDrawType; // Draw Type
|
||||
ENUM_LINE_STYLE mcDrawStyle; // Draw Style
|
||||
color mcHHColor; // Highest High Color
|
||||
color mcLLColor; // Lowest Low Color
|
||||
// MC Drawings ...
|
||||
bool mcDrawHH; // Draw Highest High
|
||||
bool mcDrawLL; // Draw Lowest Low
|
||||
|
||||
//
|
||||
// Short Cycle ...
|
||||
// SC Market ...
|
||||
int scLength; // Length
|
||||
double scThresholdInPips; // Threshold In Pips
|
||||
ENUM_SERIESMODE scHHMode; // Highest High Calculation Method
|
||||
ENUM_SERIESMODE scLLMode; // Lowest Low Calculation Method
|
||||
// SC Style ...
|
||||
int scDrawWidth; // Draw Width
|
||||
ENUM_DRAW_TYPE scDrawType; // Draw Type
|
||||
ENUM_LINE_STYLE scDrawStyle; // Draw Style
|
||||
color scHHColor; // Highest High Color
|
||||
color scLLColor; // Lowest Low Color
|
||||
// SC Drawings ...
|
||||
bool scDrawHH; // Draw Highest High
|
||||
bool scDrawLL; // Draw Lowest Low
|
||||
|
||||
//
|
||||
// Constructor(s) ...
|
||||
@@ -57,6 +130,64 @@ struct XXCHLHInputs
|
||||
void Clean()
|
||||
{
|
||||
//
|
||||
// Hot Areas ...
|
||||
drawHotAreas = false;
|
||||
hotHHArrowCode = 234;
|
||||
hotHHArrowColor = CLR_NONE;
|
||||
hotLLArrowCode = 233;
|
||||
hotLLArrowColor = CLR_NONE;
|
||||
|
||||
//
|
||||
// Long Cycle ...
|
||||
// LC Market ...
|
||||
lcLength = 0;
|
||||
lcThresholdInPips = 0;
|
||||
lcHHMode = MODE_HIGH;
|
||||
lcLLMode = MODE_LOW;
|
||||
//
|
||||
// LC Style ...
|
||||
lcDrawWidth = 1;
|
||||
lcDrawType = DRAW_NONE;
|
||||
lcDrawStyle = STYLE_DOT;
|
||||
lcHHColor = CLR_NONE;
|
||||
lcLLColor = CLR_NONE;
|
||||
// LC Drawings ...
|
||||
lcDrawHH = false;
|
||||
lcDrawLL = false;
|
||||
|
||||
//
|
||||
// Medium Cycle ...
|
||||
// MC Market ...
|
||||
mcLength = 0;
|
||||
mcThresholdInPips = 0;
|
||||
mcHHMode = MODE_HIGH;
|
||||
mcLLMode = MODE_LOW;
|
||||
// MC Style ...
|
||||
mcDrawWidth = 1;
|
||||
mcDrawType = DRAW_NONE;
|
||||
mcDrawStyle = STYLE_DOT;
|
||||
mcHHColor = CLR_NONE;
|
||||
mcLLColor = CLR_NONE;
|
||||
// MC Drawings ...
|
||||
mcDrawHH = false;
|
||||
mcDrawLL = false;
|
||||
|
||||
//
|
||||
// Short Cycle ...
|
||||
// SC Market ...
|
||||
scLength = 0;
|
||||
scThresholdInPips = 0;
|
||||
scHHMode = MODE_HIGH;
|
||||
scLLMode = MODE_LOW;
|
||||
// SC Style ...
|
||||
scDrawWidth = 1;
|
||||
scDrawType = DRAW_NONE;
|
||||
scDrawStyle = STYLE_DOT;
|
||||
scHHColor = CLR_NONE;
|
||||
scLLColor = CLR_NONE;
|
||||
// SC Drawings ...
|
||||
scDrawHH = false;
|
||||
scDrawLL = false;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -64,6 +195,64 @@ struct XXCHLHInputs
|
||||
void Default()
|
||||
{
|
||||
//
|
||||
// Hot Areas ...
|
||||
drawHotAreas = false;
|
||||
hotHHArrowCode = 234;
|
||||
hotHHArrowColor = CLR_NONE;
|
||||
hotLLArrowCode = 233;
|
||||
hotLLArrowColor = CLR_NONE;
|
||||
|
||||
//
|
||||
// Long Cycle ...
|
||||
// LC Market ...
|
||||
lcLength = 28;
|
||||
lcThresholdInPips = 0.3;
|
||||
lcHHMode = MODE_HIGH;
|
||||
lcLLMode = MODE_LOW;
|
||||
//
|
||||
// LC Style ...
|
||||
lcDrawWidth = 1;
|
||||
lcDrawType = DRAW_LINE;
|
||||
lcDrawStyle = STYLE_DOT;
|
||||
lcHHColor = clrAqua;
|
||||
lcLLColor = clrFuchsia;
|
||||
// LC Drawings ...
|
||||
lcDrawHH = true;
|
||||
lcDrawLL = true;
|
||||
|
||||
//
|
||||
// Medium Cycle ...
|
||||
// MC Market ...
|
||||
mcLength = 14;
|
||||
mcThresholdInPips = 0.3;
|
||||
mcHHMode = MODE_HIGH;
|
||||
mcLLMode = MODE_LOW;
|
||||
// MC Style ...
|
||||
mcDrawWidth = 1;
|
||||
mcDrawType = DRAW_LINE;
|
||||
mcDrawStyle = STYLE_DOT;
|
||||
mcHHColor = clrLime;
|
||||
mcLLColor = clrRed;
|
||||
// MC Drawings ...
|
||||
mcDrawHH = true;
|
||||
mcDrawLL = true;
|
||||
|
||||
//
|
||||
// Short Cycle ...
|
||||
// SC Market ...
|
||||
scLength = 7;
|
||||
scThresholdInPips = 0.3;
|
||||
scHHMode = MODE_HIGH;
|
||||
scLLMode = MODE_LOW;
|
||||
// SC Style ...
|
||||
scDrawWidth = 1;
|
||||
scDrawType = DRAW_LINE;
|
||||
scDrawStyle = STYLE_DOT;
|
||||
scHHColor = clrLightBlue;
|
||||
scLLColor = clrLightSalmon;
|
||||
// SC Drawings ...
|
||||
scDrawHH = true;
|
||||
scDrawLL = true;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -76,7 +265,24 @@ struct XXCHLHInputs
|
||||
//
|
||||
result =
|
||||
//
|
||||
false
|
||||
// LC ...
|
||||
(lcLength >= 4 &&
|
||||
lcLength > mcLength &&
|
||||
lcLength > scLength)
|
||||
//
|
||||
&&
|
||||
//
|
||||
// MC ...
|
||||
(mcLength >= 4 &&
|
||||
mcLength > scLength &&
|
||||
mcLength < lcLength)
|
||||
//
|
||||
&&
|
||||
//
|
||||
// SC ...
|
||||
(scLength >= 4 &&
|
||||
scLength < mcLength &&
|
||||
scLength < lcLength)
|
||||
//
|
||||
;
|
||||
|
||||
@@ -92,7 +298,8 @@ struct XXCHLHInputs
|
||||
int result = 0;
|
||||
|
||||
//
|
||||
result = MathMax(0, 0);
|
||||
result = MathMax(lcLength, mcLength);
|
||||
result = MathMax(result, scLength);
|
||||
|
||||
//
|
||||
return result;
|
||||
@@ -124,7 +331,7 @@ public:
|
||||
bool Init(
|
||||
string symbol, // Trading Symbol
|
||||
ENUM_TIMEFRAMES period, // Trading Period
|
||||
XXCHLHInputs &inputs // Inputs
|
||||
XXCHLHInputs &inputs // Inputs
|
||||
)
|
||||
{
|
||||
//
|
||||
@@ -144,21 +351,110 @@ public:
|
||||
//
|
||||
mInputs = inputs;
|
||||
|
||||
// //
|
||||
// // ArraySetAsSeries(shortExit2Buffer, true);
|
||||
// mHandler = iCustom(
|
||||
// mSymbol,
|
||||
// mPeriod,
|
||||
// "x-saherelm.x",
|
||||
// //
|
||||
// // Inputs ...
|
||||
// //
|
||||
// );
|
||||
// result = mHandler != INVALID_HANDLE;
|
||||
// if (!result)
|
||||
// {
|
||||
// return result;
|
||||
// }
|
||||
//
|
||||
ArraySetAsSeries(scHHBuffer, true);
|
||||
ArraySetAsSeries(scLLBuffer, true);
|
||||
ArraySetAsSeries(mcHHBuffer, true);
|
||||
ArraySetAsSeries(mcLLBuffer, true);
|
||||
ArraySetAsSeries(lcHHBuffer, true);
|
||||
ArraySetAsSeries(lcLLBuffer, true);
|
||||
ArraySetAsSeries(hotStateBuffer, true);
|
||||
|
||||
//
|
||||
mHandler = iCustom(
|
||||
mSymbol,
|
||||
mPeriod,
|
||||
"x-saherelm.xchlh",
|
||||
//
|
||||
// Inputs ...
|
||||
//
|
||||
// Hot Areas ...
|
||||
"",
|
||||
//
|
||||
mInputs.drawHotAreas, // Draw Hot Areas Symbol
|
||||
mInputs.hotHHArrowCode, // Hot HH Arrow Code
|
||||
mInputs.hotHHArrowColor, // Hot HH Arrow Color
|
||||
mInputs.hotLLArrowCode, // Hot LL Arrow Code
|
||||
mInputs.hotLLArrowColor, // Hot LL Arrow Color
|
||||
//
|
||||
// Long Cycle ...
|
||||
"",
|
||||
// LC Market ...
|
||||
"",
|
||||
//
|
||||
mInputs.lcLength, // Length
|
||||
mInputs.lcThresholdInPips, // Threshold In Pips
|
||||
mInputs.lcHHMode, // Highest High Calculation Method
|
||||
mInputs.lcLLMode, // Lowest Low Calculation Method
|
||||
//
|
||||
// LC Style ...
|
||||
"",
|
||||
//
|
||||
mInputs.lcDrawWidth, // Draw Width
|
||||
mInputs.lcDrawType, // Draw Type
|
||||
mInputs.lcDrawStyle, // Draw Style
|
||||
mInputs.lcHHColor, // Highest High Color
|
||||
mInputs.lcLLColor, // Lowest Low Color
|
||||
//
|
||||
// LC Drawings ...
|
||||
"",
|
||||
mInputs.lcDrawHH, // Draw Highest High
|
||||
mInputs.lcDrawLL, // Draw Lowest Low
|
||||
//
|
||||
// Medium Cycle ...
|
||||
"",
|
||||
// MC Market ...
|
||||
"",
|
||||
//
|
||||
mInputs.mcLength, // Length
|
||||
mInputs.mcThresholdInPips, // Threshold In Pips
|
||||
mInputs.mcHHMode, // Highest High Calculation Method
|
||||
mInputs.mcLLMode, // Lowest Low Calculation Method
|
||||
//
|
||||
// MC Style ...
|
||||
"",
|
||||
//
|
||||
mInputs.mcDrawWidth, // Draw Width
|
||||
mInputs.mcDrawType, // Draw Type
|
||||
mInputs.mcDrawStyle, // Draw Style
|
||||
mInputs.mcHHColor, // Highest High Color
|
||||
mInputs.mcLLColor, // Lowest Low Color
|
||||
//
|
||||
// MC Drawings ...
|
||||
"",
|
||||
mInputs.mcDrawHH, // Draw Highest High
|
||||
mInputs.mcDrawLL, // Draw Lowest Low
|
||||
//
|
||||
// Short Cycle ...
|
||||
"",
|
||||
// SC Market ...
|
||||
"",
|
||||
//
|
||||
mInputs.scLength, // Length
|
||||
mInputs.scThresholdInPips, // Threshold In Pips
|
||||
mInputs.scHHMode, // Highest High Calculation Method
|
||||
mInputs.scLLMode, // Lowest Low Calculation Method
|
||||
//
|
||||
// SC Style ...
|
||||
"",
|
||||
//
|
||||
mInputs.scDrawWidth, // Draw Width
|
||||
mInputs.scDrawType, // Draw Type
|
||||
mInputs.scDrawStyle, // Draw Style
|
||||
mInputs.scHHColor, // Highest High Color
|
||||
mInputs.scLLColor, // Lowest Low Color
|
||||
//
|
||||
// SC Drawings ...
|
||||
"",
|
||||
mInputs.scDrawHH, // Draw Highest High
|
||||
mInputs.scDrawLL // Draw Lowest Low
|
||||
//
|
||||
);
|
||||
result = mHandler != INVALID_HANDLE;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
@@ -190,6 +486,31 @@ public:
|
||||
//
|
||||
// Buffers ...
|
||||
|
||||
// //
|
||||
// double GetMain(
|
||||
// int barIndex // Bar Index
|
||||
// )
|
||||
// {
|
||||
// //
|
||||
// if (barIndex < 0)
|
||||
// {
|
||||
// barIndex = 0;
|
||||
// }
|
||||
|
||||
// //
|
||||
// Calculate();
|
||||
|
||||
// //
|
||||
// int count = ArraySize(mainBuffer);
|
||||
// if (barIndex >= count)
|
||||
// {
|
||||
// barIndex = count - 1;
|
||||
// }
|
||||
|
||||
// //
|
||||
// return mainBuffer[barIndex];
|
||||
// }
|
||||
|
||||
// //
|
||||
// // Copy Required Long Exits 2 ...
|
||||
// int CopyLongExit2(
|
||||
@@ -227,7 +548,13 @@ private:
|
||||
|
||||
//
|
||||
// Buffers ...
|
||||
// double longExit1Buffer[];
|
||||
double scHHBuffer[];
|
||||
double scLLBuffer[];
|
||||
double mcHHBuffer[];
|
||||
double mcLLBuffer[];
|
||||
double lcHHBuffer[];
|
||||
double lcLLBuffer[];
|
||||
double hotStateBuffer[];
|
||||
|
||||
//
|
||||
// Tools ...
|
||||
@@ -239,16 +566,91 @@ private:
|
||||
//
|
||||
int totalBars = CountBars();
|
||||
|
||||
// //
|
||||
// // Short Exit 2 ...
|
||||
// CopyBuffer(
|
||||
// mHandler,
|
||||
// X_CHE_SHORT_EXIT_2_LINE,
|
||||
// 0,
|
||||
// totalBars,
|
||||
// shortExit2Buffer
|
||||
// //
|
||||
// );
|
||||
//
|
||||
// Short Cycle ...
|
||||
|
||||
//
|
||||
// HH ...
|
||||
CopyBuffer(
|
||||
mHandler,
|
||||
XCHLH_SC_HH_LINE,
|
||||
0,
|
||||
totalBars,
|
||||
scHHBuffer
|
||||
//
|
||||
);
|
||||
|
||||
//
|
||||
// LL ...
|
||||
CopyBuffer(
|
||||
mHandler,
|
||||
XCHLH_SC_LL_LINE,
|
||||
0,
|
||||
totalBars,
|
||||
scLLBuffer
|
||||
//
|
||||
);
|
||||
|
||||
//
|
||||
// Medium Cycle ...
|
||||
|
||||
//
|
||||
// HH ...
|
||||
CopyBuffer(
|
||||
mHandler,
|
||||
XCHLH_MC_HH_LINE,
|
||||
0,
|
||||
totalBars,
|
||||
mcHHBuffer
|
||||
//
|
||||
);
|
||||
|
||||
//
|
||||
// LL ...
|
||||
CopyBuffer(
|
||||
mHandler,
|
||||
XCHLH_MC_LL_LINE,
|
||||
0,
|
||||
totalBars,
|
||||
mcLLBuffer
|
||||
//
|
||||
);
|
||||
|
||||
//
|
||||
// Long Cycle ...
|
||||
|
||||
//
|
||||
// HH ...
|
||||
CopyBuffer(
|
||||
mHandler,
|
||||
XCHLH_LC_HH_LINE,
|
||||
0,
|
||||
totalBars,
|
||||
lcHHBuffer
|
||||
//
|
||||
);
|
||||
|
||||
//
|
||||
// LL ...
|
||||
CopyBuffer(
|
||||
mHandler,
|
||||
XCHLH_LC_LL_LINE,
|
||||
0,
|
||||
totalBars,
|
||||
lcLLBuffer
|
||||
//
|
||||
);
|
||||
|
||||
//
|
||||
// Hot State ...
|
||||
CopyBuffer(
|
||||
mHandler,
|
||||
XCHLH_HOT_STATE_LINE,
|
||||
0,
|
||||
totalBars,
|
||||
hotStateBuffer
|
||||
//
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user