Build with AI

Hand our documentation to an AI coding assistant, copy a prompt, and get working code — even if you have never used one of these tools before.

For programmersBeginners welcomeFree tools work
In short
  • An AI assistant can write your code — Pine Script for alerts, or a program that calls our trading APIs.
  • Never used one? Start with Your first five minutes. You can start free, and you type in plain English.
  • Give it our documentation file first. One file, one upload: see the context packs.
  • Then copy a prompt for alerts or for your own program.
  • Never paste your API key into an AI chat. See Keep your keys out of the chat.
  • Always test before real money — alert checker, then the smallest quantity in one account.

There are two ways programmers use AutoTrader Web: our broker-independent trading APIs, and alert automation from TradingView. Both need some code from you — a program in your language, or a Pine Script that fires an alert.

Most people now write that code with an AI coding assistant. It works well, and it is much faster than starting from a blank page. This page shows you how to do it properly: what to give the AI, what to ask it, and what to check before you trade with the result.

If you have never used one of these tools, start at the next section. Nothing here needs experience.

New to AI coding tools?

An AI coding assistant is a chat window. You type what you want in plain English, and it writes the code for you. You can then ask it to explain the code, change it, or fix an error — in the same conversation, in normal words.

The well-known ones are ChatGPT, Claude, Gemini and Copilot. For the work on this page, any of them is fine. You can start free with any of them, and they all run in a browser, so there is nothing to install.

What this changes for you:

  • You do not have to learn a new language first. You describe the rules in plain English, and the tool writes the Pine Script or the program for you.
  • You are not stuck on an error. Paste the error message back into the same chat and ask it to fix it.
  • Small changes are cheap. “Now do the same for a group of accounts” is one sentence, not an evening.

What it does not change:

  • You still have to test it. These tools sound confident even when they are wrong.
  • The strategy is still yours. The AI writes the code, but what to buy or sell, and when, is your decision. We are a software tool only, and we never give tips or strategies.

Your first five minutes

Do this once, with no money at risk. It only teaches you the shape of the conversation.

  1. Open ChatGPT, Claude, Gemini or Copilot in your browser and start a new chat.
  2. Copy the prompt below and send it.
  3. Read the reply. Ask it anything you did not understand, in plain English.
Read this file first: https://stocksdeveloper.in/ai/alert-automation.txt

It is the official reference for AutoTrader Web alert automation.
Using only what that file says, explain to me in simple words:
1. what an alert message looks like,
2. which fields are required,
3. one example that buys 1 lot of a stock at market price
   in an account named MY_ACCOUNT.

Do not write a strategy. Do not invent any field that is not in the file.

If your tool cannot open web links, it will say so — that is normal on some free plans. In that case open the same link yourself, copy everything, and paste it into the chat before the prompt. That is the whole trick, and the next section explains it properly.

Step 1 — give the AI our documentation

This is the step that decides whether the code works.

An AI that has not read our documentation will guess our format. The guess looks completely right — real-looking field names, sensible values, confident explanation — and it fails at the broker. You find out when an order does not get placed.

So before you ask for any code, give the tool our reference. There are three ways, best first.

Best — attach our context pack file

We publish our whole reference for each task as a single plain-text file, built automatically from this documentation, so it is never out of date. Download the one you need and attach it to your chat, or paste it in.

What you are buildingFile to give the AI
TradingView alerts, Pine Scriptstocksdeveloper.in/ai/alert-automation.txt
Your own program, any languagestocksdeveloper.in/ai/trading-api.txt

Open the link, save the page (Ctrl+S), and attach the file to your chat. Every one of these tools accepts a text file.

The API file covers every call in every language we support. If your tool has a small limit, or you want a tighter answer, use the file for your language only:

