9.1 Collecting external data

Your UDI can collect external data, such as an economic calendar or trading signals, and then draw that data on the chart or incorporate it into the output which your indicator calculates.

Like any Javascript in a web browser, your UDI can use XMLHttpRequest (or web sockets).

However, as always, XMLHttpRequest is subject to browser security: your web browser will only let you make a cross-origin call to a remote server if that server permits such a call by setting the CORS headers Access-Control-Allow-Origin and Access-Control-Allow-Credentials on its response.

If you are trying to use a third-party service which is not CORS-compatible then you need a proxy in between your UDI and the third-party server. For example, you cannot request the Forex Factory calendar at https://cdn-nfs.forexfactory.net/ff_calendar_thisweek.xml directly from browser Javascript, because the Forex Factory page does not set CORS headers.

In addition, Sway Charts Pro is hosted at an https:// address. Standard browser security will prevent you making any sort of connection to a non-secure http:// address.

Last updated