I wish to draw a rectangle in the Stochastic panel between 40 and 60.
Using this command:
Draw.Rectangle(this, "oo"+CurrentBar.ToString(), true, 1, 60.0, 0, 40.0, Brushes.Blue, Brushes.Blue, 50);
It gets confused and displays a scale of 0 to 0.24. I have tried both true and false
What am I doing wrong?
protected override void OnBarUpdate()
{
double min0 = min[0];
nom[0] = Close[0] - min0;
den[0] = max[0] - min0;
if (den[0].ApproxCompare(0) == 0)
fastK[0] = CurrentBar == 0 ? 50 : fastK[1];
else
fastK[0] = Math.Min(100, Math.Max(0, 100 * nom[0] / den[0]));
// Slow %K == Fast %D
K[0] = smaFastK[0];
D[0] = smaK[0];
Draw.Rectangle(this, "oo"+CurrentBar.ToString(), true, 1, 60.0, 0, 40.0, Brushes.Blue, Brushes.Blue, 50);
}

Comment