VALYNOXSTRATEGY RESEARCH TECHNOLOGY
AlphaPrimeAlphaPrime
ACADEMY / Strategy generation

Is algo trading legal? What retail traders may and may not do

Algo trading is legal for individuals in most major markets. The law regulates what the orders do and what controls the broker keeps, not whether a computer sent them. You need the broker's automation agreement and an approved route; in India the algo also goes through a broker API and is registered via the broker. Spoofing, layering and wash trades are illegal for a program just as for a person.

By · Published · updated · Editorial policy

Contents
  1. Is algo trading legal for retail traders?
  2. What do brokers and exchanges require for automated orders?
  3. Is algo trading legal in India, and what approval does a retail algo need?
  4. Which practices are illegal even when a program does them?
  5. What does a compliant retail automated strategy look like?
  6. Frequently asked questions
  7. References

Is algo trading legal? Yes. In the US, the EU, Taiwan, India and most other major markets a retail trader may run a program that places orders. The law regulates what the orders do and what controls the broker keeps, not whether a person or a computer pressed the button.

Algo trading is trading in which a program applies written rules to price data and sends the resulting orders to a broker. Think of it like driving: owning a car is legal, and so is a self-driving feature, but the traffic rules apply to the car no matter who steers. The plain description in what algo trading is and what it costs covers the mechanics; this article covers the rules. Whether a legal strategy is worth running is a separate question, answered in whether algo trading is profitable for retail traders.

The question has three layers, and you need a yes at each one: national law (fraud and manipulation rules), exchange rules (order tagging, message limits) and the broker's own terms (automation agreement, API access, risk limits). Algorithmic orders are an ordinary part of modern markets; Hendershott, Jones and Menkveld (2011) measured their growth on the NYSE and found liquidity improved as they spread.

One order, three layers: a trader's program sits inside the broker's terms, the exchange rules and the law, and its order passes through all three before it reaches the market One order, three layers Your program sits inside all of them Law Exchange rules Broker terms Program Market Legal at one layer is not enough. So: get a yes from all three.
A program's order passes through three layers of rules before it reaches the market. Legal at one layer is not enough.

What do brokers and exchanges require for automated orders?

Before a program can send orders you need four things from the broker and the exchange: an automated-trading agreement, an approved order route or API, pre-trade risk limits, and on some exchanges a tag that marks the order as algorithmic.

  1. Automated-trading agreement. Most futures brokers have a separate form for clients who send orders from software. It states that you are responsible for every order the program sends.
  2. Approved route or API. An API (application programming interface) is the connection a program uses to talk to the broker's order system. Brokers list the platforms and APIs they accept; a strategy running on anything else cannot place live orders.
  3. Pre-trade risk limits. Pre-trade risk limits are checks the broker runs on each order before it leaves, such as a maximum order size, a maximum position and a daily loss limit. The broker sets them and you cannot switch them off.
  4. Order tagging. Some exchanges require each order to carry a flag saying whether a human or a program entered it. Your platform or broker fills this in; ask which value it sends.

These controls exist because an unattended program can repeat a mistake thousands of times in a minute. The CFTC and SEC report on 6 May 2010 traced how one automated sell program interacted with other algorithms during the flash crash, and tighter controls on automated order flow followed.

Algo trading is legal for retail traders in India, but under the SEBI framework the program must connect through a broker-provided API and the algo must be registered through the broker with the exchange. SEBI is the Securities and Exchange Board of India, the national regulator, and it sets the rules that brokers and exchanges then apply.

The practical difference from most other markets is who vouches for the program. In the US a client who has signed the automation agreement may run any program through an approved route. In India the broker is the gate: it provides the API, registers the algo with the exchange, and holds the risk controls. Because the details of the framework have been issued in stages, the first step is to ask your broker which path it supports today and to read the current circular on the SEBI website and the exchange's page before building anything.

QuestionMost markets (for example US futures)India (SEBI framework)
Who may run an algoAny client with a broker automation agreementRetail client through a SEBI-registered broker
How the order reaches the exchangeApproved platform or API chosen by the clientBroker-provided API only
Approval or registration stepBroker agreement; no registration of the strategyAlgo registered with the exchange via the broker
Who holds the risk controlsBroker pre-trade limitsBroker pre-trade limits and exchange oversight
Comparison of most markets and India: in most markets any client with an automation agreement may run an algo through an approved API with no registration and broker risk checks; in India the algo runs via the broker's API, is registered through the broker, and the exchange adds oversight Where India differs Most markets vs SEBI framework Most markets India Who Route Registration Risk checks Any client Approved API None Broker only Via broker Broker API Registered Exchange too India adds a registration step. So: ask your broker its path.
The Indian path adds a registration step through the broker. The questions to ask the broker are the row labels.

Which practices are illegal even when a program does them?

Spoofing, layering, wash trades and quote stuffing are market manipulation whether a human or a program does them, and the test is intent. A program that places orders it never means to fill is the clearest case, because the code itself shows the plan.

