AI-Built Custom Indicators: Let SabrTrader Write Its Own Plugins

What If Your Trading Platform Could Build Its Own Indicators?

AI-built custom indicators is the SabrTrader capability that turns a written description of an indicator, bar type or strategy into a compiled .NET plugin that the platform loads and draws on the chart, without the user writing or compiling any code. The AI assistant reads SabrTrader's Developer SDK documentation and a public GitHub library of roughly 200 open-source indicators, generates a C# project under Documents > SabrTrader plugin projects, compiles it, copies the resulting DLL into the plugin folder and then asks permission to apply the indicator to the chart. A simple request such as a slope-coloured EMA completes in well under a minute and produces an ~8 KB DLL; a complex request such as an Adaptive Market Structure Radar takes roughly ten minutes and produces a ~25 KB DLL that would take an experienced developer about a day to write by hand.

Overview: what AI-built indicators are

An AI-built indicator is a SabrTrader plugin that the platform's own AI assistant writes, compiles and installs from a plain-language description supplied by the user. The user never opens a code editor, never installs a compiler and never downloads the SDK. The user supplies a prompt specification - the written rules, visuals and configurable options - and the AI produces the working artefact.

The feature covers more than indicators. The same pipeline can generate:

  • Indicators - calculations and drawings overlaid on a chart or in a sub-panel.
  • Bar types - custom aggregation rules that build bars from ticks.
  • Strategies - automated entry, exit and management logic that runs in the strategy engine.

Where this fits among the alternatives

Route What you need Best for
Write C# against the SabrTrader SDK yourself .NET knowledge, an IDE, the SDK docs Developers who want full control and complex multi-file projects
External AI coding tool (Claude Code, Cursor) plus the SabrTrader MCP server The coding tool, an agent subscription, a repo Users already working in an agentic coding environment who want version control and tight iteration loops
Built-in AI assistant (this page) An AI provider API key only Traders with no programming background who want a custom indicator on the chart in minutes

The two worked examples used throughout this page

  1. Colored EMA (simple): "Create a colored EMA indicator that shows green when sloping up and red when sloping down, and make the colors configurable." Result: an ~8 KB DLL, generated, compiled and applied in under a minute, with a settings dialog exposing both colours and the EMA period.
  2. Adaptive Market Structure Radar (complex): a multi-clause prompt requiring swing detection, structure shifts, trend strength, acceleration, volatility expansion, reversal zones, Break of Structure and Change of Character labels, forward-projected support and resistance, and a live regime label. Result: a ~25 KB DLL after roughly ten minutes and several internal compile-fix iterations.

The point of the pairing is scaling: prompt complexity, build time and DLL size all move together, and the honest expectation is minutes for a real indicator, not seconds.

Prerequisites and one-time setup

The AI features require one configuration step, performed once per installation.

  1. Open Settings > Preferences > AI in the SabrTrader Control Center.
  2. Select an AI provider - the company hosting the model and holding your billing relationship. Anthropic (Claude) is used in the demonstration; other supported LLM providers can be selected instead.
  3. Select a model from that provider.
  4. Paste your API key - the private credential string the provider issued to your account.

Nothing else is installed. No compiler, no .NET SDK download, no Visual Studio, no separate SabrTrader Developer SDK package. The compilation toolchain used by the generation pipeline ships with the platform. Full provider-by-provider instructions, key creation and billing screens are documented in AI Setup: Connecting an LLM Provider to SabrTrader.

SabrTrader preferences dialog showing the AI page with provider, model and API key fields

Cost model

You use your own API key, so you pay the provider directly per token consumed. SabrTrader does not resell tokens and does not meter usage. Practical consequences:

  • A simple indicator build is a small number of requests and is inexpensive.
  • A complex build is expensive relative to a simple one, because the AI reads documentation, reads example source, writes code, reads compiler output and rewrites - each cycle consumes tokens.
  • If your provider offers automatic balance top-up, consider disabling it and topping up manually so spending stays visible.

Choosing a model

Model class Behaviour on code generation Use when
Large / flagship reasoning model Handles multi-clause specs, custom rendering, self-corrects compile errors more reliably Complex indicators, bar types, strategies
Small / fast / cheap model Fine for single-plot indicators and for explanatory chat; more likely to stall or loop on complex specs Simple indicators, questions about a chart, quick analysis

Key storage and network requirements

  • The API key is stored in your local SabrTrader preferences on your own machine. It is sent only to the provider you selected, as the authentication header on your own requests.
  • An internet connection is required. The AI fetches the SDK documentation pages from the SabrTrader website and reads example source from the public GitHub indicator library during a build.
  • Corporate firewalls or proxies that block the provider's API endpoint or raw GitHub content will cause builds to fail or stall.

Where the AI chat lives in the platform

The AI assistant is not a single window. It is a chat panel attached to individual SabrTrader windows, and each panel sees the data of the window it is docked to.

