Project 2
TrendEdge App

Make faster trading decisions with simple, transparent research.
Backtest moving‑average strategies on any ticker, visualize price action, and export results in one mobile‑friendly dashboard.

Project Overview
What you can do

Run instant backtests
on any symbol (e.g., SPY, AAPL) using fast/slow moving averages.
Compare vs. buy‑and‑hold with equity curves and key metrics: CAGR, Sharpe, max drawdown.
See the setup with price + MA overlays and an interactive candlestick chart.
Inspect signals (1 = long, 0 = flat) and the most recent crossovers.
Explore a prototype ML model that estimates next‑day “up” probability from MA features.
Download results as CSV for further analysis.
Created in collaboration
More updates soon.

Notes: next-day execution (no look-ahead), and no fees/slippage/taxes. Educational use only.
Visualize & Export
Review Price & Moving Averages, Equity Curves, Candlesticks, and a Signals preview table.
Download a CSV with equity and signal data for your own analysis.

Under the Hood
Data source: Yahoo Finance (via yfinance), cached for fast loads.
Strategy: Moving-average crossover signals with next-day execution; the backtest simulates equity over time.
Metrics: Headline stats include CAGR, Sharpe, and Max Drawdown.
Charts: Interactive Plotly line and candlestick charts in a sleek dark theme.

HOW IT WORKS

Parameter set section
Brand Designer
2025
Pick your inputs:

Enter a ticker (e.g., SPY), choose Fast MA and Slow MA, optionally set a start/end date.

Click “Run backtest.”

We fetch market data
Prices come from Yahoo Finance (via yfinance in python).
We use OHLC / Adjusted Close when available, with caching for fast loads and sensible fallbacks.

Inputs & validation
Ticker: any Yahoo Finance symbol (e.g., SPY, AAPL, BTC-USD).
Fast MA / Slow MA: positive integers; Fast must be < Slow. (Very large windows are flagged.)
Date range: optional—leave blank for full history.
Robustness: handles missing columns, NaNs, and multi-symbol (MultiIndex) data safely.

Overview
See headline metrics, a price chart with your fast/slow moving averages, strategy vs. buy-and-hold equity curves, an interactive candlestick view, and a one-click CSV download of results.
Strategy tab
Table with Price, MA(fast), MA(slow), and the binary Signal (1 = long, 0 = flat) for the latest ~200 points—perfect for auditing MA crossovers and understanding entries/exits.
Research (ML) tab
A simple logistic-regression demo uses MA features and recent return to forecast P(up next day), shows hold-out accuracy from a basic train/test split, and plots the probability line (0–1).
Data tab
Raw series view: Quick view of the last 1,000 price points used in your run so you can verify symbols, dates, and data quality.
Data tab
Settings tab
Theme controls: Uses Streamlit dark theme with custom palette. You can tweak theme in the app menu or via config.toml.
Backtest & Metrics
We simulate a moving-average crossover strategy with next-day execution and compare it to a Buy-&-Hold baseline.
Your run produces four headline metrics:
CAGR (Strategy): annualized growth of the strategy’s equity. Higher is better.
CAGR (Buy & Hold): annualized growth if you simply stayed invested. Benchmark for comparison.
Sharpe: return per unit of volatility (risk-adjusted). Higher is better.
Max Drawdown: worst peak-to-trough drop in the equity curve. Closer to 0% is better.
Price & Moving Averages: Line chart showing price with your fast/slow MA windows.
Equity Curves:
Strategy vs. Buy‑&‑Hold, so you can see relative performance over time.
Candlestick chart:
Interactive OHLC view to inspect recent price action.
Note: purely educational—meant to inspire further research.
Downloads:
One‑click CSV export of the full backtest (equities + signals).

Want to get in touch?
Drop me a line!

I’d love to hear from you — whether it’s about a project, an opportunity, or just to connect.

NAME
EMAIL ADDRESS
FORM LABEL
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.