Chart markup
This drives the browser the user is already signed into, over the Chrome DevTools Protocol, on Stockbit's own chart page. It is the one place this server touches a UI, and everything it draws lands in the user's real saved layout.
The sequence
chartbit_open symbol=…— put the chart in front of them.resolutionandchart_typeset the timeframe and style. Do this first; everything below acts on the open chart.chartbit_analyze symbol=…— derive support, resistance and trend lines from the bars.min_touchescontrols how much evidence a level needs;lookbackhow far back to look. Withdraw=trueit draws what it found in one step, andreplace=trueclears the previous set instead of stacking on it.chartbit_draw symbol=… annotations=… anchor_date=…for anything specific. Times are epoch seconds, andanchor_dateis what the annotation coordinates are relative to. Getting this wrong puts a line in 1970, which is visible but not useful.chartbit_study symbol=… study=…for indicators. The studies are a closed list — the tool description names them. A study Stockbit does not have cannot be added by asking twice.chartbit_screenshot symbol=…to see the result, andchartbit_save symbol=…to keep it.
Rules
- Saving is explicit. Stockbit autosaves on its own schedule, which is not yours: if the user
wants the markup to survive, call
chartbit_save. Say that you did. replaceversus stacking. Runningchartbit_analyzethree times withoutreplace=trueleaves three sets of lines on the user's real chart. Preferreplace=trueunless they asked to add to what is there.- This is their chart. Do not clear a layout you did not draw without asking. There is no undo.
- Check the drawing landed. Take the screenshot. The CDP call can succeed while the chart rejects the annotation.
- A blank white page means signed out. Stockbit's chart renders nothing at all when there is no session — no login prompt, nothing. If the screenshot is blank, that is what happened, and the fix is a login in that browser, not a retry.