# 1.3	Adding a UDI to a chart

You add a UDI to a chart – including any of the examples – by clicking on the indicators button in the chart toolbar, choosing Advanced / UDI, and then pasting in the Javascript code.&#x20;

You can also store your UDI on a web server, and then paste in the URL of the file rather than its contents. Note: your server must be CORS-friendly; your server must set the CORS headers Access-Control-Allow-Origin and Access-Control-Allow-Credentials on its response so that the chart is allowed to make the cross-origin HTTP request.

If you want to share your UDI with other people while protecting how it does its calculation, you can use a code obfuscation service. Examples include [javascript-obfuscator](https://github.com/javascript-obfuscator/javascript-obfuscator) (free) and [JScrambler](https://jscrambler.com/) (paid).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sway-technologies.gitbook.io/sway-charts-pro-scripts-documentation/sway-charts-pro-user-defined-indicators/introduction/1.3-adding-a-udi-to-a-chart.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
