mcp-server

v0.78.0
@dwlf/mcp-server Checked 1 hour ago Published 19 hours ago

MCP server for DWLF market analysis platform — exposes market data, indicators, signals, strategies, backtests, portfolio, trade journal, and more as…

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

dwlf_get_market_data

Get OHLCV candle data (open, high, low, close, volume) for a trading symbol at a chosen timeframe. Reach for this when you need ACTUAL BARS — sweeps, ranges, exact intraday highs/lows, "did price touch $X on date D", the close on a specific bar. `dwlf_get_price_picture` / `dwlf_get_events` are something else: dated records of what happened (pivots, crosses, trend-line breaks), each with the price on its date; they describe structure, cycles and breaks, not candles. Timeframes: `daily`, `weekly`, `hourly` (hourly is available only for symbols that have 1h data). Gated to the owner account; ot…

ParameterTypeDescription
symbol *stringTrading symbol — accepts BTC, BTC/USD, BTC-USD, BTCUSD, or stock tickers like AAPL, TSLA
limitnumberNumber of most-recent candles to fetch (default: 50; the API caps it per timeframe)
timeframestringCandle timeframe (default: daily). Hourly is available only for symbols with 1h data.

dwlf_get_quote

Get the latest price (close + date) for one or more symbols. Lightweight and API-key-accessible — works for ANY tracked symbol, including off-watchlist ones the daily briefing does not cover. Gives ONLY the current level (no OHLCV, no history) — for bar data use dwlf_get_market_data (owner-account only) or dwlf_get_price_picture for a pivot narrative. Ideal for marking a trade/skip to current price or pricing an arbitrary symbol. Unknown symbols come back with found:false (not an error).

ParameterTypeDescription
symbolstringSingle-symbol shorthand. Use `symbols` for multiple.
symbolsarraySymbols to quote, e.g. ["CAT","BTC-USD"]. Accepts BTC / BTC-USD / BTC/USD / stock-ticker shapes. Max 50.

dwlf_list_symbols

List all available trading symbols with metadata. Use this to discover what symbols are available on DWLF.

dwlf_get_support_resistance

Get the current key levels (support and resistance) for a trading symbol, from daily candles, recomputed nightly. Each level is a zone (`zone.lower`/`zone.upper`, ATR-wide) built from confirmed cycle pivots (daily and weekly) and the previous week, month and year high/low and year open; round numbers only add confluence. `sources` lists what built it, `score`/`scoreParts` rank it (touches × reaction × recency × timeframe × confluence), `distanceAtr` is how far it sits from the close, and `id` is stable across nights. Up to 5 per side, nearest first. Interactions with these levels are daily…

ParameterTypeDescription
symbol *stringTrading symbol — accepts BTC, BTC/USD, BTC-USD, BTCUSD, or stock tickers like AAPL, TSLA

dwlf_get_events

Get indicator events (cycle lows/highs, crossovers, breakouts, divergences, etc.). Filter by a single `symbol` or a `symbols` watchlist, by `type` (e.g. `cycle.low.confirmed`), by `timeframe` (1d / 4h / 1h — without this the response is dominated by hourly noise), and by time window via `days` or explicit `fromDate` / `toDate`. 📑 PAGINATION: results are paged. When scoped by `customEventId` or `eventName`, this tool AUTO-FOLLOWS the cursor and gives the event’s COMPLETE history in one call (`filtersApplied.autoPaginated` / `pagesFetched` report what happened) — but you still need to p…