LanguageSmaller file
Pythonstocksdeveloper.in/ai/trading-api/python.txt
Javastocksdeveloper.in/ai/trading-api/java.txt
C#stocksdeveloper.in/ai/trading-api/csharp.txt
HTTP RESTstocksdeveloper.in/ai/trading-api/http.txt
Excelstocksdeveloper.in/ai/trading-api/excel.txt
AmiBrokerstocksdeveloper.in/ai/trading-api/amibroker.txt
MetaTraderstocksdeveloper.in/ai/trading-api/metatrader.txt

Each file also carries a short set of rules for the AI itself — use only these field names, handle every failure, check your own work, never place a real order to test. You do not have to write those rules yourself.

If your tool can open web links, paste the links for your task and ask it to read them first. The prompts further down already include the right ones.

There is also a single map of our whole documentation at stocksdeveloper.in/llms.txt. Most AI tools can read it in one go and then open whichever page they need. It is a list of links, though — if the tool cannot browse, it gets nothing from it, so prefer the context pack above.

If neither works — paste the page

Open the documentation page in your browser, select everything, and paste it into the chat. It is not elegant, but it works everywhere.

Step 2 — copy a prompt

Pick the track that matches what you are building. Replace the parts in CAPITALS, and send.

Track 1 — TradingView alerts and Pine Script

You write a Pine Script that decides when to trade. It fires an alert. The alert text tells us what order to place. See Alert Automation for the format, and Connect TradingView for how the alert reaches your account.

