Register
Product

Automated Commodity Trading Algos for Indian Traders

QuantPower lets you build, test and automate strategies on MCX futures, including gold, silver and crude oil, through your own broker account. This page covers what you can automate, the contract details that matter for an algo, the evening session, margin and delivery rules, and the costs to plan for.

QuantPower Research · Updated 15 Nov 2026 · 17 min read

Commodity algos run on the same engine as equity and index algos in QuantPower. The difference is the market around them. MCX trades from 9:00 am until late at night, its prices follow global markets and the US dollar, its contracts are large, and gold and silver can end in physical delivery. An algo that works on Nifty needs new session times, new sizes and new exits before it can run on crude oil. QuantPower reads each contract's own trading hours and holidays from the exchange calendar, so entries, exits, alerts and risk rules all use the right clock for the commodity you trade. The rule for risk stays the same as anywhere else: a loss limit for the session, set before it starts.

What you can automate on MCX

FeatureHow it works for commodities
AlgosLegs on MCX futures and options, with entry and exit times, stops, targets, trailing stops and re-entries
Entry modesAt a time, wait and trade, or an opening range breakout from 9:00 am or a time you set
SignalsA price level, an indicator or a rule of up to 20 conditions on a commodity chart, checked on every closed candle
WebhooksOther charting software, or any tool that can call a URL, starts and stops your commodity algos
Forward testRun the algo on live MCX prices with no real money
BacktestingTest a rule on past commodity candles from your broker
Account controlsSmart Exit, the daily loss limit and the kill switch, with commodity as its own segment
ChartsArth.live charts with 201 indicators on MCX contracts, free

Your broker account needs the commodity segment active. Algo orders on MCX follow SEBI's framework for retail algorithmic trading, which MCX applies through its own circulars.1

A short history of commodity trading in India

Futures trading in commodities is older in India than in shares. Cotton futures traded in Bombay in the nineteenth century, and the Bombay Cotton Trade Association was founded in 1875. Through the twentieth century, regional exchanges traded futures in cotton, oilseeds, jute and other crops, under the Forward Contracts (Regulation) Act of 1952 and the Forward Markets Commission. Many contracts were banned for long periods in the decades that followed.

The modern market began in 2003, when the government allowed national, electronic, multi-commodity exchanges. MCX, the Multi Commodity Exchange of India, started trading in November 2003 and soon became the largest of them, with bullion, energy and base metals at its centre.2 A commodity transaction tax on non-agricultural futures came in from 1 July 2013.3 In September 2015 the Forward Markets Commission was merged into SEBI, which since then has regulated commodity derivatives alongside securities.4 Options on commodity futures followed from October 2017, starting with gold.

Algo trading reached commodities with the rest of the market. Under SEBI's circular of 4 February 2025, retail algo orders must reach the exchange through a broker, from a static IP registered with the broker, and algos offered to retail traders must be registered with the exchange. MCX issued its own circulars to implement the framework, and it came into force from 1 April 2026.1

Contracts most traded by algo traders

ContractLot sizePrice quoted perValue of a ₹1 move per lot
Crude Oil100 barrelsBarrel₹100
Crude Oil Mini10 barrelsBarrel₹10
Gold1 kg10 grams₹100
Gold Mini100 grams10 grams₹10
Silver30 kgKilogram₹30
Silver Mini5 kgKilogram₹5
Silver Micro1 kgKilogram₹1

Smaller gold contracts, Gold Guinea (8 grams) and Gold Petal (1 gram), also trade. Check MCX's contract specifications before you trade, because lot sizes and tick values can change.5

What a lot is worth

At an illustrative crude oil price of ₹6,000 a barrel, one Crude Oil Mini lot is worth about ₹60,000 and a standard lot about ₹6 lakh. A 2% move, ₹120 a barrel, changes a Mini position by ₹1,200 and a standard position by ₹12,000.

Start testing with Mini or Micro contracts. The rules are the same, and the money at risk per lot is a tenth or less. Move to a standard lot only when the Mini version has run live for a few weeks and behaved as its forward test did.

Trading hours and timing rules

