{
  "slug": "log-return-calculator",
  "name": "gizza-ai/log-return-calculator",
  "version": "0.1.0",
  "title": "Log Return Calculator — Continuously Compounded Returns — gizza.ai",
  "description": "Paste a price series and get continuously compounded log returns per period, cumulative and total log return, volatility, and annualized figures as text, CSV or JSON.",
  "tags": [
    "log return",
    "continuously compounded return",
    "logarithmic return",
    "cc return",
    "volatility",
    "annualized return",
    "cagr",
    "price series"
  ],
  "category": "math",
  "urls": {
    "page": "https://gizza.ai/tools/log-return-calculator/",
    "markdown": "https://gizza.ai/tools/log-return-calculator/index.md",
    "descriptor": "https://gizza.ai/tools/log-return-calculator/tool.json",
    "deep_link_example": "https://gizza.ai/tools/log-return-calculator/?prices=2024-01-02%2C187.15%0A2024-01-03%2C184.25%0A2024-01-04%2C181.91&has_header=true&periods_per_year=252&unit=percent&decimals=4&output=summary"
  },
  "cli": "gizza tool log-return-calculator \"2024-01-02,187.15\n2024-01-03,184.25\n2024-01-04,181.91\"",
  "tool": {
    "description": "Convert a series of PRICES or levels — closes, index levels, NAVs, exchange rates — into continuously-compounded log returns, ln(p_t / p_{t-1}). Paste one price per line (optionally as 'label,price' like '2024-01-02,187.15'), or a single comma-separated line; currency symbols and thousands separators are accepted and every price must be positive. Returns the per-period log return, the simple return of the same step and a running cumulative log return, plus the total log return (which equals the sum of the periods because log returns are time-additive), the equivalent simple return, the mean log return, the per-period and annualized volatility, the annualized log and simple rates, best and worst periods, and how many periods were positive. Set periods_per_year (252 trading days, 365 calendar, 52 weekly, 26 biweekly, 12 monthly, 4 quarterly, 1 annual) to annualize, unit=percent or decimal, decimals 0-10, and output=summary, table, csv or json. Runs locally. Educational only, not financial advice.",
    "parameters": {
      "additionalProperties": false,
      "properties": {
        "decimals": {
          "default": 4,
          "description": "Decimal places for every return in the output, 0 to 10. Default 4.",
          "maximum": 10,
          "minimum": 0,
          "type": "integer"
        },
        "has_header": {
          "default": false,
          "description": "Skip the first line before parsing, for when the pasted column starts with a header like 'date,close'. Default false.",
          "type": "boolean"
        },
        "output": {
          "default": "summary",
          "description": "Output shape: summary (headline metrics plus the per-period table), table (just the table), csv (the table as CSV for a spreadsheet), or json (every computed field). Default summary.",
          "enum": [
            "summary",
            "table",
            "csv",
            "json"
          ],
          "type": "string"
        },
        "periods_per_year": {
          "default": "252",
          "description": "How many prices make up a year, used to annualize the mean return and the volatility: 252 trading days, 365 calendar days, 52 weekly, 26 biweekly, 12 monthly, 4 quarterly, 1 annual. Default 252.",
          "enum": [
            "252",
            "365",
            "52",
            "26",
            "12",
            "4",
            "1"
          ],
          "type": "string"
        },
        "prices": {
          "description": "The price or level series (levels, not returns): one price per line, or a single line of prices separated by commas. Each line may also be 'label,price' (e.g. '2024-01-02,187.15') to name the rows. Currency symbols and thousands separators are accepted. Every price must be greater than 0 because a log return is ln(price ÷ previous price). Needs at least 2 prices, maximum 2000.",
          "type": "string"
        },
        "unit": {
          "default": "percent",
          "description": "How each return is written: percent shows +1.1778%, decimal shows the raw natural-log value +0.011778. Default percent.",
          "enum": [
            "percent",
            "decimal"
          ],
          "type": "string"
        }
      },
      "required": [
        "prices"
      ],
      "type": "object"
    }
  }
}