Bitcoin Returns and Volatility Analysis
Analyze Bitcoin historical returns, compute log returns, measure drawdowns, and detect volatility regimes.
What this AI workflow does
This AI Data Analyst workflow loads 4-hour Bitcoin historical price data from a CSV URL and plots the closing price time series. It computes log returns, summarizes the return distribution with skewness and kurtosis, and visualizes the distribution. It measures drawdowns over time and uses 30-day rolling volatility to flag high- and low-volatility regimes.
Who this example is for
This is for analysts and researchers who want a reproducible notebook workflow for basic crypto return and risk diagnostics. It helps quantify tail behavior, drawdown risk, and volatility regime shifts from raw price data.
Expected analysis outcomes
These are the results the AI workflow is expected to generate.
- BTC closing price line chart
- Log return distribution plot with skewness and kurtosis
- Maximum drawdown time series chart
- 30-day rolling volatility chart with high/low regime bands
Tools and libraries used
Main Python packages and tooling used to run this AI data analysis task.
- pandas
- numpy
- matplotlib
- seaborn
- scipy
Prompt sequence
This is the exact list of prompts used in this workflow. The same prompt sequence is sent to each model so outputs and scores can be compared fairly.
- 1load Bitcoin price data from https://raw.githubusercontent.com/pplonski/datasets-for-start/refs/heads/master/bitcoin-historical-data/btc_4h_data_2018_to_2025.csv and plot closing prices
- 2calculate log returns and plot distribution with kurtosis and skewness
- 3compute and plot maximum drawdown over time
- 4identify high and low volatility regimes using 30-day rolling volatility
Model Comparison
We compared several LLM models on the same analysis task. The table below shows their scores side by side. You can also open each model run to check the full conversation and notebook results.
| Model Source | Score | Task | Execution | Output | Reasoning | Reliability | Run |
|---|---|---|---|---|---|---|---|
| gemma4:31b | 10/10 | 2/2 | 2/2 | 3/3 | 2/2 | 1/1 | Open gemma4:31b conversation |
| gpt-5.4 | 10/10 | 2/2 | 2/2 | 3/3 | 2/2 | 1/1 | Open gpt-5.4 conversation |
| gpt-oss:120b | 10/10 | 2/2 | 2/2 | 3/3 | 2/2 | 1/1 | Open gpt-oss:120b conversation |
| qwen3-coder-next | 9/10 | 2/2 | 2/2 | 3/3 | 1/2 | 1/1 | Open qwen3-coder-next conversation |
| glm-5.1 | 6/10 | 2/2 | 1/2 | 2/3 | 1/2 | 0/1 | Open glm-5.1 conversation |
| qwen3.5:397b | 6/10 | 1/2 | 2/2 | 2/3 | 1/2 | 0/1 | Open qwen3.5:397b conversation |
How scoring works
Each run is graded on five dimensions:
- Task Completion (0-2): how fully the workflow answered the requested analysis task and completed required steps.
- Execution Correctness (0-2): whether generated code is correct, consistent, and likely runnable without major fixes.
- Output Quality (0-3): how well tables, charts, and results match the expected analytical outcomes.
- Reasoning Quality (0-2): clarity and correctness of interpretation, explanation, and conclusions.
- Reliability (0-1): robustness of the run, including low hallucination risk and stable behavior.
The final score is the sum of these dimensions, so total score = 0-10. Higher values indicate more complete, correct, and reliable notebook results for this workflow.
AI Analysis with qwen3-coder-next
This run uses AI with a step-by-step list of prompts to perform the analysis task Bitcoin Returns and Volatility Analysis. Below, you can review the full conversation generated with qwen3-coder-next. After the conversation, we show detailed score cards for this run.
Score cards for qwen3-coder-next for Bitcoin Returns and Volatility Analysis
Total score: 9/10
Task Completion: 2/2
ExcellentAll four requested analyses were attempted and completed: price plot, log-return distribution with skewness/kurtosis, drawdown plot, and 30-day volatility regime identification.
Execution Correctness: 2/2
ExcellentThe provided code is coherent and matches the outputs shown, including successful plots and printed summary statistics. No major runtime-breaking issues are evident in the final workflow.
Output Quality: 3/3
ExcellentOutputs match the expected outcomes semantically: BTC price chart, fat-tailed return distribution with kurtosis well above 3, drawdown visualization, and rolling volatility regime bands with summary statistics.
Reasoning Quality: 1/2
Needs workThe reasoning is mostly correct, but it includes some unnecessary or shaky commentary, such as overexplaining drawdown and initially noting an error before the corrected implementation. The core analytical logic is still sound.
Reliability: 1/1
ExcellentThe workflow is reasonably consistent and uses standard methods, though the volatility shading loop is inefficient and the narrative mentions a prior error, indicating some fragility.
Try MLJAR Studio
Run the same type of AI-powered data analysis on your own datasets with conversational notebooks in MLJAR Studio.
Explore More AI Analysis Examples
Discover additional workflows across categories. Each example includes prompts, conversation outputs, and model-level scoring so you can compare approaches and results.