Indicator with custom painting (GDI)
Draw any graphical objects on the chart using the GDI+ library
Introduction
Access Graphics object
public override void OnPaintChart(PaintChartEventArgs args)
{
// Use received Graphics object which give us acces to chart canvas
Graphics gr = args.Graphics;
// Add your custom drawings here...
}public override void OnPaintChart(PaintChartEventArgs args)
{
Graphics gr = args.Graphics;
// Draw a line using predefined Red pen
gr.DrawLine(Pens.Red, 100,100,200,200);
// Draw a rectangle using predefined Blue pen
gr.DrawRectangle(Pens.Blue, 250, 100, 100, 100);
// Fill a rectangle using predefined yellow brush
gr.FillRectangle(Brushes.Yellow, 400, 100, 100, 100);
// Create a custom pen and use it for drawing
Pen myPen = new Pen(Color.Green, 3);
gr.DrawRectangle(myPen, 50, 50, 500, 200);
}
Drawing a simple text

Market depth levels on chart

Last updated