Connectors/BitStamp/README.md
This project implements a StockSharp (S#) message adapter for the Bitstamp cryptocurrency exchange. It allows S# based applications to receive real-time market data and to manage trading operations through Bitstamp's REST and WebSocket APIs.
BitStampMessageAdapter requires API credentials for private requests:
Key – your Bitstamp API key.Secret – the corresponding secret key.BalanceCheckInterval – optional interval for automatic balance refresh (useful when deposits or withdrawals occur).var connector = new Connector();
var adapter = new BitStampMessageAdapter(connector.TransactionIdGenerator)
{
Key = "your_api_key".ToSecureString(),
Secret = "your_secret".ToSecureString(),
BalanceCheckInterval = TimeSpan.FromMinutes(1)
};
connector.Adapter.InnerAdapters.Add(adapter);
connector.Connect();
After connecting you can subscribe to market data:
var btcUsd = new SecurityId { SecurityCode = "BTC/USD", BoardCode = BoardCodes.BitStamp };
connector.SubscribeMarketData(new MarketDataMessage
{
SecurityId = btcUsd,
DataType2 = DataType.Ticks,
IsSubscribe = true
});
Trading operations are performed by sending OrderRegisterMessage and OrderCancelMessage objects.
For more information about StockSharp connectors see the documentation.