last ...
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
//
|
||||
Reference in New Issue
Block a user