SabrTrader.Sdk 0.19.0

dotnet add package SabrTrader.Sdk --version 0.19.0
                    
NuGet\Install-Package SabrTrader.Sdk -Version 0.19.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SabrTrader.Sdk" Version="0.19.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SabrTrader.Sdk" Version="0.19.0" />
                    
Directory.Packages.props
<PackageReference Include="SabrTrader.Sdk" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SabrTrader.Sdk --version 0.19.0
                    
#r "nuget: SabrTrader.Sdk, 0.19.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SabrTrader.Sdk@0.19.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SabrTrader.Sdk&version=0.19.0
                    
Install as a Cake Addin
#tool nuget:?package=SabrTrader.Sdk&version=0.19.0
                    
Install as a Cake Tool

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 (in SabrTrader.Pipeline.Venues.Trading) gives a trading provider one ordered way to raise its events: Stage an event under the lock that wrote your book, then Flush after releasing it. Consumers hear your statements in exactly the order your book changed. FlushThrough is for a command whose caller reads its answer together with what you said during it.

Trading provider contract (no signature changes):

  • A provider raises EventEmitted in book order, by a publish gate or by ProviderEventOutbox.
  • An account a provider stops hosting is withdrawn with AccountRemovedEvent, never with made-up flat positions. StopAsync and Dispose never wait for their events to be delivered.
  • ITradingService.AddProvider throws InvalidOperationException for a provider that is already running: attach it before StartAsync. RemoveProvider withdraws every account the provider stated and never withdrew.
  • BooksSyncedEvent is the provider's full-book statement, raised once per connect.
  • The built-in simulator enforces OrderRequest.ReduceOnly when 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, AtmProtectionIncident and AtmProtectionIncidentKind. A strategy still runs an ATM through Strategy.UseAtm, SetAtmBracketGeometry and SetNextAtmStopPrice (renamed from SetNextStopPrice).
  • Position ledger removed: PositionLedger, IPositionScopeView, PositionGrowth and PositionFrameVerdict, plus these ITradingService members: GetPositionScope, GetOrCreatePositionScope, ScopesOf, IsAccountFlatAndClear and the AccountScopesChanged event. Ask IBrokerFacts about 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, settlesIn says 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:

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.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

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