
Set up your Angel One account to access the free SmartAPI, leveraging the referral benefits, and explore the web trading platform with a watch list, charts, indicators, and fundamentals.
Sign up and log in to Angel Broking's smart API, then create a trading API application. Obtain your API key and secret key, set localhost redirect URL, and safeguard credentials.
Explore Smart API resources, including general and technical FAQs, historical data, streaming prices, rate limits, symbol lists, and the Python SDK to implement your trading strategies.
Install and explore the Anaconda distribution to manage data science libraries with conda and pip, launch via Anaconda Navigator or terminal, and understand base environments for Python projects.
Create an optional virtual environment to isolate project libraries and avoid base environment conflicts, then install pandas, numpy, and spider with conda and activate when needed.
Install the smart API Python package, configure your API key, client ID, and password, and generate a trading session to authenticate with Angel One and access trading.
enable totp based login for Angel One's Smart API by linking Google Authenticator and scanning a QR code; update authentication flow to generate secure trading sessions.
Upgrade the smart api python package to at least 1.3.0 and enable totp for authentication; fetch the totp with the otp library and pass it to the generate session call.
Develop a token lookup utility that maps ticker names to instrument tokens via Angel One's Smart API by loading the exhaustive ticker list and filtering for IQ equity.
Build a historical data function for Angel One's API by creating a params dictionary with exchange, symbol token, instrument list, interval, and dates, then convert results to a pandas dataframe.
Transform historical data retrieval by using a duration-based approach, clean date-time indices, and time-zone removal, while formatting dates for smart API and addressing intraday 500-candle limits.
Learn to fetch historical hourly candles beyond the 500-candle limit of Angel One's Smart API by iterating start and end dates, appending data frames, and throttling requests with time.sleep.
Learn to extract historical data for multiple tickers by mapping each ticker to its open, high, low, close, and volume data frame in a dictionary for backtesting.
Discover what technical indicators are and why traders use them, including lagging and leading indicators, and learn to code these tools in Python for trend analysis and signal confirmation.
Explore the MACD indicator, built from 12 and 26 moving averages with a 9-day signal line and histogram, to signal bullish or bearish momentum and highlight its false positives.
Fetch historical five-minute candlestick data for multiple tickers and compute macd using fast 12 and slow 26 moving averages with a 9-point signal, deriving the histogram.
Learn to implement MACD with a custom EMA in Python by deriving EMA from SMA, applying the multiplier 2/(n+1), handling initial NaNs, and validating against charting platform values.
Explore Bollinger bands and ATR, two volatility-based indicators. Bollinger bands use a moving average and standard deviation to measure volatility; ATR analyzes three ranges to quantify volatility, with Python implementation.
Implement Bollinger bands using Smart API with historical candle data, computing middle, upper, and lower bands from a 20-period simple moving average and population standard deviation, and optionally band width.
Learn to implement ATR using Smart API data by computing true range from high, low, and previous close, then smooth with a 14-period EMA in pandas.
Explore the relative strength index, a momentum oscillator on a 0-100 scale that signals overbought and oversold levels with 70/30 thresholds and insights for Angel One charts.
Implement RSI with Smart API by computing average gain and average loss using an exponential moving average and an AMA-based EMA, then derive RSI from relative strength.
Explains the stochastic oscillator as a momentum based indicator measuring price change. Shows how to compute percent k using lookback highs and lows, and discusses oversold and overbought signals.
Learn to implement the stochastic indicator using SMA-based percent, compute highest high and lowest low with a 14-period lookback, and generate %K and %D via SMA in Angel One smartapi.
Explore how websocket connections enable real-time streaming data by establishing a persistent, bidirectional link, compared to http rest APIs that incur overhead with each request.
Learn to implement streaming data with Angel One's smart api web socket by obtaining a feed token, client code, and subscribing to tick level data.
Create a stream list utility that builds a tickers string from a list of stocks for the NSC exchange, streaming depth data and depth text with token lookup.
Filter market depth ticks from the Smart API streaming feed by printing only entries with the B and 1 keys, using on message logic to ignore others.
Discover how to enable streaming with Smart API WebSocket 2.0 beta, understand its concurrency limits and token mechanics, and explore practical workarounds for getting live ticks.
Learn to place, modify, and cancel orders using Angel One's Smart API, including order types, parameters, delivery versus intraday products, and durations like day and IOC in Python.
Explore how to implement place order functions for limit and market orders using Angel One's SmartAPI, including token lookup, symbol formatting, instrument lists, and intraday order parameters.
learn how to cancel orders using Angel One's smart API by passing order id and variety, testing with a cancel_order function, and verifying cancellation through open orders and history.
Learn how to modify open orders using the Smartapi, updating price and quantity, changing order type, and preserving the order ID while handling instrument lists and tokens.
Learn to fetch and filter the order book to identify open orders using Angel One's Smartapi, convert responses to a pandas data frame, and extract order IDs for management.
Explore stop loss orders with the smart api, selecting stop loss limit or stop loss market, and using trigger price and price parameters to ensure controlled execution.
Learn how to fetch the last traded price using the LTB data API, apply it to advanced orders, and adjust stop loss logic accordingly.
Identify limitations of robo orders with Angel One's Smart API: discrepancies in open orders, missing target orders, and difficulties canceling bracket orders; must manually square off via the platform.
Learn how to place GTD (good till triggered) orders with Angel One Smart API, a one-year delivery or margin rule that stays alive until triggered, broker-side not an exchange order.
Learn to modify and cancel gtt rules via Smart API by using rule id, symbol token, and exchange, and adjust price, quantity, or trigger price; 365-day limit.
Explore order book and market microstructure based strategies, analyzing bid and ask volumes to gauge buying or selling pressure, while examining spoofing risks and a live Python template.
Implement an order book based trading strategy using Angel One's API, expanding streaming to multiple tickers and tracking bid-ask ratios, trades, and KPIs for live testing.
Develop a pressure function that analyzes depth ticks, computes bid and ask volumes, updates bid-ask ratios, triggers buy or sell signals via trend detection, and manages long and short positions.
implement trend detection using bid-ask volume ratios to generate buy or sell signals with max, min, and mean thresholds, plus exit rules for long and short positions using python mean.
Compute the expected buy and sell prices using ESP, ask prices, and ask sizes, while tracking cumulative position and size to obtain weighted average entry and exit prices.
Demonstrate live testing of signals and trades in a single-threaded websocket setup, reveal data storage challenges, and introduce multithreading in Python to overcome these limitations for order book analysis.
Explore Python threading basics, memory management, and how the threading module enables concurrent execution, while understanding the Global Interpreter Lock and its impact on parallelism.
Implement a multithreading approach in Python using the threading library. Run the web socket connection in a separate thread while the master thread continues, updating variables in real time.
Calculate intraday KPIs for a trading strategy by counting completed trades, measuring win ratio, and computing mean return per winning trade and per losing trade from live data.
Develop KPI calculations for live testing a market microstructure or order book based strategy, computing total winners, total trades, win rate, and mean returns per winning and losing trades.
Backtest trading strategies using Interactive Brokers historical data to mimic real trading conditions, factoring in slippage, costs, and conservative entries before deployment.
Explore intraday kpis for backtesting, including absolute return, win rate, and mean return per trade, plus mean returns for winning and losing trades and maximum consecutive loss.
Explore open range breakout as an intraday strategy using the opening candle. Confirm breakouts with volume spike and place bracket orders with 5% take profit and one trade per trigger.
Define the universe of stocks and backtesting duration for open range breakout (ORB). Extract daily data, intraday data for top gap stocks to simulate trades with slippage and KPI.
Implement backtesting for the open range breakout strategy using historical daily data, compute gap and rolling volume, and identify top gap stocks within June 2021 to Oct 2022 window.
Identify top gap stocks by date using intraday data, filter gaps beyond 1.5%, and build a top gap by date dictionary to backtest the RB strategy.
Develop a backtesting framework for orb strategy using Angel One's Smartapi, processing daily and five-minute intraday data, applying slippage, take profit and stop loss rules, and computing date-wise, ticker-level returns.
Converts a nested return dictionary into a transposed data frame, then computes absolute return, win rate, mean winning/losing trade returns, and the equity curve for orb backtesting.
Deploy the open range breakout backtest to live trading by adapting to intraday five-minute data, implementing position sizing and order management, and maintaining a high-low price track on chosen tickers.
Identify top gap up and gap down stocks using filtered intraday tickers, narrowing to a daily set for the orb strategy and preparing for its deployment.
Implement the ORB strategy by filtering tickers, obtaining high and low prices, and checking existing positions and open orders before placing market orders, run every five minutes until 2:30 pm.
execute the orb strategy in live trading, identify gaps, track candle highs and lows for Hindalco, Kotak Bank, and HDFC, with no trades due to lukewarm market and low volume.
Deploy your trading algorithms in the cloud to achieve faster and more reliable operation. Cloud offers scalability and pay-as-you-go pricing on AWS and other platforms.
Launch and configure an AWS EC2 instance, choose an operating system, enable free-tier options, attach storage, and secure access by restricting SSH in the security group to your IP.
Connect to an EC2 Linux instance via browser based SSH or local terminal, adjust security group rules, secure the pem file, and use Windows Subsystem for Linux with Ubuntu.
Connect to the EC2 instance via ssh using an identity file and the ec2-user, then install Python 3 and pip to prepare the environment.
Transfer your script folder to an EC2 instance using scp with an identification key and recursive transfer. Edit and run scripts with vim and python, planning automation with crontab.
Learn to schedule and automate python scripts on linux using crontab, including writing auto scripts, ensuring executable permissions, and configuring cron jobs for EC2 instances.
Identify running processes and monitor crontab jobs using ps and grep, then kill undesired processes by pid, and use screen to maintain a visual interface for Python scripts.
Manage long-running python tasks scheduled with crontab using the screen command to run in detached mode, monitor with ps/grep, and reattach or kill processes.
Terminate unused EC2 instances to stop charges, and learn the difference between stop and terminate, including data loss and decommissioning of cloud machines for script hosting.
Learn to extract and filter option chains programmatically by underlying, expiry, strike, and option type such as call or put, with Bank Nifty examples, using Zerodha or Angel One APIs.
Angel One is a leading stock broker in India providing free API access. I have created this course based on feedback from my existing students who were not happy about the monthly API charges levied by Zerodha. Angel One's SmartAPI provides the same set of functionality provided by any other brokers through their RESTful APIs and by the end of this course you will be highly conversant with this API and should be able to design and deploy your fully automated strategies on Angel One's platform.
####################################################################################################################################################################################
Design and deploy trading strategies on Angel One's SMARTAPI platform. Automate every step of your strategy including authentication, extracting data, performing technical analysis, generating signals, risk management etc. Gain a thorough understanding of Restful APIs and smartapi python wrapper. Learn how to deploy your strategies on cloud.
You can expect to gain the following skills from this course
API trading
Harnessing streaming tick level data
Incorporating technical indicators using python
backtesting and live testing your strategy
End to End strategy design and deployment
AWS EC2
Sqlite database management
Course Prerequisites
Basic Python proficiency (Should be familiar with python data types, data structures, loops, functions etc...basic stuff)
Access to Angel One's demat/trading account
High school level mathematical proficiency
Familiarity with trading/investing in the Indian market.