Horizon Chart

Forex Market Volatility Horizon

Financial trading horizon chart showing EUR/USD volatility with gold/amber neon gradient.

Output
Forex Market Volatility Horizon
Python
import matplotlib.pyplot as plt
import numpy as np

COLORS = {
    'high': ['#4d3d00', '#806600', '#F5D327'],   # Yellow/gold
    'low': ['#001a4d', '#003399', '#276CF5'],    # Blue
    'background': '#0a0a0f',
    'text': '#ffffff',
}

np.random.seed(2020)
hours = np.arange(0, 120)  # 5 trading days (24h markets)
# Volatility: higher during session overlaps
london = 15 * np.exp(-((hours % 24 - 8)**2) / 10)
newyork = 20 * np.exp(-((hours % 24 - 14)**2) / 8)
volatility = london + newyork + np.random.exponential(3, len(hours))
volatility_centered = volatility - np.mean(volatility)

fig, ax = plt.subplots(figsize=(14, 3), facecolor=COLORS['background'])
ax.set_facecolor(COLORS['background'])

band = 8

# High volatility
ax.fill_between(hours, 0, np.clip(volatility_centered, 0, band), color=COLORS['high'][0])
ax.fill_between(hours, 0, np.clip(volatility_centered - band, 0, band), color=COLORS['high'][1])
ax.fill_between(hours, 0, np.clip(volatility_centered - 2*band, 0, band), color=COLORS['high'][2])

# Low volatility
ax.fill_between(hours, 0, np.clip(volatility_centered, -band, 0), color=COLORS['low'][0])
ax.fill_between(hours, 0, np.clip(volatility_centered + band, -band, 0), color=COLORS['low'][1])
ax.fill_between(hours, 0, np.clip(volatility_centered + 2*band, -band, 0), color=COLORS['low'][2])

ax.axhline(0, color='#555555', linewidth=0.5)
ax.set_xlim(0, 119)
ax.set_ylim(-10, 10)

ax.set_title('EUR/USD Volatility Index', color=COLORS['text'], fontsize=12, fontweight='bold', pad=10)
ax.set_xlabel('Day', color=COLORS['text'], fontsize=10)
ax.set_ylabel('Volatility', color=COLORS['text'], fontsize=10)
ax.set_xticks([0, 24, 48, 72, 96, 120])
ax.set_xticklabels(['Mon', 'Tue', 'Wed', 'Thu', 'Fri', ''])

for spine in ax.spines.values():
    spine.set_visible(False)
ax.tick_params(colors=COLORS['text'], labelsize=9)

plt.tight_layout()
plt.show()
Library

Matplotlib

Category

Time Series

Did this help you?

Support PyLucid to keep it free & growing

Support