Academy/Foundations/Price Data: OHLCV & Timeframes
FoundationsLesson 3

Price Data: OHLCV & Timeframes

Learn how price data is structured, what OHLCV means, why timeframes matter, and how to handle corporate actions.

9 minute read
4 key takeaways

Understanding Price Data

All algorithmic strategies start with price data. Understanding how price data is structured—and its limitations—is foundational.

What is OHLCV?

  • Open: The first trade price of the period
  • High: The highest price traded during the period
  • Low: The lowest price traded during the period
  • Close: The last trade price of the period (most important for technical analysis)
  • Volume: Total number of shares traded during the period

Each of these is a separate data point. Your algorithm will consume OHLCV bars and generate trading signals from them.

python
import pandas as pd

# Loading price data
df = pd.read_csv('AAPL_daily.csv', parse_dates=['Date'])
# df columns: Date, Open, High, Low, Close, Adjusted Close, Volume

print(df.head())
#            Date    Open    High     Low  Close  Adj Close    Volume
# 2024-01-01  191.00  195.50  190.75  194.45  194.23  5234000

Adjusted vs. Unadjusted Prices

Stocks undergo corporate actions: dividend payments and stock splits. If you don't adjust for these, your backtests will show massive false losses.

  • Stock split (2-for-1): One share becomes two. Unadjusted price would show a 50% "loss" that didn't actually happen.
  • Dividend ($1.00): Price drops by $1.00 on ex-dividend date. Unadjusted data shows a decline that should have been a total return.

Always Use Adjusted Close

When backtesting, always use the "Adjusted Close" price, not the raw close. Your data provider (like EODHD used by this platform) handles this automatically.

Timeframes: The Tradeoff

TimeframeUse CaseTypical StrategyProsCons
1-minuteScalpingBreakoutsMany signalsLots of noise, spread costs matter
5-15 minuteDay tradingMean reversionGood middle groundStill requires monitoring
1-hourSwing tradingTrend + momentumEnough data, less noiseOvernight gaps
DailySwing/PositionTrend followingClean signals, low costsFewer opportunities
Weekly/MonthlyPosition tradingLong-term trendsVery clean, low drawdownsSlow to respond

Lower timeframes = more signals but also more false signals (noise). Higher timeframes = cleaner signals but fewer opportunities.

Start with Daily

If you're new to algo trading, start with daily timeframes. Less noise, easier to understand, and you won't need to monitor positions 24/7.

Key Takeaways
  • OHLCV (Open, High, Low, Close, Volume) is the standard format for price data
  • The closing price is the most important price point for technical analysis
  • Different timeframes suit different strategies—always think about tradeoffs
  • Adjusted prices are critical: ignore dividends and splits at your peril