# Code Editor

## Code Editor

The Code Editor is your interactive canvas for Pine Script, located on the right side of the application. It's where HorizonAI brings your trading ideas to life by writing and updating your code in real-time.

### Key Features:

* **Live Code Generation:**&#x20;
  * Watch as HorizonAI generates and modifies your script right before your eyes. The editor is seamlessly connected to the AI, so any changes you ask for in the chat are automatically applied to the code.
* **Your Code, Your Control:**
  * You have full control. You can type directly into the editor, paste existing scripts, or make manual tweaks. HorizonAI sees your changes and adapts its responses accordingly.
* **One-Click Copy for TradingView:**
  * When your script is ready, just click the Copy Code button in the header. The entire script is instantly copied to your clipboard, ready to be pasted directly into the TradingView Pine Editor.

<figure><img src="/files/WzDxnRpBObjkosLzQ8NB" alt=""><figcaption></figcaption></figure>


---

# 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://horizon-trading.gitbook.io/horizon-trading/editor.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.
