Skip to main content
AI & Trading

ChatGPT for Trading: What It's Good For and Where It Fails

ChatGPT can't predict the stock market, but it can explain, draft code and write rules. Where chatbots help Indian traders, and the bugs they quietly add.

Anoop Thomas 10 min read

ChatGPT can’t predict the stock market, and unless it is browsing the web in that moment, it doesn’t even know where Nifty is trading today. What it’s good at is the work around a trade: explaining a concept you half understand, or turning a fuzzy idea into rules you can actually test. The trouble starts when people use it for the one job it can’t do, which is telling you whether those rules make money. It will answer anyway, in exactly the same confident tone.

Everything below applies equally to ChatGPT, Claude and Gemini. For trading work they behave alike, and whichever one is ahead this month probably won’t be next month, so I’m not going to rank them.

Last updated: November 2026.

Can ChatGPT predict the stock market?

No. A language model predicts the next word in a sentence. It has no live feed and no special access to anything that moves prices. Ask “will Nifty go up tomorrow?” and you get one of two things: a balanced paragraph that says nothing, or a confident call with no basis. The second is worse, because it sounds like analysis.

There’s a quieter problem too. Every model has a training cutoff, and Indian market details change constantly. Nifty weekly options moved from Thursday to Tuesday expiry in September 2025. The Nifty lot size went from 75 to 65 (as of 2026; NSE revises lot sizes periodically). STT on sold options went from 0.1% to 0.15% of premium on 1 April 2026, per Zerodha’s STT note. A model trained before those changes will quote the old numbers without blinking. If the answer doesn’t show you a source it just fetched, assume any lot size, expiry day or tax rate in it is stale until you check.

Where chatbots genuinely help

Explaining a concept, while you check the numbers

You can ask the “stupid” follow-up question five times without embarrassment. Be specific: “Explain why a short straddle loses money faster on expiry day than a week before, using Nifty at 25,000 and a 13% implied volatility.” You’ll usually get a clear explanation of theta and gamma.

The habit to build is treating every number in the reply as a claim. The reasoning is often right while the figures are a year old.

Drafting Pine Script or Python that you then test

A chatbot saves hours of syntax lookup, but read its code the way you’d read a bright intern’s who has never traded. Two things go wrong constantly. First, version drift: models trained on years of forum posts mix Pine Script versions, and v6 removed things older scripts relied on, such as the when parameter on order functions (TradingView’s v6 migration guide lists the breaking changes). Second, look-ahead bias, which gets its own section below because it’s the one that costs money.

If you’re new to TradingView’s language, our Pine Script glossary entry covers the basics.

Summarising long documents

SEBI circulars, an annual report, or your own backtest trade log exported as CSV. Chatbots are good at structure and bad at exact figures and dates. SEBI’s October 2024 derivatives circular has six measures with three different effective dates, and a summary that flattens them into one date reads perfectly well and is wrong. Ask for the paragraph number behind each claim and open the PDF. Reading your own results is a good use, by the way: “which months drove the drawdown, and were they expiry weeks?” is a question a model handles well, because the data is in front of it.

Turning a vague idea into written rules

This is where I’d spend most of my chatbot time. Plenty of retail strategies never get a fair test because they were never defined. “Buy Nifty when it breaks out with strength” is a feeling. A backtester needs a timeframe, an exact trigger, an exit, a size, and a definition of “strength”. A model is good at noticing the words you left vague.

A prompt that turns an idea into testable rules

Here’s the pattern I’d use. Paste it, replace the idea, and keep the last instruction.

I trade on NSE. Turn the idea below into rules a backtester could run
without asking me anything. Do not tell me whether it will be profitable.

Idea: buy Nifty futures when price breaks above the first 15-minute
range with strength; get out if the breakout fails.

Write out:
1. Instrument, timeframe and session hours (IST).
2. The exact entry condition, using only data available at the moment
   the order would be placed.
3. Exits: stop-loss, target, time-based exit, end-of-day square-off.
4. Position size, and what happens on expiry day.
5. Every ambiguous word in my idea ("strength", "fails"), with two or
   three concrete ways to define each.
6. Costs to model: brokerage, STT, exchange charges, GST, stamp duty
   and slippage.

Finish with the questions you need me to answer before the rules are final.

A few lines in there do real work. “Do not tell me whether it will be profitable” stops the model cheerleading for your idea. “Using only data available at the moment the order would be placed” plants the look-ahead guard before any code exists. And item 5 is the actual value: “strength” might become “the breakout candle’s volume is above 1.5 times the average volume of that same 15-minute slot over the last 20 sessions”, or “the candle closes in the top quarter of its range”. You pick one definition, write it down, and that’s what you test.

One warning. If you then test every definition of “strength” and keep whichever did best, you’ve started curve-fitting. I’ve written a separate guide on spotting overfitting in a backtest for exactly that trap.

Where chatbots fail, and how to catch it

They will describe a backtest they never ran

Ask a chatbot for the win rate of a 9:20 am short straddle and it may well give you a percentage. Unless it ran code on a dataset sitting in front of you, that number was computed from nothing. It’s a blend of things people have posted online, and the model can’t tell a careful published backtest from a Telegram screenshot. It may not even notice that Bank Nifty hasn’t had weekly options since SEBI’s one-weekly-expiry rule took effect in November 2024, and cheerfully describe results for a contract that no longer exists.