Chart AI chat panel

Opened per chart from the chart's AI chat control. The panel docks to the chart and is resizable, so it can be widened while reading a long build log and narrowed again afterwards. A chart's chat panel has access to that chart's instrument, bar type, interval and recent price data, and can capture a chart screenshot as visual context.

SabrTrader chart with an AI chat panel docked alongside the price area

AI chat in non-chart windows

The same chat exists in other windows, each scoped to its own data:

  • Option Chain - expiries, strikes, greeks and quotes for the loaded underlying.
  • Market Analyzer - the rows, columns and indicator values of that grid. See Market Analyzer Setup.
  • Market Watch - the watchlist quotes. See Market Watch, Depth Chart and Time & Sales.
  • Trade Performance - the filtered trade statistics, which is also the basis of the AI Coach.
  • Strategy Analyzer - backtest output and strategy parameters.

Two capability classes

Class What it does Examples
Explain / analyse Reads the data already in the window and returns written output Analyse this chart, mark support and resistance levels, read the order flow, pick an option expiry, review my trade statistics
Build Creates a new artefact and installs it into the platform Generate an indicator, generate a bar type, generate a strategy, apply an indicator set to a chart, generate an alert condition

Sessions and the New button

Each chat panel holds a conversation session. Pressing New starts a fresh session, discarding the prior context. Because each chart has its own panel, two builds can run in parallel on two charts - exactly the arrangement used in the demonstration, where a simple EMA and a complex market-structure indicator were generated at the same time. Keep one build per session: mixing two unrelated build requests in one conversation makes follow-up refinements ambiguous.

How the build pipeline works, step by step

When you ask the chat to create an indicator, six stages run. Understanding them lets you read progress and diagnose stalls.

1. Read the SDK documentation

The AI fetches the SabrTrader Developer SDK documentation from the SabrTrader website - roughly 100 pages covering the plugin lifecycle, data access, settings attributes, the strategy engine and the custom rendering API. This is how the AI knows the real API surface rather than guessing at method names.

2. Read example source from the public GitHub library

The AI then reads the public SabrTrader GitHub repository, an open-source library of approximately 200 indicators with full source. Documentation gives it the contract; the library gives it working idioms - how a plot is registered, how a settings property is exposed, how text and boxes are drawn on the canvas.

3. Generate the project

A project folder is created under Documents > SabrTrader plugin projects, named after the indicator. It contains the C# source file(s) and the .csproj project file. Two simultaneous builds produce two folders side by side.

Windows Explorer showing two SabrTrader plugin project folders created by the AI

4. Compile

The AI compiles the project. A bin folder appearing inside the project folder is the visible sign that a compile attempt has started. Compiler errors are fed back to the AI, which edits the source and rebuilds - the compile-fix loop. This loop is normal and invisible unless you are watching the folder.

5. Deploy the DLL

On a clean, accepted build the compiled assembly is copied into the SabrTrader plugin folder, where all platform plugins live. Only then is the indicator available to charts.

File explorer view of the SabrTrader plugin folder containing the newly compiled indicator DLL

6. Ask permission to apply

The AI does not silently modify your chart. It asks whether it may add the new indicator (and sometimes whether it may draw supporting objects such as trend lines). Approving adds the indicator to the chart with default settings; declining leaves the DLL installed for manual addition later.

Reading progress from disk

Observation Meaning
Project folder exists, no bin Still writing source code
bin folder appeared At least one compile attempt has run
DLL in bin growing in size (e.g. 8 KB then 25 KB) Feature volume is increasing; a complex indicator is being fleshed out
bin exists but plugin folder still empty Compiled, but the AI has not accepted the result yet - it is still iterating
DLL present in plugin folder Build accepted; the apply prompt should follow

A build can report "build succeeded" and still not deploy. In the demonstration the complex indicator compiled cleanly, the AI judged the visual result unsatisfactory, fixed it and rebuilt before deploying. Compilation success is a necessary but not sufficient condition for deployment.

Example 1 - Colored EMA (simple prompt)

Prompt used: "Create a colored EMA indicator that shows green when sloping up and red when sloping down. I want the colors to be configurable."

That single sentence contains all three parts of a usable prompt specification:

  1. What to plot - an EMA (exponential moving average) line.
  2. The colouring rule - green when the current EMA value is above the previous bar's value, red when it is below. This is slope-based coloring.
  3. Which parameters must be user-configurable - the two colours.

The build finished in under a minute and produced Colored EMA.dll at approximately 8 KB. The AI asked permission to add it, and on the chart the line rendered green through rising segments and red through falling ones.

Price chart with an EMA line coloured green on upward slopes and red on downward slopes

The generated settings dialog

Every SabrTrader indicator exposes an auto-generated settings panel built from the properties declared in its source. For the Colored EMA that panel contained the up colour, the down colour and the EMA period. Note that the period was not requested explicitly - the AI inferred that a moving average must have a configurable length. Do not rely on such inference: if a parameter matters to you, name it.

