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 Framework

Sending mail into Liquid Charts Pro from outside the platform

PreviousScript contextsNextlanguage variables

Last updated 3 months ago

It's possible to send mail into Liquid Charts Pro from outside the platform, from any environment which can make HTTP requests. If you are sending to a mobile device this also generates an iOS/Android push notification, and so you can receive alerts on your phone (or tablet) from external sources.

For example, you can send messages into Liquid Charts Pro from a huge range of sources, covering everything from a financial model in Microsoft Excel to an EA in the MT4 or MT5 trading platforms.

The examples in this guide use the general-purpose command-line tool curl. This is just a way of demonstrating that mail can be sent into Liquid Charts Pro from anything which can make HTTP requests. You can use the to translate from these examples to any other environment which can make HTTP requests.

All mail in Liquid Charts Pro is sent to devices (not to people, or to trading accounts). You need three pieces of information in order to send mail into Liquid Charts Pro:

· The mail ID of your device, which will be an 8-character code such as DMZLXCVG. You can see this by opening the new-mail window in Liquid Charts Pro, from the Mailbox widget.

· Your sender password, which is a long alphanumeric string. You can see this by doing a long tap/click over your ID in the new-mail window. This expands the new-mail window to show extra information.

· Your message server. This is also shown when you do the long-tap/click over the ID.

You send mail by making a POST request to the messaging server, with the request body being a block of JSON describing the message. For example, using curl:

curl --url "https://proapimessaging.Liquidcharts.com/send?DMZLXCVG" --request "POST" --data-raw "{'password':'C9753B5FA8E5417BA064618AF65E2520', 'subject':'Test message'}"

To confirm, what this example is doing is making a POST request to a URL which consists of three parts:

· The message server, such as https://proapimessaging.Liquidcharts.com

· The path /send

· Your device ID as the request's querystring: ?DMZLXCVG

The body of the POST is then a block of JSON data. As a minimum, it must contain your sender password and a subject line for the message.

The values which you can include in the JSON body, describing the message, are as follows. The password and subject are compulsory. Everything else is optional.

Property

Description

password

The sending password for your device, as described above

subject

A subject line for the message (max 200 characters)

body

An optional body for the message (max 4KB)

to

Recipient ID, if sending a message to another device. If there is no to value, then the message is simply sent to your own device as identified by the request querystring.

priority

Priority for the message

attachment

Attachment data

noPush

Turns off any iOS/Android push notification

You can send mail to other people's devices as well as your own, by setting the to property. But it's deliberate that there is no way of discovering someone else's ID without them looking it up – in the Liquid Charts Pro new-mail window as described above – and telling it to you.

Messages to your own device can have priority. This is ignored if you use the to value to send a message to another device. Priorities are as follows:

Priority

Description

0

Normal priority

1

Message is marked in red in the Liquid Charts Pro mailbox

2

Liquid Charts Pro displays a red new-mail icon in its banner until the message has been read

3

Message is forced to open in the platform (after next log-in, if Liquid Charts Pro is not currently running)

The optional message body can be any of three things:

· Plain text

· HTML – a full HTML document with <html> and </html>

· The URL of a web page. This must be an https:// page, not http://, and the page must not set the X-Frame-Options header.

For example, the following sends a priority 2 message with the www.Liquidcharts.com website as the content:

curl --url "https://proapimessaging.Liquidcharts.com/send?DMZLXCVG" --request "POST" --data-raw "{'password':'C9753B5FA8E5417BA064618AF65E2520', 'subject':'Test message', 'body':'https://www.fxblue.com', 'priority': 2}"

If you are sending to a mobile phone (or tablet), then Liquid Charts Pro mail generates iOS/Android push notifications by default. You can turn this off by setting 'noPush':true in the JSON (or any value for noPush – it is not actually treated as a boolean).

Mail into Liquid Charts Pro is subject to a quota – for example, a maximum of 60 requests per hour. Messages will be rejected if you try to send too many (including invalid requests such as those missing a subject line, or with a non-existent recipient).

The HTTP status code of the response from the server will be 200 if the message succeeds. If the message fails for any reason, then the status code will be 400. The body of the response from the server is JSON consisting of either one or two values:

Property

Description

success

True/false, indicating whether the message succeeded (duplicating the 200/400 status code of the response)

error

If success=false, a description of why the message failed

Like with messages sent from inside the Liquid Charts Pro platform in its new-mail window, you can also add attachment data. This works as follows:

· You use the Data Transfer widget in Liquid Charts Pro to download an attachment (a .Liquid Charts Protransfer file)

· You open the .Liquid Charts Protransfer file in any text editor

· You add the attachment data (beginning AAAA…) into the message

help material for curl