8
n8n 中文网amn8n.com

币安价格-24小时统计-订单簿-K线工具

高级

这是一个Finance, AI领域的自动化工作流,包含 17 个节点。主要使用 Agent, LmChatOpenAi, ExecuteWorkflowTrigger, ToolHttpRequest, MemoryBufferWindow 等节点,结合人工智能技术实现智能自动化。 币安价格-24小时统计-订单簿-K线工具

前置要求
  • OpenAI API Key
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "xAa5vBxhQzEWWFJM",
  "meta": {
    "instanceId": "a5283507e1917a33cc3ae615b2e7d5ad2c1e50955e6f831272ddd5ab816f3fb6",
    "templateCredsSetupCompleted": true
  },
  "name": "Binance SM 价格-24小时统计-订单簿-K线工具",
  "tags": [],
  "nodes": [
    {
      "id": "200b26ba-fd67-48a2-86fc-cc1f92548757",
      "name": "获取当前价格",
      "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
      "position": [
        80,
        160
      ],
      "parameters": {
        "url": "https://api.binance.com/api/v3/ticker/price",
        "sendQuery": true,
        "parametersQuery": {
          "values": [
            {
              "name": "symbol"
            }
          ]
        },
        "toolDescription": "Fetches the current price for a trading pair (e.g., BTCUSDT) from Binance Spot Market.\n\n✅ Expected Query Format (JSON):\n\njson\n{\n  \"symbol\": \"BTCUSDT\"\n}\nYou must provide a valid symbol (e.g., BTCUSDT, ETHUSDT, BNBUSDT) as a string."
      },
      "typeVersion": 1.1
    },
    {
      "id": "978a1d9f-b217-4455-b0b3-96b86d2fd809",
      "name": "获取24小时统计",
      "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
      "position": [
        320,
        160
      ],
      "parameters": {
        "url": "https://api.binance.com/api/v3/ticker/24hr",
        "sendQuery": true,
        "parametersQuery": {
          "values": [
            {
              "name": "symbol"
            }
          ]
        },
        "toolDescription": "Fetches 24-hour price statistics including open, high, low, close, and volume for a trading pair (e.g., BTCUSDT) from Binance Spot Market.\\n\\n\\u2705 Expected Query Format (JSON):\\n{\\n  \\\"symbol\\\": \\\"BTCUSDT\\\"\\n}\\nReplace 'BTCUSDT' with the symbol you want to monitor."
      },
      "typeVersion": 1.1
    },
    {
      "id": "b6c4bb2d-6669-433a-a83b-f0c25c48e5ce",
      "name": "获取订单簿",
      "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
      "position": [
        560,
        160
      ],
      "parameters": {
        "url": "https://api.binance.com/api/v3/depth",
        "sendQuery": true,
        "parametersQuery": {
          "values": [
            {
              "name": "symbol"
            },
            {
              "name": "limit"
            }
          ]
        },
        "toolDescription": "Fetches the live order book (bids and asks) for a specific trading pair from Binance.\n\n✅ Expected Input Format (JSON):\n{\n  \"symbol\": \"BTCUSDT\",\n  \"limit\": 100\n}\n\nYou may adjust the `limit` between 1 and 5000 (default: 100). The response includes `bids` and `asks` as arrays of [price, quantity] levels."
      },
      "typeVersion": 1.1
    },
    {
      "id": "c5403bc9-349d-4205-9bd6-f0e48a33630e",
      "name": "获取K线数据",
      "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
      "position": [
        820,
        160
      ],
      "parameters": {
        "url": "https://api.binance.com/api/v3/klines",
        "sendQuery": true,
        "parametersQuery": {
          "values": [
            {
              "name": "symbol"
            },
            {
              "name": "interval"
            },
            {
              "name": "limit",
              "valueProvider": "modelOptional"
            }
          ]
        },
        "toolDescription": "Fetches candlestick (OHLCV) data for a trading pair and time interval from Binance. Supports optional time range filtering.\n\n✅ Expected Input Format (JSON):\n{\n  \"symbol\": \"BTCUSDT\",\n  \"interval\": \"15m\",\n  \"limit\": 100,\n  \"startTime\": 1690000000000,\n  \"endTime\": 1690100000000,\n  \"timeZone\": \"0\"\n}\n\nOnly `symbol` and `interval` are required. All other fields are optional.\n\nThe response is an array of arrays representing each candlestick:\n[\n  [ openTime, open, high, low, close, volume, closeTime, quoteVolume, numTrades, takerBase, takerQuote, ignore ]\n]"
      },
      "typeVersion": 1.1
    },
    {
      "id": "d4296211-d100-4b4d-9f39-31d5799c46cb",
      "name": "OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -440,
        180
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini",
          "cachedResultName": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "yUizd8t0sD5wMYVG",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "7a941f53-2294-4926-957d-ee82d01e4c11",
      "name": "简单记忆",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -200,
        180
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "8f6328d3-2508-40e5-a01c-44e428384f16",
      "name": "当被另一个工作流执行时",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        -320,
        -180
      ],
      "parameters": {
        "workflowInputs": {
          "values": [
            {
              "name": "message"
            },
            {
              "name": "sessionId"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "c4400f35-e18f-4645-b92e-187ac73d40f6",
      "name": "Binance SM 价格-24小时统计-订单簿-K线智能体",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        80,
        -180
      ],
      "parameters": {
        "text": "={{ $json.message }}",
        "options": {
          "systemMessage": "You are the **Binance SM Price-24hrStats-OrderBook-Kline Agent**, responsible for gathering and summarizing real-time price and market structure data for any given trading pair. You always call **all four market data tools** and return **latest candles across all key intervals**.\n\n---\n\n### 🔧 Connected Tools (Always Executed)\n\n#### 📈 `getCurrentPrice`\n\n*Latest trade price*\n**Endpoint**: `/api/v3/ticker/price`\n**Input**:\n\n```json\n{ \"symbol\": \"BTCUSDT\" }\n```\n\n---\n\n#### 📊 `get24hrStats`\n\n*24-hour stats including OHLC and volume*\n**Endpoint**: `/api/v3/ticker/24hr`\n**Input**:\n\n```json\n{ \"symbol\": \"BTCUSDT\" }\n```\n\n---\n\n#### 🧾 `getOrderBook`\n\n*Live order book (top 100 bids/asks)*\n**Endpoint**: `/api/v3/depth`\n**Input**:\n\n```json\n{ \"symbol\": \"BTCUSDT\", \"limit\": 100 }\n```\n\n---\n\n#### 🕰️ `getKlines` (Multi-Interval)\n\n*Latest candle data for multiple timeframes*\n**Endpoint**: `/api/v3/klines`\n**Inputs** (run separately for each):\n\n```json\n{ \"symbol\": \"BTCUSDT\", \"interval\": \"15m\", \"limit\": 1 }\n{ \"symbol\": \"BTCUSDT\", \"interval\": \"1h\",  \"limit\": 1 }\n{ \"symbol\": \"BTCUSDT\", \"interval\": \"4h\",  \"limit\": 1 }\n{ \"symbol\": \"BTCUSDT\", \"interval\": \"1d\",  \"limit\": 1 }\n```\n\n---\n\n### 🧠 Behavior Instructions\n\n* Always extract the **symbol** from the user's prompt (e.g., \"ETHUSDT\", \"SOLUSDT\")\n* Trigger **all four tools** in parallel\n* For klines, call the endpoint 4 times (15m, 1h, 4h, 1d)\n* Merge all tool outputs into a **single response**\n* Format clearly for **Telegram** messaging\n\n---\n\n### 📤 Output Format (Telegram HTML)\n\nExample:\n\n```\n📊 BTCUSDT Market Overview\n\n💰 Price: $63,220  \n📈 24h Change: +2.3% | Volume: 45,210 BTC  \n\n📉 Order Book  \n• Top Bid: $63,190  \n• Top Ask: $63,230  \n\n🕰️ Latest Candles  \n• 15m: O: $63,000 | C: $63,220 | Vol: 320 BTC  \n• 1h : O: $62,700 | C: $63,300 | Vol: 980 BTC  \n• 4h : O: $61,800 | C: $63,500 | Vol: 2,410 BTC  \n• 1d : O: $59,200 | C: $63,220 | Vol: 7,850 BTC\n```\n\n---\n\n### ✅ Input Expectations\n\n* Input is in natural language, e.g.:\n\n  * \"What’s going on with BTC?\"\n  * \"Give me full SOL update\"\n  * \"Show 4h and 1d candles for ETH\"\n\n* If no symbol is found, ask:\n\n  > “Please provide the token symbol (e.g., BTCUSDT).”\n\n"
        },
        "promptType": "define"
      },
      "typeVersion": 1.9
    },
    {
      "id": "f8d29f2d-5359-4dba-a99f-caaee2e44d91",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -380,
        -480
      ],
      "parameters": {
        "color": 4,
        "height": 500,
        "content": "## 由父工作流触发"
      },
      "typeVersion": 1
    },
    {
      "id": "2ffb4f3e-2cce-4e14-a1e4-c4cc0af8874b",
      "name": "便签8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -40,
        -460
      ],
      "parameters": {
        "color": 5,
        "width": 500,
        "height": 460,
        "content": "## 主要推理智能体"
      },
      "typeVersion": 1
    },
    {
      "id": "f722bc3b-983d-423a-bce2-a62d238873a7",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -500,
        120
      ],
      "parameters": {
        "width": 220,
        "height": 520,
        "content": "## OpenAI 格式化器"
      },
      "typeVersion": 1
    },
    {
      "id": "60d3f253-2d1f-480c-ac32-8fc48c4cfab2",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -260,
        120
      ],
      "parameters": {
        "color": 3,
        "width": 220,
        "height": 520,
        "content": "## 简单记忆"
      },
      "typeVersion": 1
    },
    {
      "id": "dccc52f0-2f57-4bdb-a16b-79e84275bda6",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        20,
        120
      ],
      "parameters": {
        "color": 6,
        "width": 220,
        "height": 620,
        "content": "## 获取当前价格"
      },
      "typeVersion": 1
    },
    {
      "id": "dcae06d0-e8c6-4b72-87fd-1f730ef4829d",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        260,
        120
      ],
      "parameters": {
        "color": 6,
        "width": 220,
        "height": 680,
        "content": "## 获取24小时统计"
      },
      "typeVersion": 1
    },
    {
      "id": "4606d831-1579-4a5f-874a-c8d139369ebe",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        500,
        120
      ],
      "parameters": {
        "color": 6,
        "width": 220,
        "height": 720,
        "content": "## 获取订单簿"
      },
      "typeVersion": 1
    },
    {
      "id": "25239ca3-ca99-4095-9d64-5581d39244e0",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        760,
        120
      ],
      "parameters": {
        "color": 6,
        "width": 220,
        "height": 720,
        "content": "## 获取K线数据(多时间框架)"
      },
      "typeVersion": 1
    },
    {
      "id": "9937f721-ab8e-4ef1-9809-9b146c98de1a",
      "name": "便签7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1240,
        -1420
      ],
      "parameters": {
        "width": 1220,
        "height": 2480,
        "content": "# 📈 Binance SM 价格-24小时统计-订单簿-K线工具 – 文档"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "3c34c007-ae59-4ea9-a073-4d5ba14ba3b8",
  "connections": {
    "getKlines": {
      "ai_tool": [
        [
          {
            "node": "Binance SM Price-24hrStats-OrderBook-Kline Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "get24hrStats": {
      "ai_tool": [
        [
          {
            "node": "Binance SM Price-24hrStats-OrderBook-Kline Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "getOrderBook": {
      "ai_tool": [
        [
          {
            "node": "Binance SM Price-24hrStats-OrderBook-Kline Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "Binance SM Price-24hrStats-OrderBook-Kline Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "getCurrentPrice": {
      "ai_tool": [
        [
          {
            "node": "Binance SM Price-24hrStats-OrderBook-Kline Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Binance SM Price-24hrStats-OrderBook-Kline Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "Binance SM Price-24hrStats-OrderBook-Kline Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

高级 - 财务, 人工智能

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
高级
节点数量17
分类2
节点类型6
难度说明

适合高级用户,包含 16+ 个节点的复杂工作流

作者
Don Jayamaha Jr

Don Jayamaha Jr

@don-the-gem-dealer

With 12 years of experience as a Blockchain Strategist and Web3 Architect, I specialize in bridging the gap between traditional industries and decentralized technologies. My expertise spans tokenized assets, crypto payment integrations, and blockchain-driven market solutions.

外部链接
在 n8n.io 查看

分享此工作流