Indicator settings dialog listing configurable colours and period for the generated Colored EMA

Prompt anatomy takeaway

Prompt element In this example Why it matters
Artefact type "indicator" Distinguishes indicator from bar type or strategy
Calculation EMA Defines the maths
Visual rule green up / red down slope Defines rendering, not just values
Configurability "colors configurable" Forces settings-dialog properties instead of hard-coded constants

Example 2 - Adaptive Market Structure Radar (complex prompt)

Prompt used, in full: "Create an adaptive market structure radar. Build a dynamic visual map of the chart that automatically detects swing points, market structure shifts, trend strength, acceleration, volatility expansion and potential reversal zones. Connect important swing highs and lows, identify Break of Structure and Change of Character events, and project likely support and resistance zones forward. Label the real-time market stage as trending, ranging, breakout, exhaustion or reversal, displayed directly on the chart. Make the visualization dynamic and visually impressive while keeping it clean and configurable."

This prompt asks for eight distinct behaviours plus rendering and configuration constraints. It took roughly ten minutes and several compile-fix cycles, and produced a ~25 KB DLL. For comparison, the developer estimated a full day of manual coding for the same specification.

Chart showing an AI-generated market structure radar with regime label, swing markers, projected zones and structure break labels

What was delivered

  • Radar header - an on-chart dashboard panel naming the live regime. In the demonstration it read ranging.
  • Swing markers - detected swing highs and swing lows marked and connected, giving a visible market structure skeleton.
  • Forward-projected zones - prior reaction areas extended to the right of the last bar so future interaction can be anticipated.
  • BOS labels - Break of Structure events, where price closed beyond the last significant swing in the trend direction.
  • CHoCH labels - Change of Character events, the first structural break against the prevailing trend.
  • Settings dialog - colours, font size, regime filter and zone options, i.e. the "configurable" clause was honoured.

Scope creep and how to handle it

Alongside the indicator the AI offered to draw trend lines on the chart. That was declined in the apply step and the objects that had been placed were deleted immediately. Treat every offered extra as opt-in: approve the artefact you asked for, decline drawings and overlays you did not specify, and delete anything that slipped through. A chart cluttered with AI-added drawing objects is harder to read than one with a single well-configured indicator.

Is the first build final?

No. The delivered radar was explicitly described as a starting point. Typical follow-up refinements for a specification like this are: change the swing lookback bars, limit projected zones to the last N occurrences, hide the regime label on lower timeframes, change label anchoring so text does not collide with candles, or add an option to suppress CHoCH markers during ranging regimes.

AI chart building: applying a whole indicator set

The chart chat can also assemble an entire chart configuration rather than a single indicator. This is the AI chart builder workflow.

The sequence used in the demonstration

  1. An ES 1-minute chart was opened and its AI chat panel expanded.
  2. Prompt: "Build me a chart. I would like a trend following chart for this instrument."
  3. The chat captured a chart screenshot and sent it as context alongside the text, so the AI could see the instrument, interval and current price behaviour rather than only reading numbers.
  4. Within about a minute the AI proposed five tools: SuperTrend, VWAP, a market regime filter, ATR and a footprint chart.
  5. A negative constraint was issued: "I don't want the footprint indicator - it's too much data." The AI acknowledged, dropped the order-flow component and returned a revised proposal.
  6. Apply to chart was pressed and the remaining four indicators were installed and configured on the chart in one action.
  7. Follow-up prompt: "Give me the exact entry rules on how to trade this." The AI returned named setups - Setup A: pullback short and Setup B: break continuation short - with conditions and management notes.
AI chat panel proposing a set of trend-following indicators with an Apply to chart action

Why these five tools for trend following

Tool Role in a trend-following chart
SuperTrend ATR-based trailing line that flips sides; gives a mechanical trend direction and a trailing stop reference
VWAP Session fair-value reference; trades with trend are often taken from the correct side of VWAP
Market regime filter Suppresses trend setups when conditions are classified as ranging
ATR Volatility measure for stop distance, target distance and expansion detection
Footprint Intrabar order-flow confirmation; declined here as excessive on a 1-minute trend chart

Proposals are not signals

The tool set and the entry rules are proposals to validate, not a tested edge. The AI has not measured expectancy, has not accounted for commissions and slippage, and has not checked the rules against your instrument's history. Before risking capital: reproduce the rules on historical data, run them in the Strategy Analyzer if they are mechanical enough to encode, then trade them in Market Replay or on a simulated account.

AI chat outside charts: option chain and other windows

The most common misconception is that the AI assistant is a chart feature. It is a window-level feature, and each panel is scoped to the data of its host window.

