LootX

AI Assistant in the Editor

new Updated September 30, 2026 This page as PDF

Chat with an AI model inside the LootScript editor: it writes and edits scripts, runs them on candles, answers market questions. Which providers are supported, where to enter your key, and what is sent from your computer.

The LootScript editor includes a chat with an AI model. Describe in words the indicator you need — the assistant will write the code directly in the editor, compile it, run it on real candles and report the results. It also edits existing scripts, explains other people’s code and answers market questions using terminal data.

You choose the model yourself: cloud — with your API key, or local — running on your machine. Requests go from the terminal directly to the chosen provider, without passing through LootX servers.

How to open the assistant

  1. Click ƒ on the chart panel — the Indicators window opens.
  2. Click Editor… next to the search box, or open your script.
  3. In the editor’s top bar, next to Add to chart, click Assistant.

The chat docks to the right of the code. Resize its width by dragging the divider. The X in the chat header (Hide chat) closes it without deleting the conversation; clicking Assistant again reopens it.

Connecting a model

Open the connection card

On first use the card opens automatically. Later open it via the gear Key and connection in the chat header.

Choose a provider

The list is in the table below. Claude is selected by default.

Paste your API key

There’s a link under the field Get key on … — it goes to the provider dashboard. A saved key is not shown in the field: leave it empty to keep the existing key, or click Delete key.

Check the model and save

The Model field is prefilled with a default; hints list a few more. Enter any model name the provider recognises. Click Save.

Provider What you need
Claude Anthropic API key. A Claude subscription does not work — Anthropic forbids third-party apps from using it.
Gemini Google API key. A Gemini subscription does not work for the same reason.
OpenAI, DeepSeek, Grok, Mistral, Qwen, Kimi, GLM, Groq Provider API key.
OpenRouter OpenRouter key: gives access to models from different companies.
Ollama, LM Studio No key required: the model runs on your computer. Start the server, load the model and enter its name.
OpenAI-compatible Any server with an OpenAI Chat Completions-style API: a gateway, vLLM, corporate proxy. Provide the address (usually ending in /v1), model and key if required.

Cloud requests are billed according to your account with the provider, separate from LootX. After each chat reply you’ll see how many tokens were used for input and output.

A local model must support tool calling. Without tool calling the assistant cannot write into the editor or run checks.

Proxy and your own address

If a provider’s service is unreachable from your network, enter a proxy in the Proxy field — http://host:port or socks5://login:password@host:port. The proxy is shared across providers. The API Address (for your gateway) field is needed only if you access the provider via your own gateway.

What the assistant can do

  • Write a new script from a description and place the code in the editor immediately.
  • Edit an existing script — targeted edits without rewriting the whole file.
  • Self-check. Compiles code and runs it on real candles — by default on the instrument and timeframe of the chart, up to the last 5000 bars; on request it can run on any other. It inspects outputs per row and looks for runtime errors.
  • Add the script to the chart when you ask.
  • Answer market questions. It takes candles for any instrument from the terminal, screener metrics (volatility, volume, open interest, funding rate, spread) and ranks the market: “Which futures are the most volatile right now?”
  • Cross-check the language reference, looks at Built-in indicators and scripts from your library.

Each step is shown in the time and sales as a line: “Compiling”, “Running on candles”, “Editing code”. If the model displays its reasoning, it is folded in a Chain of thought block. You can interrupt a reply with the Stop button.

Everything the assistant writes in the editor is undoable with the usual Ctrl+Z. If code arrives as a block it has buttons in its header. For a whole script this is To editor — replace the editor code; for a fragment it’s Insert at the cursor. Both have Copy.

Quick commands

Type / in the input field — a hint appears. The same commands are available as buttons in an empty chat. Text after the command is your clarification: /fix look at volume.

Command What it does
/fix Finds and fixes errors: compiles, runs on candles, repairs errors and rows that are all na. Preserves your intent and style, and lists the fixes at the end.
/explain Explains in plain words what the script does, what each setting affects, what it draws and how to read the signals. Does not change code.
/optimize Speeds up the script without changing results: replaces custom loops with built-ins, removes redundant work and verifies by running that values are unchanged.

Any other word after the slash is sent to the model as a normal question.

Images and chart snapshots

Attach an image to your question via the paperclip under the input field, paste from the clipboard (Ctrl+V) or drag a file into the chat. The chart button next to the paperclip attaches a snapshot of the panel where the script will be added. Up to six images per question. Large images are downscaled before sending.

Not all models see images. If the selected model can’t see images the chat warns you before sending. If the terminal cannot determine whether the model sees images and the provider rejects the request, the images are returned to the input field.

Conversation history

A conversation is tied to a script. Open another script — the chat for that script appears. Close the editor or restart the terminal — the conversation remains.

  • A new, unsaved script’s conversation is not written to disk. It is saved with the script on first Save.
  • The New chat icon in the header starts a new conversation and deletes the previous one from disk.
  • Deleting a script deletes its conversation.
  • While the assistant is replying you cannot open a different script: stop the reply first.

The entire conversation is sent to the model with each question, so a long chat increases cost. The conversation size in tokens is shown as a number in the chat header, e.g. “42k”. Click it to compress the conversation into a summary: the assistant will remember the chat by that summary from then on. Old test results and images are collapsed automatically. In saved history older images are eventually replaced with the note “Image for this question is no longer stored”.

What is sent from your computer

Sent directly to the chosen provider:

  • your messages and attached images;
  • the script name, line count and errors, the chart instrument and timeframe — with each question;
  • code from the editor and compiler reports — when the assistant reads or edits the script;
  • data the assistant requested: candles, screener metrics, run results, fragments of the language documentation.

Not sent:

  • Secrets. The assistant does not see exchange keys. The provider key is stored on this computer encrypted, is not synced with settings and is sent only to the provider — for authentication. The terminal strips from outgoing text anything that looks like a key, token or password, and file paths. A message in which you pasted something that looks like a key is not sent at all — the chat asks you to remove the secret.
  • Account. The assistant has no access to balances, positions or orders — it only sees what you show in a snapshot. It cannot place orders.
  • Chat history. It is stored encrypted on this computer and is not part of settings sync, export or support reports.

With Ollama or LM Studio the conversation and code never leave your computer.

Limitations

  • No streaming data in test runs. Footprint clusters, delta, open interest, funding rate, order book, time and sales, screener and order book history are na when running on candles. The assistant cannot validate logic that relies on them — add the script to the chart and check yourself.
  • Step limit. The assistant performs up to 24 steps per reply, then summarises. A reply cut short by length can be continued — just ask.
  • The model errs. Runs catch compile and runtime errors, but not conceptual mistakes. Before relying on signals, inspect the script on the chart.
  • Provider rejections are shown as text with the provider name: key not accepted, request quota exhausted, out of funds or quota, no connection, local server not responding. Check your internet or set a proxy.

Next

FAQ

Can I use a Claude Pro or Gemini subscription instead of an API key?
No. Anthropic and Google prohibit third-party apps from operating via a subscription. You need an API key — it’s billed by the provider separately, based on usage.
Does my code get sent to LootX servers?
No. The terminal sends requests directly to the selected provider. API keys and chat history are stored on your computer in encrypted form and are not included in settings sync.
Can I use the Assistant for free and without the cloud?
Yes — via Ollama or LM Studio: the model runs on your computer, no key required. The model must support tool calling.
Why can't the Assistant check a script that uses footprint clusters or delta?
In the test run on candles there’s no streaming data — footprint clusters, delta, open interest, funding rate, the order book and time and sales are all na there. Check that script on a chart.