dwlf_create_thesis
Save what you are waiting for on a symbol and why, as ordered conditions plus optional invalidation. DWLF checks nightly after the close and alerts when a step is met or the thesis is challenged.
Instructions
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 the confirming low exists, an invalidation cannot be "a close below the new low": use engine_event cycle.low.break (the latest confirmed low breaks) or a close_vs_level against a level the user already knows. Worked examples: dwlf_thesis_guide.
Use dryRun: true first: it restates every condition in plain words (checks) and checks each can occur, writing nothing. Show the restatement to the user before saving.
Refusals: 422 CANNOT_OCCUR (a condition can never happen for its symbol), 422 ALREADY_MET (a step condition is already true now; set allowAlreadyMet to save anyway). The refusal's checks are returned.
clientKey makes the call an upsert (re-sending an identical thesis writes nothing; a changed one writes a new revision). 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 (invalidation only: the stored window closes with no pivot of its side; only when the user asks to void the thesis by time), trendline_break, engine_event (a short allow-list), manual. Full parameters and definitions: dwlf_list_thesis_condition_types.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"symbol": "<symbol>",
"title": "<title>",
"steps": "<steps>"
},
"name": "dwlf_create_thesis"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| group | No | Optional grouping, e.g. a watchlist name. | |
| steps | Yes | Ordered: step n+1 is checked only after step n is met. Limits: dwlf_list_thesis_condition_types. | |
| title | Yes | One line: what you are waiting for. | |
| dryRun | No | Restate and check only; nothing is saved. | |
| symbol | Yes | The thesis symbol, e.g. AMZN, BTC-USD. | |
| context | No | Your assessment, why you are waiting. Replayed verbatim in every alert. | |
| nextStep | No | What you intend to look at when it fires (your words). | |
| clientKey | No | Your stable key for this thesis (e.g. "amzn-dcl-nov"), making re-sends safe. | |
| invalidation | No | Any one of these happening marks the thesis challenged (review it). Optional. window_closes goes only here. | |
| allowAlreadyMet | No | Save even if a step condition is already true now. |