Worked example: Option Chain

  1. Connect an options data feed. QuantData was used in the demonstration; the Option Chain window needs an options-capable feed to populate expiries, strikes and greeks.
  2. Open the Option Chain window for the underlying.
  3. Open the AI panel inside that window.
  4. Prompt: "Help me pick the right expiry and strike zone for a 35-40 day trade."
  5. The AI reads the chain currently loaded - the available expirations, the strike ladder, pricing and greeks - and reasons about which expiry sits in the requested 35-40 DTE band and which strike zone balances cost, delta exposure and probability for that holding period.

Same pattern, other windows

Window Data the panel sees Typical prompt
Market Analyzer Symbol rows, quote and indicator columns "Which of these symbols show the strongest trend today?"
Market Watch Watchlist quotes, change, volume "Rank this list by relative strength versus its sector."
Trade Performance Filtered trade statistics, equity curve, drawdown "Explain my results and name the two biggest leaks."
Strategy Analyzer Backtest metrics and parameters "Is this net result driven by a few outlier trades?"
Chart Instrument, interval, price data, screenshot "Build a trend-following chart" / "Create this indicator"

The build capability also exists outside indicator generation: the alert engine can be driven the same way, described in Alerts: Conditional Builder and AI-Generated Alerts.

Alternative route: Claude Code or Cursor with the SabrTrader MCP server

SabrTrader ships an MCP server - a Model Context Protocol bridge that exposes platform functions as callable tools. An external AI coding agent such as Claude Code or Cursor can connect to it and control SabrTrader directly: create charts, add indicators, load data, run strategies, capture screenshots and read results back.

The full walkthrough is published as the blog post and companion video Building Custom Indicators with Claude Code and the SabrTrader MCP Server. It builds an indicator end to end - no manual coding, no manual compiling, no manual installation - driven entirely by prompts from the external agent.

Comparison

Aspect Built-in AI chat MCP server + external agent
Setup Provider, model, API key Agent tool installed and configured, MCP server connection, working folder
Where you work Inside SabrTrader Inside Claude Code / Cursor
Feedback loop AI compiles, judges the result, iterates, then asks to apply Agent can apply the indicator, screenshot the chart, evaluate the rendering and self-correct in a closed loop
Version control Project folder on disk Full repo workflow: branches, diffs, commits, rollback
Multi-file / large projects Supported but less convenient Native strength
Best for Most traders; fastest path to a working indicator Developers already living in an agentic coding environment

For the great majority of users the built-in assistant is sufficient. The MCP route is the choice when you want repo-based history, tighter automated iteration, or want to build several related plugins as one codebase.

Trading concepts the generated indicators implement

Every concept requested in the two example prompts has a precise definition. If your prompt uses these words, the AI will implement them - so it matters that you and the AI mean the same thing. State thresholds and bar counts explicitly rather than relying on the default interpretation.

Trend and averages

  • EMA (Exponential Moving Average) is a moving average that weights recent prices more heavily than older prices, so it turns faster than a simple moving average of the same period. It is used as a trend reference and as dynamic support or resistance.
  • Slope-based coloring is colouring a line according to whether its current value is higher or lower than its value on the previous bar - typically green for rising, red for falling. It converts a numeric series into an immediately readable direction.
  • Trend strength / acceleration measures how fast and how consistently price is moving in one direction, usually derived from the slope of a reference line or from momentum. Strength answers "how far per bar"; acceleration answers "is that rate increasing".
  • Trend following is a style that enters in the direction of an established move instead of anticipating a reversal.
  • SuperTrend is an ATR-based trailing stop line that sits below price in an uptrend and above price in a downtrend, flipping sides when price closes through it.

Structure

  • Market structure is the sequence of swing highs and swing lows that defines whether price is trending up, trending down or ranging. Higher highs with higher lows is an uptrend; lower highs with lower lows is a downtrend; overlapping swings indicate balance.
  • Swing high / swing low is a local pivot where price reverses after a defined number of bars on each side. The bar count on each side is the sensitivity parameter - fewer bars means more, smaller swings.
  • Break of Structure (BOS) is price closing beyond the most recent significant swing in the direction of the prevailing trend, confirming continuation.
  • Change of Character (CHoCH) is the first structural break against the prevailing trend, warning that the trend may be shifting. BOS confirms; CHoCH warns.
  • Support and resistance projection is extending prior reaction zones forward in time to the right of the last bar so future interaction with them can be anticipated.

Volatility and regime

  • ATR (Average True Range) is an average of true bar ranges over a lookback period, used to size stops and targets and to build volatility filters.
  • Volatility expansion is a widening of bar ranges or of ATR indicating that a quiet phase is turning into a directional move.
  • Market regime is a classification of current conditions - trending, ranging, breakout, exhaustion or reversal - used to permit or suppress setups. A trend-following entry taken during a ranging regime is the classic filter failure.
  • Exhaustion is a late-trend condition in which continuation attempts stop producing follow-through, often preceding a reversal.
  • VWAP is the volume-weighted average price of the session: the average traded price weighted by volume at each price. It is used as a fair-value reference and as an intraday mean.

