Skip to main content

Drawing API Reference

HyperionX drawing calls live on Draw and Ctx.Drawing.

Use HyperionX drawing methods, not drawing calls from other platforms. Draw.TextFixed is not a HyperionX API. Use Draw.FixedText(...) or Draw.HudText(...).

Tags

Drawings are keyed by tag. Reusing a tag updates/replaces the existing drawing.

Draw.LineHorizontal(this, "session-high", High[0], Brushes.DeepSkyBlue, 1, DashStyles.Dash);

Use stable tags for one drawing that moves. Use unique tags for historical marks.

Lines

Draw.Line(
this,
"swing-line",
startBarsAgo: 10,
startY: Low[10],
endBarsAgo: 0,
endY: High[0],
brush: Brushes.DeepSkyBlue,
width: 2,
dash: DashStyles.Solid);

Horizontal line:

Draw.LineHorizontal(this, "last-close", Close[0], Brushes.Gray, 1, DashStyles.Dash);

Vertical line:

Draw.LineVertical(this, "event", 0, Brushes.Gray, 1, DashStyles.Solid);

Text

Draw.Text(
this,
"breakout-label",
"Breakout",
barsAgo: 0,
y: High[0],
textBrush: Brushes.White,
fontName: "Verdana",
textSize: 12,
outlineBrush: Brushes.Black,
areaBrush: Brushes.Black,
areaOpacity: 0.7,
yTop: true);

Fixed HUD Text

Use fixed text for panel labels, status values, timers, or readouts that should stay pinned while the chart pans.

Draw.FixedText(
this,
"status",
$"Close: {Close[0]:0.####}",
ChartHudAnchor.TopRight,
xOffset: 10,
yOffset: 10,
textBrush: Brushes.White,
backgroundBrush: Brushes.Black,
borderBrush: Brushes.DeepSkyBlue,
fontName: "Verdana",
fontSize: 12,
opacity: 0.85,
padding: 6);

Draw.HudText(...) is an alias for fixed HUD text.

Available anchors:

  • TopLeft
  • TopCenter
  • TopRight
  • CenterLeft
  • Center
  • CenterRight
  • BottomLeft
  • BottomCenter
  • BottomRight

Arrows

Draw.Arrow(
this,
ArrowDirection.Up,
"long-arrow",
barsAgo: 0,
y: Low[0],
connector: ArrowConnector.End,
brush: Brushes.LimeGreen);

Arrow directions:

  • Left
  • Down
  • Right
  • Up

Remove And Check Drawings

if (Draw.Exists("status"))
Draw.Remove("status");

Draw.Reset();

Ctx.Drawing exposes a smaller structured wrapper:

Ctx.Drawing.FixedText("status", "Live", ChartHudAnchor.TopRight);
bool exists = Ctx.Drawing.Exists("status");
Ctx.Drawing.Remove("status");

Pane Targeting

Several drawing calls accept a PaneControl pane = null. If no pane is supplied, the drawing targets the main pane.

For indicator panels, keep the PaneControl returned by AddPane(...) and pass it into drawing calls where needed.

Porting Notes

Other-platform conceptHyperionX direction
Draw.TextFixed(...)Draw.FixedText(...) or Ctx.Drawing.FixedText(...).
TextPosition.TopRightChartHudAnchor.TopRight.
IsOverlayUse panes and plots.
direct WPF chart drawingUse Draw or IChartOverlayRenderer.