StockSharp.BusinessEntities 5.0.217

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package StockSharp.BusinessEntities --version 5.0.217
                    
NuGet\Install-Package StockSharp.BusinessEntities -Version 5.0.217
                    
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="StockSharp.BusinessEntities" Version="5.0.217" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="StockSharp.BusinessEntities" Version="5.0.217" />
                    
Directory.Packages.props
<PackageReference Include="StockSharp.BusinessEntities" />
                    
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 StockSharp.BusinessEntities --version 5.0.217
                    
#r "nuget: StockSharp.BusinessEntities, 5.0.217"
                    
#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 StockSharp.BusinessEntities@5.0.217
                    
#: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=StockSharp.BusinessEntities&version=5.0.217
                    
Install as a Cake Addin
#tool nuget:?package=StockSharp.BusinessEntities&version=5.0.217
                    
Install as a Cake Tool

StockSharp.BusinessEntities

StockSharp.BusinessEntities is the core library that defines the trading entities used throughout the S# platform. It contains models describing exchanges, instruments, orders, trades and other objects along with provider interfaces for market data and order management.

Key classes

  • Exchange and ExchangeBoard — descriptions of an exchange and a specific electronic board.
  • Security — represents a financial instrument with fields such as symbol, type, price step and currency.
  • Portfolio and Position — trading account information and open positions.
  • Order, MyTrade and Trade — objects that reflect registered orders and trades.
  • MarketDepth — order book (best bid/ask and current quotes).
  • News — news item information.
  • Candle and its derivations (e.g. TimeFrameCandle, TickCandle) — candle models for analyzing market data.

Provider interfaces

The library declares base interfaces for interacting with various data sources and trading systems:

  • IConnector is the main interface combining connectivity, subscriptions, orders and data access. It inherits from IMarketDataProvider, ITransactionProvider, ISecurityProvider and others. A fragment of the interface:
public interface IConnector : IMessageChannel, IPersistable, ILogReceiver,
        IMarketDataProvider, ITransactionProvider, ISecurityProvider,
        ISubscriptionProvider, ITimeProvider,
        IPortfolioProvider, IPositionProvider
{
    event Action<Message> NewMessage;
    event Action Connected;
    event Action Disconnected;
    // ...
}
  • IMarketDataProvider — receiving market data and price levels.
  • ITransactionProvider — registering, canceling and modifying orders.
  • ISubscriptionProvider — managing real‑time data subscriptions.
  • ISecurityProvider, IPortfolioProvider, IPositionProvider — access to lists of securities, portfolios and positions.
  • ITimeProvider — current time source.

Extensions and helpers

EntitiesExtensions.cs contains many utilities:

  • Converting price values to pips or points.
  • Cloning and re-registering orders.
  • Transforming entities to StockSharp.Messages types.
  • Enumerating all registered exchanges and boards.

Example method:

public static IEnumerable<Exchange> EnumerateExchanges()
    => typeof(Exchange)
        .GetMembers<PropertyInfo>(_publicStatic, typeof(Exchange))
        .Select(prop => (Exchange)prop.GetValue(null, null));

Project structure

BusinessEntities.csproj connects shared settings and package dependencies:

<Project Sdk="Microsoft.NET.Sdk">
  <Import Project="..\common_target_net.props" />
  <PropertyGroup>
    <ProjectGuid>{DCE69DB8-53CA-4B7F-9368-02F175A31074}</ProjectGuid>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Ecng.Configuration" Version="$(EcngVer)" />
    <PackageReference Include="Ecng.Drawing" Version="$(EcngVer)" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\Messages\Messages.csproj" />
  </ItemGroup>
</Project>

Usage

BusinessEntities is used in all Samples projects and production connectors. Add the project to your solution or install the package from the private S# NuGet feed. You can then create Security objects, subscribe to data through the interfaces and register orders.

Example

A code fragment for subscribing to an instrument and receiving market data can be found in Samples/01_Basic/01_ConnectAndDownloadInstruments.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on StockSharp.BusinessEntities:

Package Downloads
StockSharp.Alerts.Interfaces

S#.Alerts.Interfaces More info on web site https://stocksharp.com/store/

StockSharp.Charting.Interfaces

S#.Charting.Interfaces More info on web site https://stocksharp.com/store/

TradeSystemsCommon.Tools

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
5.0.218 104 7/30/2026
5.0.217 189 7/28/2026
5.0.216 5,293 9/11/2025
5.0.215 727 9/1/2025
5.0.214 661 8/30/2025
5.0.213 864 8/10/2025
5.0.212 1,182 7/23/2025
5.0.211 993 7/20/2025
5.0.210 1,488 7/14/2025
5.0.209 601 7/8/2025
5.0.208 597 7/4/2025
5.0.207 605 6/30/2025
5.0.206 1,117 6/20/2025
5.0.205 595 6/18/2025
5.0.204 706 6/2/2025
5.0.203 849 5/14/2025
5.0.202 1,482 3/29/2025
5.0.201 559 3/27/2025
5.0.200 1,277 2/26/2025
5.0.199 1,114 2/15/2025
Loading failed

Async: unsubscribe from the finally when a subscription enumeration is cancelled
Convert security access to async (SaveAsync/GetSecurityAsync) end to end
WorkingTime. IsEnabled turned off by default.
WorkingTime moved to Ecng.
Position. OpenTime, CloseTime properties.
Security. Stat fields made obsolete.
Removed sync NewOutMessage event, migrated to NewOutMessageAsync
ExecMsg. MarketPrice property.
Async extensions: Impl pattern, RegisterOrderAsync, tests
IMessageTransport
ICustomProvider<T> interface.
IAsyncEnumerable<T> impl refactoring.
Storages. Init -> InitAsync.
Lock usage.
ISecurityProvider. Async mode.
DateTimeOffset -> DateTime UTC
Fix stale price bug in PnL calculation
Position. ServerTime made as primary.
MarketDepthPair removed as obsolete.
MarketDepth removed as obsolete.
CandleSeries -> ToMarketDataMessage removed as obsolete.
CandleSeries. BuildCandlesFrom, FillGaps removed as obsolete.
MarketDepth. LastChangeTime removed as obsolete.
Order. Direction, LastChangeTime removed as obsolete.
IConnector. MarketTimeChanged removed as obsolete.
Removed candle entity conversion extensions as obsolete.
Removed candle entity extensions as obsolete.
Subscription. CandleSeries removed as obsolete.
Removed entity candle types as obsolete.
Order. DerivedOrder removed as obsolete.
IMarketDataProvider. SessionStateChanged, LookupBoardsResult, LookupTimeFramesResult removed as obsolete.
ITransactionProvider. OrderStatusFailed2 removed as obsolete.
Trade, OrderLogItem removed as obsolete.
MyTrade. Trade is ITickTradeMessage
Indicator value. Disable IsEmpty auto-set.
IIndicatorValue. Fix restore state.
ICandleMessage. GetTypicalPrice, GetMedianPrice extensions.
IIndicator. Preload values.
IIndicator. Source is writable
IIndicator. Source property.