3Commas 交易机器人 API

通过 3Commas WebSocket 网关,跨多个交易所管理自动交易机器人、交易和智能交易。

TsgcWSAPI_ThreeCommas

通过 3Commas 交易机器人平台的 WebSocket 网关流式传输交易和智能交易更新。配合 TsgcWebSocketClient 作为传输层。

组件类

TsgcWSAPI_ThreeCommas

平台

Windows, macOS, Linux, iOS, Android

版本

Standard / Professional / Enterprise

拖入组件,设置密钥,订阅

将 TsgcWebSocketClient 连接到 API 组件,在 ThreeCommas 组中设置 ApiKey / ApiSecret,然后调用 SubscribeDeals 或 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();

功能详情

针对 3Commas WebSocket 网关的类型化封装器,支持 HMAC 签名订阅和事件驱动的数据分发。

交易流

SubscribeDeals / UnSubscribeDeals 在服务端打开 DealsChannel。组件在已连接交易所的机器人触发时,分发交易创建/更新/关闭事件。

智能交易流

SubscribeSmartTrades / UnSubscribeSmartTrades 打开 SmartTradesChannel,用于接收所有活跃智能交易订单的状态变更(成交中、已完成、已取消)。

身份验证

Set ThreeCommas.ApiKey and ThreeCommas.ApiSecret — the component computes the per-channel HMAC-SHA256 identifier 3Commas requires for private streams.

WebSocket 传输

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.

与交易所组合使用

在同一窗体上添加 TsgcWSAPI_BinanceTsgcWSAPI_Coinbase 等兄弟组件,将 3Commas 机器人事件与底层交易所行情关联。

规范与参考

本组件所实现 API 的权威参考来源。

文档与演示

直接访问组件参考文档,获取即用型演示项目,并下载试用版。

Online Help — API_3Commas 本组件的完整属性、方法和事件参考。
Demo Project — Demos\05.Crypto\10.ThreeCommas 即用型示例项目,随 sgcWebSockets 包一起提供 — 请在下方下载试用版。
技术文档(PDF) 功能概述、快速入门、Delphi 和 C++ Builder 代码示例及主要参考资源 — 仅适用于本组件。
用户手册(PDF) 涵盖库中每个组件的综合手册。

准备好自动化 3Commas 交易了吗?

下载免费试用版,将交易和智能交易流式传输到您的 Delphi 应用程序中。