MCX hours depend on the commodity and on the season, because its evening session follows US markets:

CommoditiesHours (IST)
Non-agricultural (bullion, energy, base metals) while the US is on daylight saving time, March to November9:00 am to 11:30 pm
Non-agricultural while the US is on standard time, November to March9:00 am to 11:55 pm
Cotton, cotton oil, kapas and crude palm oil9:00 am to 9:00 pm
Other agricultural commodities9:00 am to 5:00 pm

QuantPower reads these hours, and MCX's own holiday list, from its market calendar for every contract. The MCX market timings guide lists the session of every commodity group and the dates the evening close changes. An algo's exit time can never be later than the market's own square-off time, and an alert or a signal is checked only while its contract trades.

What this means for a strategy:

  • Set session times per strategy. An equity strategy that exits at 3:10 pm must have a different exit time on MCX.
  • Know when liquidity arrives. Gold, silver and crude are most active in the evening, when US markets are open.
  • Plan for US data. The US weekly oil inventory report comes out at 8:00 pm IST during US daylight saving time and 9:00 pm IST otherwise.6 US inflation and jobs data come out at 6:00 or 7:00 pm IST. Many traders pause entries for a few minutes around them.
  • Watch the seasonal change. When the US changes its clocks, the MCX close moves by 25 minutes. An exit time set for 11:20 pm works in both seasons; one set for 11:45 pm does not.
  • Decide who watches the evening. An algo that trades until late at night needs an account-level stop for the whole session.

Building a commodity algo in QuantPower

  1. Pick the contract. Search for the commodity and choose the future or the option, for example the current month's Crude Oil Mini future.
  2. Set the legs. Buy or sell, and the number of lots. For options on commodity futures, choose the strike and expiry.
  3. Set the entry. At a time, such as 6:00 pm; wait and trade, where the leg enters when the price moves by the points or per cent you set; or an opening range breakout, where the algo reads the high and low of the first N minutes, from 1 to 180, and enters on the first break.
  4. Set the exits. A stop-loss and a target on each leg, in points or per cent, a trailing stop, and an exit time inside the session.
  5. Set the product. Intraday or overnight. Overnight positions carry to the next session; a next-day exit (BTST or STBT) closes them at a time you set the following trading day.
  6. Test it. Backtest the rule, then switch the algo on in Forward test for a few weeks.
  7. Switch it on live with the smallest size, at the broker that has your commodity segment active.

What moves each commodity

Commodity prices answer to different forces from shares, and an algo built on one should respect what drives it.

CommodityWhat usually moves itWhat it means for an algo
Crude oilOPEC+ decisions, US inventory data, global growth, the dollar-rupee rateSharp moves around scheduled reports; wide intraday ranges
Natural gasUS weather, storage data, LNG supplyVery large daily swings; smaller size per lot of risk
GoldUS interest rates, the dollar, central bank buying, import duty in IndiaTrends that last; reactions to US data in the evening
SilverGold's moves, plus industrial demandLarger percentage moves than gold
Base metalsChinese demand, global growth, supply newsMoves overnight in Asian and London trading

Because MCX prices are quoted in rupees, every commodity also moves with the dollar-rupee rate. A day when the rupee weakens can lift the MCX price of gold even if the global price is flat. Check both before you judge a move.

Testing commodity rules

Test a commodity rule the way you would an index rule, with two extra checks.

  1. Backtest it on your broker's commodity candles. QuantPower's backtesting reads up to 2,000 candles of one contract and deducts charges from every trade. On 15-minute candles, a full MCX session has about 58 candles, so 2,000 candles cover about 35 sessions. On hourly candles they cover more than four months.
  2. Check the roll. A futures contract expires every month. A rule tested across several expiries is really tested on several contracts; look for jumps at the roll.
  3. Run a [forward test](/forward-test) on live MCX prices for several weeks, including at least a few evenings with US data.
  4. Compare the forward test with the backtest over the same weeks, with charges on both sides.
  5. Go live with Mini or Micro contracts first.

Signals and alerts on commodity charts

