- Calculate the size of the bar divided by the speed of the bar
- Take a 20 period SMA of that calculation
- Compare the current bar to the SMA
- If the current bar is greater than the SMA, change the bar's color to blue.
Here's what I have:
double ticks = Range()[0] / TickSize;
TimeSpan duration;
duration = Time[0] - Time[1];
double span = duration.TotalSeconds;
double speed = ticks / span;
speedseries.Set(speed);
avespeedseries.Set(SMA(speedseries,20)[0]);
if(speed > avespeedseries[0])
{
BarColor = Color.Blue;
CandleOutlineColor = Color.Black;
}
Unfortunately, this doesn't do anything. I can even change to greater-than sign to less-than, so that's telling me there's something wrong with the code.
Any help would be appreciated.
Comment