Skip to content

Quick Start

This guide walks through three core operations: downloading ISO market data, computing trading metrics, and launching the interactive dashboard.

Prerequisites

Make sure you have completed the Installation and Configuration steps before proceeding.

Step 1 -- Download ISO Data

Download raw day-ahead LMP data from MISO for a date range:

from progridpy.iso import MISO, MISORawDataType

miso = MISO()
miso.download_raw_data(
    start_date="2024-01-01",
    end_date="2024-01-31",
    data_types=[MISORawDataType.DAY_AHEAD_EXANTE_PRICE],
)

The same pattern applies to every supported ISO:

from progridpy.iso import SPP, SPPRawDataType

spp = SPP()
spp.download_raw_data(
    start_date="2024-01-01",
    end_date="2024-01-31",
    data_types=[SPPRawDataType.DA_LMP],
)
from progridpy.iso import ERCOT, ERCOTRawDataType

ercot = ERCOT()
ercot.download_raw_data(
    start_date="2024-01-01",
    end_date="2024-01-31",
    data_types=[ERCOTRawDataType.SPP_DAY_AHEAD_HOURLY],
)

ERCOT credentials

ERCOT downloads require API credentials. See Configuration for the required environment variables.

Step 2 -- Compute Metrics

Given a DataFrame of trade results (trade_df), compute the full suite of risk, return, ratio, drawdown, and streak metrics:

from progridpy.metrics import MetricsEngine

engine = MetricsEngine(iso_name="MISO", df_iso=trade_df)
result = engine.compute()

print(f"Sharpe Ratio: {engine.sharpe_overall:.2f}")
print(f"Max Drawdown: ${engine.max_drawdown:,.2f}")
print(f"Win Rate:     {engine.win_rate_pct:.1f}%")

Export the computed metrics to CSV:

metrics_df = engine.metrics_df
metrics_df.to_csv("metrics_report.csv", index=False)

Step 3 -- Launch the Dashboard

Render an interactive Streamlit dashboard with KPI cards, performance charts, heatmaps, and distribution plots:

from progridpy.metrics import MetricsEngine, StreamlitDashboard

engine = MetricsEngine(iso_name="MISO", df_iso=trade_df)
dashboard = StreamlitDashboard(engine=engine)
dashboard.render()

Or export a standalone HTML report:

dashboard.export_html("trading_report.html")

The dashboard can also be launched from the command line via the helper scripts:

streamlit run scripts/miso/dashboard.py -- -t ./trades -p ./processed

Next Steps