Arth.live charts show MCX contracts with every indicator, drawing tool and pattern, and the chart is free. On a commodity chart you can set an alert that only tells you, or a signal that acts. With signal trading, a condition such as "Crude Oil Mini closes above the previous day's high on 15-minute candles" can prepare an order for your touch, place it by itself once armed, or start one of your algos. Signals are checked on every closed candle, so an evening signal fires even if you have closed the app. An alert from other charting software can do the same through a webhook.

Options on commodity futures

Options on MCX are mostly options on the futures contract: exercising a crude oil option gives a crude oil futures position, not barrels. That matters for algos in three ways.

  • Expiry comes before the future's. An option algo that holds to the option's expiry must be set for that date, not the future's.
  • Devolvement. An in-the-money option at expiry can turn into a futures position, with the futures margin that comes with it. Exit or roll before expiry unless you want the future.
  • Liquidity is thinner. Fewer strikes trade actively than in Nifty options. Check the bid and ask before you set a rule that picks strikes far from the money.

Account controls for the evening session

The commodity segment has its own place in QuantPower's account controls.

  • Smart Exit can be armed on the commodity segment alone, with a target, a stop, a locked profit or a trail for the evening. When it fires, it cancels open commodity orders, stops the commodity algos and squares off every commodity position. It lasts until the close of trading in the segment.
  • The daily loss limit counts the whole account. Once the day's loss reaches it, new orders are refused in every segment, so a bad morning in options also stops a new crude oil entry in the evening.
  • The kill switch can stop the commodity segment until its next session without touching equity.

A checklist before the evening

  1. Check that the commodity segment is active and has margin.
  2. Check the calendar for US reports and holidays that evening.
  3. Arm Smart Exit on the commodity segment with your stop for the evening.
  4. Check every commodity algo's exit time against tonight's close.
  5. Sign in to your broker if its session needs a daily sign-in.

Margin

MCX margins are set as a percentage of contract value and change with volatility. Crude oil margins in particular can rise sharply when prices swing. Your broker may add its own margin on top. QuantPower checks margin before every order and shows a margin preview in the order sheet, but the margin itself is set by the exchange and your broker. Before deploying, check the current margin for the contract, and keep a buffer for increases.

Brokers also tend to ask for more margin on bullion contracts in the days before the delivery period, and some stop new positions in the expiring month altogether. Plan the roll before that, not on the day.

An algo whose entry is refused for margin does not leave a half-built position behind: it closes the legs already in, stops, and shows the reason.

Delivery and expiry

  • Crude oil futures are cash settled and expire around the 19th of the contract month. Options on crude oil expire a few days before the futures.
  • Gold and silver futures can settle by delivery. Most brokers close or block positions before the delivery period starts. Set your algo to exit or roll before your broker's cut-off.
  • Options on MCX are mostly options on the futures contract. In-the-money options can turn into futures positions at expiry, so check the contract terms and your margin.
  • Fixed legs stop at expiry. An algo whose leg is a fixed contract stops when that contract expires and says so. Edit it to move to the next month.

Costs to include in backtests

CostRate or basis
BrokerageSet by your broker, often ₹20 per executed order
Commodity transaction tax (CTT)0.01% of the sell value of non-agricultural futures
Exchange transaction chargesSet by MCX, on turnover
SEBI fee₹10 per crore of turnover
Stamp dutyOn the buy side, at the state rate
GST18% on brokerage, exchange charges and the SEBI fee

Slippage matters more in thin contracts and in the morning, when volumes are lower. Include it in every backtest.

A worked example: a crude oil breakout in the evening

A trader wants to trade the move that often follows the US weekly oil inventory report.

  1. Contract: the current month's Crude Oil Mini future, 1 lot.
  2. Entry: an opening range breakout counted from 8:05 pm, over 15 minutes, on the future itself. The algo records the high and low from 8:05 to 8:20 pm and enters on the first price above the high or below the low.
  3. Exits: a stop-loss at the other side of the range, a target of twice the range, and an exit time of 11:00 pm.
  4. Days: Wednesdays only, the usual day of the report. If a holiday moves the report, switch the algo off that week.
  5. Season: during US standard time the report comes an hour later, so the start of the range moves to 9:05 pm.
  6. Account controls: Smart Exit armed on the commodity segment with a stop for the evening.

