# Comparisons

> Overlay other instruments on the main chart.

Source: https://kcq.nebutra.com/docs/agent/tools/comparisons


<Callout>
  Generated from the pinned chart source (

  [`1aa5e22`](https://github.com/TsekaLuk/KLineChartQuant/blob/1aa5e22c61313a34d08878ad895e604e0d4a85e9/packages/core/src/foundation/agent/chartToolRegistry.ts)

  ). Descriptions are the exact text the model receives.
</Callout>

comparisons_list [#comparisons_list]

<ToolMeta label="List comparison symbols" safety="read-only" safetyLabel="Read-only" mode="Runs in parallel" origin="Chart core" source="https://github.com/TsekaLuk/KLineChartQuant/blob/1aa5e22c61313a34d08878ad895e604e0d4a85e9/packages/core/src/engine/data/comparisonCommands.ts#L148" sourceLabel="Source" />

List every comparison symbol currently overlaid on the chart. Each item exposes the stable identity, the complete symbol spec, and the assigned line color. Use identity with comparison\_remove.

**Parameters**

This tool takes no input.

<ToolSchema name="comparisons_list" label="JSON Schema" />

comparison_create [#comparison_create]

<ToolMeta label="Add comparison symbol" safety="destructive" safetyLabel="Modifies the chart" mode="Runs in order" origin="Chart core" source="https://github.com/TsekaLuk/KLineChartQuant/blob/1aa5e22c61313a34d08878ad895e604e0d4a85e9/packages/core/src/engine/data/comparisonCommands.ts#L169" sourceLabel="Source" />

Add one comparison symbol to the main chart. symbol is required and is resolved against the active market-data sources so the real exchange, id, and params are used; source, exchange, and assetClass restrict which instrument the code may resolve to; assetClass only accepts a known class, never unknown. primary is the chart main symbol; its source, period, and adjust only fill omitted fields and never override the resolved instrument. When several distinct instruments match, nothing is added and the result is \{ status: "ambiguous", candidates: \[...] }: ask the user to choose with the ask\_user tool, then retry with the chosen candidate's source and exchange (add assetClass only when its class is not unknown). Never pick a candidate yourself. Fails with an actionable reason only when the symbol cannot be resolved or is already compared; an unknown market is rejected.

**Parameters**

| Name                           | Type                | Required | Constraints                                                                                | Description |
| ------------------------------ | ------------------- | -------- | ------------------------------------------------------------------------------------------ | ----------- |
| <code>symbol</code>            | <code>string</code> | Yes      | min length <code>1</code>                                                                  |             |
| <code>market</code>            | <code>string</code> | —        | min length <code>1</code>                                                                  |             |
| <code>exchange</code>          | <code>string</code> | —        | min length <code>1</code>                                                                  |             |
| <code>source</code>            | <code>string</code> | —        | min length <code>1</code>                                                                  |             |
| <code>assetClass</code>        | <code>enum</code>   | —        | one of <code>"stock", "index", "fund", "etf", "future", "option", "forex", "crypto"</code> |             |
| <code>period</code>            | <code>string</code> | —        | min length <code>1</code>                                                                  |             |
| <code>adjust</code>            | <code>string</code> | —        | min length <code>1</code>                                                                  |             |
| <code>primary</code>           | <code>object</code> | —        | closed                                                                                     |             |
| <code>primary.symbol</code>    | <code>string</code> | —        | min length <code>1</code>                                                                  |             |
| <code>primary.market</code>    | <code>string</code> | —        | min length <code>1</code>                                                                  |             |
| <code>primary.exchange</code>  | <code>string</code> | —        | min length <code>1</code>                                                                  |             |
| <code>primary.source</code>    | <code>string</code> | —        | min length <code>1</code>                                                                  |             |
| <code>primary.period</code>    | <code>string</code> | —        | min length <code>1</code>                                                                  |             |
| <code>primary.adjust</code>    | <code>string</code> | —        | min length <code>1</code>                                                                  |             |
| <code>primary.startDate</code> | <code>string</code> | —        | min length <code>1</code>                                                                  |             |
| <code>primary.endDate</code>   | <code>string</code> | —        | min length <code>1</code>                                                                  |             |

**Minimal input** · Required fields only; placeholders are derived from the schema.

```json
{
  "symbol": "<symbol>"
}
```

<ToolSchema name="comparison_create" label="JSON Schema" />

comparison_remove [#comparison_remove]

<ToolMeta label="Remove comparison symbol" safety="destructive" safetyLabel="Modifies the chart" mode="Runs in order" origin="Chart core" source="https://github.com/TsekaLuk/KLineChartQuant/blob/1aa5e22c61313a34d08878ad895e604e0d4a85e9/packages/core/src/engine/data/comparisonCommands.ts#L219" sourceLabel="Source" />

Remove one comparison line by its identity from comparisons\_list; a matching symbol code also works. The primary symbol and chart mode remain unchanged.

**Parameters**

| Name                  | Type                | Required | Constraints               | Description |
| --------------------- | ------------------- | -------- | ------------------------- | ----------- |
| <code>identity</code> | <code>string</code> | Yes      | min length <code>1</code> |             |

**Minimal input** · Required fields only; placeholders are derived from the schema.

```json
{
  "identity": "<identity>"
}
```

<ToolSchema name="comparison_remove" label="JSON Schema" />

comparisons_clear [#comparisons_clear]

<ToolMeta label="Clear comparison symbols" safety="destructive" safetyLabel="Modifies the chart" mode="Runs in order" origin="Chart core" source="https://github.com/TsekaLuk/KLineChartQuant/blob/1aa5e22c61313a34d08878ad895e604e0d4a85e9/packages/core/src/engine/data/comparisonCommands.ts#L240" sourceLabel="Source" />

Remove every comparison line while keeping the primary symbol and chart mode unchanged. Returns the number of removed symbols.

**Parameters**

This tool takes no input.

<ToolSchema name="comparisons_clear" label="JSON Schema" />