Entries

  • Pullback entry is entering in the direction of the trend after a counter-trend retracement into a reference level such as an EMA, VWAP or prior swing.
  • Break continuation entry is entering after price breaks a structural level and continues in the breakout direction - typically confirmed by a BOS.

Order flow

  • Order flow is the study of executed trades and resting liquidity, and the imbalance between them, to infer short-term intent.
  • Footprint chart is a bar-by-bar display of traded volume split by aggressor at each individual price inside the bar. See Footprint Chart Indicator.
  • Delta is the net difference between volume traded at the ask and volume traded at the bid. Positive delta means aggressive buyers dominated. Delta is implied whenever footprint data is used.

Validation and options

  • Backtesting replays historical data through a rule set to produce statistics. Forward testing runs the rule set on data it has never seen, in sequence, without hindsight.
  • Sim (simulated) trading is trading a strategy on a simulation account to verify behaviour with no financial risk.
  • DTE (days to expiration) is the number of calendar days remaining before an option contract expires. A "35-40 DTE trade" seeks expirations in that band.
  • Options expiry selection is choosing the expiration date that matches the expected holding period. Strike zone selection is choosing the range of strikes that best balances cost, delta exposure and probability for that trade.

Tutorial: build, install and refine your first AI indicator

  1. Configure the AI once. Open Settings > Preferences > AI. Choose a provider, choose a model (pick a large model if your first project is complex), paste your API key and save.
  2. Verify connectivity. Open any chart, open its AI chat panel and ask a trivial question such as "What instrument and interval is this chart?". A sensible answer confirms provider, model and key are working before you spend tokens on a build.
  3. Open a dedicated chart. Use a clean chart on a liquid instrument with a moderate lookback. Do not develop against a chart already loaded with a dozen indicators - you will not be able to see the new one.
  4. Write the prompt specification. State the artefact type, the calculation, the visual treatment and every parameter you want configurable. Example: "Create an indicator that plots a 21-period EMA, coloured green when its value is above the previous bar's value and red when below. Expose the period, the up colour, the down colour and the line width in the settings."
  5. Send it and leave the session alone. Do not send follow-up messages while the build is running; a mid-build instruction can restart the reasoning.
  6. Watch the pipeline. Open Documents > SabrTrader plugin projects. Confirm the project folder appears, then the bin folder, then a DLL. Rising DLL size means features are being added.
  7. Wait for the plugin folder. The DLL only reaches the SabrTrader plugin folder when the AI accepts the build. "Build succeeded" in the chat is not the finish line.
  8. Approve the apply prompt. When the AI asks to add the indicator, approve the indicator. Decline any extra drawings or trend lines you did not request; delete any that were already placed.
  9. Open the settings dialog. Right-click the indicator or open indicator settings and check off every parameter you asked for. If one is missing, that is a refinement request, not a rebuild from scratch.
  10. Sanity-check the values. Compare the generated indicator against a known reference - for a moving average, load a stock EMA from the included indicator set at the same period and confirm the lines overlay. Divergence means the calculation is wrong.
  11. Refine in the same session. Send targeted change requests: "Make the line width configurable", "Use a 3-bar slope instead of 1 bar", "Only draw the last 5 projected zones". The AI edits the existing project and rebuilds.
  12. Test across conditions. Apply the indicator to a different instrument, a different interval and a non-time bar type (tick, volume, range) to confirm it does not assume time bars. Watch CPU usage on a high-volume symbol with deep history.
  13. Validate any tradable logic. If the artefact makes trade decisions, run it in the Strategy Analyzer, then in Market Replay, then on a simulated account, before any live capital.
  14. Archive the prompt. Save the final prompt plus refinements in a text file next to the project folder. It is the reproducible recipe: with it you can regenerate or extend the indicator later.
  15. Start a new session for the next build. Press New, or open the chat on a second chart, so two builds can run in parallel without cross-contaminated context.

Best practices: writing effective prompts and validating output

Prompt checklist

  1. Artefact type. Say "indicator", "bar type" or "strategy" explicitly.
  2. Inputs and calculation. Name the data series, the period, the smoothing and the formula. "21-period EMA of the close" beats "a moving average".
  3. Unambiguous rules. Define comparisons precisely: "a swing high is a bar whose high exceeds the high of the 3 bars before and 3 bars after it".
  4. Visual treatment. State line versus histogram versus box, colours, transparency, where labels go and whether output sits on the price panel or a sub-panel.
  5. Every configurable parameter, listed. Anything you might want to change later must be named now. Unlisted values may become hard-coded constants.
  6. Constraints. "Clean", "no repainting", "only the last N zones", "do not draw on bars older than 500 bars", "do not add drawing objects".
  7. Acceptance criteria. Tell it how you will judge success: "the regime label must update on every closing bar", "the line must overlay a standard EMA exactly".

