OK, yes, that makes sense now; I am wondering if it would be possible for you to change the indicator to color the bar, instead of the indicator, when the conditions are met.
I am attaching a chart; I am wondering if you can color the 4th bar from the right green.
Do you see the long signal generated right before the 4th bar? It would be very good if the 4th bar itself could be colored green as an indicator to go long.
Is this possible to do?
Quote:
|
Originally Posted by codersguru
This is the code of changing the color of indicator:
PHP Code:
for(shift=limit; shift>=0; shift--)
{
if (buffer[shift-1]>buffer[shift])
{
UpBuffer[shift-1] = EMPTY_VALUE;
}
else if (buffer[shift-1]<buffer[shift] )
{
DownBuffer[shift-1] = EMPTY_VALUE;
}
else
{
UpBuffer[shift-1] = CLR_NONE;
DownBuffer[shift-1] = CLR_NONE;
}
}
The code above means: - When the previous value of of Moving average is Greater than the current value change the color to red
- And when the previous value of of Moving average is Lesser than the current value change the color to green
That's all!
|