SabrTrader.Sdk
0.19.0
dotnet add package SabrTrader.Sdk --version 0.19.0
NuGet\Install-Package SabrTrader.Sdk -Version 0.19.0
<PackageReference Include="SabrTrader.Sdk" Version="0.19.0" />
<PackageVersion Include="SabrTrader.Sdk" Version="0.19.0" />
<PackageReference Include="SabrTrader.Sdk" />
paket add SabrTrader.Sdk --version 0.19.0
#r "nuget: SabrTrader.Sdk, 0.19.0"
#:package SabrTrader.Sdk@0.19.0
#addin nuget:?package=SabrTrader.Sdk&version=0.19.0
#tool nuget:?package=SabrTrader.Sdk&version=0.19.0
SabrTrader SDK
Build your own plugins for the SabrTrader trading platform: indicators, strategies, drawing tools, bar types, Market Analyzer columns, add-on windows and venue plugins for data feeds and brokers.
This package is the only one you need. It brings in the contract assemblies you compile against:
| Package | What it covers |
|---|---|
SabrTrader.Pipeline.Contracts |
Indicators, plots and rendering, drawing tools, bar types, market data, order flow and depth, options data |
SabrTrader.Pipeline.Strategies.Contracts |
Strategies: the Strategy base class, parameters, managed orders and ATM |
SabrTrader.Pipeline.Venues.Contracts |
Venue plugins, plus the trading model: accounts, orders, positions and trade history |
SabrTrader.Pipeline.AddOns.Contracts |
Add-ons: your own windows and Control Center menu entries |
These assemblies hold contracts only. SabrTrader provides the implementations when it loads your plugin, so your DLL stays small and ships nothing but your own code.
New in 0.18.0
Additive:
ProviderEventOutbox(inSabrTrader.Pipeline.Venues.Trading) gives a trading provider one ordered way to raise its events:Stagean event under the lock that wrote your book, thenFlushafter releasing it. Consumers hear your statements in exactly the order your book changed.FlushThroughis for a command whose caller reads its answer together with what you said during it.
Trading provider contract (no signature changes):
- A provider raises
EventEmittedin book order, by a publish gate or byProviderEventOutbox. - An account a provider stops hosting is withdrawn with
AccountRemovedEvent, never with made-up flat positions.StopAsyncandDisposenever wait for their events to be delivered. ITradingService.AddProviderthrowsInvalidOperationExceptionfor a provider that is already running: attach it beforeStartAsync.RemoveProviderwithdraws every account the provider stated and never withdrew.BooksSyncedEventis the provider's full-book statement, raised once per connect.- The built-in simulator enforces
OrderRequest.ReduceOnlywhen the order fills: it caps the fill at the held quantity and cancels the rest with its OCO siblings.
New in 0.17.0
The ATM engine and the position ledger now live inside SabrTrader, so their types are no longer part of the SDK. A plugin that references one of the types or members below must be updated before it builds against 0.17.0. A plugin that does not keeps loading as before.
Breaking:
- ATM engine types removed:
IAtmEngine,IAtmEngineFactory,IAtmOrderGateway,IChartAtmHost,AtmGatewayOperation,AtmGatewayFault,AtmAdoptedProtectiveOrder,IBracketLegSplitController,IManualProtectiveLegController,IBracketPresetStore,AtmProtectionIncidentandAtmProtectionIncidentKind. A strategy still runs an ATM throughStrategy.UseAtm,SetAtmBracketGeometryandSetNextAtmStopPrice(renamed fromSetNextStopPrice). - Position ledger removed:
PositionLedger,IPositionScopeView,PositionGrowthandPositionFrameVerdict, plus theseITradingServicemembers:GetPositionScope,GetOrCreatePositionScope,ScopesOf,IsAccountFlatAndClearand theAccountScopesChangedevent. AskIBrokerFactsabout a position instead (see below). - Host services removed: the types behind the host's own alert spine, data stores, strategy
catalog and backtest runner, risk registries, option-strategy store, backfill activity tracking,
replay planning and chart styling are no longer in the SDK. SabrTrader keeps providing these
services; a plugin reaches what it needs through its context (
IIndicatorContext,IStrategyContext, the venue session).
Additive:
IBrokerFacts.PositionSettled(key)is true once a position has had no execution for its provider's settle window, so the broker's latest statement stands for it.IBrokerFacts.IsFlatAndClear(key, out settlesIn)is true when the broker states the position flat, no order works on it and it has settled. When it is flat and clear of orders but not settled yet,settlesInsays how long until it can be judged again.
Install
Create a class library and add the package:
dotnet new classlib -n MyFirstPlugin -f net10.0
cd MyFirstPlugin
dotnet add package SabrTrader.Sdk --version 0.18.0
Then set up the project file like this:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<DeploySabrTraderPlugin>true</DeploySabrTraderPlugin>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SabrTrader.Sdk" Version="0.18.0" />
</ItemGroup>
</Project>
A first indicator
This indicator plots the median price of each bar, the midpoint between high and low:
using SabrTrader.Pipeline.Indicators;
using SabrTrader.Pipeline.Plots;
using SabrTrader.Pipeline.Series;
namespace MyFirstPlugin;
[IndicatorDescription("Median price: the (high + low) / 2 midpoint of each bar.")]
public sealed class MedianPrice : IndicatorBase
{
private readonly ChunkedSeries<double> _output = new();
public MedianPrice(IIndicator? parent = null, ISeries<double>? input = null)
: base(parent, input)
{
AddPlot(new Plot("Median", _output, PlotStyle.Line, new ChartColor(91, 157, 255), 1.5));
}
// History: one pass over the loaded bars, oldest first (index 0 is the newest bar).
public override void OnDataLoaded(IIndicatorContext ctx)
{
var bars = ctx.Bars(0);
for (int i = bars.Count - 1; i >= 0; i--)
_output.Append((bars[i].High + bars[i].Low) / 2.0);
}
// Live: one value each time a bar closes.
public override void OnBarUpdate(IIndicatorContext ctx)
{
var bar = ctx.Bars(0)[0];
_output.Append((bar.High + bar.Low) / 2.0);
}
}
There is no registration code. SabrTrader finds every public class deriving from IndicatorBase
and lists it in the indicator picker.
Build, deploy and hot reload
dotnet build -c Release
With DeploySabrTraderPlugin set, the build copies your DLL and its PDB to
Documents\SabrTrader\Plugins, using your real Documents folder, so a folder redirected to OneDrive
works too. To deploy somewhere else, set SabrTraderPluginsFolder in the project file. Without the
property, copy bin\Release\net10.0\MyFirstPlugin.dll into that folder yourself.
SabrTrader watches the plugin folder. A DLL that is there at startup loads at startup, and a DLL you copy or rebuild while the platform runs is loaded within a second or so. Charts that use your indicator switch to the new build without a restart, so the loop is: edit, build, look at the chart.
If your plugin does not show up, open the Log tab in the Control Center and look at the Plugins category. Every load, reload and registration error is logged there with the DLL and type name.
Documentation
The full developer guide lives at https://www.sabrtrader.com/pages/sdk. Good places to start:
- Your first plugin: https://www.sabrtrader.com/pages/sdk-getting-started-first-plugin
- Indicators: https://www.sabrtrader.com/pages/sdk-indicators
- Strategies: https://www.sabrtrader.com/pages/sdk-strategies
- Drawing tools: https://www.sabrtrader.com/pages/sdk-drawing-tools
- Add-ons: https://www.sabrtrader.com/pages/sdk-addons
- Venue plugins: https://www.sabrtrader.com/pages/sdk-connections
- Building and deploying: https://www.sabrtrader.com/pages/sdk-building-plugins
- Troubleshooting: https://www.sabrtrader.com/pages/sdk-troubleshooting
License
The SDK contracts are MIT licensed, so you can use them in free and commercial plugins alike. The SabrTrader application itself is proprietary and is not covered by this license.
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- SabrTrader.Pipeline.AddOns.Contracts (>= 0.19.0)
- SabrTrader.Pipeline.Contracts (>= 0.19.0)
- SabrTrader.Pipeline.Strategies.Contracts (>= 0.19.0)
- SabrTrader.Pipeline.Venues.Contracts (>= 0.19.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.19.0 | 54 | 10/26/2026 |
| 0.18.0 | 350 | 10/14/2026 |
| 0.17.0 | 145 | 9/29/2026 |
| 0.15.0 | 151 | 9/24/2026 |
| 0.12.0 | 140 | 9/21/2026 |
| 0.11.0 | 202 | 9/5/2026 |
| 0.10.0 | 173 | 9/2/2026 |
| 0.9.0 | 178 | 8/27/2026 |
| 0.8.0 | 197 | 8/17/2026 |
| 0.6.0 | 193 | 8/13/2026 |
| 0.5.0 | 193 | 8/12/2026 |
| 0.4.0 | 203 | 8/10/2026 |
| 0.3.0 | 194 | 8/8/2026 |
| 0.1.0 | 246 | 7/15/2026 |