Overview

SabrTrader Plugin SDK

The SabrTrader plugin SDK

Indicators, strategies, bar types, drawing tools, Market Analyzer columns, add-ons and venues (market-data feeds and brokers) are all plugins in SabrTrader. You compile a .NET class library against the public SDK, copy the DLL into the plugin folder, and the running platform loads it.

These pages cover every plugin kind, from a minimal first indicator to venue and broker integrations. Each subject has its own page; use the menu on the left to go straight to it. You reference one NuGet package and implement its contracts. You never need the platform's source.

Who this is for. C# developers. Each example is preceded by a short explanation of what it does and why, and each one compiles against the SDK package alone.
Example source on GitHub. The standard indicators that ship with SabrTrader are open source under the MIT license. Read them alongside these docs, or fork one as the starting point for your own plugin. github.com/erwin-beckers/sabrtrader-indicators ↗

Start here

Two pages take you from an empty folder to a plugin on a chart, and a third explains the model the rest of the documentation builds on. Read them in order if you are new to the SDK.

Install the SDK

Add the NuGet package every plugin compiles against, target net10.0, and turn on auto-deploy.

Set up your toolchain →

Your first plugin

Write a minimal indicator, build it, deploy it and see it draw on a chart.

Build it end to end →

Core concepts

The plugin model, the contract assemblies, capability interfaces, series indexing, lifecycle phases and threading.

Read the core concepts →

What you can build

Each plugin kind has its own chapter: an overview, a walkthrough of a first working example, then one page per feature. The chapters are independent, so start with the one you need.

Indicators

Plot lines, bands, histograms and candles. Custom chart rendering, order flow, per-tick or per-bar calculation, panel placement, threshold lines, child indicators, multiple timeframes and toolbar menus.

Build an indicator →

Strategies

Automated entries and exits with managed orders, ATM brackets (stop, target, breakeven, trailing, scale in and out), optimizable parameters, backtests and live execution.

Build a strategy →

Bar types

Custom bar aggregation, built from ticks or derived from another series: Renko, range, volume, Heikin-Ashi, or your own.

Build a bar type →

Drawing tools

Interactive chart annotations with anchors, hit-testing, editable properties and automatic persistence: lines, shapes, Fibonacci level sets and patterns.

Build a drawing tool →

Add-ons

Your own window with its own Control Center menu entry, such as a scanner, a risk dashboard or a journal. Add-ons read accounts, orders, live ticks and history, and their windows are restored with the user's workspace.

Build an add-on →

Venue plugins

Connect the platform to a new venue (data feed, broker or crypto exchange): backfill, live ticks, depth and instruments, behind one plugin, one manifest and one session.

Build a venue →

Trading providers

Route orders to a venue: place, cancel, modify and flatten, stream order and account updates, report fills and commissions, and declare your capabilities.

Build a trading provider →

Market Analyzer columns

Add columns to the Market Analyzer grid: a computed value per instrument, with its own parameters and data type.

Build a column →

Alerts

Raise user-facing alerts from a plugin. The platform routes each alert to the log, a sound and the remote channels the user has configured.

Raise alerts →

Trading hours & sessions

Session-aware logic: detect the session's opening bar, the first bar of a session, and whether a bar time falls inside a configured window.

Work with sessions →

Broker venues

A broker is a venue that also routes orders: one plugin, a trading port over your vendor client, and the components and contract test kit for the order lifecycle.

Build a broker venue →

Trade history

Persist and query fills, and backfill historical executions from a broker into the platform's trade-history store.

Work with trade history →

Options data & trading

Venue-agnostic option chains with IV, open interest and greeks, bounded snapshots for exposure analytics (GEX, DEX, VEX), streaming contract quotes, and multi-leg orders from strategies.

Work with options →

Options levels

Read gamma and options-levels snapshots from a levels feed: named walls, HVL, expected-move bands and per-strike exposure profiles.

Work with levels →

SDK reference

Every public type in the contract assemblies (interfaces, records, enums and attributes), grouped by namespace, with signatures.

Open the reference →

How the SDK is structured

One meta-package, SabrTrader.Sdk, brings in the four contract assemblies you compile against, plus an MSBuild target that can deploy your built DLL. The contract assemblies hold interfaces, base classes, attributes, enums, data records and a small set of helpers. The platform supplies the implementations at load time, so a deployed plugin consists of its own DLL.

  • SabrTrader.Pipeline.Contracts: indicators, plots, series, bars, ticks, market depth, drawing tools, Market Analyzer columns, alerts, data providers and the venue-agnostic options data model.
  • SabrTrader.Pipeline.Venues.Contracts: the venue seam (plugin, descriptor, manifest, session) plus orders, positions, accounts, risk, ATM brackets, multi-leg option orders, the option chain SPI and trade history.
  • SabrTrader.Pipeline.Strategies.Contracts: the Strategy base class, its runtime context, the strategy catalog and backtest analytics.
  • SabrTrader.Pipeline.AddOns.Contracts: add-ons, meaning the plugin export and its manifest, window kinds, windows and their declared views, workspace state, and the host services an add-on reads the platform through.

Core concepts walks through how these fit together: the plugin model, the "base class plus optional capability interfaces" pattern, series and bars-ago indexing, ambient providers, and the shared lifecycle every plugin kind follows.

How a plugin works

The mechanism is the same for every plugin kind. There is no registration call and no platform configuration to edit: you implement a contract, build a DLL, and the platform finds your types by inspecting the assembly. The Building & deploying chapter covers each step in depth.

  1. Reference the SDK. One NuGet package, SabrTrader.Sdk, brings in every contract assembly.
  2. Implement a contract. Subclass IndicatorBase, Strategy or DrawingToolBase, or implement a discovery interface such as IVenuePlugin (the export behind a market-data feed or a broker) or IAddOn. The platform creates your type through a public constructor it can call without arguments, then applies settings.
  3. Build & deploy. Build a net10.0 DLL and copy it into Documents\SabrTrader\Plugins. The MSBuild target in the SDK can do this on every build.
  4. Use it. The platform watches the plugin folder. A new or rebuilt DLL is loaded while SabrTrader runs, its types are registered in the matching catalogs, and they appear in the UI next to the built-in ones.
Deploy your own DLL. The platform already provides the SDK contract assemblies and always binds your plugin to its own copies, so there is nothing to gain from shipping them. Copy your plugin DLL, its PDB if you want line numbers in stack traces, and any third-party libraries the platform does not provide. Dependencies & isolation explains how references are resolved.

The pipeline at a glance

Two value types carry market data through the platform, a bar and a tick, and every plugin kind produces or consumes them.

C#// One OHLCV bar, passed by value through the whole pipeline.
// StartUtc / EndUtc are true venue UTC. Start / End is the chart timeline
// (display-zone wall-clock when the host has stamped StartDisplay / EndDisplay).
public readonly record struct Bar(
    DateTime StartUtc, DateTime EndUtc,
    double Open, double High, double Low, double Close,
    long Volume, long TickCount,
    DateTime StartDisplay = default, DateTime EndDisplay = default);

Venues produce ticks, bar builders aggregate ticks into bars, indicators and strategies read the bar series and emit plots, signals and orders, and the chart renders plots and drawing tools. Each layer is a contract you can plug into, and the SDK reference maps the full surface.

Conventions used in this guide

Marker Meaning
SIMPLE A minimal, get-it-working example.
ADVANCED Production features: rendering, parameters, multi-timeframe, ATM, persistence.
INTERFACE A contract type you implement or consume.