Best regards from Germany
Al
#region Plot
public override void Plot(Graphics graphics, Rectangle bounds, double min, double max)
{
try
{
if (!InHitTest)
{
if (swBtnP00 == true)
{
for (int x = 1; x <= CurrentBar; x++)
{
#region Period3
vPriceX1sma = ChartControl.GetXByBarIdx(BarsArray[0], x);
vPriceY1sma = ChartControl.GetYByValue(BarsArray[0], SMA3Line[CurrentBar - x]);
vPriceX1ema = ChartControl.GetXByBarIdx(BarsArray[0], x);
vPriceY1ema = ChartControl.GetYByValue(BarsArray[0], EMA3Line[CurrentBar - x]);
vPriceX2sma = ChartControl.GetXByBarIdx(BarsArray[0], x - 1);
vPriceY2sma = ChartControl.GetYByValue(BarsArray[0], SMA3Line[CurrentBar - (x-1)]);
vPriceX2ema = ChartControl.GetXByBarIdx(BarsArray[0], x - 1);
vPriceY2ema = ChartControl.GetYByValue(BarsArray[0], EMA3Line[CurrentBar - (x-1)]);
point1 = new Point(vPriceX1sma, vPriceY1sma);
point2 = new Point(vPriceX1ema, vPriceY1ema);
point3 = new Point(vPriceX2ema, vPriceY2ema);
point4 = new Point(vPriceX2sma, vPriceY2sma);
curvePoints = new Point[]
{
point4,
point3,
point2,
point1
};
if (vPriceY1sma < vPriceY2ema)
{
//graphics.DrawPolygon(new Pen(Color.Red, 1), curvePoints);
graphics.FillPolygon(new SolidBrush(Color.FromArgb(VIntensity, Color.Red)), curvePoints, FillMode.Alternate);
graphics.DrawLine(new Pen(Color.Chocolate, 1), vPriceX2sma, vPriceY2sma, vPriceX1sma, vPriceY1sma);
}
else
{
//graphics.DrawPolygon(new Pen(Color.Red, 1), curvePoints);
graphics.FillPolygon(new SolidBrush(Color.FromArgb(VIntensity, Color.Green)), curvePoints, FillMode.Winding);
graphics.DrawLine(new Pen(Color.Chocolate, 1), vPriceX2sma, vPriceY2sma, vPriceX1sma, vPriceY1sma);
}
#endregion Period3
}
}
}
}
#region Exception
catch (Exception ex)
{
Print("Unhandled exception in HCSCloudMA.Plot(): " + ex.Message);
}
#endregion Exception
}
#endregion Plot
Comment