Before you start
What this module changes in your trading process.
Explain OHLCV components and what timeframes and bars represent.
A strategy is only as good as its data. Learn price-data structure, timeframe resampling, and the quiet data traps that break backtests.
Module outline
Before you start
Explain OHLCV components and what timeframes and bars represent.
Lesson 1
Menjelaskan komponen OHLCV dan arti timeframe/bar.
Data harga umumnya disajikan sebagai bar/candle dengan lima nilai per periode — OHLCV : Kode Arti Open Harga pembukaan periode High Harga tertinggi periode Low Harga terendah periode Close Harga penutupan periode (paling sering dipakai untuk sinyal) Volume Jumlah transaksi pada periode Timeframe menentukan panjang tiap bar: 1 menit, 1 jam, 1 hari, dst.
Pemilihan timeframe memengaruhi karakter strategi, kebutuhan data, dan biaya (semakin sering trading, semakin tinggi biaya kumulatif). Tick vs bar Data paling granular adalah tick (tiap transaksi). Bar adalah agregasi tick dalam interval waktu. Sebagian besar strategi ritel bekerja pada bar; HFT bekerja pada tick & order book. Timezone & jam pasar Selalu sadari zona waktu data dan jam buka pasar.
Bar "harian" saham punya jam tutup; FX hampir 24 jam; crypto 24/7. Salah menafsirkan timestamp menghasilkan sinyal yang keliru.
Example
Practical example: OHLCV adalah representasi standar harga per periode; Close paling sering dipakai sinyal.
Key points
Practice checkpoint
Apply this lesson to one market you actually watch. Write the rule, the data needed, the risk check, and the condition that invalidates the idea.
Before continuing
Lesson 2
Melakukan resampling antar timeframe dengan benar.
Resampling mengubah data dari satu timeframe ke timeframe lain (mis. 1 menit → 1 jam). Aturannya: tiap kolom OHLCV diagregasi berbeda.
Example code: import pandas as pd # df berindeks waktu dengan kolom open/high/low/close/volume ohlc_dict = { "open": "first", "high": "max", "low": "min", "close": "last", "volume": "sum" } df_1h = df.resample("1H").agg(ohlc_dict).dropna() • Open = nilai pertama, Close = nilai terakhir. • High = maksimum, Low = minimum. • Volume = jumlah (sum).
Anda hanya bisa resample naik (ke timeframe lebih besar) dari data yang lebih granular. Anda tidak bisa "menebak" detail intra-bar dari bar yang lebih besar. Konsistensi sinyal Pastikan timeframe sinyal dan eksekusi konsisten. Mengambil sinyal dari bar harian tetapi mengeksekusi seolah punya data menit dapat menimbulkan asumsi yang tidak realistis.
Example
import pandas as pd # df berindeks waktu dengan kolom open/high/low/close/volume ohlc_dict = { "open": "first", "high": "max", "low": "min", "close": "last", "volume": "sum" } df_1h = df.resample("1H").agg(ohlc_dict).dropna()
Key points
Practice checkpoint
Apply this lesson to one market you actually watch. Write the rule, the data needed, the risk check, and the condition that invalidates the idea.
Before continuing
Lesson 3
Mengidentifikasi & menangani jebakan data: gap, missing, survivorship, corporate actions, outlier.
Data "mentah" hampir selalu kotor. Beberapa jebakan yang diam-diam membuat backtest terlihat hebat padahal salah: • Missing data & gap: bar yang hilang atau hari libur.
Tangani eksplisit — jangan asal forward-fill harga tanpa berpikir. • Survivorship bias: dataset yang hanya berisi aset yang "selamat" (mis. saham yang masih listing) melebih-lebihkan kinerja, karena yang bangkrut/delisting dihapus. • Corporate actions: stock split & dividen membuat harga "melompat". Pakai harga adjusted agar return tidak palsu. • Outlier & bad ticks: harga nol, lonjakan ekstrem akibat error data.
Saring sebelum dipakai. • Look-ahead via data revisi: data fundamental/ekonomi sering direvisi; pakai nilai yang tersedia saat itu (point-in-time), bukan revisi final.
Example
Practical example: Jebakan: missing/gap, survivorship bias, corporate actions, outlier, data revisi.
Key points
Practice checkpoint
Apply this lesson to one market you actually watch. Write the rule, the data needed, the risk check, and the condition that invalidates the idea.
Before continuing
Fieldwork
Build one worksheet for Market Data and Time Series: state the market, the rule, the data input, the risk limit, the validation check, and the review note before using it live.
Glossary
Checkpoint quiz
Quiz results can add XP when you are signed in.
Progress action
Marking complete saves the module, updates streak activity, and awards XP only once per module.
Previous module
Python is the de facto language for quantitative research. Build practical foundations with environments, NumPy, Pandas, and price data.
Next module
Connect the pieces from hypothesis to rules, signals, and positions through a simple moving-average crossover strategy.
Risk note: Metavulus learning content is for education and market preparation only. It is not financial advice, investment advice, or a trading recommendation.