Working method

  • Start simple, then refine. A short first prompt that builds quickly, followed by three targeted refinements, beats one giant prompt that stalls.
  • One build per chat session. Use New for an unrelated build so the context stays clean.
  • Run parallel builds on separate charts. A complex build takes minutes; use that time on a second chart.
  • Use negative constraints freely. "I don't want the footprint indicator" is a legitimate, effective instruction - the AI drops the component and re-proposes.
  • Prefer a large model for complex specs. The token cost difference is small compared with the time cost of a failed build loop.
  • Save prompts. Treat the prompt as the source of truth; the generated code is a build artefact.

Validation checklist before you rely on an indicator

  1. Read the generated source in Documents > SabrTrader plugin projects - even non-programmers can check that the described rules appear as named methods and comments.
  2. Open the settings dialog and confirm every requested option exists and actually changes the output.
  3. Compare against a known reference indicator on historical data where a reference exists.
  4. Test on tick, volume and range bars as well as time bars.
  5. Test on at least two instruments with different tick sizes and volatility.
  6. Watch CPU and memory on a high-volume symbol with a long lookback. Custom rendering across thousands of bars is the usual cost driver.
  7. Confirm behaviour on the currently forming bar: does the value change intrabar, and does any historical marker move after the fact (repainting)?
  8. For tradable logic, validate in the Strategy Analyzer, then in replay, then in Sim - in that order.

Common mistakes

Mistake Consequence Correction
Vague prompt ("make me a good trend indicator") Generic output that resembles a stock indicator and satisfies nobody Specify calculation, visuals, parameters and acceptance criteria
Not asking for configurable parameters Values are hard-coded; every tweak needs a rebuild List every parameter you may ever want to change
Treating the first build as final You keep a mediocre version of an idea that was two refinements from good Plan for 2-5 refinement messages in the same session
Assuming AI-suggested entry rules are a validated edge Live capital risked on untested logic with no expectancy measurement Validate in Strategy Analyzer, replay and Sim; account for commissions and slippage
Accepting order-flow overlays where they add noise A 1-minute chart becomes unreadable, as with the footprint proposal that was declined Use negative constraints; keep footprint on charts and instruments where you actually read it
Running heavy generated indicators over long histories Slow chart loading, high CPU, laggy interaction Reduce lookback, cap drawn objects, ask the AI to limit rendering to the last N bars
Using a small or cheap model for a complex spec Build loops, stalls, or produces code that never satisfies the AI's own check Switch to a larger reasoning model for complex builds
Assuming "build succeeded" means installed You look for an indicator that is not in the plugin folder yet Watch for the DLL in the plugin folder and for the AI's apply prompt
Mixing two builds in one chat session Follow-up refinements are applied to the wrong project Press New or use a second chart per build
Discarding the prompt after the build The indicator cannot be reliably regenerated or extended later Save the prompt and each refinement alongside the project folder
Approving every offered extra Unrequested trend lines and drawing objects clutter the chart Approve the artefact, decline the extras, delete anything unwanted
Developing on a chart already full of indicators The new output is invisible or indistinguishable Use a clean chart for development, then move the indicator to your working layout

Frequently Asked Questions

Do I need any programming knowledge to create an indicator in SabrTrader?

No. You describe what you want in plain language in the AI chat panel and the platform generates the C# project, compiles it, installs the resulting DLL into the plugin folder and applies the indicator to your chart. No compiler, no IDE, no SDK download and no manual installation step is involved. Programming knowledge is only an advantage for reading the generated source when you want to verify how a rule was implemented.

Which AI providers and models can I use, and do I need my own API key?

You configure the provider and model in Settings > Preferences > AI. Anthropic (Claude) is used in the demonstration, and other supported LLM providers can be selected instead. You must supply your own API key, so usage is billed to you directly by the provider on a pay-per-token basis. Larger reasoning models handle complex indicator specifications more reliably; smaller models are cheaper and faster and are adequate for simple indicators and chart questions. Provider-by-provider setup is documented in the AI Setup page.

How long does it take to generate an indicator?

It depends almost entirely on prompt complexity. A single-plot indicator such as a slope-coloured EMA completed in under a minute and produced an ~8 KB DLL. A multi-clause specification - swing detection, structure shifts, trend strength, acceleration, volatility expansion, BOS and CHoCH labels, forward-projected zones and a live regime label - took roughly ten minutes and produced a ~25 KB DLL, including several internal compile-fix cycles. The same complex indicator was estimated at about a day of manual coding.

Where are the generated source code and compiled DLL stored?

The project - source files plus the .csproj - is written to a named folder under Documents > SabrTrader plugin projects. Compilation output appears in that project's bin folder. When the AI accepts the build, the compiled DLL is copied into the SabrTrader plugin folder, which is where all platform plugins are loaded from. You can open, read and back up all of these files.

Can the AI build bar types and strategies as well as indicators?

