Herramienta de estadísticas de 24 horas, libro de órdenes y gráficos de velas de precio de Binance

Avanzado

Este es unFinance, AIflujo de automatización del dominio deautomatización que contiene 17 nodos.Utiliza principalmente nodos como Agent, LmChatOpenAi, ExecuteWorkflowTrigger, ToolHttpRequest, MemoryBufferWindow, combinando tecnología de inteligencia artificial para lograr automatización inteligente. Binance precio - estadísticas de 24 horas - order book - herramienta de velas (K-line)

Requisitos previos
  • Clave de API de OpenAI
  • Pueden requerirse credenciales de autenticación para la API de destino
Vista previa del flujo de trabajo
Visualización de las conexiones entre nodos, con soporte para zoom y panorámica
Exportar flujo de trabajo
Copie la siguiente configuración JSON en n8n para importar y usar este flujo de trabajo
{
  "id": "xAa5vBxhQzEWWFJM",
  "meta": {
    "instanceId": "a5283507e1917a33cc3ae615b2e7d5ad2c1e50955e6f831272ddd5ab816f3fb6",
    "templateCredsSetupCompleted": true
  },
  "name": "Binance SM Price-24hrStats-OrderBook-Kline Tool",
  "tags": [],
  "nodes": [
    {
      "id": "200b26ba-fd67-48a2-86fc-cc1f92548757",
      "name": "getCurrentPrice",
      "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": "get24hrStats",
      "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": "getOrderBook",
      "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": "getKlines",
      "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": "Modelo de chat 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": "Simple Memoria",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -200,
        180
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "8f6328d3-2508-40e5-a01c-44e428384f16",
      "name": "When Executed by Another Workflow",
      "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 Price-24hrStats-OrderBook-Kline Agente",
      "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": "Nota adhesiva",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -380,
        -480
      ],
      "parameters": {
        "color": 4,
        "height": 500,
        "content": "## Triggered by Parent Workflow\nNode: When Executed by Another Workflow\nThis agent only activates when another agent (e.g., **Financial Analyst)** passes:"
      },
      "typeVersion": 1
    },
    {
      "id": "2ffb4f3e-2cce-4e14-a1e4-c4cc0af8874b",
      "name": "Nota adhesiva8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -40,
        -460
      ],
      "parameters": {
        "color": 5,
        "width": 500,
        "height": 460,
        "content": "## Main Reasoning Agent\nNode: Binance SM Price-24hrStats-OrderBook-Kline Agent\nThis is the AI interface that:\n\n**Accepts the prompt (symbol)**\n\nExtracts the **trading pair**\n\n**Automatically routes the query to all four** price tools\n\nCombines results and sends formatted response to parent agent\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "f722bc3b-983d-423a-bce2-a62d238873a7",
      "name": "Nota adhesiva2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -500,
        120
      ],
      "parameters": {
        "width": 220,
        "height": 520,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## OpenAI Formatter\nNode: OpenAI Chat Model (**gpt-4.1-mini**)\nUsed to:\n\nParse raw JSON responses\n\n**Convert numeric results into clean text blocks**\n\n**Label important stats** (e.g., trend, spread, volatility)\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "60d3f253-2d1f-480c-ac32-8fc48c4cfab2",
      "name": "Nota adhesiva1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -260,
        120
      ],
      "parameters": {
        "color": 3,
        "width": 220,
        "height": 520,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Simple Memory\nStores the session and symbol context. **Ensures continuity across tool calls** and can be used for **summarization logic.**\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "dccc52f0-2f57-4bdb-a16b-79e84275bda6",
      "name": "Nota adhesiva3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        20,
        120
      ],
      "parameters": {
        "color": 6,
        "width": 220,
        "height": 620,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n##  getCurrentPrice\nType: toolHttpRequest\nEndpoint:\nhttps://api.binance.com/api/v3/ticker/price\n\nInput:\n\njson\n{ \"symbol\": \"BTCUSDT\" }\n\n**Returns last trade price.**"
      },
      "typeVersion": 1
    },
    {
      "id": "dcae06d0-e8c6-4b72-87fd-1f730ef4829d",
      "name": "Nota adhesiva4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        260,
        120
      ],
      "parameters": {
        "color": 6,
        "width": 220,
        "height": 680,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## get24hrStats\nType: toolHttpRequest\nEndpoint:\nhttps://api.binance.com/api/v3/ticker/24hr\n\nInput:\n\njson\n{ \"symbol\": \"BTCUSDT\" }\n\n**Returns 24h OHLC, % change, and volume.**\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "4606d831-1579-4a5f-874a-c8d139369ebe",
      "name": "Nota adhesiva5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        500,
        120
      ],
      "parameters": {
        "color": 6,
        "width": 220,
        "height": 720,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## getOrderBook\nType: toolHttpRequest\nEndpoint:\nhttps://api.binance.com/api/v3/depth\n\nInput:\n\njson\n{\n  \"symbol\": \"BTCUSDT\",\n  \"limit\": 100\n}\n\n**Returns top 100 bids and asks.**"
      },
      "typeVersion": 1
    },
    {
      "id": "25239ca3-ca99-4095-9d64-5581d39244e0",
      "name": "Nota adhesiva6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        760,
        120
      ],
      "parameters": {
        "color": 6,
        "width": 220,
        "height": 720,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## getKlines (Multi-Timeframe)\nType: toolHttpRequest\nEndpoint:\nhttps://api.binance.com/api/v3/klines\nInputs:\n\nExecuted 4 times, once for each timeframe:\n\njson\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**Returns OHLCV for each interval’s most recent candle.**"
      },
      "typeVersion": 1
    },
    {
      "id": "9937f721-ab8e-4ef1-9809-9b146c98de1a",
      "name": "Nota adhesiva7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1240,
        -1420
      ],
      "parameters": {
        "width": 1220,
        "height": 2480,
        "content": "# 📈 Binance SM Price-24hrStats-OrderBook-Kline Tool – Documentation\n\nA market structure sub-agent that collects **real-time price data**, **order book depth**, **24-hour statistics**, and **multi-timeframe candlestick data** for any Binance Spot trading pair.\n\n---\n\n## 🎯 Purpose\n\nThis tool provides the foundation of all market structure insights for a symbol by:\n\n* Fetching current price (`/ticker/price`)\n* Retrieving 24h stats like OHLC and volume (`/ticker/24hr`)\n* Capturing order book data (bids/asks, `/depth`)\n* Pulling latest candlesticks for: **15m, 1h, 4h, 1d** intervals (`/klines`)\n\n---\n\n## 🧩 Included API Endpoints\n\n| Tool Name         | Endpoint               | Description                                   |\n| ----------------- | ---------------------- | --------------------------------------------- |\n| `getCurrentPrice` | `/api/v3/ticker/price` | Latest trade price                            |\n| `get24hrStats`    | `/api/v3/ticker/24hr`  | OHLC + volume in past 24 hours                |\n| `getOrderBook`    | `/api/v3/depth`        | Top 100 bid/ask levels                        |\n| `getKlines`       | `/api/v3/klines`       | OHLCV candles for 15m, 1h, 4h, 1d (limit = 1) |\n\nAll tools are triggered **together**, and return unified results to the parent agent.\n\n---\n\n## 🛠️ Workflow Architecture\n\n| Node                                  | Function                                                 |\n| ------------------------------------- | -------------------------------------------------------- |\n| ✅ `When Executed by Another Workflow` | Triggers this tool from Financial Analyst Agent          |\n| 🤖 `Binance SM Price... Agent`        | Receives prompt, extracts symbol, calls all market tools |\n| 💡 `OpenAI Chat Model (gpt-4o-mini)`  | Converts raw API output into clean Telegram summary      |\n| 🧠 `Simple Memory`                    | Tracks session context (`sessionId`, last-used symbol)   |\n\n---\n\n## 📥 Expected Input\n\nThis tool is **not user-facing** — it is triggered by a parent workflow with input like:\n\n```json\n{\n  \"message\": \"BTCUSDT\",\n  \"sessionId\": \"539847013\"\n}\n```\n\n---\n\n## 🧾 Telegram Output Example\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## ✅ Use Case Scenarios\n\n| Scenario                                | Result                                           |\n| --------------------------------------- | ------------------------------------------------ |\n| Trader asks for “current BTC data”      | Returns full snapshot across all structure tools |\n| Analyst needs “candles for SOL”         | Returns 15m, 1h, 4h, 1d OHLCV for SOLUSDT        |\n| Quant AI Agent triggers market analysis | Sends back clean Telegram-ready price structure  |\n\n---\n\n## 🚀 Installation Steps\n\n### 1. Import Workflow\n\n* Load this JSON into your n8n instance\n* Activate and rename for clarity if needed\n\n### 2. Credential Setup\n\n* No auth required for Binance public API\n* Ensure OpenAI API key is connected to `OpenAI Chat Model` node\n\n### 3. Trigger Configuration\n\n* This tool is **only executed via `Execute Workflow`** by:\n\n  * `Binance SM Financial Analyst Tool`\n  * `Binance Spot Market Quant AI Agent`\n\n---\n\n## 🔐 Licensing & Support\n\n🔗 **Don Jayamaha – LinkedIn**\n[http://linkedin.com/in/donjayamahajr](http://linkedin.com/in/donjayamahajr)\n\n© 2025 Treasurium Capital Limited Company. All rights reserved.\nThis automation system — including prompt flow, logic architecture, and tool structure — is proprietary to Treasurium Capital Limited Company. Redistribution, resale, or replication without license is prohibited under U.S. and international law.\n\n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "3c34c007-ae59-4ea9-a073-4d5ba14ba3b8",
  "connections": {
    "c5403bc9-349d-4205-9bd6-f0e48a33630e": {
      "ai_tool": [
        [
          {
            "node": "Binance SM Price-24hrStats-OrderBook-Kline Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "978a1d9f-b217-4455-b0b3-96b86d2fd809": {
      "ai_tool": [
        [
          {
            "node": "Binance SM Price-24hrStats-OrderBook-Kline Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "b6c4bb2d-6669-433a-a83b-f0c25c48e5ce": {
      "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
          }
        ]
      ]
    },
    "200b26ba-fd67-48a2-86fc-cc1f92548757": {
      "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
          }
        ]
      ]
    },
    "8f6328d3-2508-40e5-a01c-44e428384f16": {
      "main": [
        [
          {
            "node": "Binance SM Price-24hrStats-OrderBook-Kline Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Preguntas frecuentes

¿Cómo usar este flujo de trabajo?

Copie el código de configuración JSON de arriba, cree un nuevo flujo de trabajo en su instancia de n8n y seleccione "Importar desde JSON", pegue la configuración y luego modifique la configuración de credenciales según sea necesario.

¿En qué escenarios es adecuado este flujo de trabajo?

Avanzado - Finanzas, Inteligencia Artificial

¿Es de pago?

Este flujo de trabajo es completamente gratuito, puede importarlo y usarlo directamente. Sin embargo, tenga en cuenta que los servicios de terceros utilizados en el flujo de trabajo (como la API de OpenAI) pueden requerir un pago por su cuenta.

Información del flujo de trabajo
Nivel de dificultad
Avanzado
Número de nodos17
Categoría2
Tipos de nodos6
Descripción de la dificultad

Adecuado para usuarios avanzados, flujos de trabajo complejos con 16+ nodos

Autor
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.

Enlaces externos
Ver en n8n.io

Compartir este flujo de trabajo

Categorías

Categorías: 34