apply some fix on XCH OSC Indicator Helpers Buffers ...

This commit is contained in:
2024-08-01 05:10:16 +03:30
parent a7982d6f05
commit 0f2bcd75e7
6 changed files with 74 additions and 69 deletions
+2 -2
View File
@@ -46,8 +46,8 @@ double eaSLPoint = 500; // Static SL Point
double eaR2R = 1.5; // Risk to Reward Ratio
double eaAllowLong = true; // Allow Long Positions
double eaAllowShort = true; // Allow Short Positions
int eaMaxAllowedLongs = 2; // Max Allowed Long Positions
int eaMaxAllowedShorts = 2; // Max Allowed Short Positions
int eaMaxAllowedLongs = 1; // Max Allowed Long Positions
int eaMaxAllowedShorts = 1; // Max Allowed Short Positions
double eaMaxDrawdownPercentForOpenTrades = 3; // Max Drawdown Percent for Open Trades
//
+3 -3
View File
@@ -1001,7 +1001,7 @@ public:
//
result =
//
ToState(value) == XCHVLM_BEARISH_STATE;
ToState(value) == XCHVLM_BULLISH_STATE;
//
;
@@ -1449,7 +1449,7 @@ public:
}
//
result = GetSum(values);
result = MathAbs(GetSum(values));
//
return result;
@@ -1475,7 +1475,7 @@ public:
}
//
result = GetSum(values);
result = MathAbs(GetSum(values));
//
return result;
+35 -35
View File
@@ -561,91 +561,91 @@ void DefineBuffers()
// Current ...
//
ENUM_DRAW_TYPE cDrawType = showCurrent ? DRAW_LINE : DRAW_NONE;
// ENUM_DRAW_TYPE cDrawType = showCurrent ? DRAW_LINE : DRAW_NONE;
//
ArraySetAsSeries(cBullBuffer, true);
SetIndexBuffer(cBullBufferIndex, cBullBuffer, INDICATOR_DATA);
PlotIndexSetInteger(cBullBufferIndex, PLOT_DRAW_TYPE, cDrawType);
PlotIndexSetInteger(cBullBufferIndex, PLOT_SHOW_DATA, showCurrent);
SetIndexBuffer(cBullBufferIndex, cBullBuffer, INDICATOR_CALCULATIONS);
// PlotIndexSetInteger(cBullBufferIndex, PLOT_DRAW_TYPE, cDrawType);
// PlotIndexSetInteger(cBullBufferIndex, PLOT_SHOW_DATA, showCurrent);
//
ArraySetAsSeries(cBearBuffer, true);
SetIndexBuffer(cBearBufferIndex, cBearBuffer, INDICATOR_DATA);
PlotIndexSetInteger(cBearBufferIndex, PLOT_DRAW_TYPE, cDrawType);
PlotIndexSetInteger(cBearBufferIndex, PLOT_SHOW_DATA, showCurrent);
SetIndexBuffer(cBearBufferIndex, cBearBuffer, INDICATOR_CALCULATIONS);
// PlotIndexSetInteger(cBearBufferIndex, PLOT_DRAW_TYPE, cDrawType);
// PlotIndexSetInteger(cBearBufferIndex, PLOT_SHOW_DATA, showCurrent);
//
// Short ...
//
ENUM_DRAW_TYPE sDrawType = showShort ? DRAW_LINE : DRAW_NONE;
// ENUM_DRAW_TYPE sDrawType = showShort ? DRAW_LINE : DRAW_NONE;
//
ArraySetAsSeries(sBullBuffer, true);
SetIndexBuffer(sBullBufferIndex, sBullBuffer, INDICATOR_DATA);
PlotIndexSetInteger(sBullBufferIndex, PLOT_DRAW_TYPE, sDrawType);
PlotIndexSetInteger(sBullBufferIndex, PLOT_SHOW_DATA, showShort);
SetIndexBuffer(sBullBufferIndex, sBullBuffer, INDICATOR_CALCULATIONS);
// PlotIndexSetInteger(sBullBufferIndex, PLOT_DRAW_TYPE, sDrawType);
// PlotIndexSetInteger(sBullBufferIndex, PLOT_SHOW_DATA, showShort);
//
ArraySetAsSeries(sBearBuffer, true);
SetIndexBuffer(sBearBufferIndex, sBearBuffer, INDICATOR_DATA);
PlotIndexSetInteger(sBearBufferIndex, PLOT_DRAW_TYPE, sDrawType);
PlotIndexSetInteger(sBearBufferIndex, PLOT_SHOW_DATA, showShort);
SetIndexBuffer(sBearBufferIndex, sBearBuffer, INDICATOR_CALCULATIONS);
// PlotIndexSetInteger(sBearBufferIndex, PLOT_DRAW_TYPE, sDrawType);
// PlotIndexSetInteger(sBearBufferIndex, PLOT_SHOW_DATA, showShort);
//
// Medium ...
//
ENUM_DRAW_TYPE mDrawType = showMedium ? DRAW_LINE : DRAW_NONE;
// ENUM_DRAW_TYPE mDrawType = showMedium ? DRAW_LINE : DRAW_NONE;
//
ArraySetAsSeries(mBullBuffer, true);
SetIndexBuffer(mBullBufferIndex, mBullBuffer, INDICATOR_DATA);
PlotIndexSetInteger(mBullBufferIndex, PLOT_DRAW_TYPE, mDrawType);
PlotIndexSetInteger(mBullBufferIndex, PLOT_SHOW_DATA, showMedium);
SetIndexBuffer(mBullBufferIndex, mBullBuffer, INDICATOR_CALCULATIONS);
// PlotIndexSetInteger(mBullBufferIndex, PLOT_DRAW_TYPE, mDrawType);
// PlotIndexSetInteger(mBullBufferIndex, PLOT_SHOW_DATA, showMedium);
//
ArraySetAsSeries(mBearBuffer, true);
SetIndexBuffer(mBearBufferIndex, mBearBuffer, INDICATOR_DATA);
PlotIndexSetInteger(mBearBufferIndex, PLOT_DRAW_TYPE, mDrawType);
PlotIndexSetInteger(mBearBufferIndex, PLOT_SHOW_DATA, showMedium);
SetIndexBuffer(mBearBufferIndex, mBearBuffer, INDICATOR_CALCULATIONS);
// PlotIndexSetInteger(mBearBufferIndex, PLOT_DRAW_TYPE, mDrawType);
// PlotIndexSetInteger(mBearBufferIndex, PLOT_SHOW_DATA, showMedium);
//
// Long ...
//
ENUM_DRAW_TYPE lDrawType = showLong ? DRAW_LINE : DRAW_NONE;
// ENUM_DRAW_TYPE lDrawType = showLong ? DRAW_LINE : DRAW_NONE;
//
ArraySetAsSeries(lBullBuffer, true);
SetIndexBuffer(lBullBufferIndex, lBullBuffer, INDICATOR_DATA);
PlotIndexSetInteger(lBullBufferIndex, PLOT_DRAW_TYPE, lDrawType);
PlotIndexSetInteger(lBullBufferIndex, PLOT_SHOW_DATA, showLong);
SetIndexBuffer(lBullBufferIndex, lBullBuffer, INDICATOR_CALCULATIONS);
// PlotIndexSetInteger(lBullBufferIndex, PLOT_DRAW_TYPE, lDrawType);
// PlotIndexSetInteger(lBullBufferIndex, PLOT_SHOW_DATA, showLong);
//
ArraySetAsSeries(lBearBuffer, true);
SetIndexBuffer(lBearBufferIndex, lBearBuffer, INDICATOR_DATA);
PlotIndexSetInteger(lBearBufferIndex, PLOT_DRAW_TYPE, lDrawType);
PlotIndexSetInteger(lBearBufferIndex, PLOT_SHOW_DATA, showLong);
SetIndexBuffer(lBearBufferIndex, lBearBuffer, INDICATOR_CALCULATIONS);
// PlotIndexSetInteger(lBearBufferIndex, PLOT_DRAW_TYPE, lDrawType);
// PlotIndexSetInteger(lBearBufferIndex, PLOT_SHOW_DATA, showLong);
//
// Hind ...
//
ENUM_DRAW_TYPE hDrawType = showHind ? DRAW_LINE : DRAW_NONE;
// ENUM_DRAW_TYPE hDrawType = showHind ? DRAW_LINE : DRAW_NONE;
//
ArraySetAsSeries(hBullBuffer, true);
SetIndexBuffer(hBullBufferIndex, hBullBuffer, INDICATOR_DATA);
PlotIndexSetInteger(hBullBufferIndex, PLOT_DRAW_TYPE, hDrawType);
PlotIndexSetInteger(hBullBufferIndex, PLOT_SHOW_DATA, showHind);
SetIndexBuffer(hBullBufferIndex, hBullBuffer, INDICATOR_CALCULATIONS);
// PlotIndexSetInteger(hBullBufferIndex, PLOT_DRAW_TYPE, hDrawType);
// PlotIndexSetInteger(hBullBufferIndex, PLOT_SHOW_DATA, showHind);
//
ArraySetAsSeries(hBearBuffer, true);
SetIndexBuffer(hBearBufferIndex, hBearBuffer, INDICATOR_DATA);
PlotIndexSetInteger(hBearBufferIndex, PLOT_DRAW_TYPE, hDrawType);
PlotIndexSetInteger(hBearBufferIndex, PLOT_SHOW_DATA, showHind);
SetIndexBuffer(hBearBufferIndex, hBearBuffer, INDICATOR_CALCULATIONS);
// PlotIndexSetInteger(hBearBufferIndex, PLOT_DRAW_TYPE, hDrawType);
// PlotIndexSetInteger(hBearBufferIndex, PLOT_SHOW_DATA, showHind);
}
//
+22 -17
View File
@@ -569,9 +569,10 @@ void DefineBuffers()
//
// ENUM_DRAW_TYPE cDrawType = showCurrent ? DRAW_COLOR_HISTOGRAM : DRAW_NONE;
// PlotIndexSetInteger(cPlotBufferIndex, PLOT_DRAW_TYPE, cDrawType);
SetIndexBuffer(cBufferIndex, cBuffer, INDICATOR_DATA);
SetIndexBuffer(cColorBufferIndex, cColorBuffer, INDICATOR_COLOR_INDEX);
PlotIndexSetInteger(cPlotBufferIndex, PLOT_SHOW_DATA, showCurrent);
// PlotIndexSetInteger(cPlotBufferIndex, PLOT_SHOW_DATA, showCurrent);
// SetIndexBuffer(cColorBufferIndex, cColorBuffer, INDICATOR_COLOR_INDEX);
SetIndexBuffer(cBufferIndex, cBuffer, INDICATOR_CALCULATIONS);
SetIndexBuffer(cColorBufferIndex, cColorBuffer, INDICATOR_CALCULATIONS);
//
// Short ...
@@ -579,9 +580,10 @@ void DefineBuffers()
//
// ENUM_DRAW_TYPE sDrawType = showShort ? DRAW_COLOR_HISTOGRAM : DRAW_NONE;
// PlotIndexSetInteger(sPlotBufferIndex, PLOT_DRAW_TYPE, sDrawType);
SetIndexBuffer(sBufferIndex, sBuffer, INDICATOR_DATA);
SetIndexBuffer(sColorBufferIndex, sColorBuffer, INDICATOR_COLOR_INDEX);
PlotIndexSetInteger(sPlotBufferIndex, PLOT_SHOW_DATA, showShort);
// PlotIndexSetInteger(sPlotBufferIndex, PLOT_SHOW_DATA, showShort);
// SetIndexBuffer(sColorBufferIndex, sColorBuffer, INDICATOR_COLOR_INDEX);
SetIndexBuffer(sBufferIndex, sBuffer, INDICATOR_CALCULATIONS);
SetIndexBuffer(sColorBufferIndex, sColorBuffer, INDICATOR_CALCULATIONS);
//
// Medium ...
@@ -589,9 +591,10 @@ void DefineBuffers()
//
// ENUM_DRAW_TYPE mDrawType = showMedium ? DRAW_COLOR_HISTOGRAM : DRAW_NONE;
// PlotIndexSetInteger(mPlotBufferIndex, PLOT_DRAW_TYPE, mDrawType);
SetIndexBuffer(mBufferIndex, mBuffer, INDICATOR_DATA);
SetIndexBuffer(mColorBufferIndex, mColorBuffer, INDICATOR_COLOR_INDEX);
PlotIndexSetInteger(mPlotBufferIndex, PLOT_SHOW_DATA, showMedium);
// PlotIndexSetInteger(mPlotBufferIndex, PLOT_SHOW_DATA, showMedium);
// SetIndexBuffer(mColorBufferIndex, mColorBuffer, INDICATOR_COLOR_INDEX);
SetIndexBuffer(mBufferIndex, mBuffer, INDICATOR_CALCULATIONS);
SetIndexBuffer(mColorBufferIndex, mColorBuffer, INDICATOR_CALCULATIONS);
//
// Long ...
@@ -599,19 +602,21 @@ void DefineBuffers()
//
// ENUM_DRAW_TYPE lDrawType = showLong ? DRAW_COLOR_HISTOGRAM : DRAW_NONE;
// PlotIndexSetInteger(lPlotBufferIndex, PLOT_DRAW_TYPE, lDrawType);
SetIndexBuffer(lBufferIndex, lBuffer, INDICATOR_DATA);
SetIndexBuffer(lColorBufferIndex, lColorBuffer, INDICATOR_COLOR_INDEX);
PlotIndexSetInteger(lPlotBufferIndex, PLOT_SHOW_DATA, showLong);
// PlotIndexSetInteger(lPlotBufferIndex, PLOT_SHOW_DATA, showLong);
// SetIndexBuffer(lColorBufferIndex, lColorBuffer, INDICATOR_COLOR_INDEX);
SetIndexBuffer(lBufferIndex, lBuffer, INDICATOR_CALCULATIONS);
SetIndexBuffer(lColorBufferIndex, lColorBuffer, INDICATOR_CALCULATIONS);
//
// Hind ...
//
ENUM_DRAW_TYPE hDrawType = showHind ? DRAW_COLOR_HISTOGRAM : DRAW_NONE;
SetIndexBuffer(hBufferIndex, hBuffer, INDICATOR_DATA);
SetIndexBuffer(hColorBufferIndex, hColorBuffer, INDICATOR_COLOR_INDEX);
PlotIndexSetInteger(hPlotBufferIndex, PLOT_DRAW_TYPE, hDrawType);
PlotIndexSetInteger(hPlotBufferIndex, PLOT_SHOW_DATA, showHind);
// ENUM_DRAW_TYPE hDrawType = showHind ? DRAW_COLOR_HISTOGRAM : DRAW_NONE;
// PlotIndexSetInteger(hPlotBufferIndex, PLOT_DRAW_TYPE, hDrawType);
// PlotIndexSetInteger(hPlotBufferIndex, PLOT_SHOW_DATA, showHind);
// SetIndexBuffer(hColorBufferIndex, hColorBuffer, INDICATOR_COLOR_INDEX);
SetIndexBuffer(hBufferIndex, hBuffer, INDICATOR_CALCULATIONS);
SetIndexBuffer(hColorBufferIndex, hColorBuffer, INDICATOR_CALCULATIONS);
}
//
+7 -7
View File
@@ -570,8 +570,8 @@ void DefineBuffers()
// ENUM_DRAW_TYPE cDrawType = showCurrent ? DRAW_COLOR_HISTOGRAM : DRAW_NONE;
// PlotIndexSetInteger(cPlotBufferIndex, PLOT_DRAW_TYPE, cDrawType);
SetIndexBuffer(cBufferIndex, cBuffer, INDICATOR_DATA);
SetIndexBuffer(cColorBufferIndex, cColorBuffer, INDICATOR_COLOR_INDEX);
PlotIndexSetInteger(cPlotBufferIndex, PLOT_SHOW_DATA, showCurrent);
SetIndexBuffer(cColorBufferIndex, cColorBuffer, INDICATOR_COLOR_INDEX);
//
// Short ...
@@ -580,8 +580,8 @@ void DefineBuffers()
// ENUM_DRAW_TYPE sDrawType = showShort ? DRAW_COLOR_HISTOGRAM : DRAW_NONE;
// PlotIndexSetInteger(sPlotBufferIndex, PLOT_DRAW_TYPE, sDrawType);
SetIndexBuffer(sBufferIndex, sBuffer, INDICATOR_DATA);
SetIndexBuffer(sColorBufferIndex, sColorBuffer, INDICATOR_COLOR_INDEX);
PlotIndexSetInteger(sPlotBufferIndex, PLOT_SHOW_DATA, showShort);
SetIndexBuffer(sColorBufferIndex, sColorBuffer, INDICATOR_COLOR_INDEX);
//
// Medium ...
@@ -590,8 +590,8 @@ void DefineBuffers()
// ENUM_DRAW_TYPE mDrawType = showMedium ? DRAW_COLOR_HISTOGRAM : DRAW_NONE;
// PlotIndexSetInteger(mPlotBufferIndex, PLOT_DRAW_TYPE, mDrawType);
SetIndexBuffer(mBufferIndex, mBuffer, INDICATOR_DATA);
SetIndexBuffer(mColorBufferIndex, mColorBuffer, INDICATOR_COLOR_INDEX);
PlotIndexSetInteger(mPlotBufferIndex, PLOT_SHOW_DATA, showMedium);
SetIndexBuffer(mColorBufferIndex, mColorBuffer, INDICATOR_COLOR_INDEX);
//
// Long ...
@@ -600,18 +600,18 @@ void DefineBuffers()
// ENUM_DRAW_TYPE lDrawType = showLong ? DRAW_COLOR_HISTOGRAM : DRAW_NONE;
// PlotIndexSetInteger(lPlotBufferIndex, PLOT_DRAW_TYPE, lDrawType);
SetIndexBuffer(lBufferIndex, lBuffer, INDICATOR_DATA);
SetIndexBuffer(lColorBufferIndex, lColorBuffer, INDICATOR_COLOR_INDEX);
PlotIndexSetInteger(lPlotBufferIndex, PLOT_SHOW_DATA, showLong);
SetIndexBuffer(lColorBufferIndex, lColorBuffer, INDICATOR_COLOR_INDEX);
//
// Hind ...
//
ENUM_DRAW_TYPE hDrawType = showHind ? DRAW_COLOR_HISTOGRAM : DRAW_NONE;
// ENUM_DRAW_TYPE hDrawType = showHind ? DRAW_COLOR_HISTOGRAM : DRAW_NONE;
// PlotIndexSetInteger(hPlotBufferIndex, PLOT_DRAW_TYPE, hDrawType);
SetIndexBuffer(hBufferIndex, hBuffer, INDICATOR_DATA);
SetIndexBuffer(hColorBufferIndex, hColorBuffer, INDICATOR_COLOR_INDEX);
PlotIndexSetInteger(hPlotBufferIndex, PLOT_DRAW_TYPE, hDrawType);
PlotIndexSetInteger(hPlotBufferIndex, PLOT_SHOW_DATA, showHind);
SetIndexBuffer(hColorBufferIndex, hColorBuffer, INDICATOR_COLOR_INDEX);
}
//
+5 -5
View File
@@ -1635,11 +1635,11 @@ private:
chvlmInputs.hcPeriod = hcPeriod;
//
chvlmInputs.showCurrent = false;
chvlmInputs.showShort = false;
chvlmInputs.showMedium = false;
chvlmInputs.showLong = false;
chvlmInputs.showHind = false;
chvlmInputs.showCurrent = true;
chvlmInputs.showShort = true;
chvlmInputs.showMedium = true;
chvlmInputs.showLong = true;
chvlmInputs.showHind = true;
//
chvlmHelper = new XSCXCHVLMHelper();