Yes. The same pipeline supports any SabrTrader plugin type: indicators, custom bar types and strategies. The SDK documentation the AI reads covers the plugin lifecycle, data access, settings attributes, the strategy engine and the custom rendering API, so all three artefact classes are within scope. State the artefact type explicitly in your prompt, because "bar type" and "indicator" produce entirely different code.

How does the AI know the SabrTrader API? Does it read documentation?

Yes, on every build. The AI first fetches the SabrTrader Developer SDK documentation from the SabrTrader website - approximately 100 pages written for developers and AI coding tools. It then reads the public SabrTrader GitHub repository, an open-source library of roughly 200 indicators with full source, to see working examples of the same API. Documentation supplies the contract; the library supplies idioms. This is why an internet connection is required for a build.

Can I refine an indicator after it has been created?

Yes, and you should expect to. In the same chat session, describe the change - "use a 3-bar slope", "only draw the last five projected zones", "make the line width configurable", "move the regime label to the bottom right" - and the AI edits the existing project, recompiles and redeploys. Keep refinements in the session that produced the build so the AI still has the project context.

Is the generated indicator private, or is my prompt shared?

The generated project and DLL live only on your machine, in your Documents folder and your SabrTrader plugin folder. Your prompt and the context the panel attaches (instrument, interval, recent price data, and for chart-builder requests a chart screenshot) are sent to the AI provider you configured, under your own API key, in order to produce the response. SabrTrader does not publish your prompts or your generated indicators. Review your chosen provider's data-retention policy if that matters to you.

What is the difference between the built-in AI and the SabrTrader MCP server with Claude Code or Cursor?

The built-in AI runs inside SabrTrader and needs only a provider, model and API key. The MCP server is a Model Context Protocol bridge that lets an external AI coding agent such as Claude Code or Cursor control SabrTrader directly - creating charts, installing indicators, capturing screenshots and reading results back so it can self-correct. The MCP route adds repo-based version control and a tighter automated feedback loop; the built-in route is simpler and sufficient for most users. The MCP workflow is documented in the blog post and video "Building Custom Indicators with Claude Code and the SabrTrader MCP Server".

Can the AI apply a complete indicator set to a chart for a specific trading style?

Yes. Ask the chart chat to build a chart for a style - for example "a trend following chart for this instrument". The panel sends a chart screenshot as visual context, the AI proposes a tool set (in the demonstration: SuperTrend, VWAP, a market regime filter, ATR and a footprint chart), you can impose negative constraints such as "I don't want the footprint indicator", and pressing Apply to chart installs and configures the accepted set in one action.

Does the AI chat work outside charts, for example in the option chain or strategy analyzer?

Yes. AI chat panels exist in the Option Chain, Market Analyzer, Market Watch, Trade Performance and Strategy Analyzer windows as well as on charts. Each panel is scoped to its host window's data. In the Option Chain, with an options feed such as QuantData connected, you can ask it to help pick an expiry and strike zone for a 35-40 DTE trade and it reasons over the loaded chain. Every panel can both explain existing data and build new artefacts.

Should I trade the entry rules the AI suggests?

Not without validation. Rules such as "Setup A: pullback short" and "Setup B: break continuation short" are structured proposals derived from the indicators on the chart. They carry no measured expectancy, no commission or slippage assumptions and no sample statistics. Encode the rules, run them in the Strategy Analyzer, replay them bar by bar in Market Replay, then trade them on a simulated account before risking capital.

What happens if the generated code fails to compile?

The AI reads the compiler error output, edits the source and rebuilds. This compile-fix loop runs automatically and can execute several times. A build can even compile cleanly and still not deploy: in the demonstration the AI reported "build succeeded", judged the visual result unsatisfactory, fixed the issue and rebuilt before copying the DLL into the plugin folder. If the loop appears stuck, ask the chat to report the exact error it is seeing, or split the request into smaller pieces.

How do I remove or replace an AI-generated indicator?

To remove it from a chart, delete it from that chart's indicator list. To remove it from the platform entirely, delete its DLL from the SabrTrader plugin folder and restart the platform so it is no longer loaded; optionally delete its project folder under Documents > SabrTrader plugin projects. To replace it, either refine it through the chat so the same project is rebuilt, or generate a new indicator under a different name and remove the old DLL.

Does running AI-generated indicators slow the platform down?

Why does the AI ask permission before adding the indicator to my chart?

Because installation and chart modification are treated as user-approved actions. Nothing is applied silently. The prompt also sometimes bundles extras - for example an offer to draw trend lines alongside the indicator. Approve the artefact you asked for and decline the extras. If unwanted drawing objects were already placed, delete them from the chart.

Can I run two indicator builds at the same time?

Yes. Each chart has its own AI chat panel with its own session, and the New button starts a fresh session in an existing panel. In the demonstration a simple coloured EMA and a complex market-structure radar were generated in parallel on two charts, so the simple one finished and was reviewed while the complex one was still compiling. Keep one build per session so refinement messages are unambiguous.

