Area Chart

Trading Volume Profile

Intraday trading volume with VWAP overlay

Output
Trading Volume Profile
Python
import matplotlib.pyplot as plt
import numpy as np

np.random.seed(42)
minutes = np.arange(0, 390)  # 6.5 hours of trading

# Volume pattern: high at open/close
volume = 50000 * (np.exp(-((minutes - 30)**2)/1000) + 
                  np.exp(-((minutes - 360)**2)/1000) + 0.3)
volume += np.random.normal(0, 5000, len(minutes))
volume = np.clip(volume, 0, None)

# Price for VWAP
price = 150 + np.cumsum(np.random.normal(0, 0.1, len(minutes)))
vwap = np.cumsum(price * volume) / np.cumsum(volume)

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

# Volume bars as area
ax1.fill_between(minutes, 0, volume, alpha=0.6, color='#4927F5')
ax1.set_ylabel('Volume', color='#4927F5', fontsize=11)
ax1.tick_params(axis='y', colors='#4927F5', labelsize=9)
ax1.tick_params(axis='x', colors='#888888', labelsize=9)

# VWAP line on secondary axis
ax2 = ax1.twinx()
ax2.plot(minutes, vwap, color='#F5B027', linewidth=2, label='VWAP')
ax2.plot(minutes, price, color='#27D3F5', linewidth=1, alpha=0.7, label='Price')
ax2.set_ylabel('Price ($)', color='#F5B027', fontsize=11)
ax2.tick_params(axis='y', colors='#F5B027', labelsize=9)

ax1.set_xlabel('Minutes from Open', color='white', fontsize=11)
ax1.set_title('Intraday Volume Profile & VWAP', color='white', fontsize=14, fontweight='bold', pad=15)
for spine in ax1.spines.values():
    spine.set_color('#333333')
for spine in ax2.spines.values():
    spine.set_color('#333333')
ax1.set_xlim(0, 389)

ax2.legend(facecolor='#0a0a0f', edgecolor='#333333', labelcolor='white', loc='upper right')

plt.tight_layout()
plt.show()
Library

Matplotlib

Category

Basic Charts

Did this help you?

Support PyLucid to keep it free & growing

Support