CodeForFinance

Learn

Step-by-step tutorials with real, runnable code. Each tutorial includes prerequisites, code examples, expected output, and next steps.

Python

Build a Stock Screener in Python

Filter stocks by P/E ratio, market cap, dividend yield and more using Python and free API data.

Python

Build a Portfolio Tracker in Python

Track your investment portfolio with real-time prices, P&L calculations, and allocation charts.

Python

Moving Average Crossover Strategy in Python

Implement SMA and EMA crossover signals with backtesting to evaluate a classic trading strategy.

Python

Calculate RSI (Relative Strength Index) in Python

Build the RSI indicator from scratch, identify overbought and oversold levels, and generate trading signals.

Python

Bollinger Bands Strategy in Python

Implement Bollinger Bands to identify volatility squeezes and mean-reversion opportunities.

Python

Monte Carlo Simulation for Portfolio Risk

Run thousands of simulated portfolio paths to estimate VaR, expected returns, and worst-case scenarios.

Python

Black-Scholes Options Pricing in Python

Implement the Black-Scholes model to price European call and put options and calculate the Greeks.

Python

Web Scraping Stock Data with Python

Scrape financial data from websites using BeautifulSoup and requests, with rate limiting and error handling.

Python

Build a Cryptocurrency Price Tracker in Python

Track real-time crypto prices, calculate portfolio value, and set up price alerts using the CoinGecko API.

Python

Dividend Income Calculator and DRIP Simulator

Calculate dividend income, model DRIP (dividend reinvestment), and project long-term compounding returns.

Excel

Build a Financial Model in Excel (with Python Automation)

Create a three-statement financial model in Excel, then automate data population with Python and openpyxl.

Excel

DCF Valuation Model in Excel with Python

Build a Discounted Cash Flow model to value a company, with Python automation for sensitivity analysis.

Excel

Automated Budget Tracker with Python and Excel

Build an automated personal budget tracker that categorises transactions and generates monthly reports in Excel.

SQL

Design a Trading Database with SQL

Build a relational database schema for storing trades, positions, and P&L with SQL queries for analysis.

Python

Fetching Market Data from Financial APIs

Connect to Alpha Vantage, Yahoo Finance, and CoinGecko APIs to build a unified market data pipeline.

Recommended Books

As an Amazon Associate we may earn from qualifying purchases.

Developer Essentials

As an Amazon Associate we may earn from qualifying purchases.