Course contents
What coding lets you do
Python lets you do in seconds, and repeat without error, the data work a trader would otherwise do by hand: fetching prices, computing returns, testing ideas. This chapter shows what you will build and sets honest expectations about what coding can and cannot give you.
- Explain why Python is the common language of quantitative trading
- Preview the concrete things the course will build
- Set the honest expectation that coding is a tool, not an edge in itself
Working out the return on a single trade is easy with a calculator: you bought a share at 1400 rupees, sold it at 1540, and made about 10%. Now do that for every one of the 500 stocks in an index, every day, for the last ten years, and then test whether a particular buy-and-sell rule would have made money across all of it. By hand that is impossible. With a few lines of Python it takes seconds, and it is exactly the kind of work this course teaches you to do. Python is how a trader stops doing sums by hand and starts asking real questions of real data.
What you will be able to build
By the end of this course you will be able to write Python from nothing, and then point it at the market. You will fetch real historical prices for an Indian stock or index, compute their returns and volatility, draw a price chart with a moving average on it, build a simple trading signal, and test that signal against years of past data to see how it would have done. None of it requires prior coding experience, and we start from the very first line.
Here is a taste of what even the simplest code can do. You do not need to understand the syntax yet; just read it like a recipe.
# A first taste of Python: turn two prices into a return.
buy_price = 1400 # rupees, what you paid for one share (illustrative)
sell_price = 1540 # rupees, what you sold it for
return_pct = (sell_price - buy_price) / buy_price * 100
print(f"Bought at {buy_price}, sold at {sell_price}")
print(f"Return: {return_pct:.2f}%")Bought at 1400, sold at 1540 Return: 10.00%
Those few lines take a buy price and a sell price, compute the percentage return, and print it, giving a return of 10.00%. It is a trivial calculation, but notice two things that matter enormously at scale. The computer did the arithmetic without a single slip, and the same handful of lines would work just as well on two prices or two million. That reliability and that scale are the whole reason code beats hand-work for a trader.
Why Python
There are many programming languages, and for working with market data Python has become the common one, for a few plain reasons. It is unusually readable, closer to plain English than most languages, which makes it kind to beginners. It is free and open, so nothing stands between you and starting. And above all it has an enormous collection of free, ready-made tools for exactly this work: libraries for numerical maths, for handling tables of data, for charting, and for fetching prices, which you will meet through the course. When you write Python for trading, you stand on the shoulders of a great deal of work others have already done and given away.
What coding can and cannot do
One honest caution belongs right at the start, because it shapes how you should hold everything that follows. Being able to code does not, by itself, make you money. It is a tool, a very good one, for doing analysis and testing ideas, but the tool is not an edge. A badly conceived strategy coded perfectly is still a badly conceived strategy, and the uncomfortable finding from the Risk and Psychology course, that most individual traders lose, is not repealed by automating the losing.
There is a specific trap this course returns to hard in its final part. Testing a strategy on past data, called backtesting, is the easiest thing in all of trading to fool yourself with, because it is simple to produce a beautiful result that would never have worked in reality. Learning to code a strategy is the easy half; learning to distrust your own backtest is the hard and important half, and this course teaches both. Treat coding as a way to ask honest questions of the market, not as a machine for printing money. This is education, not advice.
What to carry forward
This course builds toward writing Python from scratch and using it to fetch, analyse, chart, and test trading ideas on real Indian market data. Even simple code earns its place through reliability and scale, doing without error, and at any size, what would be impossible by hand, and Python is the natural choice for its readability and its vast free toolkit. Hold on to the honest framing too: coding is a tool, not an edge, and a backtest is something to doubt, not to believe.
The next chapter sets up your workbench, installing Python and getting a place to run code, so the tools never stand in your way.