ClickAPIs
Docs · Entry & exit plan

Docs / Endpoints

Entry & exit plan

POST/v1/entry-exitunits: 3intraday

ATR, chandelier and swing stops, R-multiple and level targets, reward/risk, position size for your account and risk, and how often the stop or the 2R target was hit first in the past.

Add "async": true to run it as a job, and "webhook_url" to be called when it finishes (Jobs & async). Calls estimated above 1,000 units run as jobs automatically. Supports interval for intraday bars at 5× the units (Intraday).

Parameters

FieldTypeDefaultDescription
symbolrequiredstring—Ticker symbol, e.g. AAPL, SPY, BTC-USD.
side"long" | "short""long"Trade direction.
entry_pricenumber—Planned entry. Default: the last close.
stop_method"atr" | "chandelier" | "swing""atr"Stop used for targets and sizing: atr (entry -/+ atr_mult x ATR), chandelier (extreme of chandelier_bars -/+ chandelier_mult x ATR) or swing (nearest swing low/high).
atr_periodinteger14ATR period in bars.
atr_multnumber2.0ATR multiple for the atr stop.
chandelier_barsinteger22Lookback for the chandelier stop's highest high / lowest low.
chandelier_multnumber3.0ATR multiple for the chandelier stop.
risk_per_tradenumber0.01Share of the account risked if the stop is hit (0.01 = 1%).
account_sizenumber—Account value, for the position size.
targets_rarray of number[1.0, 2.0, 3.0]Profit targets as multiples of the risk (R).
sim_target_rnumber2.0Target (in R) for the historical stop-vs-target test.
max_barsinteger60Bars a simulated trade may last before it counts as neither.
sim_yearsinteger10Years of history for the simulation (daily).
intervalstring"1day""1day" | "1hour" | "30min" | "15min" | "5min" | "1min". Intraday costs 5× the units; see Intraday.

Example request

Where should a MSFT long put its stop and targets? Read the walkthrough →

Request POST /v1/entry-exit
{
  "symbol": "MSFT",
  "account_size": 100000
}
The same call with curl, Python and JavaScript
curl https://clickapis.com/v1/entry-exit \
  -H "Authorization: Bearer $CLICKAPIS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"symbol":"MSFT","account_size":100000}'
import os, requests

r = requests.post(
    "https://clickapis.com/v1/entry-exit",
    headers={"Authorization": f"Bearer {os.environ['CLICKAPIS_KEY']}"},
    json={
      "symbol": "MSFT",
      "account_size": 100000
    },
    timeout=60,
)
print(r.json()["data"])
const r = await fetch("https://clickapis.com/v1/entry-exit", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.CLICKAPIS_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "symbol": "MSFT",
    "account_size": 100000
  }),
});
console.log((await r.json()).data);

Example response

Response 200 OK
{
  "ok": true,
  "data": {
    "symbol": "MSFT",
    "as_of": "2026-11-12",
    "side": "long",
    "entry": 521.89,
    "atr": 15.3264,
    "atr_pct": 0.029367,
    "stops": {
      "atr": {
        "price": 491.2372,
        "distance": 0.058734
      },
      "chandelier": {
        "price": 513.1707,
        "distance": 0.016707
      },
      "swing": {
        "price": 519.4374,
        "distance": 0.0047
      }
    },
    "stop_method": "atr",
    "stop": 491.2372,
    "risk_per_share": 30.6528,
    "risk_pct": 0.058734,
    "targets": [
      {
        "r_multiple": 1.0,
        "price": 552.5428,
        "move": 0.058734
      },
      {
        "r_multiple": 2.0,
        "price": 583.1957,
        "move": 0.117469
      },
      {
        "r_multiple": 3.0,
        "price": 613.8485,
        "move": 0.176203
      }
    ],
    "level_target": {
      "price": 540.97,
      "move": 0.036559,
      "reward_risk": 0.622,
      "kind": "resistance"
    },
    "nearest_resistance": 540.97,
    "nearest_support": 513.9694,
    "position_size": {
      "account_size": 100000.0,
      "risk_per_trade": 0.01,
      "cash_at_risk": 1000.0,
      "shares": 32,
      "notional": 16700.48,
      "notional_pct_of_account": 0.167
    },
    "historical": {
      "rule": "enter at every close, stop by method, target 2.0R, max 60 bars",
      "years": 10,
      "by_stop_method": [
        {
          "method": "atr",
          "trades": 2574,
          "target_first": 0.5117,
          "stop_first": 0.4507,
          "neither_within_max_bars": 0.0377,
          "median_bars_to_target": 20.0,
          "median_bars_to_stop": 7.0,
          "expectancy_r": 0.6124,
          "breakeven_win_rate": 0.3333
        },
        {
          "method": "chandelier",
          "trades": 2050,
          "target_first": 0.501,
          "stop_first": 0.4556,
          "neither_within_max_bars": 0.0434,
          "median_bars_to_target": 16.0,
          "median_bars_to_stop": 5.0,
          "expectancy_r": 0.5937,
          "breakeven_win_rate": 0.3333
        },
        {
          "method": "swing",
          "trades": 2391,
          "target_first": 0.4287,
          "stop_first": 0.4203,
          "neither_within_max_bars": 0.151,
          "median_bars_to_target": 16.0,
          "median_bars_to_stop": 4.0,
          "expectancy_r": 0.5499,
          "breakeven_win_rate": 0.3333
        }
      ]
    },
    "parameters": {
      "atr_period": 14,
      "atr_mult": 2.0,
      "chandelier_bars": 22,
      "chandelier_mult": 3.0
    },
    "notes": [
      "atr stop: entry -/+ atr_mult x ATR. chandelier: highest high (lowest low) of chandelier_bars -/+ chandelier_mult x ATR. swing: the nearest confirmed swing low (high) of the last 30 bars beyond the entry, padded by 0.1 ATR.",
      "Historical hit rates use the same stop rules at every past close; a bar that touches both stop and target counts as a stop (conservative)."
    ],
    "interval": "1day"
  },
  "meta": {
    "op": "entry-exit",
    "units": 3,
    "cost_usd": 0.0,
    "billing": "internal",
    "free_call": false,
    "free_calls_left": 0,
    "balance_usd": 5.0,
    "ms": 306,
    "interval": "1day",
    "data_as_of": "2026-11-12",
    "partial_last_bar": false
  }
}

Every response has the same envelope: ok, data and meta (op, units, cost_usd, ms, interval, billing, balance_usd, data_as_of, partial_last_bar). Numbers are decimals (0.05 = 5%), dates ISO, and a value that cannot be computed is null.