Liquid Charts API Docs
Liquid Charts Pro Scripts Documentation
Liquid Charts Pro Scripts Documentation
  • Liquid Charts Pro User-Defined Indicators
    • Introduction
      • 1.1 Access to the Liquid Charts scripting framework (UDI vs UDIX)
      • 1.2 Example UDI code
      • 1.3 Adding a UDI to a chart
      • 1.4 Lifecycle
      • 1.5 Alerts
      • 1.6 Indicator-on-indicator
      • 1.7 Technical note: web workers
      • 1.8 Technical note: dates
    • Initialisation: UDI.onInit()
      • 2.1 Return value from UDI.onInit()
      • 2.2 The plots[] array
      • 2.3 The settingsFields[] array
      • 2.4 Context data passed to UDI.onInit()
    • Calculating data: UDI.onCalculate()
      • 3.1 Reading settings fields
      • 3.2 Input data for the UDI
      • 3.3 Updates of the current bar only
      • 3.4 Calculating output data
      • 3.5 Requesting out-of-band updates
      • 3.6 Technical analysis: moving averages, ATR etc
    • Changes to the chart or parameters
      • 4.1 UDI.onContextChange()
      • 4.2 UDI.onParameterChange()
    • Creating drawings, event markers, and bar highlights
      • 5.1 Creating drawings
      • 5.1.1 Drawing properties
      • 5.2 Creating event markers
      • 5.2.1 Click notifications from event markers
      • 5.3 Creating bar highlights
    • Notifying the user
      • 6.1 Creating toast
      • 6.2 Changing the panel background colour
    • Adding HTML to the chart
      • 7.1 Adding HTML
      • 7.2 Positioning the HTML
      • 7.3 Sending messages from the HTML to the UDI
      • 7.4 Sending messages from the UDI to the HTML
    • Recommended trade
      • 8.0 Recommended trade
    • Other indicator topics
      • 9.1 Collecting external data
      • 9.2 Converting dates to chart time
      • 9.3 Multi-timeframe (MTF) indicators
  • Liquid Charts Pro Framework
    • Examples
    • Collections, objects, and properties in the framework
    • Functions in the framework
    • Messages and event handlers
    • Working with candle data
    • Widget HTML and CSS reference
    • Liquid.utils and other helper functions
    • Framework error codes
    • Script contexts
    • Sending mail into Liquid Charts Pro from outside the platform
    • language variables
Powered by GitBook
On this page
  1. Liquid Charts Pro User-Defined Indicators
  2. Creating drawings, event markers, and bar highlights

5.1.1 Drawing properties

Drawings can have the following properties. Each drawing must have a type and an array of points[]. The number of required points depends on the type of drawing: one for a horizontal line, two for a rectangle etc

Some properties are only applicable to some types of drawing (e.g. text, icon).

Property

Description

type

Type of drawing, e.g. "lineSegment"

points[]

Array of points, each one consisting of a date and a value. For example: points: [{date: data.barData.date[0]}, value: data.barData.high[0]}]

For text and rectangle drawings, the points can also be pixel co-ordinates (from the top-left of the chart), instead of time-price co-ordinates. For example: points: [{x:100, y:100}, {x:200, y:200}]

style

Graphical style for the drawing, consisting of line and/or fill and/or text sub-objects depending on the type of drawing

style.line

Can contain the properties color, width, and lineStyle. The style of the line can be "solid", "dash", or "dot". For some types of drawing, such as lines, the style can also be any character from the Font Awesome font, in the form "icon-aaaa" where "aaaa" is the hex code of the character, such as "f0ab".

style.fill

Can contain a color property, specifying fill color

style.text

Can contain the properties color, fontFamily, fontSize, and fontStyle

inMainPanel

Only applicable to indicators which are displayed in their own sub-panel (isOverlay:false). Controls whether the drawing is created in the indicator's sub-panel or in the main chart panel.

unselectable

If true, makes the drawing completely unselectable (and unmoveable, and undeletable)

moveable

If true, allows the user to move the drawing

removable

If true, allows the user to delete the drawing

showInBackground

Controls whether the drawing is shown in front of the bars, or behind them

text

Text to display

icon

Icon to display, as a hex code of a character from the Font Awesome character set, such as "f0ab"

iconSize

Size, in pixels, for the icon

markerOffset

For the barMarker drawing type, offsets the position of the marker from the price by the specified number of pixels (negative for above, positive for below)

textAboveLine

Boolean value which positions text above the centre of the drawing (e.g. above a horizontal line or a bar marker) rather than below it

Previous5.1 Creating drawingsNext5.2 Creating event markers

Last updated 3 months ago