> ## Documentation Index
> Fetch the complete documentation index at: https://docs.quantspace.limex.pro/llms.txt
> Use this file to discover all available pages before exploring further.

# run_plot_job

> Render interactive HTML charts from pipeline JSON

## Overview

`run_plot_job` renders an HTML chart via SingleBlockGraphsMCP. Pick a `block_name` (family) and a `tool_name` (specific chart), plus `params`.

Ask in chat (“equity curve for my last PO”, “AAPL close prices”) — skills fill `block_name` / `tool_name` for you.

***

## Chart catalog

### Prices (`prices_graphs`)

Input: `data_extractor_*.json`

| `tool_name`                      | What you get                                                                        |
| -------------------------------- | ----------------------------------------------------------------------------------- |
| `plot_ohlcv_section_for_ticker`  | One ticker — OHLCV field over time (`params.ticker`, `params.section` e.g. `close`) |
| `plot_ohlcv_section_for_tickers` | Same OHLCV field for **all** tickers on one chart                                   |

### Features (`feature_graphs`)

Input: `feature_engine_*.json`

| `tool_name`                       | What you get                                             |
| --------------------------------- | -------------------------------------------------------- |
| `plot_feature_for_ticker`         | Single indicator series for one ticker                   |
| `plot_features_for_ticker`        | Several features for one ticker (overlay / multi-series) |
| `plot_feature_correlation_matrix` | Correlation heatmap across selected features             |

### ML predictions (`ml_visualization`)

Input: `ml_engine_*.json` (or compatible DL artifact with the same prediction fields)

| `tool_name`                            | What you get                                 |
| -------------------------------------- | -------------------------------------------- |
| `plot_pred_returns_for_ticker`         | Model-predicted returns for one ticker       |
| `plot_test_returns_for_ticker`         | Realized test returns for one ticker         |
| `plot_compare_pred_vs_real_for_ticker` | Predicted vs actual returns on the same plot |

### Portfolio P\&L (`profit_and_loss_graphs`)

Input: `portfolio_optimization_*.json`, or `data_extractor_*.json` with optional `params.portfolio_weights` (else equal 1/N)

| `tool_name`                 | What you get                                                      |
| --------------------------- | ----------------------------------------------------------------- |
| `plot_equity_curve`         | Portfolio equity / cumulative P\&L over time (optional benchmark) |
| `plot_asset_position_curve` | Per-asset position / exposure curves                              |

### Weights (`weights_graphs`)

| `tool_name`            | What you get           |
| ---------------------- | ---------------------- |
| `plot_weight_dynamics` | Weight paths over time |

<Note>
  For portfolio weights from a standard PO blob, prefer [`run_risk_job`](/tools/risk-job) with `function: "dynamic_weights"`. `plot_weight_dynamics` expects a wrapped `weights.dates` / `weights.values` shape, not raw PO `Weights` alone.
</Note>

***

## Parameters

<ParamField body="input_url" type="string" required>
  Blob URL for the stage that matches the chart family (see table above).
</ParamField>

<ParamField body="config" type="object" required>
  <Expandable title="config fields">
    <ParamField body="block_name" type="string" required>
      One of: `prices_graphs`, `weights_graphs`, `feature_graphs`, `ml_visualization`, `profit_and_loss_graphs`.
    </ParamField>

    <ParamField body="tool_name" type="string" required>
      Chart id from the catalog above.
    </ParamField>

    <ParamField body="params" type="object">
      Chart options (`ticker`, `section`, `feature_names`, `portfolio_weights`, `add_benchmark`, `benchmark_ticker`, …).
    </ParamField>
  </Expandable>
</ParamField>

***

## Example

```json theme={null}
{
  "input_url": "https://stqsnpprod.blob.core.windows.net/data/data_extractor_2b510101b9b7.json",
  "config": {
    "block_name": "prices_graphs",
    "tool_name": "plot_ohlcv_section_for_ticker",
    "params": {
      "ticker": "AAPL",
      "section": "close"
    }
  }
}
```

***

## Returns

```json theme={null}
{
  "status": "Succeeded",
  "output_url": "https://stqsnpprod.blob.core.windows.net/data/plot_c4d5e6f78901.html",
  "output_name": "plot_c4d5e6f78901.html",
  "execution_name": "job-plot-worker-abc123xyz"
}
```

***

## Resources

| Resource           | Value                 |
| ------------------ | --------------------- |
| Container Apps Job | `job-plot-worker`     |
| Env vars injected  | `INPUT_URL`, `CONFIG` |
| Output blob prefix | `plot_`               |