In Forward test for eight weeks, the trader reads each trade: did the range form after the report, did the entry fill near the break, and did the stop or the target come first? Only if the trades behave as intended does the algo go live, with one Mini lot.

A worked example: a gold trend algo held overnight

A trader wants to follow the trend in gold on hourly candles and hold positions for days.

  1. Signal: on the Gold Mini chart, hourly candles, the 20-period EMA crosses above the 50-period EMA.
  2. Action: the signal starts a long algo that buys 1 lot of Gold Mini, overnight, with a stop-loss of 1.5% and a trailing stop that tightens by 0.5% for every 1% the price moves up.
  3. Exit signal: the 20 EMA crossing back below the 50 EMA stops the algo and squares off.
  4. Expiry: before the broker's cut-off for the delivery period, switch the algo off and move it to the next contract.

Because the position is held overnight, a gap at the next morning's open can pass the stop. Size for the gap, not only for the stop.

Sizing a commodity position

Commodity contracts are large, and their daily ranges are wide. Size from the stop, not from the margin.

Take a trader with ₹5,00,000 who risks 1% of the account, ₹5,000, on each trade.

ContractStop in priceLoss per lot at the stopLots for ₹5,000 risk
Crude Oil Mini₹60 a barrel₹6008
Crude Oil₹60 a barrel₹6,0000 (one lot is already above the risk)
Gold Mini₹800 per 10 grams₹8,0000
Silver Micro₹1,500 per kg₹1,5003

The table uses illustrative stops. The point is the method: the loss per lot at the stop is the stop distance times the value of a ₹1 move, and the number of lots is your risk divided by that. When even one lot is above your risk, the contract is too large for the stop, so either use a smaller contract or do not take the trade. Margin tells you whether you can open the position; the stop tells you whether you should.

Who uses commodity algos

  • Evening traders who work during the day and trade MCX after hours. An algo with a clear exit time and an account stop lets them trade the busy evening hours without watching every tick.
  • Index traders adding a second market. Rules that work on Nifty futures, such as an opening range breakout or a moving-average trend, can be tested on crude oil or gold with new times and sizes.
  • Hedgers. Jewellers, traders in metals and businesses with fuel costs sometimes use futures to offset price risk. An algo can place and roll a hedge by rule.
  • Bullion investors who follow gold's trend on daily or weekly candles and want a signal to act when it turns.

Commodity algos with Quanty

Quanty, the AI assistant in the QuantPower app, can build a commodity algo from your description, such as "buy one lot of Crude Oil Mini on a break of the 8:05 to 8:20 pm range, stop at the other side, exit at 11 pm". It builds the legs and rules for you to check, backtests them and runs a risk check that flags a missing stop-loss. It saves the algo switched off. Only you can switch it on, in Forward test or live. Quanty is software, not an adviser: it will not tell you which commodity to trade or which way.

How to run commodity algos well

  1. Start small. Mini and Micro contracts first.
  2. Use the right clock. Every time in the algo should be inside the contract's session, and the exit should leave room before the close.
  3. Treat events as risk. Inventory reports, central bank decisions and US data move commodities in seconds. Either trade them on purpose or step aside.
  4. Set an evening stop. Smart Exit on the commodity segment closes the session at your loss limit, whether or not you are watching.
  5. Mind the rupee. MCX prices are in rupees, so a move in the dollar-rupee rate moves them too.
  6. Watch margin on volatile days. A margin increase can block new entries in the middle of a strategy.

Common mistakes

  • Copying an equity algo without changing the times. A 3:10 pm exit closes a crude oil position just before its busiest hours.
  • Ignoring the seasonal change in closing time. An exit set near 11:55 pm fails in summer.
  • Holding bullion into the delivery period. Your broker may close it for you at a price you did not choose.
  • Standard lots too early. A standard crude lot moves ten times as much as a Mini.
  • No account stop for the evening. An algo that runs after you have stopped watching needs a limit you set before.
  • Trading through a scheduled report by accident. If the strategy is not built for event moves, set its days and times to avoid the minutes around the US inventory report and major US data.
  • Reading a move without the rupee. A rise in MCX gold on a day the rupee falls may be a currency move, not a gold move. Check the global price too.
  • Testing on one contract month only. A rule that worked in one month's contract may have caught one event. Test across several expiries.

