Report

Price Scatterplot

The Price Scatterplot report.

A scatter plot of the price of one commodity in the report currency over time. Use it to see how a security or a foreign currency has moved. The commodity and the currency must differ, or it says Identical commodities. In GnuCash: Reports ▸ Assets & Liabilities ▸ Price Scatterplot.

The options that matter are Price/Price of Commodity, Price/Report's currency, Price/Price Source (actual transactions or the price database), Price/Invert prices and General/Start Date and End Date.

Examples

Example: with a copy of the reports/stock-test-data example book open as book.gnucash, at 2024-03-15T12:00:00Z.

JSON-RPC

Request:

{"jsonrpc":"2.0","id":1,"method":"report.run","params":{"report":"Price Scatterplot","options":{"General":{"Start Date":{"absolute":"1980-01-01"},"End Date":{"absolute":"1981-12-31"}},"Price":{"Price of Commodity":"NASDAQ::AAPL"}}}}

Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "title": "Price Scatterplot",
    "sections": [
      {
        "blocks": [
          {
            "kind": "chart",
            "type": "scatter",
            "title": [
              "Price Scatterplot",
              "AAPL - 01/01/80 to 12/31/81"
            ],
            "…": "…"
          },
          "…"
        ],
        "…": "…"
      },
      "…"
    ],
    "…": "…"
  }
}

Command line

red-ale exec --book book.gnucash report.run '{"report":"Price Scatterplot","options":{"General":{"Start Date":{"absolute":"1980-01-01"},"End Date":{"absolute":"1981-12-31"}},"Price":{"Price of Commodity":"NASDAQ::AAPL"}}}'

It prints:

{
  "title": "Price Scatterplot",
  "sections": [
    {
      "blocks": [
        {
          "kind": "chart",
          "type": "scatter",
          "title": [
            "Price Scatterplot",
            "AAPL - 01/01/80 to 12/31/81"
          ],
          "…": "…"
        },
        "…"
      ],
      "…": "…"
    },
    "…"
  ],
  "…": "…"
}

MCP tool call

Tool call:

{"name":"report.run","arguments":{"report":"Price Scatterplot","options":{"General":{"Start Date":{"absolute":"1980-01-01"},"End Date":{"absolute":"1981-12-31"}},"Price":{"Price of Commodity":"NASDAQ::AAPL"}}}}

Result:

{
  "structuredContent": {
    "title": "Price Scatterplot",
    "sections": [
      {
        "blocks": [
          {
            "kind": "chart",
            "type": "scatter",
            "title": [
              "Price Scatterplot",
              "AAPL - 01/01/80 to 12/31/81"
            ],
            "…": "…"
          },
          "…"
        ],
        "…": "…"
      },
      "…"
    ],
    "…": "…"
  }
}

Template GUID: 1d241609fd4644caad765c95be20ff4c · Script: standard/price-scatter.rhai

Options

Display

  • Marker Color (color, default "b22222"): Color of the marker.
  • Plot Width (plotSize, default {"percent":100}): Width of plot, 10 - 100 in percent, above in pixels.
  • Plot Height (plotSize, default {"percent":100}): Height of plot, 10 - 100 in percent, above in pixels.

General

  • Report name (string, default "Price Scatterplot"): Enter a descriptive name for this report.
  • Stylesheet (multichoice, default "Default"): Select a stylesheet for the report.
  • Add options summary (multichoice, default "never"): Add summary of options.
  • Start Date (date, default {"relative":"start-accounting-period"}): Start of reporting period.
  • End Date (date, default {"relative":"end-accounting-period"}): End of reporting period.
  • Step Size (multichoice, default "MonthDelta"): The amount of time between data points.

Price

  • Report's currency (currency, default "CURRENCY::USD"): Select the currency to display the values of this report in.
  • Price of Commodity (commodity, default "CURRENCY::USD"): Calculate the price of this commodity.
  • Price Source (multichoice, default "actual-transactions"): The source of price information.
  • Invert prices (boolean, default false): Plot commodity per currency rather than currency per commodity.