This commit is contained in:
2024-08-23 14:06:34 +03:30
parent 015fccaa99
commit 8774674629
7 changed files with 384 additions and 581 deletions
+70 -72
View File
@@ -68,39 +68,17 @@ input ENUM_TIMEFRAMES hcPeriod = NULL; // Time Period
input group "Presentation";
//
// Current ...
input bool showCurrentLE1 = true; // Show Current Cycle Long Exit 1
input bool showCurrentLE2 = true; // Show Current Cycle Long Exit 2
input bool showCurrentSE1 = true; // Show Current Cycle Short Exit 1
input bool showCurrentSE2 = true; // Show Current Cycle Short Exit 2
input bool showLE1 = true; // Show Long Exit 1
input bool showLE2 = true; // Show Long Exit 2
input bool showSE1 = true; // Show Short Exit 1
input bool showSE2 = true; // Show Short Exit 2
//
// Short ...
input bool showShortLE1 = true; // Show Short Cycle Long Exit 1
input bool showShortLE2 = true; // Show Short Cycle Long Exit 2
input bool showShortSE1 = true; // Show Short Cycle Short Exit 1
input bool showShortSE2 = true; // Show Short Cycle Short Exit 2
//
// Medium ...
input bool showMediumLE1 = true; // Show Medium Cycle Long Exit 1
input bool showMediumLE2 = true; // Show Medium Cycle Long Exit 2
input bool showMediumSE1 = true; // Show Medium Cycle Short Exit 1
input bool showMediumSE2 = true; // Show Medium Cycle Short Exit 2
//
// Long ...
input bool showLongLE1 = true; // Show Long Cycle Long Exit 1
input bool showLongLE2 = true; // Show Long Cycle Long Exit 2
input bool showLongSE1 = true; // Show Long Cycle Short Exit 1
input bool showLongSE2 = true; // Show Long Cycle Short Exit 2
//
// Hind ...
input bool showHindLE1 = true; // Show Hind Cycle Long Exit 1
input bool showHindLE2 = true; // Show Hind Cycle Long Exit 2
input bool showHindSE1 = true; // Show Hind Cycle Short Exit 1
input bool showHindSE2 = true; // Show Hind Cycle Short Exit 2
input bool showCurrent = true; // Show Current Cycle
input bool showShort = true; // Show Short Cycle
input bool showMedium = true; // Show Medium Cycle
input bool showLong = true; // Show Long Cycle
input bool showHind = true; // Show Hind Cycle
//
// Buffers ...
@@ -732,30 +710,34 @@ void DefineBuffers()
//
// Long Exit 1 ...
ENUM_DRAW_TYPE cLE1DrawType = showCurrentLE1 ? DRAW_LINE : DRAW_NONE;
bool canShowCLE1 = showCurrent && showLE1;
ENUM_DRAW_TYPE cLE1DrawType = canShowCLE1 ? DRAW_LINE : DRAW_NONE;
SetIndexBuffer(cLE1BufferIndex, cLE1Buffer, INDICATOR_DATA);
PlotIndexSetInteger(cLE1BufferIndex, PLOT_SHOW_DATA, showCurrentLE1);
PlotIndexSetInteger(cLE1BufferIndex, PLOT_SHOW_DATA, canShowCLE1);
PlotIndexSetInteger(cLE1BufferIndex, PLOT_DRAW_TYPE, cLE1DrawType);
//
// Long Exit 2 ...
ENUM_DRAW_TYPE cLE2DrawType = showCurrentLE2 ? DRAW_LINE : DRAW_NONE;
bool canShowCLE2 = showCurrent && showLE2;
ENUM_DRAW_TYPE cLE2DrawType = canShowCLE2 ? DRAW_LINE : DRAW_NONE;
SetIndexBuffer(cLE2BufferIndex, cLE2Buffer, INDICATOR_DATA);
PlotIndexSetInteger(cLE2BufferIndex, PLOT_SHOW_DATA, showCurrentLE2);
PlotIndexSetInteger(cLE2BufferIndex, PLOT_SHOW_DATA, canShowCLE2);
PlotIndexSetInteger(cLE2BufferIndex, PLOT_DRAW_TYPE, cLE2DrawType);
//
// Short Exit 1 ...
ENUM_DRAW_TYPE cSE1DrawType = showCurrentSE1 ? DRAW_LINE : DRAW_NONE;
bool canShowCSE1 = showCurrent && showSE1;
ENUM_DRAW_TYPE cSE1DrawType = canShowCSE1 ? DRAW_LINE : DRAW_NONE;
SetIndexBuffer(cSE1BufferIndex, cSE1Buffer, INDICATOR_DATA);
PlotIndexSetInteger(cSE1BufferIndex, PLOT_SHOW_DATA, showCurrentSE1);
PlotIndexSetInteger(cSE1BufferIndex, PLOT_SHOW_DATA, canShowCSE1);
PlotIndexSetInteger(cSE1BufferIndex, PLOT_DRAW_TYPE, cSE1DrawType);
//
// Short Exit 2 ...
ENUM_DRAW_TYPE cSE2DrawType = showCurrentSE2 ? DRAW_LINE : DRAW_NONE;
bool canShowCSE2 = showCurrent && showSE2;
ENUM_DRAW_TYPE cSE2DrawType = canShowCSE2 ? DRAW_LINE : DRAW_NONE;
SetIndexBuffer(cSE2BufferIndex, cSE2Buffer, INDICATOR_DATA);
PlotIndexSetInteger(cSE2BufferIndex, PLOT_SHOW_DATA, showCurrentSE2);
PlotIndexSetInteger(cSE2BufferIndex, PLOT_SHOW_DATA, canShowCSE2);
PlotIndexSetInteger(cSE2BufferIndex, PLOT_DRAW_TYPE, cSE2DrawType);
//
@@ -763,30 +745,34 @@ void DefineBuffers()
//
// Long Exit 1 ...
ENUM_DRAW_TYPE sLE1DrawType = showCurrentLE1 ? DRAW_LINE : DRAW_NONE;
bool canShowSLE1 = showShort && showLE1;
ENUM_DRAW_TYPE sLE1DrawType = canShowSLE1 ? DRAW_LINE : DRAW_NONE;
SetIndexBuffer(sLE1BufferIndex, sLE1Buffer, INDICATOR_DATA);
PlotIndexSetInteger(sLE1BufferIndex, PLOT_SHOW_DATA, showCurrentLE1);
PlotIndexSetInteger(sLE1BufferIndex, PLOT_SHOW_DATA, canShowSLE1);
PlotIndexSetInteger(sLE1BufferIndex, PLOT_DRAW_TYPE, sLE1DrawType);
//
// Long Exit 2 ...
ENUM_DRAW_TYPE sLE2DrawType = showCurrentLE2 ? DRAW_LINE : DRAW_NONE;
bool canShowSLE2 = showShort && showLE2;
ENUM_DRAW_TYPE sLE2DrawType = canShowSLE2 ? DRAW_LINE : DRAW_NONE;
SetIndexBuffer(sLE2BufferIndex, sLE2Buffer, INDICATOR_DATA);
PlotIndexSetInteger(sLE2BufferIndex, PLOT_SHOW_DATA, showCurrentLE2);
PlotIndexSetInteger(sLE2BufferIndex, PLOT_SHOW_DATA, canShowSLE2);
PlotIndexSetInteger(sLE2BufferIndex, PLOT_DRAW_TYPE, sLE2DrawType);
//
bool canShowSSE1 = showShort && showSE1;
// Short Exit 1 ...
ENUM_DRAW_TYPE sSE1DrawType = showCurrentSE1 ? DRAW_LINE : DRAW_NONE;
ENUM_DRAW_TYPE sSE1DrawType = canShowSSE1 ? DRAW_LINE : DRAW_NONE;
SetIndexBuffer(sSE1BufferIndex, sSE1Buffer, INDICATOR_DATA);
PlotIndexSetInteger(sSE1BufferIndex, PLOT_SHOW_DATA, showCurrentSE1);
PlotIndexSetInteger(sSE1BufferIndex, PLOT_SHOW_DATA, canShowSSE1);
PlotIndexSetInteger(sSE1BufferIndex, PLOT_DRAW_TYPE, sSE1DrawType);
//
// Short Exit 2 ...
ENUM_DRAW_TYPE sSE2DrawType = showCurrentSE2 ? DRAW_LINE : DRAW_NONE;
bool canShowSSE2 = showShort && showSE2;
ENUM_DRAW_TYPE sSE2DrawType = canShowSSE2 ? DRAW_LINE : DRAW_NONE;
SetIndexBuffer(sSE2BufferIndex, sSE2Buffer, INDICATOR_DATA);
PlotIndexSetInteger(sSE2BufferIndex, PLOT_SHOW_DATA, showCurrentSE2);
PlotIndexSetInteger(sSE2BufferIndex, PLOT_SHOW_DATA, canShowSSE2);
PlotIndexSetInteger(sSE2BufferIndex, PLOT_DRAW_TYPE, sSE2DrawType);
//
@@ -794,30 +780,34 @@ void DefineBuffers()
//
// Long Exit 1 ...
ENUM_DRAW_TYPE mLE1DrawType = showCurrentLE1 ? DRAW_LINE : DRAW_NONE;
bool canShowMLE1 = showMedium && showLE1;
ENUM_DRAW_TYPE mLE1DrawType = canShowMLE1 ? DRAW_LINE : DRAW_NONE;
SetIndexBuffer(mLE1BufferIndex, mLE1Buffer, INDICATOR_DATA);
PlotIndexSetInteger(mLE1BufferIndex, PLOT_SHOW_DATA, showCurrentLE1);
PlotIndexSetInteger(mLE1BufferIndex, PLOT_SHOW_DATA, canShowMLE1);
PlotIndexSetInteger(mLE1BufferIndex, PLOT_DRAW_TYPE, mLE1DrawType);
//
// Long Exit 2 ...
ENUM_DRAW_TYPE mLE2DrawType = showCurrentLE2 ? DRAW_LINE : DRAW_NONE;
bool canShowMLE2 = showMedium && showLE2;
ENUM_DRAW_TYPE mLE2DrawType = canShowMLE2 ? DRAW_LINE : DRAW_NONE;
SetIndexBuffer(mLE2BufferIndex, mLE2Buffer, INDICATOR_DATA);
PlotIndexSetInteger(mLE2BufferIndex, PLOT_SHOW_DATA, showCurrentLE2);
PlotIndexSetInteger(mLE2BufferIndex, PLOT_SHOW_DATA, canShowMLE2);
PlotIndexSetInteger(mLE2BufferIndex, PLOT_DRAW_TYPE, mLE2DrawType);
//
// Short Exit 1 ...
ENUM_DRAW_TYPE mSE1DrawType = showCurrentSE1 ? DRAW_LINE : DRAW_NONE;
bool canShowMSE1 = showMedium && showSE1;
ENUM_DRAW_TYPE mSE1DrawType = canShowMSE1 ? DRAW_LINE : DRAW_NONE;
SetIndexBuffer(mSE1BufferIndex, mSE1Buffer, INDICATOR_DATA);
PlotIndexSetInteger(mSE1BufferIndex, PLOT_SHOW_DATA, showCurrentSE1);
PlotIndexSetInteger(mSE1BufferIndex, PLOT_SHOW_DATA, canShowMSE1);
PlotIndexSetInteger(mSE1BufferIndex, PLOT_DRAW_TYPE, mSE1DrawType);
//
// Short Exit 2 ...
ENUM_DRAW_TYPE mSE2DrawType = showCurrentSE2 ? DRAW_LINE : DRAW_NONE;
bool canShowMSE2 = showMedium && showSE2;
ENUM_DRAW_TYPE mSE2DrawType = canShowMSE2 ? DRAW_LINE : DRAW_NONE;
SetIndexBuffer(mSE2BufferIndex, mSE2Buffer, INDICATOR_DATA);
PlotIndexSetInteger(mSE2BufferIndex, PLOT_SHOW_DATA, showCurrentSE2);
PlotIndexSetInteger(mSE2BufferIndex, PLOT_SHOW_DATA, canShowMSE2);
PlotIndexSetInteger(mSE2BufferIndex, PLOT_DRAW_TYPE, mSE2DrawType);
//
@@ -825,30 +815,34 @@ void DefineBuffers()
//
// Long Exit 1 ...
ENUM_DRAW_TYPE lLE1DrawType = showCurrentLE1 ? DRAW_LINE : DRAW_NONE;
bool canShowLLE1 = showLong && showLE1;
ENUM_DRAW_TYPE lLE1DrawType = canShowLLE1 ? DRAW_LINE : DRAW_NONE;
SetIndexBuffer(lLE1BufferIndex, lLE1Buffer, INDICATOR_DATA);
PlotIndexSetInteger(lLE1BufferIndex, PLOT_SHOW_DATA, showCurrentLE1);
PlotIndexSetInteger(lLE1BufferIndex, PLOT_SHOW_DATA, canShowLLE1);
PlotIndexSetInteger(lLE1BufferIndex, PLOT_DRAW_TYPE, lLE1DrawType);
//
// Long Exit 2 ...
ENUM_DRAW_TYPE lLE2DrawType = showCurrentLE2 ? DRAW_LINE : DRAW_NONE;
bool canShowLLE2 = showLong && showLE2;
ENUM_DRAW_TYPE lLE2DrawType = canShowLLE2 ? DRAW_LINE : DRAW_NONE;
SetIndexBuffer(lLE2BufferIndex, lLE2Buffer, INDICATOR_DATA);
PlotIndexSetInteger(lLE2BufferIndex, PLOT_SHOW_DATA, showCurrentLE2);
PlotIndexSetInteger(lLE2BufferIndex, PLOT_SHOW_DATA, canShowLLE2);
PlotIndexSetInteger(lLE2BufferIndex, PLOT_DRAW_TYPE, lLE2DrawType);
//
// Short Exit 1 ...
ENUM_DRAW_TYPE lSE1DrawType = showCurrentSE1 ? DRAW_LINE : DRAW_NONE;
bool canShowLSE1 = showLong && showSE1;
ENUM_DRAW_TYPE lSE1DrawType = canShowLSE1 ? DRAW_LINE : DRAW_NONE;
SetIndexBuffer(lSE1BufferIndex, lSE1Buffer, INDICATOR_DATA);
PlotIndexSetInteger(lSE1BufferIndex, PLOT_SHOW_DATA, showCurrentSE1);
PlotIndexSetInteger(lSE1BufferIndex, PLOT_SHOW_DATA, canShowLSE1);
PlotIndexSetInteger(lSE1BufferIndex, PLOT_DRAW_TYPE, lSE1DrawType);
//
// Short Exit 2 ...
ENUM_DRAW_TYPE lSE2DrawType = showCurrentSE2 ? DRAW_LINE : DRAW_NONE;
bool canShowLSE2 = showLong && showSE2;
ENUM_DRAW_TYPE lSE2DrawType = canShowLSE2 ? DRAW_LINE : DRAW_NONE;
SetIndexBuffer(lSE2BufferIndex, lSE2Buffer, INDICATOR_DATA);
PlotIndexSetInteger(lSE2BufferIndex, PLOT_SHOW_DATA, showCurrentSE2);
PlotIndexSetInteger(lSE2BufferIndex, PLOT_SHOW_DATA, canShowLSE2);
PlotIndexSetInteger(lSE2BufferIndex, PLOT_DRAW_TYPE, lSE2DrawType);
//
@@ -856,30 +850,34 @@ void DefineBuffers()
//
// Long Exit 1 ...
ENUM_DRAW_TYPE hLE1DrawType = showCurrentLE1 ? DRAW_LINE : DRAW_NONE;
bool canShowHLE1 = showHind && showLE1;
ENUM_DRAW_TYPE hLE1DrawType = canShowHLE1 ? DRAW_LINE : DRAW_NONE;
SetIndexBuffer(hLE1BufferIndex, hLE1Buffer, INDICATOR_DATA);
PlotIndexSetInteger(hLE1BufferIndex, PLOT_SHOW_DATA, showCurrentLE1);
PlotIndexSetInteger(hLE1BufferIndex, PLOT_SHOW_DATA, canShowHLE1);
PlotIndexSetInteger(hLE1BufferIndex, PLOT_DRAW_TYPE, hLE1DrawType);
//
// Long Exit 2 ...
ENUM_DRAW_TYPE hLE2DrawType = showCurrentLE2 ? DRAW_LINE : DRAW_NONE;
bool canShowHLE2 = showHind && showLE2;
ENUM_DRAW_TYPE hLE2DrawType = canShowHLE2 ? DRAW_LINE : DRAW_NONE;
SetIndexBuffer(hLE2BufferIndex, hLE2Buffer, INDICATOR_DATA);
PlotIndexSetInteger(hLE2BufferIndex, PLOT_SHOW_DATA, showCurrentLE2);
PlotIndexSetInteger(hLE2BufferIndex, PLOT_SHOW_DATA, canShowHLE2);
PlotIndexSetInteger(hLE2BufferIndex, PLOT_DRAW_TYPE, hLE2DrawType);
//
// Short Exit 1 ...
ENUM_DRAW_TYPE hSE1DrawType = showCurrentSE1 ? DRAW_LINE : DRAW_NONE;
bool canShowHSE1 = showHind && showSE1;
ENUM_DRAW_TYPE hSE1DrawType = canShowHSE1 ? DRAW_LINE : DRAW_NONE;
SetIndexBuffer(hSE1BufferIndex, hSE1Buffer, INDICATOR_DATA);
PlotIndexSetInteger(hSE1BufferIndex, PLOT_SHOW_DATA, showCurrentSE1);
PlotIndexSetInteger(hSE1BufferIndex, PLOT_SHOW_DATA, canShowHSE1);
PlotIndexSetInteger(hSE1BufferIndex, PLOT_DRAW_TYPE, hSE1DrawType);
//
// Short Exit 2 ...
ENUM_DRAW_TYPE hSE2DrawType = showCurrentSE2 ? DRAW_LINE : DRAW_NONE;
bool canShowHSE2 = showHind && showSE2;
ENUM_DRAW_TYPE hSE2DrawType = canShowHSE2 ? DRAW_LINE : DRAW_NONE;
SetIndexBuffer(hSE2BufferIndex, hSE2Buffer, INDICATOR_DATA);
PlotIndexSetInteger(hSE2BufferIndex, PLOT_SHOW_DATA, showCurrentSE2);
PlotIndexSetInteger(hSE2BufferIndex, PLOT_SHOW_DATA, canShowHSE2);
PlotIndexSetInteger(hSE2BufferIndex, PLOT_DRAW_TYPE, hSE2DrawType);
}
@@ -1029,7 +1027,7 @@ void CalculateCycle(
const double &close[],
const double &low[],
//
int _length, // Calculation Length
int _length, // Calculation Length
double &work[][], // Working Array
//
double &le1[],