Spoofing is placing orders you intend to cancel so that other traders react to a false picture of supply and demand. Layering is spoofing with several price levels at once. A wash trade is buying and selling the same contract with yourself to create false volume. Quote stuffing is flooding the exchange with orders and cancels to slow other participants. In the US, spoofing in futures has been a named offence in the Commodity Exchange Act since 2010; in the EU the Market Abuse Regulation covers the same conduct. Kirilenko, Kyle, Samadi and Tuzun (2017) show how regulators now reconstruct order-by-order sequences to see who placed and cancelled what.

Spoofing in three moments of a simplified order book: large fake sell orders appear while a small real buy order waits, other traders sell and the buy order fills, then the fake sell orders are cancelled; the planned cancel is the offence Spoofing: fake, fill, cancel Simplified order book, three moments 1 Fake wall 2 Others sell 3 Cancel Buy waits Buy fills Buy kept The planned cancel is the offence. So: send only orders you want filled.
The spoofing sequence: fake pressure, real fill, cancel. Regulators look for the cancel that follows the fill.

What does a compliant retail automated strategy look like?

A compliant retail strategy places only orders it wants filled, carries a stop or a risk limit, is tested with fees and slippage before going live, keeps a log of every order, and runs on a platform the broker has approved for automation. Each step below answers one of the three layers from the first section.

Six steps to go live: write the rule with a stop, backtest with costs, test out-of-sample on unseen data, sign the broker's automation agreement and get API access, set risk limits and logging, then run small and read the order log Six steps to go live Steps 1–3 for you, 4–6 for the broker 123 456 Write rule With a stop Backtest With costs Test OOS Unseen data Agreement API access Risk limits And a log Run small Read the log
From written rule to live strategy in six steps. The first three satisfy you, the last three satisfy the broker and the exchange.

The report below shows what step two produces. AlphaPrime (Valynox) ran a search on NQ daily bars from 2019-01-02 to 2025-06-30, long and short, one contract, with $20 commission and $10 slippage charged on every trade. The rule is a stand-in built from standard indicators, not the subject of this article. It is the one candidate the search kept out of the 1,024 it tried, chosen for its return against its drawdown; picking the kept one after the fact flatters the figures, so they show the shape of an ordinary rule-based report, not what the rule earns or what a reader can expect.

Source: AlphaPrime product engine (CPU), run 2026-10-31. NQ daily bars, 2019-01-02 to 2025-06-30, long and short, 1 contract, $20 commission and $10 slippage per trade.

NumberResult
Net profit (closed trades)$146,230
Max drawdown$40,325
Trades49
Win rate61.22%
Profit factor2.37
Average trade$2,984.29
Time in market23.29%
Look at the trade count and the cost settings: every trade is a real order with commission and slippage charged, which is the kind of program regulators have no issue with.
Look at the trade count and the cost settings: every trade is a real order with commission and slippage charged, which is the kind of program regulators have no issue with. NQ · daily · 2019-01-02 to 2025-06-30 · CPU engine backtest

Forty-nine trades in six and a half years also means each order can be checked by hand against the log, which is what step six asks for. Before step four, run the five checks in how to tell whether an algo strategy works consistently, and when you choose the software that will hold the live orders, use the list in the algo trading software features that actually matter. Once a strategy passes, the broker-approved platform is where it has to live, so AlphaPrime exports the strategy's source code to MultiCharts, TradingView, TradeStation, NinjaTrader, MetaTrader 4 and MetaTrader 5, and the platform export page lists which one matches your broker's route.

Your next step: ask your broker for its automated-trading agreement and its list of approved platforms, and if you trade in India, read the current SEBI circular on retail algo trading before you write the first rule.

Frequently asked questions

Is algo trading legal in India?

Yes. SEBI, the Indian securities regulator, allows retail investors to use algorithmic trading, but the program must connect through an API provided by a SEBI-registered broker, and the algo is registered with the exchange through that broker. Ask your broker which path it supports and read the current SEBI circular, because the framework has been issued in stages.

Is algo trading legal?

Yes, in the US, the EU, Taiwan, India and most other major markets an individual may run a program that places orders. The rules apply to what the orders do, such as bans on spoofing and wash trades, and to the controls the broker must keep, such as pre-trade risk limits. You also need the broker's agreement for automated orders.

Do I need a licence to run my own trading algorithm?

No licence is needed to trade your own account with a program in most markets. Licensing applies when you manage other people's money or sell signals or software to the public. For your own account the requirements are the broker's automation agreement, an approved platform or API, and the broker's risk limits.

What is spoofing in algo trading?

Spoofing is placing orders you intend to cancel so that other traders see false buying or selling pressure and trade against it. It is market manipulation whether a person or a program does it. A strategy that sends one order per signal and wants every order filled is not spoofing.

References

  • Hendershott, T., Jones, C. M., & Menkveld, A. J. (2011). Does Algorithmic Trading Improve Liquidity? The Journal of Finance, 66(1), 1–33.
  • Staffs of the CFTC and SEC (2010). Findings Regarding the Market Events of May 6, 2010. Report to the Joint Advisory Committee on Emerging Regulatory Issues, September 30, 2010.
  • Kirilenko, A., Kyle, A. S., Samadi, M., & Tuzun, T. (2017). The Flash Crash: High-Frequency Trading in an Electronic Market. The Journal of Finance, 72(3), 967–998.