Back to packages
NuGet package
StockSharp.Btce
BTC-e connector. More info on web site https://stocksharp.com/store/
Package details are public. Package downloads require StockSharp access.
Install
dotnet add package StockSharp.Btce --version 5.0.190
README
BTC-e (WEX) Connector for StockSharp
Overview
This project contains the source code of the BtceMessageAdapter, a connector used to interact with the BTC‑e crypto exchange (later renamed to WEX). The adapter is implemented as part of the StockSharp trading framework and provides both real‑time market data and transactional capabilities.
Features
- Market Data: Receives ticks, order books and level 1 information through a WebSocket connection. Historical data can be downloaded via the REST API.
- Trading Operations: Supports registration and cancellation of limit orders. Conditional orders are used to perform withdrawals.
- Portfolio Information: The adapter retrieves account balances and updates positions based on trades and wallet changes.
- Configurable Connection: API access is configured with a key and secret as well as a domain address (default value is
https://wex.nz/). - Pusher WebSocket Client: Real‑time market updates are delivered by the internal
PusherClientclass located underNative.
File Structure
BtceMessageAdapter.cs– core adapter implementation and initialization logic.BtceMessageAdapter_MarketData.cs– market data subscription handling.BtceMessageAdapter_Transaction.cs– order registration, cancellations and portfolio management.BtceMessageAdapter_Settings.cs– adapter settings including API key, secret and heartbeat interval.BtceOrderCondition.cs– order condition class for withdrawal operations.Native/– low level protocol helpers such as the RESTHttpClientand WebSocketPusherClient.
Installation
- Add the StockSharp connectors to your solution via the StockSharp NuGet feed.
- Include the
Btceproject or compiled assembly in your application. - Reference
BtceMessageAdapterfrom your trading connector.
Usage Example
var connector = new Connector();
var adapter = new BtceMessageAdapter(connector.TransactionIdGenerator)
{
Key = "YOUR_API_KEY".ToSecureString(),
Secret = "YOUR_SECRET".ToSecureString(),
Address = BtceMessageAdapter.DefaultDomain,
};
connector.Adapter.InnerAdapters.Add(adapter);
connector.Connect();
// request available instruments
connector.LookupSecurities(new SecurityLookupMessage());
// place a limit order
await connector.RegisterOrderAsync(new OrderRegisterMessage
{
SecurityId = "BTC/USD".ToSecurityId(BoardCodes.Btce),
Side = Sides.Buy,
OrderType = OrderTypes.Limit,
Price = 650m,
Volume = 0.1m,
});
Withdrawal can be performed by registering an order with a BtceOrderCondition instance containing the required withdrawal information.
Documentation
StockSharp documentation provides general instructions on working with message adapters: Creating your own connector.
Support
Questions and discussion can be posted in the StockSharp chat.
Dependencies
net6.0
-
Ecng.Net.SocketIO
[1.0.428, ) -
StockSharp.Media.Names
[5.0.1, ) -
StockSharp.Messages
[5.0.220, )