protected override void OnUpdate(UpdateArgs args)
// get current values (offset is '0' by default)
var currFastValue = this.fastSma.GetValue();
var currSlowValue = this.slowSma.GetValue();
// get previous values (offset is '1')
var prevFastValue = this.fastSma.GetValue(1);
var prevSlowValue = this.slowSma.GetValue(1);
// check if our lines are crossed.
var isCrossing = currFastValue > currSlowValue && prevFastValue < prevSlowValue ||
currFastValue < currSlowValue && prevFastValue > prevSlowValue;
this.SetValue(currFastValue, 0);
this.SetValue(currSlowValue, 1);
// finish drawing the current cloud.
this.EndCloud(0, 1, Color.Empty);
// start drawing a new cloud.
if (currFastValue > currSlowValue)
this.BeginCloud(0, 1, this.FastAboveCloudColor);
else if (currFastValue < currSlowValue)
this.BeginCloud(0, 1, this.SlowAboveCloudColor);