Area Chart

Crypto Portfolio Tracker

Real-time cryptocurrency portfolio value with volatility bands

Output
Crypto Portfolio Tracker
Python
import matplotlib.pyplot as plt
import numpy as np

np.random.seed(42)
hours = np.arange(0, 168)  # 1 week
btc_price = 45000 * np.cumprod(1 + np.random.normal(0.001, 0.02, len(hours)))
volatility = btc_price * 0.05

fig, ax = plt.subplots(figsize=(10, 6), facecolor='#0a0a0f')
ax.set_facecolor('#0a0a0f')

ax.fill_between(hours, btc_price - volatility, btc_price + volatility, alpha=0.3, color='#F5B027')
ax.plot(hours, btc_price, color='#F5B027', linewidth=2)

# 24h markers
for day in range(7):
    ax.axvline(day * 24, color='#333333', linewidth=0.5, linestyle=':')

change = ((btc_price[-1] - btc_price[0]) / btc_price[0]) * 100
color = '#6CF527' if change > 0 else '#F5276C'
ax.text(0.02, 0.95, f'${btc_price[-1]:,.0f}', transform=ax.transAxes, color='white', fontsize=18, fontweight='bold', va='top')
ax.text(0.02, 0.82, f'{change:+.2f}% (7d)', transform=ax.transAxes, color=color, fontsize=12, va='top')

ax.set_xlabel('Hours', color='white', fontsize=11)
ax.set_ylabel('Portfolio Value ($)', color='white', fontsize=11)
ax.set_title('Bitcoin Portfolio - 7 Day Performance', color='white', fontsize=14, fontweight='bold', pad=15)
ax.tick_params(colors='#888888', labelsize=9)
for spine in ax.spines.values():
    spine.set_color('#333333')
ax.set_xlim(0, 167)

plt.tight_layout()
plt.show()
Library

Matplotlib

Category

Basic Charts

Did this help you?

Support PyLucid to keep it free & growing

Support