The test is simple. A real backtest comes with a date range, a trade count, a cost assumption and a trade list you can open. If the answer has none of those, it isn’t a backtest. It’s prose.

Some chat apps can execute Python on a file you upload, which is a genuine step up: now the number came from code. But that moves the problem into the code.

Look-ahead bugs in generated backtest code

This is the classic one. It’s all over free backtesting tutorials, so models reproduce it happily. A simple trend rule on daily Nifty closes:

import pandas as pd

df = pd.read_csv("nifty_daily.csv", parse_dates=["date"], index_col="date")
df["sma20"] = df["close"].rolling(20).mean()
df["signal"] = (df["close"] > df["sma20"]).astype(int)  # decided at today's close
df["ret"] = df["close"].pct_change()                     # yesterday's close -> today's close

df["strategy"] = df["signal"] * df["ret"]                # BUG

The signal is decided using today’s close. The return is the move from yesterday’s close to today’s close. Multiplying them means you’re credited with the very move that created the signal. Every day Nifty closes above its 20-day average, you “earned” the rally that pushed it there. The equity curve looks spectacular and it is fiction.

The fix is one call:

df["strategy"] = df["signal"].shift(1) * df["ret"]       # act on yesterday's signal

Even that assumes you got filled at the close on the signal day, which you can’t really do, because you don’t know the close until it prints. A stricter version enters at the next day’s open.

The same bug wears other clothes. A shift(-1) inside a feature is literally tomorrow’s data. Choosing the “ATM strike” from the day’s closing price for a 9:20 am entry leaks the future. An intraday rule that decides and fills on the same 5-minute bar’s close does it too. In Pine Script, pulling daily data with request.security() and lookahead_on without offsetting the series returns values that didn’t exist yet on historical bars; TradingView’s repainting docs call it out explicitly.

Two cheap checks catch most of these. Ask the model to annotate every line with which timestamp’s data it reads and when the order would be sent. Then delay every signal by one extra bar and rerun. A real edge usually degrades a bit. An edge that vanishes completely was probably living in the leak.

They skip costs unless you force them in

Generated backtests usually run frictionless. On NSE that matters more than people expect. One lot of Nifty futures at 25,000 is ₹16.25 lakh of notional (25,000 × 65). A round trip at a ₹20-per-order discount broker works out roughly like this: STT of 0.05% on the sell side is ₹812.50, stamp duty of 0.002% on the buy side is ₹32.50, exchange charges on both sides come to about ₹59.50, brokerage is ₹40, and GST plus SEBI fees add about ₹22. That’s around ₹966, or close to 15 Nifty points, before a rupee of slippage. An intraday rule that averages 10 points a trade is a losing rule. You can redo this sum for your own broker with the brokerage calculator.

“An AI wrote rules” is not “the rules were tested”

People blur these two all the time, so it helps to put them side by side.

AI wrote the rulesRules tested on real data with costs
What you haveA descriptionEvidence about the past
Data behind itNone, or whatever the model remembersNSE price history over a stated date range
CostsUsually ignoredBrokerage, STT, exchange charges, GST, stamp duty, slippage
What you get backConfident proseTrade list, equity curve, drawdown, trade count
How it failsSilently, and you can’t tellVisibly, if you inspect the trades
What it provesThe idea can be written downThe rules made or lost money in that period, after costs

Even the right-hand column only tells you about the past. Out-of-sample testing and a stretch of paper trading come next; I’ve written up what backtesting and paper trading each prove separately.

Where INDfolio fits, and why the same caveat applies to us

We build INDfolio, so weigh my view here accordingly. INDfolio uses AI too: you describe a strategy in plain English and the AI strategy builder turns it into rules. I’m not going to pretend that step is magic. The model can misread “strength” just as easily as a chatbot can.

The difference we care about is what happens after the translation. The rules don’t come back as a paragraph about how promising they look. They go into a backtest on NSE history with the Indian cost stack, and you get a trade list you can open and argue with. The rules themselves are shown as blocks you can read and edit, which matters more than people think: if the AI misunderstood you, that’s where you’ll see it. Our guide to building strategies with AI walks through the full workflow, and the Starter plan is free if you want to try it with a real backtest attached.

Frequently asked questions

Can ChatGPT predict the stock market? No. It predicts text, not prices, and it has no live market data unless it’s browsing. Any forecast it gives you is a confident-sounding guess.

Is it legal to use ChatGPT for trading in India? Using a chatbot for your own research is fine. Selling its output as tips or paid recommendations is advisory work that needs SEBI registration, and automating orders through your own broker API falls under the algo trading rules that applied from 1 April 2026.

Can ChatGPT backtest a trading strategy? Only if it actually runs code on data you give it, and then you need to check that code for look-ahead bias and missing costs. It has no NSE history of its own, so a win rate quoted without a dataset wasn’t computed from anything.

Can ChatGPT write Pine Script for TradingView? Yes, reasonably well for simple indicators and strategies. Check the //@version line, compile it in TradingView, and read every request.security() call for look-ahead before you trust a strategy report.

Which is better for trading: ChatGPT, Claude or Gemini? For explaining concepts and drafting rules, the gap between them is small and changes every few months. The gap between checking their output and not checking it is enormous.

Put this into practice

Build and backtest your own strategy free — no coding, no card.

Start free
Free · No card

Create your account

By continuing you agree to our Terms and Privacy Policy.