Attached is the official reference for AutoTrader Web alert automation
(also at https://stocksdeveloper.in/ai/alert-automation.txt).
Use only the field names and values it defines.

I use AutoTrader Web by Stocks Developer. Write a Pine Script v6 strategy that
DESCRIBE YOUR ENTRY AND EXIT RULES HERE, and fires an alert() message in the
exact AutoTrader Web plain-text alert format so the order is placed in my
account.

My account name is MY_ACCOUNT. I want to trade SYMBOL, PRODUCT TYPE,
SIZE IN LOTS OR QUANTITY.

Use the free StocksDeveloperAlerts Pine library where it helps.

Then do three things:
1. Show me the exact alert message text this script will produce.
2. Check your script line by line against the reference.
3. List every field you were not fully sure about, instead of guessing it.

Two things worth knowing before you start: sending an alert to a webhook needs a paid TradingView plan, and our free StocksDeveloperAlerts Pine library writes the alert text for you, which removes most of what can go wrong.

Track 2 — your own program

You write a program in your own language that places, modifies, cancels or reads orders across your accounts. See the API reference and Client Setup.

Attached is the official reference for the AutoTrader Web broker-independent
trading API (also at https://stocksdeveloper.in/ai/trading-api.txt).
Use only the functions, parameters and values it defines.

I use AutoTrader Web by Stocks Developer. Write LANGUAGE code that
DESCRIBE WHAT YOU WANT IT TO DO HERE.

My account nickname is MY_ACCOUNT. Read the API key from an environment
variable, never from the code.

Then do three things:
1. Explain in one line what each API call does.
2. Check your code line by line against the reference.
3. List every function or parameter you were not fully sure about,
   instead of guessing it.

That last instruction matters more than it looks. Asking the tool to check its own work against our reference catches most mistakes before you ever run the code.

What people build this way

A few examples of what is worth asking for:

  • One order placed into many accounts at once, or into a whole group.
  • A script that squares off every open position at a fixed time in the afternoon.
  • An alert that opens a full option structure — a straddle, an iron condor — when your own indicator fires.
  • A small program that reads your positions across brokers every morning and writes them into a sheet.
  • A stop-loss and target attached to every entry, so nothing is left unprotected.

You describe the outcome in plain English. The AI writes the code. You test it, then you run it.

Keep your keys out of the chat

Treat an AI chat like a public place.

  • Never paste your API key, your AutoTrader Web password, or your private webhook link into any AI tool. Anyone who has your key or your webhook link can place orders in your accounts.
  • Ask the AI to read the key from a config file or an environment variable. The prompts above already say this. Any assistant will do it correctly if you ask.
  • If you think a key has been exposed, re-generate it from Settings → Security in AutoTrader Web. The old key stops working immediately, so update every program that uses it. See Security.
  • The same goes for the Excel, AmiBroker and MetaTrader library files you download from Tools → Library — your key is already inside them, so never attach one to a chat.

When the AI gets it wrong

These are the mistakes we actually see. Each one has a one-line correction you can paste straight back into the same chat.

What went wrongWhat to send back
It used a field name that does not exist”That field is not in the reference I gave you. Re-read it and use only the fields it defines.”
It wrote the alert with colons, like account: NAME”Our alert format uses name=value, one per line. Never a colon. Fix every line.”
It used a broker’s own short forms for values”Use the exact values from the reference, for example INTRADAY and DELIVERY, not the broker’s short form.”
It invented a function name or its arguments”Give me the exact function signature from the reference. If it is not there, say so instead of guessing.”
It wrote code that assumes every call succeeds”Every call can fail. Read the status and the message, and handle the failure case.”
It mixed in a broker’s own API”Our API is broker-independent. Remove every broker-specific call and symbol.”

If it keeps getting the same thing wrong, the usual reason is that it never read our reference — start a fresh chat and attach the context pack file first.

Check it before you risk money

AI tools make mistakes, and they sound confident while making them. Never let generated code place a real order until you have done this.

  1. Check the alert text. For alerts, paste the message your script produces into the alert checker. It runs the same checks that run when a real alert arrives, and tells you the exact reason if something is wrong.
  2. Try one API call by hand. For your own program, run the call once with the Postman collection before you put it in code.
  3. Start with the smallest quantity. Run the first live signals with one lot, or the smallest quantity you can, in one account only.
  4. Watch what actually happened. The Alert Trail and Tools → Activity show every alert that arrived and every order that went out, with the reason if one was refused.
  5. Only then scale up. Raise the quantity, or point it at a group of accounts, after it has behaved the way you expect.

Read Precautions before you run anything automated with real money.

What to ask us, and what to ask the AI

Ask us anything about our side: what a field means, which values it accepts, why an alert was refused, why your broker rejected an order, what one of our error messages means, and whether something is possible at all. We answer those quickly and with certainty.

Ask the AI assistant for the code itself: writing a whole script or program, fixing an error inside it, explaining what a piece of code does, and turning your idea into working code.

We are also happy to check a short thing — one alert message, one field, one line you are unsure about. It is only long code that we cannot work with, and we would rather tell you that than guess. The full split, and why it works this way, is in Can you help me write or fix my Pine Script or API code?

One thing never changes: we are a software tool only. We do not provide, sell or recommend trading strategies, so we cannot tell you what your code should decide. The strategy is always yours, and you can stop everything at any time.

Frequently asked questions

Do I need to know programming to use an AI coding assistant?

It helps, but you do not need to be an expert. You describe what you want in plain English and the AI writes the code. You still have to read what it gives you, run it, and test it carefully — so treat it as a fast helper, not as a replacement for checking your own work.

Which AI tool is best for this?

Any of the well-known ones — ChatGPT, Claude, Gemini or Copilot. You can start free with any of them, and all of them can do this work. What changes the result is not the tool, it is whether you gave it our documentation before asking.

Why does the AI invent field names that do not exist?

Because it is guessing from other trading software it has seen. It has no way to know our format unless you hand it our documentation first. Attach our context pack file, or paste our documentation links, before you ask for any code — then ask it to check its own work against that file.

Is it safe to paste my API key into ChatGPT or Claude?

No. Never paste your API key, your password or your webhook link into any AI chat. Ask the AI to read the key from a config file or an environment variable instead. Anyone who has your key or your webhook link can place orders in your accounts.

Can your support team check the code the AI wrote for me?

We answer anything about our side — what a field means, which values it accepts, why an alert was refused, what one of our error messages means. We are not set up to read or debug a whole program or a whole strategy script, so for the code itself use an AI assistant with our documentation attached.

Next steps

Was this page helpful?

Last updated 7 September 2026