# Saylor Innovations Data Desk – Moving Average Calculator

> Saylor Innovations Data Desk – Moving Average Calculator is a paid API for AI agents from saylorinnovations.com, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-30).

Computes simple (SMA), exponential (EMA), or weighted (WMA) moving averages for a numeric series, returning the full average series, latest value, trend direction, and whether the current value is above or below the average.

## Facts

- Endpoint: GET https://saylorinnovations.com/api/stats/moving-average?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/saylor-innovations-data-desk-moving-average-calculator-adcb2a03
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_34Z6RgpOeEr6JK6bW7Ejr

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability saylor-innovations-data-desk-moving-average-calculator-adcb2a03
```

Example prompt: Calculate a 14-period exponential moving average for this price series: 100,102,98,105,110,108,112,115,111,109,114,118,120,117,122 — and tell me whether the latest value is above or below the average and which direction the trend is going.

## When to prefer this

Choose this endpoint when you need a lightweight, on-demand moving average computation over a numeric series without requiring a full data platform or financial data subscription. It is ideal for agents doing technical analysis, trend detection, or data smoothing on arbitrary numeric sequences — especially when you already have the data series in hand and just need the statistical transform. Prefer it over general-purpose code execution when you need a fast, reliable, pre-built computation with structured output including trend direction and above/below average signals.

## Known failure modes

- Fewer than 3 or more than 1000 values in the series returns an error
- Window length less than 2 or greater than 200 returns an error
- Window larger than series length causes invalid computation
- Non-numeric values in the comma-separated series cause a parse error
- Invalid type parameter (not sma, ema, or wma) returns an error
- Malformed query parameters return a 400-level error

## How this service works

Simple, exponential or weighted moving average of a numeric series for any window - full series, latest value, trend direction and price versus average

## Output

Returns a JSON object containing the moving average type used, the window length, the full computed average array, the latest moving average value, the previous moving average value (one step back), the most recent input value, a trend direction string (e.g. 'up', 'down'), a boolean indicating whether the latest value is above the moving average, and the count of values processed.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "values",
      "window"
     ],
     "properties": {
      "type": {
       "type": "string",
       "description": "optional sma (default), ema or wma"
      },
      "values": {
       "type": "string",
       "description": "Comma-separated series, 3-1000"
      },
      "window": {
       "type": "string",
       "description": "Window length, 2-200"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "json"
    },
    "example": {
     "type": "object",
     "required": [
      "type",
      "window",
      "average"
     ],
     "properties": {
      "type": {
       "type": "string",
       "description": "Type or kind"
      },
      "count": {
       "type": "number",
       "description": "Number of items returned"
      },
      "trend": {
       "type": [
        "string",
        "null"
       ],
       "description": "Direction of recent change"
      },
      "latest": {
       "type": "number",
       "description": "Most recent value or version"
      },
      "source": {
       "type": "string",
       "description": "Data source the values come from"
      },
      "window": {
       "type": "number",
       "description": "Window length used"
      },
      "average": {
       "type": "array",
       "description": "Average value"
      },
      "previous": {
       "type": [
        "number",
        "null"
       ],
       "description": "Moving average one step before the latest"
      },
      "latest_value": {
       "type": "number",
       "description": "Latest value"
      },
      "above_average": {
       "type": "boolean",
       "description": "Above average"
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/saylor-innovations-data-desk-moving-average-calculator-adcb2a03/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from saylorinnovations.com](https://www.zero.xyz/host/saylorinnovations.com/llms.txt)