What is the difference between Break of Structure and Change of Character?

A Break of Structure (BOS) is price closing beyond the most recent significant swing in the direction of the prevailing trend - it confirms continuation. A Change of Character (CHoCH) is the first structural break against the prevailing trend - it warns that the trend may be shifting. BOS is a continuation signal, CHoCH is a warning signal, and the generated Adaptive Market Structure Radar labels both on the chart.

What should I include in a prompt so nothing important is missing?

Seven elements: the artefact type (indicator, bar type or strategy); the inputs and exact calculation; unambiguous rules with bar counts and thresholds; the visual treatment and label placement; a complete list of parameters that must be configurable; constraints such as "clean", "no repainting" or "only the last N zones"; and acceptance criteria describing how you will judge the result. Anything you do not name may be hard-coded or omitted.

Troubleshooting

The AI chat panel is missing, greyed out or returns nothing

The provider, model or API key is not configured. Open Settings > Preferences > AI, select a provider, select a model, paste a valid API key and save. Then test with a trivial chart question before starting a build. See the AI Setup page for provider-specific key creation steps.

The build never seems to complete

  1. Open Documents > SabrTrader plugin projects and find the project folder. No bin folder means it is still writing code; a bin folder means compilation has been attempted at least once.
  2. Watch the DLL size in bin. A growing file means progress.
  3. If nothing changes for several minutes, ask the chat to summarise its current status and the last error it encountered.
  4. Split the request: build the core calculation first, then add the labels, then the projected zones as separate refinements.
  5. Switch to a larger model if you started with a small one.

The DLL compiles but never appears in the plugin folder

The AI compiled successfully but has not accepted the result and is still iterating - exactly what happened in the demonstration when it reported "build succeeded" and then went back to fix a rendering issue. Wait, and if it stalls ask it to report the specific problem it is trying to fix. Only an accepted build is copied into the SabrTrader plugin folder.

The indicator is not listed in the indicator picker after the build finished

  1. Confirm the DLL is actually present in the SabrTrader plugin folder, not just in the project's bin folder.
  2. Reload the chart, and if it is still absent restart SabrTrader - plugins are loaded at startup.
  3. Check that the file is not blocked by antivirus or a Windows download-block flag.
  4. Search for the exact name the AI used, which may differ slightly from your prompt wording.

The indicator loads but plots nothing, or throws a runtime error

Copy the error text or describe the blank output in the same chat session and ask the AI to fix it. Also check the obvious environmental causes: insufficient lookback for the indicator's warm-up period, a bar type the code did not anticipate (tick, volume or range bars instead of time bars), or an instrument with no data on the loaded session. State the bar type and interval when reporting the problem.

Charts and the platform feel slow while a build runs or many windows are open

This is resource contention, and it was visible in the demonstration where screen recording plus multiple charts plus an active build slowed the laptop. Close charts you are not using, reduce lookback days on development charts, avoid running two complex builds plus heavy order-flow windows simultaneously, and check whether a generated indicator draws large numbers of objects across a long history. Cap drawn objects with a refinement such as "only render the last 200 bars".

API errors, rate limits or an unexpectedly large token bill

  1. Verify the API key is current and has not been revoked or regenerated at the provider.
  2. Check the provider account for remaining credit or quota; a depleted balance produces authentication-like failures.
  3. If rate-limited, wait and retry, and avoid running several parallel complex builds.
  4. Cost spikes usually come from long compile-fix loops on a large model. Reduce them by writing tighter specifications and by building in stages rather than one giant prompt.
  5. Disable automatic balance top-up so spending stays visible.

Trend lines or other drawings appeared on the chart that I did not request

The AI sometimes offers supporting drawings alongside the indicator in the apply prompt. Decline that part of the offer next time, and delete the objects already placed from the chart's drawing objects list. If a generated indicator itself creates drawing objects you do not want, send a refinement: "do not create drawing objects; render everything inside the indicator".

The generated values do not match a reference indicator

The calculation was interpreted differently from your intent. Compare against a stock reference at the same period, then send a precise correction naming the formula and the input series - for example "use the closing price, a 21-period EMA with standard 2/(n+1) smoothing, and seed the first value with a simple average of the first 21 closes". Ambiguous wording in the original prompt is the usual root cause.

The settings dialog is missing a parameter I need

Parameters only appear if they were declared as settings properties in the generated source. Send a refinement listing the missing options explicitly - "expose the swing lookback bars, the maximum number of projected zones, and the label font size in the settings" - and the AI will add them and rebuild.

The build fails immediately with a network or fetch error

A build requires internet access so the AI can read the SDK documentation on the SabrTrader website and example source from the public GitHub repository. Confirm the machine is online and that a firewall or proxy is not blocking the AI provider's API endpoint or raw GitHub content. Offline builds are not supported.

Related reading