安装
dotnet add package StockSharp.Coinbase --version 5.0.192
README
Coinbase Connector
This folder contains the Coinbase connector for the StockSharp platform. The implementation provides both market data and transactional access to the Coinbase Advanced Trade API. It can be used as a reference for creating your own connectors or as a ready‑to‑use adapter in your trading application.
Features
- Real‑time data streaming through a websocket connection.
- Historical data and trading operations via REST.
- Supports ticks, order book updates, Level1 information and time frame candles.
- Order support for market, limit and stop orders.
- Withdraw operations via a custom order condition.
Usage
- Obtain an API Key, Secret and Passphrase from your Coinbase account.
- Create a
CoinbaseMessageAdapterand assign your credentials:
var adapter = new CoinbaseMessageAdapter(new IncrementalIdGenerator())
{
Key = "YOUR_KEY".ToSecureString(),
Secret = "YOUR_SECRET".ToSecureString(),
Passphrase = "YOUR_PASSPHRASE".ToSecureString()
};
- Add the adapter to the
Connectoror other S# component and connect as usual.
Market data subscriptions and order commands are handled through the standard S# message model. Live candle updates are available for the 5‑minute timeframe, other periods are built from ticks.
Implementation Notes
The adapter relies on two helper classes:
HttpClientfor REST requests (base URLhttps://api.coinbase.com/api).SocketClientfor websocket streaming (wss://advanced-trade-ws.coinbase.com).
Message authentication is done through Authenticator, which signs requests using your secret key.
The adapter is associated with the trading board code CNBS.
For more information see the Coinbase connector documentation.
依赖项
net6.0
-
Ecng.Net.SocketIO
[1.0.430, ) -
StockSharp.Media.Names
[5.0.1, ) -
StockSharp.Messages
[5.0.222, )