ParameterTypeDescription
customEventIdstringFilter to fires of a specific custom event by its event definition ID. Only honoured when `type` is `custom_event` (the tool defaults `type` to `custom_event` when you set this and leave `type` unset)…
daysnumberRestrict to events fired in the last N days (e.g. `5` for the last 5 days). ⚠️ DEFAULT IS 7 DAYS if omitted — anything older is silently hidden. For historical lookups (verifying old cycle pivot…
eventNamestringFilter custom event fires by their human-readable name (e.g. `wcl_confirmed`). Only honoured when `type` is `custom_event`. Useful when you know the name but not the ID.
fromDatestringInclusive lower bound on event date, ISO `YYYY-MM-DD`. Mutually useful with `toDate`.
limitnumberNumber of events to give (default: 20).
symbolstringFilter by a single trading symbol — accepts BTC, BTC/USD, BTC-USD, BTCUSD, or stock tickers
symbolsarrayFilter by multiple symbols at once. Each accepts the same shapes as `symbol`. Use this for watchlist queries (e.g. "what cycle lows fired across my watchlist today").
timeframestringFilter by candle timeframe. Set it — without it the API answers with mostly hourly events and daily-bar fires get truncated past the limit. Use `1w` to query weekly cycle events (e.g. for multi-time…
toDatestringInclusive upper bound on event date, ISO `YYYY-MM-DD`.
typestringFilter by one exact event type id, no wildcards (e.g. `cycle.low.confirmed`, `cycle.high.confirmed`, `onchain.sth_sopr.lose`, `custom_event`).
uniquePerSymbolbooleanIf true, give only the most recent event per symbol (useful for "latest fire" snapshots).

dwlf_get_price_picture

Aggregate the price-meaningful indicator events for a symbol into a chronological narrative — cycle pivots, swing points (HH/HL/LH/LL, breaks, sweeps), MA/EMA crosses, SMA 50/100/200 reclaims and losses (`sma.reclaimed` / `sma.lost`), trendline breaks and breaches, bollinger breaks, key level breaks / flips / reclaims. The levels themselves are not included (use dwlf_get_support_resistance), nor SMC, VWAP, fib or DSS events (use dwlf_get_events). Each row carries date + price (or level) + a human-readable label. Use this when you need structural price context for a symbol but do not have raw…

ParameterTypeDescription
symbol *stringTrading symbol — accepts BTC, BTC/USD, BTC-USD, BTCUSD, or stock tickers like AAPL, TSLA
daysnumberHow many days back to include (default: 90). Smaller = tighter narrative; larger = longer-term structural view.
limitnumberMax events to give (default: 50). Most useful narratives fit in 20-40 rows.
timeframestringTimeframe of events to include (default: 1d). 1d carries every type listed; 1w carries cycle pivots and trendline breaks; 1h carries cycle events only; 4h has no events today.

dwlf_get_cycle_setups

The Cycle Setup Screener: universe-wide cross-reference of the WEEKLY cycle timing window with DAILY cycle confirmation, both sides, ranked best-first. Stages: `confirmed_setup` (weekly window open AND daily pivot confirmed fresh <=15d — the multi-timeframe trigger has fired), `awaiting_confirmation` (daily pivot provisional, confidence % included), `window_open` (timing window open, no daily signal yet). Each row: weekly window position (early/mid/late + days-since-pivot), `weekly.timing`, daily pivot price/confidence/freshness, last close and % from pivot (the entry-freshness number — fr…

ParameterTypeDescription
depthbooleanAdd each row's weekly depth band and where the last close sits in it (`depth`, DWLF-416). Historical context, no targets.

dwlf_get_ranges

Range / support-resistance CONTEXT derived from cycle pivots — answers "where in a range are we?". Pass a `symbol` for that symbol's current daily + weekly ranges, or OMIT it to list every symbol currently in a range (optionally filtered by `timeframe` / `state`). Each range carries: bounds (floor/ceiling/touches/since); a `live` block — livePosition (0 = floor, 1 = ceiling) and liveState (near_floor | mid_range | near_ceiling | above | below), recomputed from the latest price = WHERE PRICE IS NOW; and a `snapshot` block — the weekly lifecycle narrative (state broke_out_up / broke_down /…

ParameterTypeDescription
statestringList mode only (no symbol): filter by LIVE position state. NB this is the live location, not the stored lifecycle state (broke_out_up etc.).
symbolstringA symbol to get that symbol's current ranges (daily + weekly). Accepts BTC, BTC/USD, BTC-USD, or stock tickers like AAPL. Omit to LIST every symbol currently in a range.
timeframestringList mode only (no symbol): restrict to one timeframe.

dwlf_get_setup_transitions

Cycle Setup Screener stage transitions in ONE call — the five `cycle.setup.*` event types merged and pre-grouped into `entered` / `downgraded` / `left`, newest first. Use this instead of five separate `dwlf_get_events` calls (that endpoint filters one `type` per request). 💡 This is the delta feed: what CHANGED stage, not what currently sits in the screener — for the current standing list use `dwlf_get_cycle_setups`. ⚠️ SEEDED ROWS ARE EXCLUDED BY DEFAULT. The first live run of the transitions job seeds the entire current state as `seeded: true` rows (≈34 of them on 27-Aug-2026); t…

ParameterTypeDescription
daysintegerLook-back window in days. Defaults to 7. The transitions job runs once daily, so `days: 1` may return nothing if today’s 04:12 run has not happened yet — prefer 2+ for "what changed recently".
includeSeededbooleanInclude first-run seed rows (`seeded: true`). Defaults to FALSE — they are current-state bookkeeping, not stage changes. Set true only to audit what the seed wrote.
maxRowsintegerMax rows returned PER bucket (default 200). `counts` are always complete — this caps only what is rendered, newest first, and reports `rowsOmitted`.
sidestringRestrict to one side. Omit for both.
symbolstringRestrict to one symbol — accepts BTC, BTC/USD, BTC-USD, BTCUSD, or stock tickers.

dwlf_get_cycle_windows

When is the window for this symbol's next cycle pivot low (or high)? Gives the STORED cycle timing window per side — the same edges the chart draws and the screener reads — for ONE symbol, whether or not the window is open yet. Use it for "when does X's next weekly-low window open?", "when is X's next DAILY low due?" and "how many weeks since X's last weekly low, against its usual gap?". Unlike `dwlf_get_cycle_setups`, which only lists symbols whose weekly window is already open (and adds `phase` / early-mid-late for them), this answers for any symbol but carries NO phase: to say whether a…

ParameterTypeDescription
symbol *stringTrading symbol — accepts BTC, BTC/USD, BTC-USD, BTCUSD, or tickers like PHAU, SPY
depthbooleanAdd each window's derived price zone (`depth`, DWLF-416): the typical move into this side's pivots, and as prices from the current cycle's anchor. Historical context, no targets.
generationintegerDetector generation to read. Omit — the API defaults to the one it stands behind (`generationSource` says which was used).
historyintegerHow many windows OLDER than `current` to include, newest first (0-20, default 0). Use ~10 to see past outcomes and judge how often this symbol's lows landed inside the window.
sidestringOmit for both sides. `low` = next cycle-low window (the entry timing); `high` = next top.
timeframestringCycle timeframe (default 1w). Weekly and daily windows are stored; hourly is not.

dwlf_get_divergences

Recent price/oscillator DIVERGENCES across every symbol DWLF tracks: dated events that happened, not calls. A divergence compares two consecutive confirmed cycle pivots: a `regular` one is price making a lower low (or a higher high) while RSI(14) or DSS does not; a `hidden` one is the reverse, a pullback inside the trend. Bullish = measured at lows, bearish = at highs. FILTERS: `days` (1-365, default 30) windows the later pivot's date; `oscillator` (rsi | dss), `kind` (regular | hidden), `direction` (bullish | bearish), `symbols` (restrict to these), `limit` (1-500; this tool sends 50 unless…

ParameterTypeDescription
confluencearrayLayers to check around each divergence.
confluenceDaysintegerThe confluence window in bars (weekly: weeks); default 10.
daysintegerWindow on the later pivot's date, in days (default 30).
directionstringBullish = measured at lows; bearish = at highs.
explainbooleanAdd `definitions` to a plain (version 1) read; version 2 always has them.
includeRetiredbooleanAlso include divergences on pivots the cycle ledger later superseded.
kindstring`regular` (against the move) or `hidden` (a pullback inside the trend).
limitintegerHow many items at most (default 50 here).
minLayersintegerKeep only items matching at least this many of the requested layers. Needs `confluence`.
oscillatorstringRSI(14) or DSS.
symbolsarrayRestrict to these symbols (any spelling, e.g. "BTC/USD", "aapl").
timeframestringDaily pivots (default), weekly, or both.

dwlf_get_stage

What stage of its market cycle is this symbol (or sector) in, on the WEEKLY chart? Gives the Weinstein stage — 1 base, 2 advance, 3 top, 4 decline — derived from the 30-week average, with `weeksInStage`, `since` (when the stage became knowable) and the recent transitions. Use it for "is X basing or advancing?", "how long has X been in Stage 2?" and, with `group` or several `symbols`, for sector breadth ("what share of metals are in Stage 2?"). This is the platform's market-cycle read: dwlf_get_regime carries no cycle phase. On a DWLF Block key the stage is the Cycles family: below the plan…

ParameterTypeDescription
groupstringA named group, e.g. metals, gold_miners, mag7, crypto_spot, btc_mining — stages plus breadth
symbolstringOne symbol — accepts BTC, BTC/USD, BTC-USD, BTCUSD, or tickers like PHAU, SPY
symbolsarraySeveral symbols: each one's stage plus breadth over them

dwlf_get_conditions

What are an asset's conditions right now? Bitcoin today (`asset: "btc"`). ONE call returning: the regime (daily and weekly trend, momentum, volatility; the Weinstein weekly stage; and the on-chain bands: MVRV below 1 / above 3.5, supply in profit below 50 %, 7-day STH-SOPR below 1); the COST-BASIS LADDER (price above or below the realised, short-term-holder and long-term-holder realised price, and since when); the stored weekly and daily cycle windows with today's `position` against their dates; every event on the symbol in the last `days` (price, cycle, CFTC positioning `cot.*`, on-chain `onc…

ParameterTypeDescription
assetstringThe asset (default btc; the only one today).
daysintegerRecent-events window in days (default 14).
symbolstringBTC/USD (default; the exchange price) or BTCOC/USD (DWLF's own on-chain BTC price). Any spelling: BTC, BTCUSD, BTC-USD, BTCOC, BTCOCUSD, BTCOC-USD.

dwlf_get_indicators

Get the stored DAILY moving averages for a symbol: SMA and EMA at 10, 20, 50, 100 and 200 periods (computed nightly from daily closes). `latest` holds the most recent value of each, with its date; `missing` lists any average with no stored value. Moving-average values give the daily closes back exactly, so they are licensed like raw candles: with an API key that is not licensed for raw prices every value is null and `valuesWithheld` says why (`latest` is then empty and `missing` is null). Then use dwlf_get_regime for the trend read (built from EMA alignment and price against the EMAs), and dwl…

ParameterTypeDescription
symbol *stringTrading symbol — accepts BTC, BTC/USD, BTC-USD, BTCUSD, or stock tickers like AAPL, TSLA
daysintegerDaily values to give per average (default 1 = latest only; max 250).

dwlf_get_trendlines

Get the automatically detected trendlines for a symbol on one timeframe (daily by default; weekly; hourly only for symbols with 1h data). Each line carries its type (support/resistance), its two anchors (date + price), slope and whether it is still active. Breaks of these lines are the `trendline_break_*` / `trendline_breach_*` events in dwlf_get_events. Weekly lines are not stored for every symbol yet (BTCOC/USD has daily lines only): an empty weekly list means "none stored", not "no trend". The engine's weekly detection still emits weekly `trendline_break_*` events (for BTCOC/USD too), so re…

ParameterTypeDescription
symbol *stringTrading symbol — accepts BTC, BTC/USD, BTC-USD, BTCUSD, or stock tickers like AAPL, TSLA
timeframestringWhich trendlines (default: daily). Hourly exists only for symbols with 1h data.

dwlf_get_active_signals

Get your strategies' currently active fires: rules that were met and are not yet resolved, which DWLF tracks. They are not actual positions: a fire's marks are what the rules would show, not trades anyone took. Any simulated figure here (a backtest, a strategy's recorded fires, a replayed skip) is hypothetical: worked out on past data, not actual trading. Say so whenever you report one, and pass on `hypotheticalLegend` when the response carries it.

dwlf_get_recent_signals

Get user trade signals — strategy fires recorded by the daily evaluator. Shows signal history with entry/exit prices, R-multiple targets, contextHash, current P&L if filled. Filters compose: `symbol` (single), `strategy` (full strategy field, e.g. `visual_strategy_X`), and `fromDate`/`toDate` (ISO YYYY-MM-DD) OR `days` (last N). Without any filter the default cutoff is the most-recent N signals up to `limit`. Use this rather than the older `/recent` endpoint variant — that one has a hard-coded 5-day window that silently hides older fires. Any simulated figure here (a backtest, a strategy's…

ParameterTypeDescription
daysnumberConvenience: signals from the last N days. Combine with `symbol`/`strategy` to scope tightly.
fromDatestringInclusive lower bound on signal date, ISO YYYY-MM-DD. Pair with toDate for a precise window.
limitnumberMax signals to return (default: 50, max ~500). Returned newest-first.
sortOrderstringDate sort order (default: desc → newest first).
strategystringFilter to a single strategy. Pass the full strategy field as stored — usually `visual_strategy_<id>` (note the visual_ prefix that the cron writes).
symbolstringFilter to a single trading symbol (e.g. BTC-USD, IREN). Slashes and hyphens both accepted.
toDatestringInclusive upper bound on signal date, ISO YYYY-MM-DD.

dwlf_get_signal_stats

Get statistics for your strategies' recorded fires: win rate, average P&L, totals and a breakdown. Any simulated figure here (a backtest, a strategy's recorded fires, a replayed skip) is hypothetical: worked out on past data, not actual trading. Say so whenever you report one, and pass on `hypotheticalLegend` when the response carries it.

dwlf_get_watchlist

Get the user's watchlist — symbols they're actively monitoring.

dwlf_add_to_watchlist

Add a trading symbol to the user's watchlist for monitoring.

ParameterTypeDescription
symbol *stringTrading symbol to add — accepts BTC, BTC/USD, BTC-USD, BTCUSD, or stock tickers like AAPL, TSLA

dwlf_get_briefing_list

Get the user's BRIEFING LIST — symbols they want in the daily briefing but are NOT actively watching (Mag7, macro/dollar like UUP, sector bellwethers). Distinct from the watchlist: the daily briefing (dwlf_get_daily_briefing) covers watchlist UNION briefing list, while the watchlist alone drives the active/Today views. An empty briefing list means the briefing is just the watchlist. The whole-universe layer is the cycle screener (dwlf_get_cycle_setups); the briefing list is the curated middle tier.

dwlf_add_to_briefing_list

Add a symbol to the BRIEFING LIST — briefed daily but not actively watched. Use for wider-universe context the user wants the structural read on without cluttering their watchlist (e.g. UUP for the dollar, AAPL/AVGO/NVDA for Mag7).

ParameterTypeDescription
symbol *stringTrading symbol to add — accepts BTC, BTC/USD, BTC-USD, BTCUSD, or stock tickers like AAPL, TSLA

dwlf_remove_from_briefing_list

Remove a symbol from the user's briefing list.

ParameterTypeDescription
symbol *stringTrading symbol to remove — accepts BTC/USD, BTC-USD, or stock tickers

dwlf_list_symbol_tags

List every distinct symbol TAG. Tags are the groups the markets chart's right-hand panel organises symbols into (e.g. crypto, metals, tech, macro); an untagged symbol falls into the catch-all "Others" bucket. Call this FIRST to see the existing group names before adding a symbol to one (reuse a name to drop it in that group).

dwlf_get_symbol_tags

Get the tags currently assigned to one symbol — i.e. which chart group(s) it belongs to (empty ⇒ it shows under "Others"). Handy to verify before/after (re)tagging.

ParameterTypeDescription
symbol *stringTrading symbol — accepts BTC, BTC/USD, BTC-USD, BTCUSD, or stock tickers like AAPL, TSLA

dwlf_add_symbol_tag

Tag a symbol so it lands in the right group on the markets chart's right-hand panel instead of "Others". Reuse an existing tag (from dwlf_list_symbol_tags) to add it to that group, or pass a new tag name to create a group. A symbol can carry multiple tags. Example: tag STRC as "crypto", GDX as "metals".

ParameterTypeDescription
symbol *stringTrading symbol to tag — accepts BTC, BTC/USD, BTC-USD, BTCUSD, or stock tickers
tag *stringThe tag / group name, e.g. "crypto", "metals", "tech", "macro"

dwlf_remove_symbol_tag

Remove a tag from a symbol — re-categorise it, or (if it has no other tags) drop it back to the "Others" bucket.

ParameterTypeDescription
symbol *stringTrading symbol — accepts BTC, BTC/USD, BTC-USD, BTCUSD, or stock tickers
tag *stringThe tag / group name to remove

dwlf_describe_strategy_nodes

Describe the visual-strategy node types and their (currently-implicit) runtime parameters. Use this to understand what an SL/TP/logic node will actually do at backtest/live time, including the engine defaults that are NOT visible in the visual graph today. Optional `nodeType` filters to a single node (e.g. `sl_below_recent_low`); optional `category` filters to a class (`stopLoss` / `takeProfit` / `signal` / `logic` / `cancellation` / `condition` / `exit`). When `honoredByExecutor: false` on a param, the listed `default` is the only value the engine uses today regardless of what the visual node…

ParameterTypeDescription
categorystringReturn only nodes in this category.
nodeTypestringGive only this one node (e.g. `sl_below_recent_low`).

dwlf_list_strategies

List the user's visual trading strategies with names, descriptions, and associated symbols.

dwlf_get_strategy

Get full details of a specific strategy including signal definitions, nodes, and edges.

ParameterTypeDescription
strategyId *stringStrategy ID

dwlf_create_strategy

⚠️ Create a new strategy. CRITICAL WORKFLOW: 1) Create strategy → 2) Compile → 3) MUST call dwlf_activate_strategy_symbols (or strategy will NEVER generate signals!) → 4) Run backtest. Without step 3, backtests return 0 trades. The strategy exists but is invisible to the evaluation engine until symbols are activated. Always activate symbols immediately after creation.

ParameterTypeDescription
name *stringStrategy name
bodyJsonstringFull strategy body as JSON string (nodes, edges, signals). Parse before sending.
descriptionstringStrategy description

dwlf_update_strategy

Update an existing visual trading strategy. Provide the strategy ID and updated fields.

ParameterTypeDescription
strategyId *stringStrategy ID to update
bodyJsonstringUpdated strategy body as JSON string (nodes, edges, metadata). Parse before sending.
descriptionstringUpdated description
namestringUpdated strategy name

dwlf_compile_strategy

Compile a visual strategy into an executable trade signal. Must be called after creating or updating a strategy before it can be evaluated or generate signals.

ParameterTypeDescription
strategyId *stringStrategy ID to compile

dwlf_delete_strategy

Permanently delete a visual strategy. Hard delete — also removes the compiled executable and symbol activations. ⚠️ Past UserTradeSignal rows that referenced this strategy are NOT scrubbed (they remain as historical record), but they will be filtered out of the chart's strategy dropdown going forward because the chart filters by current live strategies. If you have an active subscription on this strategy, the subscription will keep consuming events but the dispatcher's strategy lookup will fail — disable the subscription first via `dwlf_update_subscription({ enabled: false })` or delet…

ParameterTypeDescription
strategyId *stringStrategy ID to delete

dwlf_list_public_strategies

List community-shared public strategies that can be used as inspiration or cloned.

dwlf_run_backtest

⚠️ Run a strategy backtest (async). Returns requestId → poll with dwlf_get_backtest_results. PREREQUISITES: 1) Strategy MUST have symbols activated (dwlf_activate_strategy_symbols) or backtest returns 0 trades. 2) Requires 200+ daily candles: startDate must be 10+ months before endDate. If backtest returns 0 trades, check: a) Are symbols activated? b) Is date range long enough? c) Do event conditions actually match historical data? Optional capital/risk params (initialCapital, riskPerTrade, maxConcurrentTrades, portfolioMode, allowSymbolPyramiding) override backend defaults — set portf…

ParameterTypeDescription
strategyId *stringStrategy ID to backtest
allowSymbolPyramidingbooleanOpt into >1 concurrent open position per symbol in portfolio mode (default false = one position per symbol). Note: global maxConcurrentTrades still caps total positions, but per-symbol concentration i…
disableTakeProfitbooleanSuppress the implicit fallback take-profit (default false). When a strategy has NO take-profit node the backend otherwise force-applies a 3xATR fallback TP, which exits exit-signal-only strategies ear…
endDatestringEnd date (YYYY-MM-DD)
initialCapitalnumberStarting account size in USD (default 10000).
maxConcurrentTradesintegerConcurrency cap for portfolio mode (default 3). Pair with portfolioMode=true.
maxPositionsPerSymbolintegerBound concurrent open positions per symbol when allowSymbolPyramiding=true (e.g. 3). Default unlimited. No effect when allowSymbolPyramiding is false (cap is 1 then).
portfolioModebooleanOpt into shared-capital simulation across symbols (default false). Combine with maxConcurrentTrades to cap simultaneous open positions.
riskPerTradenumberRisk per trade as a decimal, e.g. 0.005 = 0.5% (default 0.02).
startDatestringStart date (YYYY-MM-DD)
symbolstringSingle symbol shorthand (e.g. BTC, TSLA). Use "symbols" for multiple.
symbolsarraySymbols to backtest against (e.g. ["BTC", "TSLA"]). Defaults to strategy assets.

dwlf_get_backtest_results

Get results for a backtest by requestId. If status is not "complete", poll again shortly. DEFAULTS TO SUMMARY MODE: returns DDB-level per-symbol stats (totalReturn, totalTrades, winningTrades, sharpe, maxDrawdown, finalEquity) and the portfolio-level aggregate metrics object, with all bulky fields stripped (per-symbol trades, equityCurve, signals, monthlyReturns; request-level portfolioEquityCurve, portfolioTrades, portfolioRejectedSignals). Summary is ~1-3 KB vs ~1-3 MB full — use it for headline metric checks, leaderboard-style comparisons, and "did it work" sanity passes. Pass `summary: f…

ParameterTypeDescription
requestId *stringBacktest request ID
summarybooleanDefault true — return the lightweight summary view. Set false to pull the full S3-merged payload (~1-3 MB).

dwlf_list_backtests

List your backtests (most recent first) with their status and config. DEFAULTS TO SUMMARY MODE: strips the bulky `strategyDefinition` (visual-builder node graph) from each item while keeping all metadata (requestId, strategyId/Name, symbols, timeframe, start/end dates, initialCapital, riskPerTrade, status, createdAt). PAGED: returns the 15 most recent by default plus a `cursor`; even summarised, a large account overflows in one shot. To see more: raise `limit`, pass the returned `cursor` for the next page, or narrow with `status`. Use the summary to pick a requestId, then drill in: dwlf_get_ba…

ParameterTypeDescription
cursorstringOpaque pagination cursor from a previous response's `cursor` field — pass it to fetch the next page of older runs.
limitintegerMax backtests to return, most recent first (default 15). Raise to see more, but mind the context cost.
statusstringFilter to a single request status, matched exactly. Known values: pending, processing or running (in-progress — both occur, depending on which backtest worker ran), completed, failed, cancelled. Pas…
summarybooleanDefault true — strip the per-item strategyDefinition graph. Set false to include the full visual-builder node graph on every backtest (much larger).

dwlf_delete_backtest

Permanently delete a backtest request and its associated result data by requestId. Use to clean up stale or invalid runs (e.g. results computed before an engine bug was fixed). Idempotent — deleting an already-deleted requestId returns success.

ParameterTypeDescription
requestId *stringBacktest request ID to delete

dwlf_cancel_backtest

Cancel a queued or running backtest by requestId. Pending requests cancel cleanly (worker skips). Running requests get a best-effort cancel — result is marked cancelled but mid-run computation isn't interrupted; the response's `bestEffort: true` flag indicates this. Terminal states (completed / failed / already-cancelled) return 409 with the actual status. Use this rather than `dwlf_delete_backtest` when you want to halt without scrubbing the audit trail.

ParameterTypeDescription
requestId *stringBacktest request ID to cancel

dwlf_get_backtest_summary

Get a summary of all backtests — aggregated performance stats. Any simulated figure here (a backtest, a strategy's recorded fires, a replayed skip) is hypothetical: worked out on past data, not actual trading. Say so whenever you report one, and pass on `hypotheticalLegend` when the response carries it.

dwlf_list_portfolios

List the user's portfolios.

dwlf_get_portfolio

Get portfolio details including holdings.

ParameterTypeDescription
portfolioId *stringPortfolio ID

dwlf_get_holdings

Get detailed holdings for a portfolio with current values and P&L.

ParameterTypeDescription
portfolioId *stringPortfolio ID

dwlf_get_portfolio_snapshots

Get historical snapshots for a portfolio — shows value over time.

ParameterTypeDescription
portfolioId *stringPortfolio ID

dwlf_list_trades

List trades from the trade journal. Filter by status or symbol. Statuses: `open` (live position), `closed` (exited, has P&L), `planned` (confirm-mode signal awaiting confirm/skip), `skipped` (passed signal — carries skipReasons[]/skipNote). Omit `status` to get ALL statuses. Use `status: "skipped"` to review the skip journal (which signals you passed and why).

ParameterTypeDescription
statusstringFilter by trade status. Omit for all. planned/skipped are served from the base table (they lack entryAt so aren't in the StatusIndex GSI).
symbolstringFilter by symbol (e.g. BTC, TSLA)

dwlf_get_trade

Get full details for a specific trade including notes, executions, and events.

ParameterTypeDescription
tradeId *stringTrade ID

dwlf_create_trade

Log a new trade in the journal. Specify symbol, direction, entry price, and optional stop loss / take profit. STRONGLY RECOMMENDED: pass confirmReasons[] — WHY the trade is being taken, in the same structured vocabulary dwlf_confirm_trade uses, so a directly-logged trade feeds the byConfirmReason decision analytics exactly like a confirmed planned one. Valid confirmReasons: fresh_cycle_entry, trendline_break_confirmed, cluster_confluence, regime_aligned, risk_reward_attractive, adding_to_winner, other. confirmNote is required when a reason is "other". Reasons are optional (untagged trades st…

ParameterTypeDescription
direction *stringTrade direction
entryPrice *numberEntry price
symbol *stringTrading symbol (e.g. BTC, TSLA, RIOT)
assetTypestringAsset type
confirmNotestringFree-text detail on the entry rationale. REQUIRED when a reason is "other". Max 2000 chars.
confirmReasonsarrayWHY this trade is being taken. Valid: fresh_cycle_entry, trendline_break_confirmed, cluster_confluence, regime_aligned, risk_reward_attractive, adding_to_winner, other.
initialStopnumberStop loss price
initialTakeProfitnumberTake profit price
isPaperTradebooleanWhether this is a paper trade (default: false)
positionSizenumberPosition size (quantity)
reasonTextstringFree-text trade reasoning / thesis. Not machine-readable — use confirmReasons for analytics.
timeframestringTimeframe (e.g. 1d, 4h, 1h)

dwlf_close_trade

Close an open trade by specifying the exit price.

ParameterTypeDescription
exitPrice *numberExit price
tradeId *stringTrade ID to close
exitAtstringExit timestamp (ISO 8601, defaults to now)

dwlf_add_trade_note

Add a note to an existing trade — observations, adjustments, lessons learned.

ParameterTypeDescription
content *stringNote content
tradeId *stringTrade ID

dwlf_get_trade_notes

Get all notes for a trade — observations, updates, and lessons recorded during the trade.

ParameterTypeDescription
tradeId *stringTrade ID

dwlf_list_trade_plans

List trade plan templates — reusable frameworks for entering trades.

dwlf_update_trade

Update an existing trade by ID. All fields except tradeId are optional (partial update). Parameter names match dwlf_create_trade / dwlf_confirm_trade: initialStop / initialTakeProfit / positionSize (formerly stopLoss / takeProfit / quantity — the old names are no longer accepted). symbol and tags are NOT editable — the backend has never accepted them, and offering them meant a caller could set one and be told 200 while nothing changed. To change the levels on an OPEN trade use this; to set them as the trade is taken, pass them to dwlf_confirm_trade instead so it is one call.

ParameterTypeDescription
tradeId *stringTrade ID
directionstringTrade direction
entryPricenumberEntry price
initialStopnumberStop loss price (formerly stopLoss). ⚠️ This rewrites the R BASELINE: every R-multiple is computed from |entryPrice - initialStop|, and a numeric change also clears the stopAnchor provenance. Corr…
initialTakeProfitnumberTake profit price (formerly takeProfit)
isPaperTradebooleanWhether this is a paper trade
notesstringTrade notes
positionSizenumberPosition size / quantity (formerly quantity)
quantityDEPRECATED — renamed to positionSize. Rejected with an error.
stopLossDEPRECATED — renamed to initialStop. Rejected with an error.
symbolREMOVED — not editable, the backend has never accepted it. Rejected with an error.
tagsREMOVED — not editable, the backend has never accepted it. Rejected with an error.
takeProfitDEPRECATED — renamed to initialTakeProfit. Rejected with an error.

dwlf_delete_trade

Delete a trade by ID.

ParameterTypeDescription
tradeId *stringTrade ID

dwlf_position_size

Calculate recommended position size based on account size, risk percentage, entry price, and stop loss.

ParameterTypeDescription
accountSize *numberTotal account size in currency
entryPrice *numberPlanned entry price
riskPercent *numberRisk percentage (e.g. 1 for 1%)
stopLoss *numberStop loss price
symbolstringTrading symbol for context

dwlf_get_trade_state

Get the current state of a trade — including execution history and adjustments.

ParameterTypeDescription
tradeId *stringTrade ID

dwlf_get_skip_outcomes

The Counterfactual scorecard: what would have happened had each SKIPPED trade been taken. Every skip is replayed against daily candles from its signal date using the decision-time-frozen entry/SL/TP (pre-registered — no hindsight bias). Per outcome: status (`would_be_stopped` capped at exactly -1R / `would_hit_target` / `running` = open mark), `counterfactualR`, `savedR` (= -R: positive means the skip SAVED money), move %, MFE/MAE in R, skip reasons + note. Aggregates: per-skip-reason and per-strategy rollups plus the cumulative saved-R series ("is the discretionary overlay adding edge"). As…

dwlf_get_decision_stats

The decision-quality ledger: TAKES (confirmed trades, judged by actual outcomes — closed realized R, open marks vs initial risk) and SKIPS (judged by the counterfactual replay) joined into one record. Returns: the 2x2 decision `matrix` (tookRight/tookWrong/skipRight/skipWrong, with open takes and running skips as unjudged open counts), `byStrategy` records (W/L, net realized R, net open R, skips + saved R), and per-reason hit rates for BOTH vocabularies (`byConfirmReason`, `bySkipReason`) — use these to tell the user which of their stated reasons carry alpha (e.g. "your regime_risk_off ski…

ParameterTypeDescription
fromDatestringScope to decisions on/after this date (YYYY-MM-DD). Takes precedence over months. Omit = all-time.
monthsintegerScope the ledger to the last N months (recent-form read). Omit = all-time.

dwlf_confirm_trade

Confirm (take) a confirm-mode PLANNED trade — turns it into an OPEN position. Only trades with status "planned" can be confirmed. By default it opens at the planned entryPrice / positionSize / stop and stamps entryAt=now; override any of them to reflect what you actually did. ⚠️ OVERRIDING THE STOP IS THE COMMON CASE, not an exception: the engine derives its stop from regular-session candles, so it routinely sits inside the broker's wider range and has to be moved before the take. Overriding initialStop does NOT re-derive positionSize — pass both to keep risk constant. STRONGLY RECOMME…

ParameterTypeDescription
tradeId *stringPlanned trade ID to confirm/take
confirmNotestringEntry rationale note (max 500 chars). Required when a reason is "other".
confirmReasonsarrayWHY the trade is taken (multi-select; see tool description for the valid set). First = primary.
entryAtstringEntry timestamp, ISO 8601 (defaults to now)
entryPricenumberActual entry/fill price (defaults to the planned entryPrice)
initialStopnumberActual stop the trade opens with (defaults to the planned stop). ⚠️ Overriding this does NOT re-derive positionSize — the planned size was computed from the PLANNED stop, so a wider stop means p…
initialTakeProfitnumberActual take-profit the trade opens with (defaults to the planned target)
positionSizenumberActual position size / quantity (defaults to the planned size)

dwlf_skip_trade

Skip (pass on) a confirm-mode PLANNED trade, recording WHY. Moves it to status "skipped" with skipReasons[] + an optional skipNote — this feeds the skip journal / scorecard (dwlf_list_trades(status: "skipped")). Only planned trades can be skipped. Valid skipReasons: entry_extended_from_anchor, risk_reward_poor, thesis_already_played_out, low_conviction_signal, regime_risk_off, correlated_exposure, account_drawdown_pause, broker_access, other. skipNote is REQUIRED when a reason is "other". The first reason is treated as primary. Pair with dwlf_confirm_trade to take it instead.

ParameterTypeDescription
skipReasons *arrayOne or more skip reason codes (see tool description for the valid set). First = primary.
tradeId *stringPlanned trade ID to skip
skipNotestringFree-text rationale (max 500 chars). Required when a reason is "other".

dwlf_list_custom_events

List the account's custom events: conditions the user defined (indicator and event condition nodes joined by and/or/not/then gates), each with its id and name. An event's definition is dwlf_get_custom_event; its fires are dwlf_get_events with type `custom_event` and its `customEventId` (pass a wide `days`); the symbols it runs on, and whether it is really running, are dwlf_get_event_symbols.

dwlf_get_custom_event_notifications

Get all recently fired custom events where the user has notifications enabled. Gives fires across ALL symbols in one call — the most efficient way to check what custom events have triggered. The eventName field contains the human-readable name (e.g. "wcl_confirmed"). The eventType field is always "custom_event" — use eventName to distinguish events.

ParameterTypeDescription
daysnumberHow many days back to look (default 7)

dwlf_get_custom_event

Get one custom event: its name, its condition graph (`visual`: nodes and edges), its settings and its compiled status. Its fires are not here: read them with dwlf_get_events (type `custom_event`, `customEventId` = this id, a wide `days`). Which symbols it runs on, and its last-night health, are dwlf_get_event_symbols.

ParameterTypeDescription
eventId *stringCustom event ID

dwlf_compile_custom_event

Recompile a LEGACY custom event. Saving already compiles: dwlf_create_custom_event, and every dwlf_update_custom_event that changes the definition, compile in the same request and refuse (400) a graph that does not compile, so this is needed only when activating symbols answers 422 `EVENT_NOT_COMPILED` (an older event never compiled, or one whose saved definition is not what would run). A 409 means the event changed while it compiled: reload it and retry.

ParameterTypeDescription
eventId *stringCustom event ID to compile

dwlf_preflight_custom_event

Validate a custom event graph WITHOUT saving it. Gives the execution tier (fast/async/reject), complexity score with breakdown, graph metrics, plan policy limits, errors, warnings, and suggested fixes. Call this BEFORE creating or updating a complex event to check whether it is accepted and which execution tier it lands in.

ParameterTypeDescription
bodyJson *stringFull event body as JSON string with name, visual (nodes + edges), and optionally description, metadata, version

dwlf_create_custom_event

⚠️ Create a new custom event. CRITICAL WORKFLOW: 1) Create event (saving compiles it; a graph that does not compile is refused with 400) → 2) MUST call dwlf_activate_event_symbols (or event will NEVER fire!) → 3) Trigger evaluation. Without step 2, backtests return 0 trades. The event exists but is invisible to the evaluation engine until symbols are activated. Always activate symbols immediately after creation.

ParameterTypeDescription
bodyJson *stringFull event definition body as JSON string (conditions, parameters). Parse before sending.
name *stringEvent name

dwlf_update_custom_event

Update an existing custom event. Accepts any subset of {name, description, visual, metadata, version, notifyOnFire} via bodyJson. Most common use: flip notifyOnFire to true after creation so future fires surface in dwlf_get_custom_event_notifications. A change to `visual` or a condition compiles in the same request (a graph that does not compile is refused with 400): no separate compile call is needed.

ParameterTypeDescription
bodyJson *stringPartial update body as JSON string. Any subset of name, description, visual, metadata, version, notifyOnFire.
eventId *stringCustom event ID to update

dwlf_delete_custom_event

Delete a custom event permanently. Hard delete — also removes the compiled executable, symbol activations, and watermark state. Past fires already written to EventsTable are NOT deleted (they remain as historical record).

ParameterTypeDescription
eventId *stringCustom event ID to delete

dwlf_evaluate_custom_event

⚠️ Trigger an on-demand evaluation run for a specific custom event. This is the workflow step BETWEEN activating symbols and querying fires — without it, the custom event only evaluates on the daily cron and historical data is not backfilled until then. Returns { requestId, status: "pending" } — poll dwlf_get_evaluation_status(requestId) until status is "completed", then query fires via dwlf_get_events(type: "custom_event"). Consumes one EVALUATION quota. IMPORTANT: by default only the most recent ~400 candles (~14 months of daily data) are backfilled; older history produces NO fires a…

ParameterTypeDescription
eventId *stringCustom event ID to evaluate
idempotencyKeystringOptional client-supplied idempotency key — if a request with this key already exists for this account, the existing requestId is returned instead of creating a new one
lookbackDaysintegerHow many days of history to (re)evaluate, overriding the default ~400-candle (~14-month) backfill window. Set this to at least the span of any backtest that gates on this event (e.g. 2200 ≈ 6 years)…

dwlf_evaluate_strategy

Trigger an on-demand evaluation run for a specific visual strategy. Parallels dwlf_evaluate_custom_event but for strategies. Returns { requestId, status: "pending" } — poll dwlf_get_evaluation_status until completed. Consumes one EVALUATION quota. Same backfill caveat as dwlf_evaluate_custom_event: defaults to ~400 candles (~14 months); pass lookbackDays to cover a longer history. ⚠️ IMPORTANT — this DOES NOT emit `strategy.entry.triggered` events to the dispatcher. Those events are only emitted by the daily cron (`dailyTradeSignalJob`, ~04:00 UTC) when entry conditions match on the *l…

ParameterTypeDescription
strategyId *stringVisual strategy ID to evaluate
idempotencyKeystringOptional client-supplied idempotency key
lookbackDaysintegerHow many days of history to (re)evaluate, overriding the default ~400-candle (~14-month) window. Set to at least the span of any dependent backtest. Larger-than-history values are safe.

dwlf_get_evaluation_status

Get the status and result summary of a specific evaluation by requestId. Poll this after calling dwlf_evaluate_custom_event or dwlf_evaluate_strategy until status === "completed". ⚠️ IMPORTANT — `summary.totalItems` / `summary.processedItems` count the eval-JOB items (one per strategy or one per custom event), NOT the per-symbol fan-out inside the job. A strategy eval across 37 symbols will show `totalItems: 1, processedItems: 1` when done — that just means "the strategy job finished," NOT "37 symbols were processed." For the per-symbol count: the request body itself carries `symbols:…

ParameterTypeDescription
requestId *stringEvaluation request ID returned by dwlf_evaluate_custom_event / dwlf_evaluate_strategy

dwlf_list_evaluations

List recent evaluation requests for the account with their status and summary. Useful for finding the requestId of a previous evaluation, or for checking whether one is already in-flight before triggering another.

ParameterTypeDescription
limitnumberMaximum number of evaluations to return (server default applies if omitted)
statusstringFilter by status

dwlf_list_annotations

List annotations for a symbol. Optionally filter by timeframe (e.g. daily, weekly, hourly). Returns each annotation with its annotationId, type, timeframe and full data — copy a data shape from here when you are unsure how to build a new one.

ParameterTypeDescription
symbol *stringTrading symbol (e.g. BTC, TSLA)
timeframestringTimeframe filter (e.g. "daily", "weekly", "hourly")

dwlf_create_annotation

Create a chart annotation. `type` selects the shape; `data` carries the type-specific fields documented below. Note `arrow` is the callout/bubble-with-pointer and `text` is a plain text box — for commentary that points at a level, use `arrow`. DATA SHAPES BY TYPE (times = unix-ms, prices = chart price): • hline — {price, color, lineStyle, lineWidth, showPrice, label?}: horizontal price level. • vline — {time, color, lineStyle, lineWidth, showTime, label?}: vertical time marker. • text — {time, price, text, fontSize, color, backgroundColor?}: free text box anchored at a point. Us…

ParameterTypeDescription
data *objectType-specific fields. See DATA SHAPES BY TYPE in the tool description. Max 4KB serialized.
symbol *stringTrading symbol (e.g. BTC, TSLA)
timeframe *stringTimeframe (e.g. "daily", "weekly", "hourly")
type *stringAnnotation type — see the data-shape reference in the tool description for the fields each one needs.
originstringWho created it: "user" (default), "ai" (agent-generated — use this for your own annotations), or "system".

dwlf_update_annotation

Update an existing annotation. symbol + timeframe are REQUIRED (the backend needs them to locate the row). `data` is merged field-by-field into the existing data — pass only the fields you want to change (e.g. {label: "..."} or {price: 56}); sibling fields are preserved. visible/locked/zIndex/groupId can also be patched.

ParameterTypeDescription
annotationId *stringAnnotation ID (e.g. ann_d604ba96a697)
symbol *stringTrading symbol the annotation belongs to — required to address the row
timeframe *stringAnnotation timeframe (e.g. "daily", "weekly", "hourly") — required to address the row
dataobjectPartial data fields to merge (not a full replacement). E.g. {label: "Reclaim ~56"} or {color: "#ef4444"}.
groupIdstring | nullAnnotation group/workspace id
lockedbooleanLock the annotation against edits
visiblebooleanShow/hide the annotation
zIndexnumberStacking order

dwlf_delete_annotation

Delete an annotation by ID. symbol + timeframe are required (the backend needs them to locate the row). Deleting an armed alert_line also cancels its live price alert.

ParameterTypeDescription
annotationId *stringAnnotation ID
symbol *stringTrading symbol the annotation belongs to (e.g. BTC, TSLA, GDXJ)
timeframe *stringAnnotation timeframe (e.g. "daily", "weekly", "hourly")

dwlf_bulk_create_annotations

Create multiple annotations in one call (max 25). Each entry follows the same shape as dwlf_create_annotation — see its data-shape reference. Returns a per-item results array; an individual item can fail without aborting the rest.

ParameterTypeDescription
annotations *arrayAnnotations to create (1-25)

dwlf_get_trade_plan

Get full details for a specific trade plan by ID.

ParameterTypeDescription
planId *stringTrade plan ID

dwlf_create_trade_plan

Create a new trade plan with entry, stop loss, and take profit levels.

ParameterTypeDescription
direction *stringTrade direction
entryPrice *numberPlanned entry price
stopLoss *numberStop loss price
symbol *stringTrading symbol (e.g. BTC, TSLA)
takeProfit *numberTake profit price
notesstringAdditional notes
quantitynumberPlanned position size
strategystringStrategy name or description
timeframestringTimeframe (e.g. 1d, 4h, 1h)

dwlf_update_trade_plan

Update an existing trade plan by ID. All fields except planId are optional (partial update).

ParameterTypeDescription
planId *stringTrade plan ID
directionstringTrade direction
entryPricenumberPlanned entry price
notesstringAdditional notes
quantitynumberPlanned position size
statusstringPlan status
stopLossnumberStop loss price
strategystringStrategy name or description
symbolstringTrading symbol
takeProfitnumberTake profit price
timeframestringTimeframe

dwlf_delete_trade_plan

Delete a trade plan by ID.

ParameterTypeDescription
planId *stringTrade plan ID

dwlf_activate_event_symbols

⚠️ REQUIRED STEP after creating custom events! Activate (enable) symbols for an event. Events do NOT evaluate automatically — they are invisible to backtests and the daily pipeline until activated. If backtests return 0 trades, you likely forgot this step. Call immediately after creating an event (saving compiles it).

ParameterTypeDescription
eventId *stringCustom event ID
symbols *arrayArray of symbols to activate (e.g. ["BTC-USD", "ETH-USD", "NVDA"])

dwlf_get_event_symbols

Get the symbols a custom event is activated on, plus the event's `health` line from last night's coverage check: { active, ok, failing, paused, pending, lastCheckedAt, judgedAt, lastFired: { symbol, at }, compileState }. Use it to check an event is really running, not just activated. Each activation's state is ok | failing (with a kind, e.g. stale_market_data, not_compiled, evaluation_failed) | paused | pending; kinds are an open set, so branch on the state.

ParameterTypeDescription
eventId *stringCustom event ID

dwlf_deactivate_event_symbols

Deactivate (disable) one or more symbols for a custom event: it stops evaluating, and so stops recording fires, for those symbols. An alert subscription that names those symbols is separate and is not changed: edit it with dwlf_update_subscription.

ParameterTypeDescription
eventId *stringCustom event ID
symbols *arrayArray of symbols to deactivate

dwlf_activate_strategy_symbols

⚠️ REQUIRED STEP after creating strategies! Activate symbols for a strategy. Strategies do NOT generate signals automatically — they are invisible to backtests until symbols are activated. If backtests return 0 trades, you likely forgot this step. Call immediately after compiling a strategy.

ParameterTypeDescription
strategyId *stringStrategy ID
symbols *arrayArray of symbols to activate (e.g. ["BTC-USD", "ETH-USD", "NVDA"])

dwlf_get_strategy_symbols

Get the list of symbols currently activated for a strategy.

ParameterTypeDescription
strategyId *stringStrategy ID

dwlf_deactivate_strategy_symbols

Deactivate (disable) one or more symbols for a strategy. The strategy will stop generating signals for these symbols.

ParameterTypeDescription
strategyId *stringStrategy ID
symbols *arrayArray of symbols to deactivate

dwlf_list_all_symbol_activations

List all the user's symbol activations across both custom events and strategies. Shows which symbols are active for which events/strategies.

ParameterTypeDescription
activeOnlybooleanIf true, only return active associations (default: true)

dwlf_ai_dashboard

Get a complete account overview in a single call: watchlist with prices, active strategy fires, open trades, portfolios, strategies, and recent events. Ideal for "what's going on?" queries. Requires markets:read permission; other sections degrade gracefully based on permissions. Any simulated figure here (a backtest, a strategy's recorded fires, a replayed skip) is hypothetical: worked out on past data, not actual trading. Say so whenever you report one, and pass on `hypotheticalLegend` when the response carries it.

dwlf_ai_symbol_brief

Get a condensed single-symbol view: latest price with change, key indicators, S/R levels, recent events, and active strategy fires. Raw candles (`recentCandles`) come only to the owner account under the data licence; other keys get `candlesWithheld` in their place. Perfect for "how's BTC doing?" queries. Any simulated figure here (a backtest, a strategy's recorded fires, a replayed skip) is hypothetical: worked out on past data, not actual trading. Say so whenever you report one, and pass on `hypotheticalLegend` when the response carries it.

ParameterTypeDescription
symbol *stringSymbol to get brief for (e.g. BTC, TSLA, NVDA)

dwlf_ai_strategy_performance

Get all strategies with fire statistics and performance metrics in a single call: total fires, active fires, win rate, avg R/R, total P&L, and per-strategy breakdowns. Any simulated figure here (a backtest, a strategy's recorded fires, a replayed skip) is hypothetical: worked out on past data, not actual trading. Say so whenever you report one, and pass on `hypotheticalLegend` when the response carries it.

dwlf_list_academy_tracks

List all DWLF Academy tracks and lessons. Use this to discover educational content about DWLF concepts — indicators, events, strategies, charting, and more.

dwlf_get_academy_lesson

Get the full content of a DWLF Academy lesson by slug, as markdown. Use dwlf_list_academy_tracks first to find available lessons.

ParameterTypeDescription
slug *stringLesson slug from the academy manifest (e.g. "intro-to-indicators")

dwlf_search_academy

Search DWLF Academy content by keyword. Searches track and lesson titles and lists the matching lessons with their track context.

ParameterTypeDescription
query *stringSearch term to match against track/lesson titles and descriptions

dwlf_get_regime

Get the market regime classification for a symbol on one timeframe (daily by default) — trend, momentum, volatility and a confidence score, plus `insufficientHistory` (true when the symbol has too little history on that timeframe: the fields are then placeholders, not a reading). With `history`, gives a dated regime series, newest first. It carries no cycle phase: for where an asset is in its market cycle, use dwlf_get_stage (weekly Weinstein stage).

ParameterTypeDescription
symbol *stringSymbol to query (e.g. BTC, ETH, AAPL)
historybooleanIf true, give the dated regime series (newest first) instead of just the current regime
limitintegerHistory entries to give when `history` is true (default 90).
timeframestringCandle timeframe to classify (default: daily). Hourly only for symbols with 1h data.

dwlf_get_intelligence

Get the full semantic snapshot for a symbol — current price, active events, FSM state, market regime, the weekly Weinstein `stage` object (`stage`, `stageName`, `weeksInStage`, `since`, `verification`; context, not a signal — see dwlf_get_stage), support/resistance levels, signal quality, and the swing ladders, both in the same call: `structure` (daily) and `structureWeekly` (weekly), each with bias, sequence, flipLevel, trapdoor and recent pivots. Each pivot has a `status`: "active"; "superseded" (the cycle engine replaced it in TIMING with a more extreme pivot, named in `supersededBy`, b…

ParameterTypeDescription
symbol *stringSymbol to query (e.g. BTC, ETH, AAPL)

dwlf_get_daily_briefing

Get the cross-asset daily briefing (covers the watchlist UNION the briefing list). Returns a TOP-LEVEL OVERVIEW by default: one headline line per symbol (price/%chg/ribbon, regime trend + `cycle`, the weekly cycle FSM's setup state (bottoming/rising/topping/declining; not the cycle read — that is `stage`), weekly Weinstein `stage` number + `stageWeeks` (weeks in stage; context, not a signal), cycleAlignment composite, active-signal count, openTrade, and `flags`) plus the full cross-asset block (sectorSentiment + triggerThemes + alignmentThemes) and a `drilldown` block. The overview is sized…

ParameterTypeDescription
depthbooleantrue adds crossAsset.depth = {readings, read, failed, failedSymbols, symbolLimit, omitted, omittedSymbols}: each symbol's current weekly low and high window depth reading, for the watchlist + briefing…
symbolsarrayOptional additional symbols to include alongside your watchlist + briefing list for this call only. Useful when Telegram alerts fire for symbols outside your curated lists and you want the structural…
viewstring'overview' (default) = one headline line per symbol + full crossAsset; fits one response across a large watchlist. 'summary' = compact per-symbol detail (heavier; scope with `symbols`). 'full' = every…

dwlf_register_agent

Programmatically register a new DWLF account — no browser or Google OAuth required. Works only while DWLF sign-up is open: while it is closed this returns a 403 saying so (tell your human; don't retry). When open, it returns an API key immediately, and email verification unlocks compute features (backtests, evaluations).

ParameterTypeDescription
email *stringEmail address for the new account
agentIdstringOptional agent identifier to associate with this account
purposestringOptional description of what this account is for

dwlf_get_quotas

Get the current user's plan tier, resource usage (custom events, strategies, FSMs, on-demand evals), limits, and custom event policy limits including fast/async path constraints (max nodes, max OR fanout, max nesting depth, etc.). Use this to understand what the user's plan allows before building complex events.

dwlf_list_subscriptions

List all subscriptions on the account, including their enabled state, event source, channels, and filters. Use to verify what's wired up before creating duplicates, or to find a subscriptionId for update/delete.

dwlf_create_subscription

Create a new subscription. Four shapes are supported, distinguished by `eventTypeId`: - `strategy.entry.triggered` — requires `strategyId`; pair with `mode: 'confirm'` or `'auto'`. Confirm-mode creates a planned Trade for review; auto-mode opens it directly. - `strategy.exit.triggered` — requires `strategyId`. Fires when the strategy's exit graph matches, and also delivers that strategy's stop alerts: every live stop-out (fixed or trailing) and a trailing stop locking in breakeven, then each further whole R. `strategy.stop.hit` / `strategy.stop.moved` cannot be subscribed to directly.…

ParameterTypeDescription
channels *arrayDelivery channels, e.g. [{ type: 'telegram', destination: { chatId: <number> }, enabled: true }].
eventTypeId *stringEvent source: `strategy.entry.triggered`, `strategy.exit.triggered`, `custom_event`, or an indicator event id like `cycle.low.confirmed`.
symbols *arraySymbols to scope to. Use ['*'] for wildcard across the account universe.
accountBalanceOverridenumber
customEventIdstringRequired when eventTypeId is `custom_event`.
dedupeWindowMinutesnumber
enabledbooleanWhether the subscription is active. Defaults to true.
maxConcurrentTradesOverridenumber
modestringOnly meaningful for strategy.entry.triggered. `confirm` = planned Trade for review, `auto` = trade opens directly. Defaults to `confirm`.
quietHoursobject
riskPerTradeOverridenumber
strategyIdstringRequired when eventTypeId is `strategy.entry.triggered` or `strategy.exit.triggered`.
timeframesarrayTimeframes to scope to, e.g. ['1d'], ['1w'], or ['*']. Defaults to ['*'].

dwlf_update_subscription

Update an existing subscription (PATCH). Only the fields you supply are changed; everything else is preserved. Most-used: toggle `enabled` to pause/resume without losing the subscription's history. Editable fields: enabled, symbols, timeframes, channels, quietHours, dedupeWindowMinutes, mode, strategyId, risk/accountBalance/maxConcurrentTrades overrides, and customEventId (custom_event subscriptions only). `eventTypeId` is NOT patchable — switching event class on an existing subscription requires delete+recreate.

ParameterTypeDescription
subscriptionId *stringThe subscriptionId returned by create or list.
accountBalanceOverridenumber
channelsarrayReplace the delivery channels array, e.g. [{ type: 'telegram', destination: { chatId: <number> }, enabled: true }]. It cannot be empty.
customEventIdstringOnly valid on custom_event subscriptions — repoints which custom event the sub watches. The backend answers 400 if the sub isn't a custom_event.
dedupeWindowMinutesnumber | nullDedup window for repeat fires, or null to clear. A non-negative finite number.
enabledbooleanToggle active/paused without deleting.
maxConcurrentTradesOverridenumber
modestring
quietHoursQuiet-hours window object, or null to clear. Detailed shape (start/end/timezone) is validated server-side.
riskPerTradeOverridenumber
strategyIdstring
symbolsarrayReplace the symbol scope. Pass ['*'] for wildcard across the account universe.
timeframesarrayReplace the timeframe scope. Pass ['*'] for any.

dwlf_delete_subscription

Permanently delete a subscription. Hard delete — also removes any pending dispatcher state. If you just want to pause it, use `dwlf_update_subscription` with `enabled: false` instead so the history is preserved.

ParameterTypeDescription
subscriptionId *stringThe subscriptionId to delete.

dwlf_thesis_guide

Start here for theses (what a user is waiting for on a symbol, checked by DWLF every night after the close). Returns what theses are, what they save the user (decide once; told when it happens; honest knowable-at timing; how close each is), their honest limits (end of day; information, not advice), the rules for building one that DWLF can check exactly, the workflow across the thesis tools, and worked examples with the exact dwlf_create_thesis payloads. No API call.

dwlf_list_thesis_condition_types

The vocabulary of theses: each condition type with its parameters, a definition, its fields as data (name, kind, required, values, help) and whether it may be an invalidation; the rules (ordered steps, invalidation, arming, nightly checking) and the limits. Only these types exist: DWLF checks exactly what their fields say. Read this before dwlf_create_thesis (dwlf_thesis_guide has worked examples). Condition types: pivot_confirmed (the next confirmed cycle low/high, optionally inside a level), close_vs_level (a daily/weekly close or intraday trade beyond a level), window_opens, window_closes (…

dwlf_create_thesis

Save what the user is waiting for on a symbol, and why: ordered steps of conditions, optional invalidation conditions, and the user's own context and next step. DWLF checks it once a night after the close and tells the user when a step is met or it is challenged (a Telegram digest if set up, an in-app notification, and dwlf_list_thesis_fires); nothing known before a condition was saved counts. Build it tight and detectable: only the listed condition types, each label saying exactly what its fields check. For "the next pivot after one I already know of" use pivot_confirmed with `after`. Before…

dwlf_list_theses

The user's theses: each with its steps and conditions (pending, met, missed or marked), status (waiting, in_progress, complete, challenged, archived, closed) and liveness (the bar it was last checked against; `stale` when the nightly check has been quiet over 30 hours). A challenged thesis is waiting for the user's review. With includeProgress, each active thesis also says how close it is: per pending condition of its current step and per pending invalidation, exact `words` plus fields (a price condition's last close and % move to the level; a forming pivot's % developed; a weekly window's ope…

ParameterTypeDescription
groupstringFilter by group.
includeProgressbooleanAlso say how close each active thesis is to its next condition (and its nearest invalidation), with `closest` to sort by. A few extra reads; leave off for a plain list.
includeStorybooleanAlso give each active thesis a one-line `storySummary` { beats, last { date, sentence }, needsNext, replaySummary }: the story dwlf_get_thesis_story tells, in brief (replaySummary null until a step is…
statusstringFilter: waiting, in_progress, complete, challenged, archived or closed.
symbolstringFilter by thesis symbol.

dwlf_get_thesis

One thesis in full: every condition with its state, the revisions (earlier ones are kept), its fires (what happened, when DWLF could know it) and liveness. Read `currentRevision` here before dwlf_revise_thesis or a review that revises.

ParameterTypeDescription
thesisId *stringThesis ID

dwlf_get_thesis_story

One thesis told as a story, in steps ("beats"): what happened (saved, revisions, the cycle windows, the engine events its conditions name, its fires), where it stands now, and what each unmet step needs next. Each beat has a plain `sentence`, `knowableAt` (when DWLF could first know it), `checkedAs` (the condition it speaks to, in its label's words) and `means` (what it does to the steps). Also the plan as drawn when a revision was saved (`plan`, stored once and never changed; `planNote` says when it was reconstructed after the fact or none was captured), `definitions`, a `disclaimer` and `dee…

ParameterTypeDescription
thesisId *stringThesis ID
replaybooleanAlso return `replay`: the plan as drawn told against what happened (open once a step is met or the thesis has an outcome). Larger: every plan and checkpoint.
revisionintegerWhose plan as drawn to return (1..currentRevision). Default: the current revision.

dwlf_revise_thesis

Change a thesis: writes a new revision and keeps the earlier ones. Send expectedRevision (the currentRevision you read; 409 REVISION_CONFLICT if it moved) and only the fields to change. steps/invalidation, when sent, replace the whole list: keep each unchanged condition's id so it keeps its arming and result. A changed or new condition is armed from now (nothing before counts). Same refusals as create (422 CANNOT_OCCUR / ALREADY_MET), for the changed conditions only. Use dryRun: true first: the same check for the revision (only the changed conditions, listed in `changed`, are judged; an unchan…

dwlf_review_thesis

Record the user's answer to a thesis (usually a challenged one): keep (unchanged; clears the challenge), revise (a new revision: send expectedRevision and the fields to change, as dwlf_revise_thesis) or close (ends it, with an outcome). Record the user's own answer; do not choose it for them. For revise, dryRun: true checks the revision first (as dwlf_revise_thesis), writing nothing.

dwlf_mark_thesis_condition_met

Mark one of a thesis's MANUAL conditions met (once), with an optional note: something only the user can judge (e.g. "the news I was waiting for came out"). The nightly check records it on its next run. Only manual conditions can be marked (400 NOT_A_MANUAL_CONDITION); a second mark is 409 ALREADY_MARKED.

ParameterTypeDescription
conditionId *stringThe manual condition's id (from dwlf_get_thesis).
thesisId *stringThesis ID
notestring

dwlf_archive_thesis

Archive a thesis: it is kept, with its revisions and fires, in the journal and is no longer checked. To end it with an outcome instead, use dwlf_review_thesis with answer close.

ParameterTypeDescription
thesisId *stringThesis ID

dwlf_delete_thesis

Permanently delete a thesis with its revisions and fires. This cannot be undone; dwlf_archive_thesis keeps the record instead. Confirm with the user first.

ParameterTypeDescription
thesisId *stringThesis ID

dwlf_list_thesis_fires

The feed of thesis fires, oldest first: each time a step was met, a condition was missed, an invalidation was hit or a deciding event was withdrawn, across all the user's theses. Pass back the returned `cursor` next time to read only new fires (each fire is read once). The cursor is yours to keep (this server stores nothing): with none, the feed pages from the oldest fire, and the ones the user has not seen are the loud fires with `acknowledgedAt` null. `knowableAt` is when DWLF could first know it; `session` the bar. Closes are withheld for keys not entitled to raw prices. After telling the u…

ParameterTypeDescription
cursorstringThe cursor from your last read; omit to start from the oldest.
limitintegerDefault 50.

dwlf_ack_thesis_fires

Acknowledge fires the user has seen (up to 100 per call), so the app stops showing them as new. Pass { thesisId, fireId } pairs from dwlf_list_thesis_fires or dwlf_get_thesis.

ParameterTypeDescription
fires *array

dwlf_describe_onchain_events

What does a Bitcoin on-chain event mean? Describes the `onchain.*` event types: the plain-English condition, the inputs and threshold, the history start, how often it has fired, the method version and the caveats. Packs: `engine` (the types DWLF's engine evaluates: cost-basis crosses, MVRV, supply in profit, STH-SOPR, cohorts, dormancy, CDD, whale transfers) and the onchain-packs (`quantum`, `mining`, `fees`, `dca`, `regime`, `blockspace`). No arguments → the packs with their summaries. `pack` → that pack's types. `eventType` → one type: `event` (its summary line) and `definition` (the f…

ParameterTypeDescription
eventTypestringOne event type id, e.g. onchain.mining.hash_ribbon.capitulation.enter
packstringOne pack: engine, quantum, mining, fees, dca, regime, blockspace
searchstringWords to find in an id or meaning, e.g. "hash rate" or "consolidation"

dwlf_explain_event

Explain one Bitcoin on-chain event type (`onchain.*`) and, for the types the engine evaluates, its occurrences. Gives the DEFINITION: meaning, method and version, inputs, threshold, history start, caveats, `revision` (can this event's history change under you, and why: immutable / oracle / model / estimated), `measuredHistory` (how often it fired on DWLF's node, by year, dated) and `inEngine`. With `inEngine: true` it also gives OCCURRENCES: `date` = that day's occurrence (or the nearest days either side); `since` = what changed, as three disjoint buckets placed by the day a row became knowabl…

ParameterTypeDescription
eventType *stringAn onchain.* event type id, e.g. onchain.sth_sopr.lose (a `#…` row-key suffix is ignored)
datestringYYYY-MM-DD: explain the occurrence on this day
sincestringYYYY-MM-DD: what fired, was first published, or was restated on or after this day