I'm trying to make a simple paintbar indicator for Ninja where it simply makes a candle green if the close is above previous high, red if below previous low, and neutral if neither above or below.
Here's the code that just won't seem to work:
protected override void OnBarUpdate()
{
// Use this method for calculating your indicator values. Assign a value to each
// plot below by replacing 'Close[0]' with your own formula.
if( Close[0] > High[1] ) {
BarColor = Color.Green;
} else if( Close[0] < Low[1] ) {
BarColor = Color.Red;
} else if( (Close[0] < High[1]) && (Close[0] > Low[1]) ) {
BarColor = Color.Black;
}
}
I appreciate any help!

Comment