Stocks Developer — Alert Automation reference This file is the complete, current reference for turning a TradingView alert into a real order on an Indian broker account through AutoTrader Web — the alert message format, every field, every allowed value, option structures, target and stop-loss, and the webhook setup. It is generated from the official documentation at https://stocksdeveloper.in every time that documentation changes, so it is never out of date. Documentation last updated: 2026-09-07 How to use it: give this whole file to your AI coding assistant (ChatGPT, Claude, Gemini, Copilot or any other) BEFORE you ask it to write anything. Guide for humans: https://stocksdeveloper.in/documentation/build-with-ai/ ============================================================================== INSTRUCTIONS FOR THE AI ASSISTANT READING THIS FILE ============================================================================== You are helping someone who uses AutoTrader Web by Stocks Developer. Follow these rules for every line of code you write for them: 1. Use ONLY the field names, parameter names, function names and allowed values defined in this file. If something you need is not here, say so plainly — do not invent it, and do not borrow a name from another trading API. 2. Values are exact words. Write INTRADAY, DELIVERY, NORMAL, MTF, BUY, SELL, MARKET, LIMIT, STOP_LOSS, SL_MARKET exactly as spelled here, not a broker's short form. 3. The same code must work on every broker. Never write broker-specific symbols, broker-specific logic, or a call to a broker's own API. 4. Always handle the failure case. Every call can fail; read the status and the message and report it, never assume success. 5. When you finish, check your own code line by line against this file, and list every field or function you were not fully sure about instead of quietly guessing it. 6. Never place a real order to test. Tell the user to test with the smallest quantity, in one account, before anything else. 7. This is a tools-only platform. Do not offer trading advice, tips or a strategy — the strategy belongs to the user. 8. An alert message is a list of settings, ONE PER LINE, written as name=value. Never use a colon, never JSON, never quotes around a value. A colon is the single most common reason an alert places no order. 9. Every alert must say where the order goes, using exactly one of account=NAME or group=NAME. There is no default. 10. An alert is accepted in full or refused in full, so a missing or misspelled field means no order at all — check every required field before you hand the script over. 11. After writing the script, show the user the exact alert message text it will produce, and tell them to paste that text into the alert checker on the Alert Automation page before they go live. 12. Sending the webhook needs a paid TradingView plan. Say so if the user has not mentioned it. ============================================================================== CONTENTS ============================================================================== 1. Alert Automation — https://stocksdeveloper.in/documentation/alert-automation/ 2. TradingView Automation — https://stocksdeveloper.in/documentation/trading-view/ 3. API Parameters — https://stocksdeveloper.in/documentation/api/api-parameters/ ============================================================================== PAGE 1 OF 3 — Alert Automation URL: https://stocksdeveloper.in/documentation/alert-automation/ Last updated: 2026-09-07 Summary: Alert Automation turns your TradingView alerts into real orders on your broker accounts. You write a short alert in plain text, point a TradingView webhook at your own private AutoTrader Web link, and when your alert fires the order is placed. It can place a single order or a full option structure that you choose and configure — like a straddle or an iron condor — size it in lots or quantity, and set a maximum-loss alert you choose (risk limits are in beta and email you — they do not act automatically yet). You can also set your own target and stop-loss on an order, and the tool closes the position for you when your level is reached. You can send an order to one account or a whole group. Chartink support is coming soon. You bring the strategy and the signal; the tool only places the orders you set up, and you can stop it at any time. ============================================================================== Alert Automation is the simple way to turn your **TradingView** alerts into real orders on your broker accounts. Write a short alert in plain text, connect it once, and when your alert fires the order is placed — a single order, an option, or a full option structure you choose. **Chartink** support is coming soon and will work the same way. You bring your own strategy and signals. The tool only places the orders you set up, and you can stop it at any time. ## How it works 1. You create an alert in TradingView (from an indicator, a strategy or a price level). 2. TradingView sends that alert to your own private AutoTrader Web link the moment it fires. 3. AutoTrader Web reads your short alert, works out the exact order (including the option strike and expiry, if any), and places it in the account or group you named. 4. You can watch each alert move from received to placed on the **Alert Trail** screen. Nothing runs unless your alert fires and you have set it up. You stay in control of every part. ## Before you start - A **paid TradingView plan** (webhooks are a paid feature). - A registered AutoTrader Web account. [Register here](https://stocksdeveloper.in/documentation/user-interface/user-registration/) if you have not. - At least one **trading account** added. See [Trading Accounts](https://stocksdeveloper.in/documentation/user-interface/accounts/trading-accounts/). - Optional: a **group** if you want one alert to trade many accounts. See [Group Accounts](https://stocksdeveloper.in/documentation/user-interface/accounts/group-accounts/). ## Step 1 — Get your private webhook link Sign in to AutoTrader Web and open **Alert Auto. → Tokens** from the left menu. Give the token a name and create it. This gives you a private link that looks like this: ``` https://signals.stocksdeveloper.in/tradingview/YOUR-TOKEN ``` - **Keep this link private.** It is the key that lets your alerts place orders in your account. - You do **not** put your API key anywhere in TradingView. The link is all you need. - If the link is ever exposed, open **Alert Auto. → Tokens** again, revoke it, and create a new one. Your old link stops working at once, and no one can use it again. ## Step 2 — Create the alert in TradingView 1. Open your chart and add your indicator or strategy. 2. Create an alert (press **Alt + A**). 3. In **Notifications**, turn on **Webhook URL** and paste your private link from Step 1. 4. In the alert **Message** box, write your order in the simple format below. 5. Optional: also turn on **Send email** so you keep a copy of each alert for your records. You can learn more from the [TradingView alerts help](https://www.tradingview.com/support/categories/alerts/). ## Skip the typing — the Pine Script library If you build your strategies in **Pine Script** on TradingView, you do not have to write the alert text by hand. We publish a free, open-source Pine library that builds a correct alert message for you — you call one function and pass the result to `alert()`. Add it to the top of your script: ``` //@version=6 import StocksDeveloper/StocksDeveloperAlerts/1 as atw ``` Then build and fire an alert wherever your signal triggers: ``` // Buy one lot of an at-the-money Nifty call when your signal fires if longSignal alert(atw.option(symbol="NIFTY", exchange="NFO", producttype="NORMAL", tradetype="BUY", optiontype="CE", strike="ATM", expiry="weekly", account="MY_ACCOUNT", lots=1), alert.freq_once_per_bar_close) ``` Every function returns the alert text and **you** decide when to fire it, so you stay in control. The functions cover everything on this page: | Function | What it places | | --- | --- | | `atw.equity(...)` | a single stock or futures order | | `atw.option(...)` | a single option order (pick the strike and expiry) | | `atw.order(...)` | the full single-order builder (every field) | | `atw.straddle` / `strangle` / `bullCall` / `bearPut` / `bullPut` / `bearCall` / `ironCondor` / `ironFly(...)` | a ready-made option structure | | `atw.leg(...)` + `atw.multiLeg(...)` | your own custom multi-leg (up to 10 legs) | | `atw.riskLimits(...)` | a risk limit to attach to any order (pass as `risk=`) | A few more examples: ``` // Stock order to a whole group of accounts alert(atw.equity(symbol="SBIN", exchange="NSE", producttype="INTRADAY", tradetype="BUY", group="MY_GROUP", lots=1)) // Iron condor with your own daily-loss limit alert(atw.ironCondor(symbol="NIFTY", exchange="NFO", producttype="NORMAL", account="MY_ACCOUNT", lots=1, width=8, wing=4, risk=atw.riskLimits(maxloss=10000))) // Your own four-leg structure legs = array.from(atw.leg("PE","ATM-2","SELL"), atw.leg("PE","ATM-6","BUY"), atw.leg("CE","ATM+2","SELL"), atw.leg("CE","ATM+6","BUY")) alert(atw.multiLeg(symbol="NIFTY", exchange="NFO", producttype="NORMAL", account="MY_ACCOUNT", lots=1, expiry="weekly", legs=legs)) ``` The field names and values are the same as the plain-text format below, so use this page as the reference for every option. You still need a paid TradingView plan to send the alert (webhooks are a paid feature). You can view the library on TradingView here: [StocksDeveloperAlerts](https://in.tradingview.com/script/snwyFJQs-StocksDeveloperAlerts/). ## Getting the Pine Script itself written We help with **our** side of it — the alert format, what each field means, which values it accepts, and why an alert was refused. We are not set up to read or debug a whole strategy script, so our support assistant will tell you honestly instead of guessing. For the strategy code itself, use an **AI coding assistant** (ChatGPT, Claude, Gemini, Copilot, or whichever you use) — and give it our alert format first, so it uses our real field names instead of inventing them. The quickest way is to attach one ready-made file that holds this whole page plus every allowed value: [stocksdeveloper.in/ai/alert-automation.txt](https://stocksdeveloper.in/ai/alert-automation.txt). It is built from this documentation, so it is never out of date. **[Build with AI](https://stocksdeveloper.in/documentation/build-with-ai/)** has the full method — prompts you can copy, the mistakes these tools make with our format, and what to check before you go live. It starts from zero, so it is worth reading even if you have never used one of these tools. Whatever writes your script, check the alert message it produces in the [alert checker](https://stocksdeveloper.in/documentation/alert-automation/#check-it-before-you-use-it) below before you go live. ## Writing an alert An alert is just a list of settings, **one per line**, written as `name=value`. Field names are not case sensitive. Here is a simple order — sell one lot of a Nifty put option at a limit price: ``` account=MY_ACCOUNT symbol=NIFTY exchange=NFO producttype=NORMAL optiontype=PE strike=ATM expiry=weekly tradetype=SELL ordertype=LIMIT price=50 lots=1 ``` ### Check it before you use it Paste your alert below and it is checked straight away — the same required fields, the same allowed values and the same reasons for refusing it that apply when your alert really arrives. Use the buttons to load a working example of each kind. The thing worth noticing: an alert is either **accepted in full or refused in full**. There is no half-placed order — a mistake costs you an order you never wanted, never a filled position you cannot protect. ### Three mistakes that stop an alert before it starts These are the ones we see most often. In each case the alert reaches us, but there is nothing in it we can read, so no order is placed. All three are one small edit in TradingView. - **A colon instead of an equals sign.** Settings are written `account=MY_ACCOUNT`, never `account: MY_ACCOUNT`. A line with a colon is skipped, so an alert written that way is completely empty to us. Change every `:` to `=`. - **TradingView's own message left in the box.** A new alert starts with a default message like `SBIN, 1 Crossing Up`. That is a sentence, not an order — it holds no settings at all. Clear the Message box and write your own order there. - **The classic JSON message on a new webhook link.** If your message starts with `{` and contains `"command"`, that is the [classic setup](https://stocksdeveloper.in/documentation/trading-view-classic/). It only works with a classic webhook link. On a webhook link you created in Alert Automation, rewrite the message in the format above — or point the alert back at your classic link. Paste your alert into the checker above and it will tell you which one it is, in the same words we would. ### Where the order goes: account or group Every alert must say **where** to place the order, using **one** of these: - `account=NAME` — place in that single account. - `group=NAME` — place in every live account in that group. Use exactly one. An individual account and a group can have the same name, so the field name is what tells us which you mean. There is no default — always say where. ### The common fields | Field | Required? | What it is | | --- | --- | --- | | `account` or `group` | Yes (one of them) | Where to place the order (see above). | | `symbol` | Yes | The instrument — our broker-independent symbol (e.g. `NIFTY`, `BANKNIFTY`, `SBIN`) or your [TradingView symbol](https://stocksdeveloper.in/documentation/alert-automation/#using-your-tradingview-symbol). [Look it up](https://stocksdeveloper.in/knowledgebase/instrument-not-found/) if unsure. | | `exchange` | Yes | The exchange code, e.g. `NSE` or `BSE` for stocks, or `NFO` for options and futures. [Look it up](https://stocksdeveloper.in/knowledgebase/instrument-not-found/) if unsure. | | `producttype` | Yes | `INTRADAY`, `DELIVERY`, `NORMAL` or `MTF`. | | `tradetype` | Yes | `BUY` or `SELL`. | | `lots` or `quantity` | Yes (one of them) | Size — see [Order size](https://stocksdeveloper.in/documentation/alert-automation/#order-size). | | `ordertype` | No (default `MARKET`) | `MARKET`, `LIMIT`, `STOP_LOSS` or `SL_MARKET`. | | `price` | No | Limit price (needed for `LIMIT`). | | `triggerprice` | No | Trigger price (needed for stop-loss orders). | | `validity` | No (default `DAY`) | `DAY` or `IOC`. | | `amo` | No (default `false`) | `true` for an after-market order. | Use the exact words shown (for example `INTRADAY`, not your broker's short form). For the full list of valid values, see [API Parameters](https://stocksdeveloper.in/documentation/api/api-parameters/). **`NFO` and `NSE` mean the same market to us**, so either one works for an option or a future — send whichever your chart uses. The same goes for the other segment codes: they are all read as the main exchange they belong to. This is why a message about a wrong exchange lists only the main ones. ## Using your TradingView symbol For a stock or futures order you can send **TradingView's own symbol**, so your alert can simply use `symbol={{ticker}}`. AutoTrader Web reads these forms: - a continuous future like `NIFTY1!` (nearest expiry) or `NIFTY2!` (next expiry); - a dated future like `NIFTYU2026`; - an option like `NIFTY260714C23900`. Our own broker-independent symbol still works too — a future as `NIFTY_28-JUL-2026_FUT`, an option as `NIFTY_14-JUL-2026_CE_23900`, or a stock as `SBIN`. Either way, set `exchange` to match your instrument. If a symbol cannot be matched to a live contract, the alert is rejected with a clear reason — it never places a different order. For options, the easy way below (give the underlier plus `optiontype`, `strike` and `expiry`) still needs no symbol lookup at all. ## Trading options the easy way For an option order you do not need to type the full option symbol. Give the underlier and let AutoTrader Web pick the exact contract: | Field | What it is | | --- | --- | | `optiontype` | `CE` for a call, `PE` for a put. Adding this makes it an option order. | | `strike` | `ATM` (default), or `ATM+1` / `ATM-2` to step up or down, or `OTM` / `ITM` (add a number like `OTM2`), or an exact strike like `24500`. | | `expiry` | `weekly` (default), `next` (next weekly), `monthly`, or an exact date like `10-JUL-2026`. | So `optiontype=CE`, `strike=OTM2`, `expiry=weekly` means "the call option two strikes out of the money in this week's expiry" — no symbol lookup needed. ## Ready-made option structures You can build a full multi-leg option structure with a single line. You choose the structure and set the values; AutoTrader Web works out each leg for you and places them, with the protective **buy** legs placed first. > These build the **order legs** for a structure you choose and configure. They are **not** trading strategies, tips or advice — you decide the structure, the values and when to send the alert. | Structure | What you write | Legs it builds (by default) | | --- | --- | --- | | Straddle | `strategy=straddle` | Buy call + buy put, at the money | | Strangle | `strategy=strangle` | Buy call + buy put, out of the money by `width` | | Bull call spread | `strategy=bull-call` | Buy call at the money + sell call `width` out | | Bear put spread | `strategy=bear-put` | Buy put at the money + sell put `width` out | | Bull put spread | `strategy=bull-put` | Sell put at the money + buy put `width` out | | Bear call spread | `strategy=bear-call` | Sell call at the money + buy call `width` out | | Iron condor | `strategy=iron-condor` | Sell call + sell put `width` out, buy call + buy put `width+wing` out | | Iron fly | `strategy=iron-fly` | Sell call + sell put at the money, buy call + buy put `wing` out | Settings you can add: - `width` — how far out of the money the near legs sit, in strike steps (default `2`). - `wing` — how far the protective legs sit, in strike steps (default = `width`). - `tradetype` — `BUY` builds the structure as shown above; `SELL` flips every leg. - `onlegfailure` — what to do if one leg cannot be placed: `alert` (default, tell you), `cancel` (undo the legs already placed) or `continue` (place the rest). Example — a Nifty iron condor for this week: ``` account=MY_ACCOUNT symbol=NIFTY exchange=NFO producttype=NORMAL strategy=iron-condor width=8 wing=4 expiry=weekly ordertype=LIMIT price=50 lots=1 ``` ## Build your own multi-leg If you want an exact set of legs instead of a ready-made structure, list them yourself. Each leg is `Leg1`, `Leg2`, and so on (up to 10), written as ` [xN]`, where `xN` multiplies the size for that leg. ``` account=MY_ACCOUNT symbol=NIFTY exchange=NFO producttype=NORMAL expiry=weekly lots=1 Leg1=PE ATM-2 SELL Leg2=PE ATM-6 BUY Leg3=CE ATM+2 SELL Leg4=CE ATM+6 BUY ``` ## Risk limits you set (beta) You can add your own risk limits to an alert. These are limits **you** decide and set up. > **Risk limits are in early beta.** Right now they **alert you** by email — the tool does **not** square off, block or stop your trades automatically yet. Use them as warnings for now. See [Risk Management](https://stocksdeveloper.in/documentation/user-interface/trading/risk-management/). | Limit | What you write | What it is | | --- | --- | --- | | Maximum day loss | `maxloss=5000` | A cap on the day's loss for the account (in your account currency). You are alerted if the loss crosses it. | | Square-off time | `forceexit=15:15` | An intraday time (24-hour `HH:mm`) by which you want the position closed. | | Entry-time window | `entrywindow=09:20-14:30` | Only take entries inside this time window (24-hour `HH:mm-HH:mm`). | | Block on expiry day | `blockonexpiryday=true` | Do not take new entries on the instrument's expiry day. | You can set more than one on the same alert. As the feature leaves beta, these limits will begin to act automatically instead of only alerting you. ## Set a target and stop-loss (auto-exit) You can add a **target** and a **stop-loss** to any order. Once your order is filled, AutoTrader Web watches the live price for you and closes the position the moment your target **or** your stop-loss is reached — whichever comes first. You set the levels, and you can stop it at any time. > This is an exit **you** set on your own order. It is not a tip, a strategy or advice — you choose the target and the stop-loss, and you decide when to send the alert. Give each level as a **percent**, as **points**, or as an exact **price**: | Setting | What you write | What it means | | --- | --- | --- | | Target | `target=2%` | Book profit when the price moves 2% in your favour. | | Target (points) | `target=15pt` | Book profit 15 points in your favour. | | Target (price) | `target=1560` | Book profit at the exact price 1560. | | Stop-loss | `stoploss=1%` | Limit the loss — exit when the price moves 1% against you. | | Stop-loss (points) | `stoploss=15pt` | Exit 15 points against you. | | Stop-loss (price) | `stoploss=1480` | Exit at the exact price 1480. | | Trailing stop-loss | `stoploss=15pt trailsl=5pt` | Your stop-loss starts 15 points away and moves up in 5-point steps as the price moves in your favour. It never moves back. | - You can set a **target only**, a **stop-loss only**, or **both**. With both, whichever is hit first closes the position and the other is cancelled. - Percent and points are measured from the **actual fill price of the contract you bought or sold**, and that is the same price the exit watches. If you trade options, please read the note below. #### How a trailing stop-loss works A trailing stop-loss is written as **two settings together**, and each does a different job: - `stoploss=` is **how far behind the price your stop stays** — the gap. - `trailsl=` is **how much the stop moves each step**, as the price goes your way. **`trailsl=` on its own is not accepted**, and the alert is rejected before any order is placed. On its own it cannot say how far behind the price your stop should sit, and guessing that for you is how a stop ends up far tighter than you intended. Worked example. You buy at 100 with `stoploss=10pt trailsl=2pt`: | Price reaches | Your stop-loss is | | --- | --- | | 100 (your fill) | 90 | | 101 | 90 — not a full step yet | | 102 | 92 | | 104 | 94 | The stop moves in whole steps, and it only ever moves closer to the price — never back down. You can write both settings in **percent** instead: `stoploss=1% trailsl=0.5%` works the same way. A percent is worked out **from your fill price and then stays fixed**, so on a fill of 100 a `0.5%` step is 0.50 and stays 0.50 — it does not grow as the price rises. A trailing stop-loss cannot be given as an exact price. `trailsl=` takes a percent or points only, because it describes a distance the stop moves, not a level it sits at. The level comes from `stoploss=`. ### Trading options? Points follow the option price This one catches people out, so it is worth reading once. When you buy or sell an option, the price we watch is the **option price**, not the index price on your chart. So `stoploss=55pt` on an option means 55 points of the **option price**. It does not mean 55 points of the index. The two are not the same size. An option close to the money usually moves about **half a point for every one point** the index moves, and an option further away moves less than that. So a 55 point stop-loss on the option needs roughly a **110 point** move in the index before it is reached. Here is what that looks like on an option you bought at 760: | You write | Price level used | Roughly what the index has to do | | --- | --- | --- | | `stoploss=55pt` | 705 | move about 110 points against you | | `stoploss=2%` | 744.8 | move about 30 points against you | | `stoploss=740` | 740 | move about 40 points against you | If your exit is not firing when you expected, this is the first thing to check. Set a smaller point value, or use a percent so the level scales with the option price. Either way, the **Alert Trail** shows the exact target and stop-loss price the moment your exit is armed, so you can read the real levels there before the trade runs. Example — buy one lot and set a 2% target with a 1% stop-loss: ``` account=MY_ACCOUNT symbol=SBIN exchange=NSE producttype=INTRADAY tradetype=BUY quantity=1 target=2% stoploss=1% ``` The exit runs on our servers, so it keeps working even if your chart or your computer is off. You can watch it on the **Alert Trail**: you will see the exit **armed** when your order fills, and **fired** when a level is reached. A few things to know: - The auto-exit is for the **same day** — it ends at the close of the trading day and does not carry to the next day. - If you close the position yourself, or a risk limit closes it, the auto-exit simply stops — it never places a second order. The Alert Trail shows it as **cancelled**, so a closed position is the usual reason an exit never fired. - If the price jumps past both your target and your stop-loss at once, the **stop-loss** is used (safety first). - One position per instrument in an account is managed at a time. If you add to the same position with another alert, the newest target and stop-loss apply to the whole position, worked out from the new average price once the added order fills. - Adding to a position **by hand** does not change the exit. Your target and stop-loss stay at the prices set when the exit was armed, even though your average price has moved. Send another alert with the levels you want if you need them recalculated. ## Bracket and cover orders from an alert The target and stop-loss above manage your **position**. There is a second way to protect a trade from an alert: place an **AutoTrader bracket order**, where the levels belong to the **order** itself. Add `variety=` to the alert: | Value | What you get | | --- | --- | | `variety=AT_BO` | A bracket order — a target **and** a stop-loss, with optional trailing. | | `variety=AT_CO` | A cover order — a stop-loss only, with optional trailing. | | *(nothing)* | A plain order. Add `target=`/`stoploss=` for the position-level auto-exit above. | ``` account=MY_ACCOUNT variety=AT_BO exchange= symbol=SBIN tradetype=BUY producttype=INTRADAY quantity=10 target=10pt stoploss=10pt trailsl=2pt ``` These work on **every broker we support**, including brokers with no bracket order of their own. Your entry goes to the broker as an ordinary intraday order, and we watch the levels. Full details: [Bracket & Cover Orders](https://stocksdeveloper.in/documentation/bracket-cover-orders/). **What is different from the auto-exit above:** - **It follows your order, not your position.** If you already hold the same stock, or you add to it by hand, the bracket still covers exactly the quantity this alert bought. The auto-exit above manages whatever the net position happens to be. - **Levels must be written with `pt`** — rupees away from your entry price. A percent (`2%`) or an exact price (`1560`) is not accepted here, and the alert is refused with the reason. - **`AT_BO` needs both a target and a stop-loss.** `AT_CO` needs a stop-loss and takes no target. - **`producttype=INTRADAY` is required**, and the position is squared off automatically before the market closes. - **You can change the levels afterwards** from the Positions tab in AutoTrader Web — the position-level auto-exit has no such screen. - **One per symbol per account**, and the quantity must fit within the exchange's maximum for a single order. A quantity that would have to be split is refused rather than half-protected. - **You must agree to a short set of terms once**, before your first one. Pick `AT_BO` in the order window and follow the one-time opt-in. Everything is checked **before** any order is placed, so a mistake in the alert costs you an order you never wanted — never a filled position with no protection. ## Order size Give the size in **one** of two ways: - `lots=1` — number of lots (for derivatives). AutoTrader Web works out the quantity from the lot size. - `quantity=50` — an exact quantity (for shares, or a whole number of lots for derivatives). Use one or the other, not both. If an order is larger than the exchange's single-order cap — the **quantity freeze limit** — AutoTrader Web automatically splits it into smaller orders for you, each within the limit. You do not need to do anything; each part shows separately on the Alert Trail. ## Closing a position from an alert An alert always **places an order**. There is no `squareoff` or `close` setting, so an alert cannot be written as "close whatever I am holding". How you close a position depends on one thing: whether your strategy knows the size it is holding. ### If you know the size — send the opposite order Send the same alert again with the opposite `tradetype`. A position you bought is closed with a `SELL`, and one you sold short is closed with a `BUY`. ``` account=MY_ACCOUNT symbol=NIFTY exchange= producttype=NORMAL optiontype=CE strike=24150 expiry=01-SEP-2026 tradetype=SELL ordertype=MARKET lots=1 ``` Write the size the same way you wrote it on the entry. If you entered with `lots=1`, close with `lots=1` — you never work out the quantity yourself. See [Order size](https://stocksdeveloper.in/documentation/alert-automation/#order-size). ### If you do not know the size — set the exit on the entry Most strategies cannot know their own position size when the exit signal fires. The answer is to set the exit **when you enter**, not to send a closing alert later. Add `target=` or `stoploss=` to the entry alert, and AutoTrader Web closes the position for you when your level is reached. No second alert, and no quantity for you to work out. ``` account=MY_ACCOUNT symbol=NIFTY exchange= producttype=NORMAL optiontype=CE strike=24150 expiry=01-SEP-2026 tradetype=BUY ordertype=MARKET lots=1 target=2% stoploss=1% ``` See [Set a target and stop-loss](https://stocksdeveloper.in/documentation/alert-automation/#set-a-target-and-stop-loss-auto-exit) for every level you can write, and [Bracket and cover orders](https://stocksdeveloper.in/documentation/alert-automation/#bracket-and-cover-orders-from-an-alert) if you want the levels to belong to the order rather than the position. > `forceexit=` is listed under [risk limits](https://stocksdeveloper.in/documentation/alert-automation/#risk-limits-you-set-beta) and looks like an exit, but it is in beta and only **alerts** you today — it does not close the position yet. Use `target=` or `stoploss=` for an exit that acts. ### If you need a true square-off from an alert If you must close a position of unknown size from the alert itself, the older [classic setup](https://stocksdeveloper.in/documentation/trading-view-classic/) has a square-off message that does exactly this. It closes the whole open position for the symbol you name, whatever the quantity, so you never send a size at all. It is the one thing the classic setup can do that Alert Automation cannot. It uses the older JSON message and its own webhook link, so it is not something you can add to an Alert Automation alert — you would set that alert up as a classic one. For everything else, Alert Automation is the format to use. ### From your own program If your strategy runs in your own code rather than as an alert, call the [square off a position](https://stocksdeveloper.in/documentation/api/square-off-position/) function. It closes the whole position for that account and symbol, so you do not pass a quantity. The same function is available in every one of our [client libraries](https://stocksdeveloper.in/documentation/api/). ## See what happened — the Alert Trail Every alert is recorded on the **Alert Trail** screen. For each alert you can see it move through clear steps — received, understood, checked, and finally **placed** — so you always know what happened and when. If a step fails (for example a wrong value), the trail shows where and why. The trail shows that your order was **placed**. To see whether it filled, and your live position, check your order book and positions on the trading screen as usual. ## Record when your alert fired The time shown against an alert on your chart is the time the **candle started**, not the moment your alert fired. On a one-minute chart the candle marked `09:30` runs until 09:30:59, so an alert on that candle can fire at any second inside that minute. This is why an alert sometimes looks 20 or 30 seconds late when nothing is slow. To see the real firing time, add TradingView's built-in `{{timenow}}` value as one extra line in your alert: ``` account=MY_ACCOUNT symbol=NIFTY exchange=NFO producttype=INTRADAY tradetype=BUY lots=1 timenow={{timenow}} ``` Your alert is kept on the **Alert Trail** exactly as it arrived, so you can read the value there and compare it with the time we received the alert. Two things to know: - `{{timenow}}` is given in **UTC**. Indian time is 5 hours and 30 minutes ahead, so `04:00:25` means `09:30:25` India time. - A time that lands exactly on `:00` seconds is almost always a candle time, not a firing time. Any extra line we do not recognise is simply ignored, so adding `timenow` is safe and never affects your order. If you want to dig further, see [TradingView alert looks delayed or late](https://stocksdeveloper.in/knowledgebase/tradingview-alert-delay/). ## Worked examples (with video) Want to see the whole thing end to end? These step-by-step guides build a TradingView strategy, backtest it, then automate it with AutoTrader Web — each with a video walkthrough (Hindi): - [Moving Average strategy](https://stocksdeveloper.in/tradingview-moving-average-automated-trading/) - [Supertrend strategy](https://stocksdeveloper.in/tradingview-supertrend-automated-trading/) ## What happens if… **…my alert fires twice.** Two orders are placed. We act on every alert that reaches us and we cannot tell a genuine alert from a repeat, so a strategy that fires twice will trade twice. Test with the smallest size first. **…my alert never arrives.** Nothing happens, and we will not know. We act only when an alert reaches us — we do not watch your chart or your strategy. An alert that expired, a limit on your TradingView plan, or an outage on their side all look the same from here: silence. Check the Alert Trail if you expected something and nothing happened. **…my alert arrives but nothing can be read from it.** No order is placed, and the Alert Trail says exactly what was wrong with the message. This is the most common reason an alert "does nothing", and it is almost always one of the [three message mistakes](https://stocksdeveloper.in/documentation/alert-automation/#three-mistakes-that-stop-an-alert-before-it-starts). Nothing about your wallet, your licence or your broker is involved — the alert stopped while we were still reading it. **…my alert arrives late.** It is still acted on, at the price available when it arrives — not the price when it was sent. **…an order is rejected by my broker.** It is shown in the Alert Trail with your broker's own reason. Nothing is retried automatically. **…I cancel an order that an alert placed.** We do not place it again. Once an order has been sent, it is yours — cancelling it is a deliberate action and we do not work against it. **…someone else gets my private link.** They can place real orders on your accounts with it. The link is not protected by your password or your login. If you think anyone else has seen it, create a new one straight away from the Alert Automation screen — the old one stops working immediately. **…I use copy trading.** If an alert acts on a master account, the orders are copied to your child accounts in the usual way. A copied order reaches a child account a short time after the master, so in a fast market a child account's order can fill for less quantity, or not at all. **…my Market Price Protection is switched off.** Some brokers refuse plain market orders, so orders from your alerts can be rejected. Keep it switched on. If orders are not filling because the price band is too narrow, you can widen it by setting Market Price Protection to AGGRESSIVE — though a band that is too wide can be refused by some brokers instead. ## Safe-use notes - **Stop your alerts when you are not using them.** TradingView alerts and strategies keep running on TradingView's servers until you stop them. If you forget, orders may keep getting placed. - **Test with the smallest possible size first**, then increase slowly once you are confident. - **Avoid changing your alert or strategy settings during live market hours.** TradingView can repaint a signal when you change settings, which can give unexpected results. - Automation has its own risks. Make sure you understand how your alerts and strategies work before you rely on them. Support for Alert Automation will keep improving as we learn what our users need. Share your feedback through our [contact page](https://stocksdeveloper.in/contact/). ============================================================================== PAGE 2 OF 3 — TradingView Automation URL: https://stocksdeveloper.in/documentation/trading-view/ Last updated: 2026-09-07 Summary: You can turn your TradingView alerts into real orders on your broker accounts with AutoTrader Web. Create an alert in TradingView, point its webhook at your own private AutoTrader Web link, and when the alert fires your order is placed — a single order, an option, or a full option structure you choose. Send it to one account or a whole group, and add your own risk limits. You bring the strategy; the tool only places the orders you set up. You need a paid TradingView plan and an AutoTrader Web account. ============================================================================== Automate your **TradingView** alerts into real orders on your broker accounts. Turn any indicator, strategy or price alert into a live order — on one account or many — without writing any code. TradingView sends the signal; AutoTrader Web places the order you set up. TradingView is part of our wider [Alert Automation](https://stocksdeveloper.in/documentation/alert-automation/) feature, which explains the full alert format, option structures and risk limits. This page covers the TradingView-specific setup. ## What you can do - Turn a TradingView alert into a **single order** the moment it fires. - Trade **options** without typing the full symbol — just give the strike and expiry, or pick a ready-made structure such as a straddle or an iron condor that you configure. - Send one alert to **one account or a whole group** of accounts. - Attach a **target and a stop-loss** to the order, or place a full [bracket or cover order](https://stocksdeveloper.in/documentation/bracket-cover-orders/) with `variety=AT_BO` — on every broker we support, with a stop that can trail the price. - Add your own **risk limits**, like a maximum loss or an auto-exit time. You bring the strategy and the signal. The tool only places the orders you set up, and you can stop it at any time. ## How to set it up 1. **Get your private webhook link.** In AutoTrader Web, open your Alert Automation settings and create a webhook token. You get a private link — you do not put your API key into TradingView. 2. **Create an alert in TradingView** (press **Alt + A**), turn on **Webhook URL**, and paste your private link. 3. **Write your order** in the alert Message box, one setting per line. For example, buy one lot at market: ``` account=MY_ACCOUNT symbol=NIFTY exchange=NFO producttype=NORMAL optiontype=CE strike=ATM expiry=weekly tradetype=BUY ordertype=MARKET lots=1 ``` Not sure your alert is right? Check it here before you put it in TradingView — the same checks that run when your alert reaches us: The full alert format — every field, option settings, ready-made structures and risk limits — is in the [Alert Automation guide](https://stocksdeveloper.in/documentation/alert-automation/). Trading a stock or future? You can paste TradingView's own symbol (like `{{ticker}}`, `NIFTY1!` or `NIFTYU2026`) instead of typing ours — see [Using your TradingView symbol](https://stocksdeveloper.in/documentation/alert-automation/#using-your-tradingview-symbol). **Coding in Pine?** You can skip writing the alert text — our free, open-source Pine library builds it for you. Add `import StocksDeveloper/StocksDeveloperAlerts/1 as atw` to your script and call a function like `atw.option(...)`. See the [Alert Automation guide](https://stocksdeveloper.in/documentation/alert-automation/) for every function, or [get the library on TradingView](https://in.tradingview.com/script/snwyFJQs-StocksDeveloperAlerts/). **Not a Pine Script writer?** You can have an AI assistant write the script for you — ChatGPT, Claude, Gemini or Copilot. Give it our alert format first (there is a ready-made file for exactly this), then copy a prompt from [Build with AI](https://stocksdeveloper.in/documentation/build-with-ai/). Always paste the alert message it produces into the [alert checker](https://stocksdeveloper.in/documentation/alert-automation/#check-it-before-you-use-it) before you go live. ## Worked examples (with video) Prefer to follow a complete example? These step-by-step guides build a TradingView strategy, backtest it, and automate it with AutoTrader Web — each with a full video walkthrough (Hindi): - [Moving Average strategy — automated trading](https://stocksdeveloper.in/tradingview-moving-average-automated-trading/) — a moving-average crossover strategy, start to finish. - [Supertrend strategy — automated trading](https://stocksdeveloper.in/tradingview-supertrend-automated-trading/) — a Supertrend intraday strategy, start to finish. Both use the plain-text alert format shown above. ## Trade options and strategies You can send a single option order, or ask for a full option structure (straddle, strangle, spreads, iron condor, iron fly) with one line. You choose the structure and set the values; AutoTrader Web builds and places each leg for you. See [ready-made option structures](https://stocksdeveloper.in/documentation/alert-automation/#ready-made-option-structures). ## Trade many accounts at once Use `group=YOUR_GROUP` instead of `account=` to place the same order in every live account in a group. One TradingView subscription can drive many accounts this way. First create a group under **Accounts → Group Accounts** — see [Group Accounts](https://stocksdeveloper.in/documentation/user-interface/accounts/group-accounts/). ## Already using the classic JSON setup? The older setup, which uses a longer JSON message and a Pine Script library, still works and your existing alerts keep running. For new setups we recommend Alert Automation. If you need the old format, see the [classic setup](https://stocksdeveloper.in/documentation/trading-view-classic/). ## Your alert fired but no order was placed Start on the **Alert Trail** screen in AutoTrader Web (**Alert Auto. → Alert Trail**). It lists every alert we received, the step it reached, and the reason it stopped. That reason is the answer — you do not have to guess, and you do not need to ask us first. If your alert is not on that list at all, it never reached us. Open the alert in TradingView and check it is still active, that the **Webhook URL** box is ticked, and that it holds your private link. If it is on the list but was refused, the reason is nearly always one of these three, and each is a small edit in TradingView: | What you wrote | What happens | The fix | | --- | --- | --- | | `account: MY_ACCOUNT` | Nothing is read. A line with a colon is skipped, so the whole alert is empty to us. | Use an equals sign: `account=MY_ACCOUNT`. Change every `:` to `=`. | | TradingView's default message, like `SBIN, 1 Crossing Up` | Nothing is read. It is a sentence, not an order. | Clear the Message box and write your own order in it, one setting per line. | | A message starting with `{` that contains `"command"` | Nothing is read. That is the classic format, and it only works with a classic webhook link. | Rewrite it in the format above, or point the alert back at your [classic link](https://stocksdeveloper.in/documentation/trading-view-classic/). | None of these have anything to do with your wallet, your licence or your broker. The alert stops while we are still reading it, long before any of that is involved. To be sure before you go live, paste your message into the [alert checker](https://stocksdeveloper.in/documentation/alert-automation/#check-it-before-you-use-it) — it gives you the same reason we would. ## Does your alert look late? The time shown against an alert on your chart is the time the **candle started**, not the moment your alert fired. On a one-minute chart the candle marked `09:30` runs until 09:30:59, so an alert on that candle can fire at any second inside that minute — which is why an alert sometimes looks 20 or 30 seconds late when nothing is slow. Add `timenow={{timenow}}` to your alert and you can see the exact firing time. See [TradingView alert looks delayed or late](https://stocksdeveloper.in/knowledgebase/tradingview-alert-delay/). ## Before you automate Please read the [precautions](https://stocksdeveloper.in/documentation/precautions/) first. In short: stop your alerts when you are not using them, test with the smallest size first, and avoid changing settings during live market hours (TradingView can repaint a signal). Automation has its own risks — make sure you understand your alerts before you rely on them. ============================================================================== PAGE 3 OF 3 — API Parameters URL: https://stocksdeveloper.in/documentation/api/api-parameters/ Last updated: 2026-09-06 Summary: These are the standard parameters you pass to AutoTrader API functions. AutoTrader hides each broker's order, position, trade and margin formats behind one common format. You send values in this standard format, and the software converts them to the format your broker needs. ============================================================================== Every trading platform has its own format for orders, positions, trades and margins. AutoTrader's job is to hide those differences and give you a single standard format. You pass values in the standard format defined by the AutoTrader team, and the software converts them internally for your trading platform. > The AutoTrader API is offered in multiple programming languages. The descriptions below are generic and apply to all of them, so there may be small differences. Please also check the language-specific examples for your [client setup](https://stocksdeveloper.in/documentation/client-setup/). ## Order Id **Data type:** Text or String An order id uniquely identifies an order. In AutoTrader you deal with 3 types of order ids. 1. **Publisher Id** — Used in languages like AmiBroker AFL or MetaTrader MQL, where direct HTTP REST communication is not possible. This id is generated by the API functions, and AutoTrader maps it to the actual order. It may not be unique across different users, because it is generated on the client side. 2. **System Id** — When AutoTrader receives a new order, it assigns a new id. This id is unique across all users of the AutoTrader platform. 3. **Platform Id** — The id given to the order by your stock broker's trading platform. ## Account **Data type:** Text or String A nickname (also known as a [pseudo account](https://stocksdeveloper.in/documentation/broker-independence/pseudo-account/)) you have given for your broker account. The system maps it internally to an actual trading account. Taking a nickname instead of the real broker account lets you switch broker accounts from the system without changing your code. See how to [create a nickname](https://stocksdeveloper.in/documentation/user-interface/accounts/nicknames/). Depending on the client, this parameter is named `pseudoAccount` (HTTP, Java, C#), `pseudo_account` (Python), `PseudoAccount` (Excel) or simply `account` (AmiBroker, MetaTrader). Whatever the name, the value you pass is always the nickname. For example: ```shell pseudoAccount=ACC_NICK_NAME ``` **Note:** You can rename a nickname later from the [Trading Accounts](https://stocksdeveloper.in/documentation/user-interface/accounts/trading-accounts/) screen. The nickname is the name your code passes here, so if you rename it, update the name in your code to match. If you do not, your orders will fail. ## Variety **Data type:** Text or String or Enumeration Variety represents the kind of an order. | Value | Meaning | |---|---| | **REGULAR** | A regular order | | **BO** | Your broker's own bracket order — available only on brokers that offer one | | **CO** | Your broker's own cover order — available only on brokers that offer one | | **AT_BO** | An [AutoTrader bracket order](https://stocksdeveloper.in/documentation/bracket-cover-orders/) — works on every broker we support | | **AT_CO** | An [AutoTrader cover order](https://stocksdeveloper.in/documentation/bracket-cover-orders/) — works on every broker we support | `AT_BO` and `AT_CO` are our own bracket and cover orders. Your entry is placed as an ordinary intraday order and AutoTrader Web watches your target and stoploss, so they work even on brokers that do not offer bracket or cover orders. They are always intraday, they do not give the extra margin some brokers give on their own bracket orders, and the position is squared off automatically before the market closes. See [Bracket & Cover Orders](https://stocksdeveloper.in/documentation/bracket-cover-orders/). ## Exchange **Data type:** Text or String or Enumeration An exchange represents the Indian stock exchange on which the order symbol is traded. Pass the standard code for the relevant exchange and market segment, for example the cash segment, the F&O segment or the commodity segment. ## Symbol **Data type:** Text or String A symbol represents a stock or derivative contract. The symbol must be a [broker independent symbol](https://stocksdeveloper.in/documentation/broker-independence/instruments-symbols/). You can use this [Indian API stock symbol search tool](https://stocksdeveloper.in/knowledgebase/instrument-not-found/). ## Trade Type **Data type:** Text or String or Enumeration Represents a trade type, sometimes called transaction type. The valid trade types are: | Value | Meaning | |---|---| | **BUY** | A buy order | | **SELL** | A sell order | | **SHORT** | A sell order (added for charting software support — only allowed in the CSV format used by the AmiBroker, MetaTrader and Excel libraries) | | **COVER** | A buy order (added for charting software support — only allowed in the CSV format used by the AmiBroker, MetaTrader and Excel libraries) | ## Order Type **Data type:** Text or String or Enumeration Represents an order type. There are 4 valid order types. | Value | Meaning | |---|---| | **LIMIT** | A limit order | | **MARKET** | A market order | | **STOP\_LOSS** | A stoploss order | | **SL\_MARKET** | A stoploss market order | ## Product Type **Data type:** Text or String or Enumeration Represents a product type. There are 4 valid product types. | Value | Meaning | |---|---| | **INTRADAY** | An intraday or MIS order | | **DELIVERY** | A delivery order | | **NORMAL** | A normal order | | **MTF** | A margin trading facility order (also known as buy now pay later). Supported only by brokers that offer MTF. | ## Validity **Data type:** Text or String or Enumeration Represents order validity. There are 2 valid values. | Value | Meaning | |---|---| | **DAY** | Order is valid for the day (this is the default) | | **IOC** | Immediate or cancel | **Note:** Do not confuse Validity with Product Type. They are different things. ## Quantity **Data type:** Numeric or Integer AutoTrader passes the quantity as it is to the trading platform. The confusion usually happens for derivatives: should you pass quantity as a multiple of lot size, or as a number of lots? All trading platforms supported by AutoTrader take quantity **in multiple of lot size**. **Example:** To buy 1 lot of NIFTY Future (assuming a lot size of 65), enter the quantity as: **\= (#lots \* lots\_size) = (1 \* 65) = 65** Lot sizes are revised from time to time, so always check the current lot size of the contract you are trading. ### Commodity contracts: an optional setting changes this There is one setting that changes how quantity is counted, and **only** for commodity contracts. **Commodity Quantity in Lots**, in **Settings → General**, under **Trading**. It is **off by default**, so nothing changes unless you switch it on yourself. | Setting | What to send for a commodity contract | | --- | --- | | Off (default) | The quantity as a multiple of lot size, exactly as above | | On | The **number of lots** | **Example:** for a commodity contract whose lot size is 250, to buy 1 lot you send **250** with the setting off, and **1** with it on. **This setting applies to your API orders, not only to orders you place on the website.** It is stored against your account, so switching it on changes what every one of your programs is sending — the API, a chart bridge, or anything else. **Update your program before you switch it on.** If it keeps sending its usual quantity, that number will be read as that many lots. Contracts whose lot size is 1 are unaffected either way. The setting exists because broker APIs do not agree with each other. For the same commodity contract, some count in lots and some count in units, so the same number meant different sizes at different brokers. Sending the number of lots means one number means one thing whichever broker the account belongs to, and AutoTrader converts it to whatever that broker's API expects. The unit you send is also the unit you **read back**. With the setting on, orders and positions report commodity quantity in lots, so a quantity you read can be sent straight back to any endpoint that takes one. ## Disclosed Quantity **Data type:** Numeric or Integer Represents a disclosed quantity. It is optional and defaults to zero. It follows the same unit as Quantity, so on a commodity contract it is a number of lots when **Commodity Quantity in Lots** is on. ## Price **Data type:** Decimal or Float Represents the order price. For a market order, this price defaults to zero. **Note:** Price is automatically rounded to the nearest tick price, so you need not worry about price being a multiple of tick size. Example: a price of 50.54 with a tick size of 0.05 becomes 50.55. ## Trigger Price **Data type:** Decimal or Float Represents a trigger price. It is used in a stoploss order or a cover order. For a **cover order**, this is the actual price your stop-loss sits at. It is a price, not a distance. This is worth remembering, because a bracket order works the other way round: its stoploss is a distance from your entry, not a price. See **Stoploss (Bracket Order)** below. **Note:** Trigger price is automatically rounded to the nearest tick price, so you need not worry about it being a multiple of tick size. Example: a price of 50.54 with a tick size of 0.05 becomes 50.55. ⚠️ **On a `STOP_LOSS` order, the two prices must point the right way round.** `price` is the limit price and `triggerPrice` is the level that activates the order, and the limit has to allow the direction the order will trade in: | Trade type | Required | |---|---| | `SELL` | `price` at or **below** `triggerPrice` | | `BUY` | `price` at or **above** `triggerPrice` | Equal prices are allowed. Send them the wrong way round and the request is rejected with a message naming both prices and the direction required, on **place and on modify**. A `SL_MARKET` order has no limit price, so only `triggerPrice` applies to it. **On modify, send both prices together when you move a stop.** A modify carries only the fields you change, so passing `triggerPrice` alone leaves the order's existing limit price beside your new trigger. Move it far enough and the two cross. See [Trigger price rejected](https://stocksdeveloper.in/knowledgebase/trigger-price-rejected/). ## Target (Bracket Order) **Data type:** Decimal or Float Represents the target of a bracket order, as a **distance from your entry price**. It is not the price you want to exit at. Example: you buy at 180.50 and pass `target=5`. Your target sits at 185.50, which is 5 above your entry. A common mistake is to pass the exit price itself. If you want to exit at 185.50 after buying at 180.50, pass `target=5`, not `target=185.5` — the second one asks for a target 185.50 away from your entry. On a sell order the target sits **below** your entry, because that is the profitable side. You still pass the same positive distance. The same value and the same meaning apply to an [AutoTrader bracket order](https://stocksdeveloper.in/documentation/api/place-autotrader-bracket-order/) (`AT_BO`). An AutoTrader **cover** order (`AT_CO`) has no target. ## Stoploss (Bracket Order) **Data type:** Decimal or Float Represents the stoploss of a bracket order, as a **distance from your entry price**. It is not the price you want your stop to sit at. Example: you buy at 180.50 and pass `stoploss=2.5`. Your stop sits at 178.00, which is 2.50 below your entry. On a sell order the stop sits **above** your entry. You still pass the same positive distance. The same value and the same meaning apply to an [AutoTrader bracket order](https://stocksdeveloper.in/documentation/api/place-autotrader-bracket-order/) (`AT_BO`) **and** to an [AutoTrader cover order](https://stocksdeveloper.in/documentation/api/place-autotrader-cover-order/) (`AT_CO`). ⚠️ **Note the difference from your broker's cover order.** On a `CO` the stop is given as a real price, in **Trigger Price** above. On an `AT_CO` it is given here, as a distance from your entry price — and there is no trigger price at all. Passing a stop price where a distance is expected is the one mistake worth checking for when you move a cover order across. ## Trailing Stoploss (Bracket Order) **Data type:** Decimal or Float Represents the trailing stoploss of a bracket order: the **step** your stop-loss moves by as the price moves in your favour. Like the two values above, it is a distance, not a price. It only ever moves your stop closer to the current price, never further away. Example: you buy at 180.50 with `stoploss=2.5` and `trailingStoploss=1`. Your stop starts at 178.00, and moves up in steps of 1 as the price rises. Pass it as a **rupee amount** — for example, 1 for a one-rupee step. Some brokers work a little differently. Their own system takes the trailing stoploss as a **number of ticks**. On such a system, a one-rupee step on an instrument with a tick size of 0.05 would have to be entered as 20, calculated as 1 divided by 0.05. You do not need to do that here. Because AutoTrader is broker independent, always pass the rupee amount. The software reads the tick size and converts it into ticks for you where the broker needs it. **A trailing stoploss needs a stoploss with it.** The stoploss says how far behind the price your stop sits; the trailing stoploss says how much it moves each step. On its own, a trailing value cannot say both, so an order carrying only a trailing stoploss is rejected before it is placed. This applies to bracket orders, AutoTrader bracket and cover orders, and alerts alike. **The stop moves in whole steps.** Buy at 100 with `stoploss=10` and `trailingStoploss=2`: the stop starts at 90, is still 90 when the price reaches 101, and moves to 92 once the price reaches 102. You can try this on the [Bracket & Cover Orders](https://stocksdeveloper.in/documentation/bracket-cover-orders/) page. ## AMO **Data type:** Text or String or Boolean Indicates whether an order is an **A**fter **M**arket **O**rder. | Value | Meaning | |---|---| | **TRUE** | The order is an AMO | | **FALSE** | The order is not an AMO (this is the default) | ## Validate **Data type:** Boolean This parameter is only used in AmiBroker. When set to **True**, the system will not accept back to back BUY or back to back SELL orders. It treats them as duplicate orders caused by a known limitation of AmiBroker. When you get a signal in AmiBroker, it stays active until the candle completes. Every time the strategy runs during this active state, it sees the signal is active and places an order, which results in duplicate orders. AmiBroker experts can set it to **False** and manage the signal in their own strategy code. This simple flag was built for beginners. ## OrderStatus **Data type:** Text or String or Enumeration Represents order status in a broker-independent way. Broker-specific statuses are not uniform, so AutoTrader parses them into a standard status. | Value | Meaning | |---|---| | **OPEN** | Open | | **COMPLETE** | Complete | | **CANCELLED** | Cancelled | | **REJECTED** | Rejected | | **TRIGGER\_PENDING** | Trigger pending | | **UNKNOWN** | Unknown (when the system cannot determine the type from the raw order status received from the stock broker) | ## MarginCategory **Data type:** Text or String or Enumeration Represents margin category. | Value | Meaning | |---|---| | **EQUITY** | Margin for the Equity section of your account | | **COMMODITY** | Margin for the Commodity section of your account | | **ALL** | Combined margin for Equity and Commodity | ## PositionCategory **Data type:** Text or String or Enumeration Represents position category. | Value | Meaning | |---|---| | **DAY** | Snapshot of the buying and selling activity for that particular day | | **NET** | Actual or current net position | Not every broker sends both. Some brokers give **NET** only, so a read scoped to **DAY** returns nothing for those accounts. **NET** works for every broker, so prefer it unless you specifically need today's activity on its own. See [precautions](https://stocksdeveloper.in/documentation/precautions/) for the brokers this applies to. ## PositionType **Data type:** Text or String or Enumeration Represents position type. | Value | Meaning | |---|---| | **MIS** | MIS or intraday position | | **CNC** | CNC or delivery position | | **NRML** | Normal position position | | **BO** | BracketOrder position | | **CO** | CoverOrder position | ## PositionState **Data type:** Text or String or Enumeration Represents the state of the position, which can be either OPEN or CLOSED. | Value | Meaning | |---|---| | **OPEN** | The position is open | | **CLOSED** | The position is closed | ## PositionDirection **Data type:** Text or String or Enumeration Represents the direction of the position. | Value | Meaning | |---|---| | **LONG** | A long position | | **SHORT** | A short position | | **NEUTRAL** | A neutral position | ## Related pages - [API Rate Limits](https://stocksdeveloper.in/documentation/api/api-rate-limits/) - [Place Regular Order](https://stocksdeveloper.in/documentation/api/place-regular-order/) - [Place Bracket Order](https://stocksdeveloper.in/documentation/api/place-bracket-order/) - [Place Cover Order](https://stocksdeveloper.in/documentation/api/place-cover-order/) - [Read Positions](https://stocksdeveloper.in/documentation/api/read-positions/) - [Read Margins](https://stocksdeveloper.in/documentation/api/read-margins/)