Where commodity algo trading is going

Commodity markets in India are getting closer to the global ones they follow, with longer hours, smaller contracts and options on more products. The same rules now cover algos in commodities as in shares: broker-approved paths, registered static IPs and registered strategies. For a retail trader, that means commodity algos are as accessible as index algos, and need the same care: test first, size small, and set the evening's loss limit before the evening begins. The tools for that are already in place: an exchange calendar that knows the evening close, a forward test on live evening prices, and an account stop that covers the commodity segment on its own.

Pricing

Commodity algos are priced like any other: 200 tokens per algo per 28 days live, or 100 in Forward test, with orders unlimited inside a live algo. A backtest costs 2 tokens, with the first 10 each week free. Charts, the screener and the strategy builder are free. 1 token = ₹1, GST extra. See pricing.

Strategy guides for commodities

  • Crude oil trading: contracts, margin, the evening session and four rule-based strategies
  • Gold commodity trading: contracts, margin, the import duty and four rule-based strategies for gold and silver
  • MCX market timings: the session hours of every commodity group, and how they change with the US clock

Start with 500 free tokens

Connect your broker, build a strategy and test it on paper before a single live order goes out.

Frequently asked questions

Can I run commodity and equity algos at the same time?

Yes, as separate algos with their own session times, as long as your broker account has both segments active and enough margin for both. Up to 20 algos can run at a time.

Which brokers support MCX trading through QuantPower?

Any connected broker whose account has the commodity segment active. Check with your broker that it is active on your own account before you switch on a commodity algo.

Do commodity algos follow SEBI's algo rules?

Yes. SEBI's retail algo framework applies on MCX as well, under MCX's own implementation circulars. Orders go through your broker's API from your registered static IP, and you sign in to your broker each trading day.

Does QuantPower know MCX's evening hours and holidays?

Yes. The market calendar holds each commodity group's hours, including the seasonal change in the evening close, and MCX's own holidays. An algo's exit time can never be later than its contract's square-off time.

Can an algo trade commodity options?

Yes. An algo's legs can be options on MCX futures as well as the futures themselves. Remember that commodity options expire before their futures and that an in-the-money option can turn into a futures position at expiry, so set the exit or the roll before then.

Can I backtest a commodity rule?

Yes. A rule backtest reads up to 2,000 candles of one contract from your broker, from 5-minute to daily, and deducts charges from every trade. Test across several monthly contracts and look for jumps at each roll.

Is commodity trading riskier than equity F&O?

It has different risks: evening sessions, moves driven by global events and the US dollar, high margins in volatile periods and delivery rules for bullion. Size positions with these in mind.

References

  1. SEBI, circular on safer participation of retail investors in algorithmic trading, 4 February 2025, and MCX circulars MCX/CTCL/235/2025 (6 May 2025), MCX/CTCL/364/2025 (25 July 2025) and MCX/CTCL/504/2025 (1 October 2025) on the retail algo framework (sebi.gov.in, mcxindia.com)
  2. MCX: company history, trading from November 2003 (mcxindia.com)
  3. Finance Act, 2013, Chapter VII, commodities transaction tax
  4. Government of India, merger of the Forward Markets Commission with SEBI, 28 September 2015 (sebi.gov.in)
  5. MCX, contract specifications for Crude Oil, Crude Oil Mini, Gold, Gold Mini, Silver, Silver Mini and Silver Micro (mcxindia.com)
  6. US Energy Information Administration, weekly petroleum status report schedule (eia.gov)
  7. QuantPower: market calendar, algo rules and prices, from the app's code and price list, checked 12 November 2026
Commodity derivatives trading involves substantial risk. Figures on this page use illustrative prices, not live prices or recommendations.