This commit is contained in:
2024-06-22 17:55:17 +03:30
parent fbe701f198
commit b88d74e57d
7 changed files with 2719 additions and 8 deletions
+12
View File
@@ -49,6 +49,10 @@ double mainBuffer[];
#define mainBufferColorIndex 1
double mainBufferColor[];
//
#define stateBufferIndex 2
double stateBuffer[];
//
#define hideColorIDX 0
#define bullColorIDX 1
@@ -204,17 +208,22 @@ int OnCalculate(
}
//
stateBuffer[i] = stateBuffer[i - 1];
mainBufferColor[i] = mainBufferColor[i - 1];
//
if (work[i][trend] == 1)
{
//
stateBuffer[i] = 1;
mainBufferColor[i] = bullColorIDX;
}
//
if (work[i][trend] == -1)
{
//
stateBuffer[i] = -1;
mainBufferColor[i] = bearColorIDX;
}
}
@@ -259,6 +268,9 @@ void DefineBuffers()
SetIndexBuffer(mainBufferIndex, mainBuffer, INDICATOR_DATA);
PlotIndexSetInteger(mainBufferIndex, PLOT_DRAW_TYPE, mainDrawType);
SetIndexBuffer(mainBufferColorIndex, mainBufferColor, INDICATOR_COLOR_INDEX);
//
SetIndexBuffer(stateBufferIndex, stateBuffer, INDICATOR_CALCULATIONS);
}
//