DRAWARROW

Category: Graphical

DRAWARROW is a graphical instruction used in the ProBuilder language to draw a horizontal arrow pointing to the right on a chart. This function is primarily used to visually indicate specific points or events on the price chart, such as crossovers or other significant occurrences identified by a trading strategy.

Syntax:

DRAWARROW(x1, y1) COLOURED(R, V, B, a)

Where:

  • x1 – Represents the Barindex, indicating the specific bar on the chart.
  • y1 – Represents the price or the value on the vertical axis at which the arrow should be drawn.
  • COLOURED(R, V, B, a) – Defines the color and transparency of the arrow using RGBA values:
    • R – Red component (0-255).
    • V – Green component (0-255).
    • B – Blue component (0-255).
    • a – Alpha component for transparency (0-255), where 255 is fully opaque and 0 is fully transparent.

Example:

fast = average[10](close)
slow = average[30](close)

// Draw a blue arrow if the fast average crosses over the slow average
if fast crosses over slow then
  cross = slow[1]
  DRAWARROW(barindex-1, slow[1]) COLOURED(0, 100, 255, 255)
endif

// Draw a semi-transparent purple arrow if fast is greater than slow and slow has not just been crossed
if fast > slow AND slow <> cross then
  DRAWARROW(barindex, slow) COLOURED(151, 17, 228, 100)
endif

RETURN

This example uses two moving averages (fast and slow) to determine points on the chart where an arrow should be drawn. The first arrow is blue and appears at the point where the fast moving average crosses over the slow moving average. Subsequent arrows are purple and semi-transparent, drawn whenever the fast average is greater than the slow average, provided the slow average has not just been crossed.

Additional Information:

  • The DRAWARROW function is useful for marking specific events on a chart, making it easier to visually analyze trading strategies and their effects.
  • Adjusting the color and transparency of the arrow can help differentiate between different types of events or conditions.

Related Instructions:

  • DRAWARROWDOWN graphical
  • DRAWARROWUP graphical
  • Logo Logo
    Loading...