# Trade Expectancy Calculator

> Trade Expectancy Calculator is a paid API for AI agents from api.delx.ai, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Calculates expected profit or loss per trade given a list of PnL values, helping traders assess whether a system has a positive edge before scaling position size.

## Facts

- Endpoint: POST https://api.delx.ai/api/v1/x402/expectancy
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/trade-expectancy-calculator-9532c831
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_-oXcLjoXphjBZ46MUGsox

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 trade-expectancy-calculator-9532c831 -d '<json body>'
```

Example prompt: Can you calculate the trade expectancy for my system using these PnL values: [120, -45, 200, -60, 85, -30, 175, -90]? I want to know if I have a positive edge before I start trading bigger size.

## When to prefer this

Use this endpoint when you need a fast, deterministic, no-dependency calculation of trade expectancy from raw PnL data. Prefer this over general-purpose calculators when you want a pay-per-use model at $0.001 USDC with no API key setup, and when you need advisory-only output that is reproducible and auditable. Best suited for pre-scaling checks, backtest evaluation, and comparing multiple strategies by edge.

## Known failure modes

- Empty or missing PnL array returns an error or zero expectancy
- Non-numeric values in the PnL array may cause computation failure
- Single-element arrays may yield degenerate or misleading expectancy values
- All wins or all losses produces valid but extreme expectancy with no loss or win average respectively

## How this service works

Expectancy per trade from win rate, avg win, and avg loss. Call when deciding if a system has positive edge before scaling size. Returns expectancy per trade as deterministic JSON for $0.001 USDC via x402 on Base. First-party local math only—no RPC, live market feed, API keys, storage, or mediagen. Advisory only; the caller owns capital, risk, and production controls.

## Output

Returns a deterministic JSON object containing expectancy per trade computed from the provided PnL array, including derived metrics such as win rate, average win, and average loss. No external data sources are used — all math is performed locally.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "pnls": {
   "type": "array",
   "description": "Input field: pnls."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "n": 5,
  "schema": "delx/util-expectancy/v1",
  "expectancy": 2.6
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/trade-expectancy-calculator-9532c831/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.delx.ai](https://www.zero.xyz/host/api.delx.ai/llms.txt)
