3Commas Trading Bot API
Manage automated trading bots, deals, and smart trades across multiple exchanges through the 3Commas WebSocket gateway.
Manage automated trading bots, deals, and smart trades across multiple exchanges through the 3Commas WebSocket gateway.
Streams deals and smart-trade updates from the 3Commas trading-bot platform over its WebSocket gateway. Pairs with TsgcWebSocketClient for the transport.
TsgcWSAPI_ThreeCommas
Windows, macOS, Linux, iOS, Android
Standard / Professional / Enterprise
Plug a TsgcWebSocketClient into the API component, set ApiKey / ApiSecret in the ThreeCommas group, then SubscribeDeals or SubscribeSmartTrades.
uses
sgcWebSocket, sgcWebSocket_API_ThreeCommas;
var
WSClient: TsgcWebSocketClient;
ThreeCommas: TsgcWSAPI_ThreeCommas;
begin
WSClient := TsgcWebSocketClient.Create(nil);
ThreeCommas := TsgcWSAPI_ThreeCommas.Create(nil);
ThreeCommas.Client := WSClient;
ThreeCommas.ThreeCommas.ApiKey := 'your-api-key';
ThreeCommas.ThreeCommas.ApiSecret := 'your-api-secret';
WSClient.Active := True;
ThreeCommas.SubscribeDeals;
ThreeCommas.SubscribeSmartTrades;
end;
// uses: sgcWebSocket, sgcWebSocket_API_ThreeCommas
TsgcWebSocketClient *WSClient = new TsgcWebSocketClient(this);
TsgcWSAPI_ThreeCommas *ThreeCommas = new TsgcWSAPI_ThreeCommas(this);
ThreeCommas->Client = WSClient;
ThreeCommas->ThreeCommas->ApiKey = "your-api-key";
ThreeCommas->ThreeCommas->ApiSecret = "your-api-secret";
WSClient->Active = true;
ThreeCommas->SubscribeDeals();
ThreeCommas->SubscribeSmartTrades();
A typed wrapper around the 3Commas WebSocket gateway with HMAC-signed subscriptions and event-driven payload delivery.
SubscribeDeals / UnSubscribeDeals open the DealsChannel server-side. The component delivers deal create/update/close events as new bots fire across connected exchanges.
SubscribeSmartTrades / UnSubscribeSmartTrades open SmartTradesChannel for status changes (filling, finished, cancelled) of every active smart-trade order.
Set ThreeCommas.ApiKey and ThreeCommas.ApiSecret — the component computes the per-channel HMAC-SHA256 identifier 3Commas requires for private streams.
Bind to any TsgcWebSocketClient via Client. WatchDog, HeartBeat, Authentication and TLS settings live on the WebSocket client — this component focuses on protocol framing.
OnConnect, OnDisconnect, OnException propagate from the underlying client. OnMessage exposes every raw frame for logging or custom routing.
Drop sibling components like TsgcWSAPI_Binance or TsgcWSAPI_Coinbase on the same form to correlate 3Commas bot events with underlying exchange ticks.
Authoritative sources for the APIs this component implements.
Deep-link to the component reference, grab the ready-to-run demo project, and download the trial.
| Online Help — API_3Commas Full property, method and event reference for this component. | Open | |
| Demo Project — Demos\05.Crypto\10.ThreeCommas Ready-to-run example project. Ships inside the sgcWebSockets package — download the trial below. | Open | |
| Technical Document (PDF) Features, quick start, code samples for Delphi & C++ Builder and primary-source references — this component only. | Open | |
| User Manual (PDF) Comprehensive manual covering every component in the library. | Open |