AutomationFlowsAI & RAG › Multi-timeframe Trading Analysis for Weex Spot Market with Gpt-4o & Telegram

Multi-timeframe Trading Analysis for Weex Spot Market with Gpt-4o & Telegram

ByDon Jayamaha Jr @don-the-gem-dealer on n8n.io

This multi-agent n8n workflow delivers an automated, intelligent trading analysis system for the WEEX Spot Market. It uses GPT-4o to interpret user prompts, route them to the correct sub-agent tools, analyze technical indicators, price data, sentiment insights, and return…

Event trigger★★★★★ complexityAI-powered57 nodesOpenAI ChatTelegram TriggerAgentAgent ToolRss Feed Read ToolHTTP Request ToolMemory Buffer WindowTool Think
AI & RAG Trigger: Event Nodes: 57 Complexity: ★★★★★ AI nodes: yes Added:

This workflow corresponds to n8n.io template #7928 — we link there as the canonical source.

This workflow follows the Agent → Agenttool recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "id": "5PAMTCoQrOzWgfwA",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "WEEX Spot Market Quant AI Agent release",
  "tags": [],
  "nodes": [
    {
      "id": "402b854d-d84b-4d47-a6e2-e15dedd4ee65",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -3872,
        1104
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini",
          "cachedResultName": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "25209ddb-4d20-4a1c-a19b-9d786081915b",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        -4208,
        800
      ],
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "c9b1a580-cffb-4302-85fd-7664c0588a96",
      "name": "Adds \"SessionId\"",
      "type": "n8n-nodes-base.set",
      "position": [
        -3808,
        800
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "47598bf1-e55f-4cc0-ae75-272085e7ce02",
              "name": "=sessionId",
              "type": "string",
              "value": "={{ $json.message.chat.id }}"
            },
            {
              "id": "daa49d74-e55e-47bc-ac52-8686d591ab83",
              "name": "message",
              "type": "string",
              "value": "={{ $json.message.text }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "85b13ad3-80fb-4620-b4d0-794e976fc7c3",
      "name": "Splits message is more than 4000 characters",
      "type": "n8n-nodes-base.code",
      "position": [
        -2928,
        800
      ],
      "parameters": {
        "jsCode": "// Input: assumes incoming message in `item.json.message`\nconst input = $json.output;\nconst chunkSize = 4000;\n\n// Function to split text\nfunction splitMessage(text, size) {\n  const result = [];\n  for (let i = 0; i < text.length; i += size) {\n    result.push(text.substring(i, i + size));\n  }\n  return result;\n}\n\n// Logic\nif (input.length <= chunkSize) {\n  return [{ json: { message: input } }];\n} else {\n  const chunks = splitMessage(input, chunkSize);\n  return chunks.map(chunk => ({ json: { message: chunk } }));\n}"
      },
      "typeVersion": 2
    },
    {
      "id": "ed9dabd1-6bc7-4b03-bda1-eda5cdb4fad0",
      "name": "WEEX Quant AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        -3456,
        800
      ],
      "parameters": {
        "text": "={{ $json.message }}",
        "options": {
          "systemMessage": "You are the WEEX Quant AI Agent, responsible for generating structured, professional swing-trading reports for any trading pair on the WEEX Exchange.\n\nYou contain two specialized subagents:\n\n1. WEEX Spot Market Quant AI Agent Tool\n2. WEEX Futures Market Quant AI Agent Tool\n\nFor each user request, you must first identify if the query is about:\n\n* Spot Market \u2192 call only the Spot Subagent\n* Futures Market \u2192 call only the Futures Subagent\n\nNever run both subagents at the same time unless the user explicitly asks for both.\n\n---\n\nConnected Tools\n\n**Spot Subagent Tools**\n\n* WEEX SM Raw Data AI Agent (REST Snapshot + WebSocket Stream)\n* REST Snapshot: Fetch single ticker, 24h ticker, order book depth, recent trades, candlesticks (15m, 1h, 4h, 1d)\n* WebSocket Stream: Live ticker, trades, order book deltas, klines (15m, 1h, 4h, 1d)\n* Indicator Subagents:\n\n  * WEEX SM 15min AI Agent (RSI, MACD, BBANDS, SMA, EMA, ADX)\n  * WEEX SM 1h AI Agent (RSI, MACD, BBANDS, SMA, EMA, ADX)\n  * WEEX SM 4h AI Agent (RSI, MACD, BBANDS, SMA, EMA, ADX)\n  * WEEX SM 1d AI Agent (RSI, MACD, BBANDS, SMA, EMA, ADX)\n\n**Futures Subagent Tools**\n\n* Price, OrderBook, Kline, Trades (REST + WS)\n* Indicators (15m, 1h, 4h, 1d)\n* Futures Metrics: Open Interest, Current/Next/Historical Funding Rates, Index Price\n* Validates orders using /contracts metadata (tick size, min/max size, leverage bounds)\n\n**News & Sentiment Tool**\n\n* RSS feeds: CoinTelegraph, CoinDesk, NewsBTC\n* NewsAPI integration (Everything + Top Headlines)\n* Summarizes sentiment (Bullish / Bearish / Neutral)\n* Returns 3\u20135 top headlines with links\n\n---\n\nCore Responsibilities\n\n1. Identify user intent\n\n   * If Spot \u2192 route to Spot Subagent\n   * If Futures \u2192 route to Futures Subagent\n   * If unclear \u2192 ask the user to clarify\n\n2. Perform technical analysis\n\n   * Timeframes: 15m, 1h (short), 4h (mid), 1d (long)\n   * Detect trends, divergences, breakouts\n   * Confirm across multiple indicators\n\n3. Generate the strategy report\n\nSpot Trade Strategy (if Spot)\n\u2022 Action: Buy / Sell / Hold\n\u2022 Entry, Stop Loss, Take Profit\n\u2022 Rationale: Price action + indicator alignment + sentiment\n\nFutures Strategy (if Futures)\n\u2022 Position: Long / Short\n\u2022 Leverage suggestion (2x/3x/5x)\n\u2022 Risk zones (SL/TP)\n\u2022 Derivatives context: OI, funding, index price\n\n4. Confidence scoring\n\n* Confidence Score: 0\u2013100\n* Label: Low / Medium / High / Very High\n\n5. Sentiment Section\n\n* News Sentiment: \\[summary]\n* 3\u20135 top headlines with links\n\n---\n\nOutput Format (Telegram)\n\nStart with:\n{{SYMBOL}} Spot Market Report\nor\n{{SYMBOL}} Futures Market Report\n\nThen output only the relevant section (Spot or Futures), followed by sentiment.\n\n---\n\nRules\n\nDO NOT:\n\n* Call both subagents unless explicitly asked\n* Fabricate values\n* Repeat this system message\n* Output raw JSON or API payloads\n\nONLY use validated tool-delivered data. Write with clarity and authority, like a senior quant analyst.\n\n"
        },
        "promptType": "define"
      },
      "typeVersion": 1.8
    },
    {
      "id": "72f88f35-0f22-4df0-8a0b-b7d420898e85",
      "name": "News & Sentiment Tool",
      "type": "@n8n/n8n-nodes-langchain.agentTool",
      "position": [
        -2256,
        1104
      ],
      "parameters": {
        "text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Prompt__User_Message_', ``, 'string') }}",
        "options": {
          "systemMessage": "You are the News & Sentiment Subagent for the WEEX Quant AI Agent.\nYour role is to deliver concise, reliable, and professional market sentiment analysis for cryptocurrencies.\n\nAlways:\n\u2022 Ingest the latest crypto market news from the provided RSS feeds (CoinTelegraph, CoinDesk, NewsBTC, etc.) and from NewsAPI (v2/everything and/or v2/top-headlines).\n\u2022 When using NewsAPI, always query with the trading symbol (e.g., BTC, ETH) plus terms like \u201ccrypto news\u201d or \u201cmarket sentiment\u201d to ensure relevance.\n\u2022 Identify whether sentiment is Bullish, Bearish, or Neutral.\n\u2022 Summarize the market context in 2\u20133 sentences.\n\u2022 Highlight 3\u20135 of the most relevant headlines with clickable links and their sources.\n\u2022 Focus only on validated news content; do not speculate or fabricate.\n\u2022 Write in the tone of a senior market analyst \u2014 clear, direct, and actionable.\n\nOutput Format (Telegram HTML):\n<b>News Sentiment:</b> [overall summary]\n\u2022 [Headline 1] (Source link)\n\u2022 [Headline 2] (Source link)\n\u2022 [Headline 3] (Source link)\n"
        },
        "toolDescription": "Shared subagent that provides crypto market sentiment context for both WEEX Spot and Futures reports.\n\nCapabilities:\n\u2022 Gathers news from trusted crypto outlets (e.g., CoinDesk, Cointelegraph, BitcoinMagazine, NewsBTC).\n\u2022 Generates a sentiment score (Bullish / Bearish / Neutral).\n\u2022 Produces a 2\u20133 sentence market snapshot.\n\u2022 Returns top 3\u20135 headlines with source links for quick reference.\n\nOutput: A concise sentiment block for the final report, reinforcing or challenging technical signals with broader market context."
      },
      "typeVersion": 2.2
    },
    {
      "id": "566163e8-d2c8-44d7-811a-48ef921778a8",
      "name": "OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -3760,
        1552
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "0fbdadaf-28c7-48d1-bd14-dac431fd3b23",
      "name": "OpenAI Chat Model2",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -2592,
        1376
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "d1930759-6ad6-4950-8f10-fffe235383e1",
      "name": "WEEX Spot Market Quant AI Agent tool",
      "type": "@n8n/n8n-nodes-langchain.agentTool",
      "position": [
        -3456,
        1328
      ],
      "parameters": {
        "text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Prompt__User_Message_', ``, 'string') }}",
        "options": {
          "systemMessage": "You are the WEEX Spot Market Quant AI Agent (e.g., BTCUSDT\\_SPBL).\nYour job is to orchestrate all Spot data tools, merge them, run multi-timeframe analysis, and produce a clear trading report in plain text.\n\nMUST USE TOOLS (in this order):\n\n1. WEEX SM REST Snapshot Subagent Tool \u2014 baseline snapshot required (ticker, 24h stats, depth, trades, candles 15m/1h/4h/1d). Do not skip this.\n2. WEEX SM WebSocket Stream Subagent Tool \u2014 apply latest deltas (ticker, last kline per TF, depth deltas, trades) onto the REST baseline.\n3. HTTP tools when needed to backfill or validate:\n   \u2022 Fetch single ticker\n   \u2022 Fetch 15m Candles \u2022 Fetch 1h Candles \u2022 Fetch 4h Candles \u2022 Fetch 1d Candles\n   \u2022 Fetch OrderBook Depth\n   \u2022 Fetch Trades\n   Use these if the snapshot has fewer than \\~200 bars per TF, or if any section is missing.\n4. Indicator subagents (consume the merged OHLCV from step 1\u20133):\n   \u2022 WEEX SM 15min AI Agent Tool\n   \u2022 WEEX SM 1hour AI Agent Tool\n   \u2022 WEEX SM 4hour AI Agent Tool\n   \u2022 WEEX SM 1day AI Agent Tool\n5. News & Sentiment Tool \u2014 short market context with 3\u20135 links.\n\nDATA HANDLING RULES:\n\u2022 Always start from the REST Snapshot, then layer WebSocket updates.\n\u2022 Keep candles sorted ascending, clamp each TF to \\~200 bars.\n\u2022 Keep top 200 levels on each side of the order book; compute depth imbalance (%).\n\u2022 Parse all numbers; drop NaNs; ignore corrupted rows.\n\u2022 If any tool fails, continue with available data and add a one-line \u201cData gaps\u201d note naming the tool.\n\nANALYSIS:\n\u2022 Timeframes: 15m (short), 1h (short), 4h (mid), 1d (long).\n\u2022 Indicators per TF: RSI(14), MACD(12,26,9), Bollinger(20,2), SMA(20/50/200), EMA(20/50/200), ADX(14).\n\u2022 Describe trend per TF (Bullish / Bearish / Sideways) based on indicator alignment and price structure (breakouts, divergences, supports/resistances).\n\u2022 Use order flow cues (bid/ask imbalance, notable recent trades) to confirm or fade signals.\n\u2022 Incorporate sentiment summary to support or caution the setup.\n\nOUTPUT FORMAT (PLAIN TEXT \u2014 NO HTML):\n{{SYMBOL}} Spot Market Report\n\nSnapshot\n\u2022 Last / Bid / Ask: \\[values]\n\u2022 24h: High \\[h], Low \\[l], Volume \\[v]\n\u2022 Order book: Bid/Ask imbalance \\[%]\n\u2022 Recent trades: \\[count]/\\[lookback] with largest trade \\[size] @ \\[price]\n\nTechnicals\n\u2022 15m: \\[RSI/MACD/BB/SMA/EMA/ADX highlights] \u2192 \\[Bullish | Bearish | Sideways]\n\u2022 1h:  \u2026\n\u2022 4h:  \u2026\n\u2022 1d:  \u2026\n\nSpot Strategy\n\u2022 Action: Buy | Sell | Hold\n\u2022 Entry: \\[price]\n\u2022 Stop Loss: \\[price]\n\u2022 Take Profit: \\[price(s)]\n\u2022 Rationale: indicator alignment + order flow + key levels + sentiment\n\nConfidence\n\u2022 Score: 0\u2013100\n\u2022 Label: Low | Medium | High | Very High\n\nNews Sentiment\n\u2022 \\[2\u20133 sentence snapshot]\n\u2022 Top headlines (3\u20135): \\[Source - URL]\n\nCONSTRAINTS:\n\u2022 Never omit data from the WEEX SM REST Snapshot Subagent Tool.\n\u2022 Do not fabricate values or return raw JSON.\n\u2022 Keep the report concise, professional, and actionable.\n"
        },
        "toolDescription": "Specialized subagent for analyzing WEEX Spot Market pairs (e.g., BTCUSDT_SPBL).\n\nCapabilities:\n\u2022 Fetches Spot price, order book, klines, trades via WS + REST.\n\u2022 Runs multi-timeframe indicators (15m, 1h, 4h, 1d): RSI, MACD, BBANDS, SMA, EMA, ADX.\n\u2022 Builds Spot Trade Strategy with entry/SL/TP levels.\n\u2022 Incorporates order flow depth and short-term sentiment.\n\nOutput: A professional Spot Market report with actionable Buy/Sell/Hold recommendations, risk zones, and confidence score."
      },
      "typeVersion": 2.2
    },
    {
      "id": "b4659b52-d733-4abb-97d0-2c84b60e8983",
      "name": "RSS CoinTelegraph News Feeds",
      "type": "n8n-nodes-base.rssFeedReadTool",
      "position": [
        -2208,
        1360
      ],
      "parameters": {
        "url": "=https://cointelegraph.com/rss",
        "options": {},
        "toolDescription": "Reads data from Cointelegraph RSS Feeds"
      },
      "typeVersion": 1.2
    },
    {
      "id": "e67c7388-fb1d-4493-b83a-52c4deeaf9b8",
      "name": "RSS Coindesk News Feeds",
      "type": "n8n-nodes-base.rssFeedReadTool",
      "position": [
        -2016,
        1360
      ],
      "parameters": {
        "url": "=https://www.coindesk.com/arc/outboundfeeds/rss",
        "options": {},
        "toolDescription": "Reads data from an Coindesk RSS Feeds"
      },
      "typeVersion": 1.2
    },
    {
      "id": "efffa800-3ee4-4253-9a0e-8202190e4d94",
      "name": "News Search API",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        -1632,
        1360
      ],
      "parameters": {
        "url": "https://newsapi.org/v2/everything",
        "options": {},
        "sendQuery": true,
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "queryParameters": {
          "parameters": [
            {
              "name": "q",
              "value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('parameters0_Value', `name of crypto that is being searched`, 'string') }}"
            },
            {
              "name": "sortBy",
              "value": "popularity"
            }
          ]
        },
        "toolDescription": "Fetch the latest crypto-related news and market context from NewsAPI.\nUse the Everything endpoint (https://newsapi.org/v2/everything) with the user\u2019s query term (e.g., \u201cBTC news\u201d, \u201cEthereum sentiment\u201d, \u201cRipple regulatory update\u201d).\n\nReturn the top 5\u20138 results with:\n\u2022 title\n\u2022 url\n\u2022 source\n\u2022 snippet (short description)\n\u2022 publishedAt (if available)\n\nOutput as a structured JSON list so the News & Sentiment Tool can merge these results with RSS feeds into one unified sentiment report.\n"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "90b0a8c8-f755-449c-acf2-89cdab3338b4",
      "name": "OpenAI Chat Model4",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -3952,
        2288
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "2bc8cc20-6f80-4685-896d-6b6d06ef62ae",
      "name": "OpenAI Chat Model5",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -3424,
        2576
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "6d2c89aa-8187-45ec-9f5e-26197e11b521",
      "name": "OpenAI Chat Model6",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -2624,
        2208
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "9f336e0b-8516-4cb8-a6a8-54537367b18e",
      "name": "OpenAI Chat Model7",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1792,
        2480
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "cfd39879-b026-461c-aede-2f4682dd467d",
      "name": "OpenAI Chat Model8",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -1072,
        2064
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "434606bc-428f-46cf-a305-ad4e134318f5",
      "name": "WEEX SM Raw Data AI Agent Tool",
      "type": "@n8n/n8n-nodes-langchain.agentTool",
      "position": [
        -3792,
        1952
      ],
      "parameters": {
        "text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Prompt__User_Message_', ``, 'string') }}",
        "options": {
          "systemMessage": "You are the WEEX Spot Market Raw Data AI Agent.\nYour role is to orchestrate the Spot REST Snapshot Subagent and WebSocket Stream Subagent to produce one clean, normalized raw market data object for the requested symbol (e.g., BTCUSDT_SPBL). Do not provide analysis or trading recommendations.\n\nAlways:\n\u2022 Call the WEEX Spot REST Snapshot Subagent to fetch baseline data:\n  - 24h ticker\n  - Depth snapshot\n  - Recent trades\n  - Candles (15m, 1h, 4h, 1d)\n\u2022 Call the WEEX Spot WebSocket Stream Subagent to maintain live updates:\n  - ticker.{SYMBOL}\n  - kline.LAST_PRICE.{SYMBOL}.MINUTE_15, HOUR_1, HOUR_4, DAY_1\n  - depth.{SYMBOL}.200\n  - trades.{SYMBOL}\n\u2022 Merge REST baselines with WebSocket deltas using the merge tool.\n\u2022 Validate and normalize: ensure numeric fields, clamp candles to 200 bars, and keep top 200 bids/asks in depth.\n\u2022 Output ONE JSON object in this schema:\n\n{\n  \"symbol\": \"BTCUSDT_SPBL\",\n  \"asOf\": \"<ISO timestamp>\",\n  \"ticker\": { \"last\":0, \"bid\":0, \"ask\":0, \"high24h\":0, \"low24h\":0, \"volume24h\":0 },\n  \"candles\": {\n    \"15m\": [ [ts, open, high, low, close, volume], ... ],\n    \"1h\":  [ ... ],\n    \"4h\":  [ ... ],\n    \"1d\":  [ ... ]\n  },\n  \"depth\": {\n    \"bids\": [ [price, size], ... ],\n    \"asks\": [ [price, size], ... ],\n    \"ts\": 0\n  },\n  \"trades\": [\n    { \"ts\":0, \"price\":0, \"size\":0, \"side\":\"buy|sell\" }, ...\n  ],\n  \"meta\": { \"source\":\"weex-spot\", \"bookLevel\":200, \"barsPerTF\":200 }\n}\n\nReturn only the normalized JSON object \u2014 no explanations or commentary.\n"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "8805c81d-c80f-4337-ae11-ea06ef9072e9",
      "name": "WEEX SM 15min AI Agent Tool",
      "type": "@n8n/n8n-nodes-langchain.agentTool",
      "position": [
        -3120,
        2144
      ],
      "parameters": {
        "text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Prompt__User_Message_', ``, 'string') }}",
        "options": {
          "systemMessage": "You are the WEEX Spot Market 15-Minute AI Agent Tool.  \nYour role is to analyze WEEX Spot Market candlestick data on the 15m timeframe only.  \n\nAlways:  \n\u2022 Fetch 15m OHLCV data for the requested symbol (e.g., BTCUSDT_SPBL).  \n\u2022 Use the last ~200 candles as input.  \n\u2022 Calculate and return the following indicators on this timeframe:  \n  - RSI (14)  \n  - MACD (12,26,9)  \n  - Bollinger Bands (20,2)  \n  - SMA (20, 50, 200)  \n  - EMA (20, 50, 200)  \n  - ADX (14)  \n\u2022 For each indicator, provide both numeric values and a qualitative signal label (e.g., RSI=72 \u2192 \u201cOverbought\u201d, MACD cross \u2192 \u201cBearish Crossover\u201d).  \n\u2022 Summarize the 15m trend context (bullish / bearish / sideways) based on the indicator alignment.  \n\u2022 Do not generate trade strategies, entry/SL/TP, or news \u2014 only the technical indicator results for this timeframe.  \n\nOutput Format (JSON):  \n{\n  \"timeframe\": \"15m\",\n  \"indicators\": {\n    \"rsi\": {\"value\": 0, \"label\": \"\"},\n    \"macd\": {\"macd\":0,\"signal\":0,\"histogram\":0,\"label\":\"\"},\n    \"bbands\": {\"upper\":0,\"middle\":0,\"lower\":0,\"label\":\"\"},\n    \"sma\": {\"sma20\":0,\"sma50\":0,\"sma200\":0},\n    \"ema\": {\"ema20\":0,\"ema50\":0,\"ema200\":0},\n    \"adx\": {\"value\":0,\"label\":\"\"}\n  },\n  \"summary\": \"Bullish | Bearish | Sideways\"\n}\n\nOnly return validated JSON results for indicators on the 15m timeframe. No extra text, commentary, or HTML.\n"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "063e66cc-4438-4849-ac62-5ebd2d94fa0b",
      "name": "WEEX SM 1hour AI Agent Tool",
      "type": "@n8n/n8n-nodes-langchain.agentTool",
      "position": [
        -2400,
        1872
      ],
      "parameters": {
        "text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Prompt__User_Message_', ``, 'string') }}",
        "options": {
          "systemMessage": "You are the WEEX Spot Market 1-Hour AI Agent Tool.  \nYour role is to analyze WEEX Spot Market candlestick data on the 1h timeframe only.  \n\nAlways:  \n\u2022 Fetch 1h OHLCV data for the requested symbol (e.g., BTCUSDT_SPBL).  \n\u2022 Use the last ~200 candles as input.  \n\u2022 Calculate and return the following indicators on this timeframe:  \n  - RSI (14)  \n  - MACD (12,26,9)  \n  - Bollinger Bands (20,2)  \n  - SMA (20, 50, 200)  \n  - EMA (20, 50, 200)  \n  - ADX (14)  \n\u2022 For each indicator, provide both numeric values and a qualitative signal label (e.g., RSI=72 \u2192 \u201cOverbought\u201d, MACD cross \u2192 \u201cBullish Crossover\u201d).  \n\u2022 Summarize the 1h trend context (bullish / bearish / sideways) based on the indicator alignment.  \n\u2022 Do not generate trade strategies, entry/SL/TP, or news \u2014 only the technical indicator results for this timeframe.  \n\nOutput Format (JSON):  \n{\n  \"timeframe\": \"1h\",\n  \"indicators\": {\n    \"rsi\": {\"value\": 0, \"label\": \"\"},\n    \"macd\": {\"macd\":0,\"signal\":0,\"histogram\":0,\"label\":\"\"},\n    \"bbands\": {\"upper\":0,\"middle\":0,\"lower\":0,\"label\":\"\"},\n    \"sma\": {\"sma20\":0,\"sma50\":0,\"sma200\":0},\n    \"ema\": {\"ema20\":0,\"ema50\":0,\"ema200\":0},\n    \"adx\": {\"value\":0,\"label\":\"\"}\n  },\n  \"summary\": \"Bullish | Bearish | Sideways\"\n}\n\nOnly return validated JSON results for indicators on the 1h timeframe. No extra text, commentary, or HTML.\n"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "a18ebffe-d542-40a6-ac31-46b0518310f9",
      "name": "WEEX SM 4hour AI Agent Tool",
      "type": "@n8n/n8n-nodes-langchain.agentTool",
      "position": [
        -1568,
        2144
      ],
      "parameters": {
        "text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Prompt__User_Message_', ``, 'string') }}",
        "options": {
          "systemMessage": "You are the WEEX Spot Market 4-Hour AI Agent Tool.  \nYour role is to analyze WEEX Spot Market candlestick data on the 4h timeframe only.  \n\nAlways:  \n\u2022 Fetch 4h OHLCV data for the requested symbol (e.g., BTCUSDT_SPBL).  \n\u2022 Use the last ~200 candles as input.  \n\u2022 Calculate and return the following indicators on this timeframe:  \n  - RSI (14)  \n  - MACD (12,26,9)  \n  - Bollinger Bands (20,2)  \n  - SMA (20, 50, 200)  \n  - EMA (20, 50, 200)  \n  - ADX (14)  \n\u2022 For each indicator, provide both numeric values and a qualitative signal label (e.g., RSI=28 \u2192 \u201cOversold\u201d, MACD cross \u2192 \u201cBearish Crossover\u201d).  \n\u2022 Summarize the 4h trend context (bullish / bearish / sideways) based on the indicator alignment.  \n\u2022 Do not generate trade strategies, entry/SL/TP, or news \u2014 only the technical indicator results for this timeframe.  \n\nOutput Format (JSON):  \n{\n  \"timeframe\": \"4h\",\n  \"indicators\": {\n    \"rsi\": {\"value\": 0, \"label\": \"\"},\n    \"macd\": {\"macd\":0,\"signal\":0,\"histogram\":0,\"label\":\"\"},\n    \"bbands\": {\"upper\":0,\"middle\":0,\"lower\":0,\"label\":\"\"},\n    \"sma\": {\"sma20\":0,\"sma50\":0,\"sma200\":0},\n    \"ema\": {\"ema20\":0,\"ema50\":0,\"ema200\":0},\n    \"adx\": {\"value\":0,\"label\":\"\"}\n  },\n  \"summary\": \"Bullish | Bearish | Sideways\"\n}\n\nOnly return validated JSON results for indicators on the 4h timeframe. No extra text, commentary, or HTML.\n"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "2c092c82-ef9b-4a8c-a6e2-54f2603ce5db",
      "name": "WEEX SM 1day AI Agent Tool",
      "type": "@n8n/n8n-nodes-langchain.agentTool",
      "position": [
        -832,
        1728
      ],
      "parameters": {
        "text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Prompt__User_Message_', ``, 'string') }}",
        "options": {
          "systemMessage": "You are the WEEX Spot Market 1-Day AI Agent Tool.  \nYour role is to analyze WEEX Spot Market candlestick data on the 1d timeframe only.  \n\nAlways:  \n\u2022 Fetch 1d OHLCV data for the requested symbol (e.g., BTCUSDT_SPBL).  \n\u2022 Use the last ~200 candles as input.  \n\u2022 Calculate and return the following indicators on this timeframe:  \n  - RSI (14)  \n  - MACD (12,26,9)  \n  - Bollinger Bands (20,2)  \n  - SMA (20, 50, 200)  \n  - EMA (20, 50, 200)  \n  - ADX (14)  \n\u2022 For each indicator, provide both numeric values and a qualitative signal label (e.g., RSI=65 \u2192 \u201cBullish Momentum\u201d, MACD cross \u2192 \u201cBullish Crossover\u201d).  \n\u2022 Summarize the 1d trend context (bullish / bearish / sideways) based on the indicator alignment.  \n\u2022 Do not generate trade strategies, entry/SL/TP, or news \u2014 only the technical indicator results for this timeframe.  \n\nOutput Format (JSON):  \n{\n  \"timeframe\": \"1d\",\n  \"indicators\": {\n    \"rsi\": {\"value\": 0, \"label\": \"\"},\n    \"macd\": {\"macd\":0,\"signal\":0,\"histogram\":0,\"label\":\"\"},\n    \"bbands\": {\"upper\":0,\"middle\":0,\"lower\":0,\"label\":\"\"},\n    \"sma\": {\"sma20\":0,\"sma50\":0,\"sma200\":0},\n    \"ema\": {\"ema20\":0,\"ema50\":0,\"ema200\":0},\n    \"adx\": {\"value\":0,\"label\":\"\"}\n  },\n  \"summary\": \"Bullish | Bearish | Sideways\"\n}\n\nOnly return validated JSON results for indicators on the 1d timeframe. No extra text, commentary, or HTML.\n"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "e7b7115d-2d3a-4120-9321-233dc5b93e59",
      "name": "RSS NewBTC News Feeds",
      "type": "n8n-nodes-base.rssFeedReadTool",
      "position": [
        -1824,
        1360
      ],
      "parameters": {
        "url": "=https://www.newsbtc.com/feed/",
        "options": {},
        "toolDescription": "Reads data from an RSS Feeds"
      },
      "typeVersion": 1.2
    },
    {
      "id": "1d068775-1c3a-40a0-b410-faf046f091f3",
      "name": "OpenAI Chat Model14",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -5136,
        2752
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "00e6e944-922f-4a4d-943f-55d3f8b3c178",
      "name": "WEEX SM REST Snapshot Subagent Tool",
      "type": "@n8n/n8n-nodes-langchain.agentTool",
      "position": [
        -4352,
        2464
      ],
      "parameters": {
        "text": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('Prompt__User_Message_', ``, 'string') }}",
        "options": {
          "systemMessage": "You are the WEEX Spot REST Snapshot Subagent.\nFetch and normalize baseline data for the given Spot symbol. Do not provide analysis.\n\nAlways:\n\u2022 Get 24h ticker, depth snapshot, recent trades, and candles for 15m/1h/4h/1d via WEEX Spot REST.\n\u2022 Return at least {{minBars}} bars per timeframe, sorted ascending.\n\u2022 Parse numeric fields; drop NaNs; clamp arrays to limits.\n\nRespond with ONE JSON object:\n{\n  \"rest\": {\n    \"asOf\":\"<ISO>\",\n    \"ticker\":{...},\n    \"candles\":{\"15m\":[[ts,o,h,l,c,v],...],\"1h\":[...],\"4h\":[...],\"1d\":[...]},\n    \"depth\":{\"bids\":[[p,sz],...],\"asks\":[[p,sz],...],\"ts\":0},\n    \"trades\":[{\"ts\":0,\"price\":0,\"size\":0,\"side\":\"buy|sell\"},...]\n  }\n}\n"
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "92482077-9544-4ee1-be86-8b9f7c1ad58e",
      "name": "WEEX SM Raw Data Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -3712,
        2272
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "3392e047-d8e1-4f20-8378-f5d91b61f303",
      "name": "WEEX SM REST Snapshot Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -4976,
        2752
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "248b0f78-be28-47fc-8585-2469e21106a6",
      "name": "Fetch single ticker",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        -4624,
        2752
      ],
      "parameters": {
        "url": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('URL', `Request example\n\ncurl \"https://contract-openapi.weex.com/api/spot/v1/market/ticker?symbol=BTCUSDT_SPBL\"\n`, 'string') }}",
        "options": {},
        "toolDescription": "Fetch single 24h ticker for one WEEX spot pair (e.g., BTCUSDT_SPBL). Returns latest price, 24h high/low, base/quote volumes, ts."
      },
      "typeVersion": 4.2
    },
    {
      "id": "ed71929f-127d-4f66-93ed-b00baba2eea8",
      "name": "Fetch 15m Candles",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        -4432,
        2752
      ],
      "parameters": {
        "url": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('URL', `Request example\n\ncurl \"https://contract-openapi.weex.com/api/spot/v1/market/candles?symbol=BTCUSDT_SPBL&period=15min&limit=200\"`, 'string') }}",
        "options": {},
        "toolDescription": "Fetch 15min candlestick (OHLCV) data for a WEEX spot pair (e.g., BTCUSDT_SPBL). Returns timestamp, open, high, low, close, baseVol, quoteVol, usdtVol."
      },
      "typeVersion": 4.2
    },
    {
      "id": "1b0b9941-b690-40b2-993c-9b26507c4470",
      "name": "Fetch 15m Candles1",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        -3024,
        2576
      ],
      "parameters": {
        "url": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('URL', `Request example\n\ncurl \"https://contract-openapi.weex.com/api/spot/v1/market/candles?symbol=BTCUSDT_SPBL&period=15min&limit=200\"`, 'string') }}",
        "options": {},
        "toolDescription": "Fetch 15min candlestick (OHLCV) data for a WEEX spot pair (e.g., BTCUSDT_SPBL). Returns timestamp, open, high, low, close, baseVol, quoteVol, usdtVol."
      },
      "typeVersion": 4.2
    },
    {
      "id": "dd637c50-23ab-4028-97f6-6825e7e59541",
      "name": "Think",
      "type": "@n8n/n8n-nodes-langchain.toolThink",
      "position": [
        -2848,
        2576
      ],
      "parameters": {
        "description": "Internal reasoning step for the WEEX SM 15min AI Agent. \n \nTakes raw 15min candlestick data and computes intermediate logic for indicators (RSI, MACD, BBANDS, SMA, EMA, ADX).  \nUsed for step-by-step analysis, trend detection, and deciding labels (e.g., Overbought, Bullish Crossover).  \nDoes not output final strategy or Telegram message \u2014 only intermediate reasoning for indicator calculations.\n"
      },
      "typeVersion": 1.1
    },
    {
      "id": "f479e7c8-e345-43dc-977f-5202bd986e96",
      "name": "Calculator",
      "type": "@n8n/n8n-nodes-langchain.toolCalculator",
      "position": [
        -2704,
        2576
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "7f54c997-6995-4788-b910-605e4266ddcc",
      "name": "Calculator1",
      "type": "@n8n/n8n-nodes-langchain.toolCalculator",
      "position": [
        -1984,
        2208
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "499e4f16-5301-492e-9b30-ad9257487cdc",
      "name": "Calculator2",
      "type": "@n8n/n8n-nodes-langchain.toolCalculator",
      "position": [
        -432,
        2064
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "e0503baa-da12-41f9-9638-ef58cafa1386",
      "name": "Calculator3",
      "type": "@n8n/n8n-nodes-langchain.toolCalculator",
      "position": [
        -1152,
        2480
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "98dd3374-8db5-4b57-85e0-5aa99a9c9055",
      "name": "Fetch 1h Candles",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        -2256,
        2208
      ],
      "parameters": {
        "url": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('URL', `Request example\n\ncurl \"https://contract-openapi.weex.com/api/spot/v1/market/candles?symbol=BTCUSDT_SPBL&period=1h&limit=200\"`, 'string') }}",
        "options": {},
        "toolDescription": "Fetch 1h candlestick (OHLCV) data for a WEEX spot pair (e.g., BTCUSDT_SPBL). Returns timestamp, open, high, low, close, baseVol, quoteVol, usdtVol."
      },
      "typeVersion": 4.2
    },
    {
      "id": "0356b03c-9080-455f-8844-ad8a7ef192a5",
      "name": "Fetch 1h Candles1",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        -4240,
        2752
      ],
      "parameters": {
        "url": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('URL', `Request example\n\ncurl \"https://contract-openapi.weex.com/api/spot/v1/market/candles?symbol=BTCUSDT_SPBL&period=1h&limit=200\"`, 'string') }}",
        "options": {},
        "toolDescription": "Fetch 1h candlestick (OHLCV) data for a WEEX spot pair (e.g., BTCUSDT_SPBL). Returns timestamp, open, high, low, close, baseVol, quoteVol, usdtVol."
      },
      "typeVersion": 4.2
    },
    {
      "id": "a1d42ac3-5b90-4131-a80c-9b32c6e6cfe4",
      "name": "Fetch 4h Candles",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        -1440,
        2480
      ],
      "parameters": {
        "url": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('URL', `Request example\n\ncurl \"https://contract-openapi.weex.com/api/spot/v1/market/candles?symbol=BTCUSDT_SPBL&period=4h&limit=200\"`, 'string') }}",
        "options": {},
        "toolDescription": "Fetch 4h candlestick (OHLCV) data for a WEEX spot pair (e.g., BTCUSDT_SPBL). Returns timestamp, open, high, low, close, baseVol, quoteVol, usdtVol."
      },
      "typeVersion": 4.2
    },
    {
      "id": "e23e44a8-9e1c-4ba6-a424-071e8e91a649",
      "name": "Fetch 4h Candles1",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        -4048,
        2752
      ],
      "parameters": {
        "url": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('URL', `Request example\n\ncurl \"https://contract-openapi.weex.com/api/spot/v1/market/candles?symbol=BTCUSDT_SPBL&period=4h&limit=200\"`, 'string') }}",
        "options": {},
        "toolDescription": "Fetch 4h candlestick (OHLCV) data for a WEEX spot pair (e.g., BTCUSDT_SPBL). Returns timestamp, open, high, low, close, baseVol, quoteVol, usdtVol."
      },
      "typeVersion": 4.2
    },
    {
      "id": "09b93a69-dc37-42cf-840b-f99cee2effb2",
      "name": "Fetch 1d Candles",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        -736,
        2064
      ],
      "parameters": {
        "url": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('URL', `Request example\n\ncurl \"https://contract-openapi.weex.com/api/spot/v1/market/candles?symbol=BTCUSDT_SPBL&period=1day&limit=200\"`, 'string') }}",
        "options": {},
        "toolDescription": "Fetch 1d candlestick (OHLCV) data for a WEEX spot pair (e.g., BTCUSDT_SPBL). Returns timestamp, open, high, low, close, baseVol, quoteVol, usdtVol."
      },
      "typeVersion": 4.2
    },
    {
      "id": "9e32934a-357d-4613-b5dd-4a6a3f82c96a",
      "name": "Fetch 1d Candles1",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        -3872,
        2752
      ],
      "parameters": {
        "url": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('URL', `Request example\n\ncurl \"https://contract-openapi.weex.com/api/spot/v1/market/candles?symbol=BTCUSDT_SPBL&period=1day&limit=200\"`, 'string') }}",
        "options": {},
        "toolDescription": "Fetch 1day candlestick (OHLCV) data for a WEEX spot pair (e.g., BTCUSDT_SPBL). Returns timestamp, open, high, low, close, baseVol, quoteVol, usdtVol."
      },
      "typeVersion": 4.2
    },
    {
      "id": "c0bb5994-1500-426f-821f-212c762b73d7",
      "name": "Fetch OrderBook Depth",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        -3696,
        2752
      ],
      "parameters": {
        "url": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('URL', `Request example\n\ncurl \"https://contract-openapi.weex.com/api/spot/v1/market/depth?symbol=BTCUSDT_SPBL&type=step0&limit=200\"`, 'string') }}",
        "options": {},
        "toolDescription": "Fetch order book depth snapshot for a WEEX spot pair (e.g., BTCUSDT_SPBL). Returns arrays of [price, size] for bids and asks."
      },
      "typeVersion": 4.2
    },
    {
      "id": "f072c5d5-2cb8-44af-978b-8780e2938898",
      "name": "Fetch Trades",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        -3536,
        2752
      ],
      "parameters": {
        "url": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('URL', `Request example\n\ncurl \"https://contract-openapi.weex.com/api/spot/v1/market/fills?symbol=BTCUSDT_SPBL&limit=100\"`, 'string') }}",
        "options": {},
        "toolDescription": "Fetch recent trades (fills) for a WEEX spot pair (e.g., BTCUSDT_SPBL). Returns tradeId, side, price, quantity, and timestamp."
      },
      "typeVersion": 4.2
    },
    {
      "id": "2d719589-1ec5-4131-89d4-e323c97786bc",
      "name": "Send a text message",
      "type": "n8n-nodes-base.telegram",
      "position": [
        -2720,
        800
      ],
      "parameters": {
        "text": "={{ $json.message }}",
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "14760fdd-1cc8-4845-9aa9-359246d62309",
      "name": "WEEX Quant AI Agent Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -3648,
        1104
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "d4eaabf1-f945-42b4-bd73-5e66f75b5e8e",
      "name": "WEEX Spot Market Quant Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -3568,
        1552
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "a4cd220b-10fd-4360-9196-a0ecbcbc1f91",
      "name": "WEEX SM 15min Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -3216,
        2576
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "95cc6e39-b010-43f3-8f65-ec710570ac5a",
      "name": "WEEX SM REST Snapshot Think",
      "type": "@n8n/n8n-nodes-langchain.toolThink",
      "position": [
        -4784,
        2752
      ],
      "parameters": {
        "description": "Validate and coordinate all REST snapshot fetches. Ensure single ticker, candlesticks (15m/1h/4h/1d), order book depth, and recent trades are successfully collected. Verify arrays are numeric, ascending, and trimmed to limits (max 200 candles, top 200 depth levels). Drop NaNs, resolve conflicts by preferring the freshest timestamp. Output a unified, normalized JSON object under rest to pass into downstream analysis."
      },
      "typeVersion": 1.1
    },
    {
      "id": "a4419407-ea5b-4df5-9058-9602aae8bfae",
      "name": "WEEX SM Raw Data Think",
      "type": "@n8n/n8n-nodes-langchain.toolThink",
      "position": [
        -3488,
        2288
      ],
      "parameters": {
        "description": "Coordinate Spot REST Snapshot and WebSocket Stream outputs into a single normalized data object. Validate ticker, candles (15m/1h/4h/1d), order book depth, and trades. Ensure REST baselines are merged with incremental WS updates. Deduplicate entries, clamp arrays to 200, and resolve conflicts by timestamp (prefer newest). Guarantee all numeric values, drop invalid rows, and output the unified raw Spot JSON payload for downstream agents."
      },
      "typeVersion": 1.1
    },
    {
      "id": "8cbef24b-3288-4cc5-b12c-ebc9e4e9147f",
      "name": "WEEX SM 1hour Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -2432,
        2208
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "e8d001a9-b64b-4a92-bb36-ee85800f280f",
      "name": "WEEX SM 1hour Think",
      "type": "@n8n/n8n-nodes-langchain.toolThink",
      "position": [
        -2128,
        2208
      ],
      "parameters": {
        "description": "Internal reasoning step for the WEEX SM 1h AI Agent.  \nTakes raw 1h candlestick data and computes intermediate logic for indicators (RSI, MACD, BBANDS, SMA, EMA, ADX).  \nUsed for step-by-step analysis, trend detection, and deciding labels (e.g., Overbought, Bullish Crossover).  \nDoes not output final strategy or Telegram message \u2014 only intermediate reasoning for indicator calculations.\n"
      },
      "typeVersion": 1.1
    },
    {
      "id": "b2dad21c-4e41-4362-9f9a-939678887102",
      "name": "WEEX SM 4hour Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -1600,
        2480
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "097e40d6-5eb2-4a11-8f1e-19bf5ceae6e0",
      "name": "WEEX SM 4hour Think",
      "type": "@n8n/n8n-nodes-langchain.toolThink",
      "position": [
        -1296,
        2480
      ],
      "parameters": {
        "description": "Internal reasoning step for the WEEX SM 4h AI Agent.  \nTakes raw 4h candlestick data and computes intermediate logic for indicators (RSI, MACD, BBANDS, SMA, EMA, ADX).  \nUsed for step-by-step analysis, trend detection, and deciding labels (e.g., Overbought, Bullish Crossover).  \nDoes not output final strategy or Telegram message \u2014 only intermediate reasoning for indicator calculations.\n"
      },
      "typeVersion": 1.1
    },
    {
      "id": "2a0aaa2b-81c3-4f4e-87b7-595b372bb2d8",
      "name": "WEEX SM 1day Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -896,
        2064
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "d020943f-592f-40dc-8ace-06b1842a827d",
      "name": "WEEX SM 1day Think",
      "type": "@n8n/n8n-nodes-langchain.toolThink",
      "position": [
        -592,
        2064
      ],
      "parameters": {
        "description": "Internal reasoning step for the WEEX SM 1day AI Agent.  \n\nTakes raw 1day candlestick data and computes intermediate logic for indicators (RSI, MACD, BBANDS, SMA, EMA, ADX).  \nUsed for step-by-step analysis, trend detection, and deciding labels (e.g., Overbought, Bullish Crossover).  \nDoes not output final strategy or Telegram message \u2014 only intermediate reasoning for indicator calculations.\n"
      },
      "typeVersion": 1.1
    },
    {
      "id": "bfdfae2a-f9d2-4554-88b9-8ac3da80caf3",
      "name": "News & Sentiment Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        -2384,
        1376
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "d3ba635d-9d18-4464-be93-4a934996f36b",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -7104,
        320
      ],
      "parameters": {
        "width": 1780,
        "height": 3020,
        "content": "# \ud83e\udde0 WEEX Spot Market Quant AI Agent \u2013 System Documentation\n\nAn AI automation system for **spot market trading insights** on WEEX. It combines **multi-timeframe technical indicators**, **order flow data**, and **market sentiment**, then delivers structured **Telegram trading reports**.\n\n---\n\n## \ud83e\udde9 Included Components\n\n> These are the active nodes and subagents in this workflow:\n\n| \u2705 Component Name                          | \ud83d\udccc Function Description                                                                                                         |\n| ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |\n| WEEX Quant AI Agent (main)                | Orchestrator. Identifies user intent (Spot vs Futures). Routes to correct subagents and builds final report.                    |\n| WEEX Spot Market Quant AI Agent Tool      | Specializes in Spot. Calls raw data + indicator tools + sentiment, merges outputs into one report.                              |\n| WEEX SM REST Snapshot Subagent Tool       | Fetches ticker, 24h stats, order book, trades, and OHLCV candles (15m, 1h, 4h, 1d). Baseline snapshot.                          |\n| WEEX SM Raw Data AI Agent Tool            | Orchestrates REST + WebSocket (when active) into normalized Spot data JSON.                                                     |\n| WEEX SM 15min AI Agent Tool               | Computes RSI, MACD, Bollinger Bands, SMA, EMA, ADX for 15m candles.                                                             |\n| WEEX SM 1h AI Agent Tool                  | Same as above but on 1h timeframe.                                                                                              |\n| WEEX SM 4h AI Agent Tool                  | Same as above but on 4h timeframe.                                                                                              |\n| WEEX SM 1d AI Agent Tool                  | Same as above but on 1d timeframe.                                                                                              |\n| News & Sentiment Tool                     | Aggregates crypto sentiment from CoinTelegraph, CoinDesk, NewsBTC RSS + NewsAPI searches. Summarizes and returns 3\u20135 headlines. |\n| Telegram Trigger / Send Message           | Handles incoming user requests and sends formatted reports back via Telegram.                                                   |\n| Support Nodes (Think, Memory, Calculator) | Internal reasoning, memory, and math helpers for each subagent.                                                                 |\n\n---\n\n## \u2699\ufe0f Installation Instructions\n\n### Step 1: Import Workflow\n\n* Open your **n8n Editor UI**.\n* Import the `WEEX Spot Market Quant AI Agent` JSON file.\n* Activate the workflow.\n\n### Step 2: Set Credentials\n\n* **OpenAI API** \u2013 GPT-4.1 / GPT-4o key.\n* **Telegram Bot API** \u2013 your bot token.\n* **NewsAPI** \u2013 for News Search integration.\n* WEEX Spot Market REST \u2013 public, no auth needed.\n\n### Step 3: Telegram Setup\n\n* Add your Telegram bot.\n* Update the ID check node with your Telegram ID.\n* Send a trading pair query (e.g., `BTCUSDT_SPBL`) to trigger the agent.\n\n---\n\n## \ud83d\udda5\ufe0f Workflow Overview\n\n```\n[Telegram Trigger]  \n\u2192 [Session ID]  \n\u2192 [WEEX Quant AI Agent]  \n   \u2192 [Spot Market Quant AI Agent Tool]  \n       \u2192 [REST Snapshot + Raw Data AI Agent]  \n       \u2192 [Indicator Subagents: 15m, 1h, 4h, 1d]  \n       \u2192 [News & Sentiment Tool (RSS + NewsAPI)]  \n\u2192 [Message Splitter if >4000 chars]  \n\u2192 [Telegram Send Message]  \n```\n\n---\n\n## \ud83d\udcec Telegram Output Format\n\n{{SYMBOL}} Spot Market Report\n\nSnapshot\n\u2022 Last / Bid / Ask: \u2026\n\u2022 24h: High \u2026, Low \u2026, Volume \u2026\n\u2022 Order book imbalance: \u2026%\n\u2022 Recent trades: \u2026\n\nTechnicals\n\u2022 15m: \\[Indicators + signal \u2192 Bullish/Bearish/Sideways]\n\u2022 1h: \u2026\n\u2022 4h: \u2026\n\u2022 1d: \u2026\n\nSpot Strategy\n\u2022 Action: Buy | Sell | Hold\n\u2022 Entry: \u2026\n\u2022 Stop Loss: \u2026\n\u2022 Take Profit: \u2026\n\u2022 Rationale: indicator alignment + order flow + sentiment\n\nConfidence\n\u2022 Score: 0\u2013100\n\u2022 Label: Low | Medium | High | Very High\n\nNews Sentiment\n\u2022 \\[2\u20133 sentence summary]\n\u2022 Top headlines (3\u20135): \\[Source \u2013 Link]\n\n---\n\n## \ud83d\ude80 Notes\n\n* REST Snapshot is always required \u2014 baseline must be used.\n* Indicators run separately per timeframe and return JSON.\n* Sentiment is appended last, merging RSS + NewsAPI results.\n* Output is **plain Telegram text**, not HTML.\n* If any tool fails, the agent continues with available data and notes the gap.\n\n---\n\n## \ud83d\ude80 Support & Licensing\n\n\ud83d\udd17 **Don Jayamaha \u2013 LinkedIn**\n[linkedin.com/in/donjayamahajr](https://www.linkedin.com/in/donjayamahajr)\n\n\u00a9 2025 **Treasurium Capital Limited Company**. All rights reserved.\nThis workflow structure, system architecture, and AI prompts are proprietary and protected by **U.S. copyright law**.\nReuse, resale, or redistribution is strictly prohibited without a valid license.\n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "6ed11db4-d635-4de5-99f3-0e4f0cf8a127",
  "connections": {
    "Think": {
      "ai_tool": [
        [
          {
            "node": "WEEX SM 15min AI Agent Tool",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Calculator": {
      "ai_tool": [
        [
          {
            "node": "WEEX SM 15min AI Agent Tool",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Calculator1": {
      "ai_tool": [
        [
          {
            "node": "WEEX SM 1hour AI Agent Tool",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Calculator2": {
      "ai_tool": [
        [
          {
            "node": "WEEX SM 1day AI Agent Tool",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Calculator3": {
      "ai_tool": [
        [
          {
            "node": "WEEX SM 4hour AI Agent Tool",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Trades": {
      "ai_tool": [
        [
          {
            "node": "WEEX SM REST Snapshot Subagent Tool",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "News Search API": {
      "ai_tool": [
        [
          {
            "node": "News & Sentiment Tool",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Adds \"SessionId\"": {
      "main": [
        [
          {
            "node": "WEEX Quant AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch 1d Candles": {
      "ai_tool": [
        [
          {
            "node": "WEEX SM 1day AI Agent Tool",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Fetch 1h Candles": {
      "ai_tool": [
        [
          {
            "node": "WEEX SM 1hour AI Agent Tool",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Fetch 4h Candles": {
      "ai_tool": [
        [
          {
            "node": "WEEX SM 4hour AI Agent Tool",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Adds \"SessionId\"",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch 15m Candles": {
      "ai_tool": [
        [
          {
            "node": "WEEX SM REST Snapshot Subagent Tool",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Fetch 1d Candles1": {
      "ai_tool": [
        [
          {
            "node": "WEEX SM REST Snapshot Subagent Tool",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Fetch 1h Candles1": {
      "ai_tool": [
        [
          {
            "node": "WEEX SM REST Snapshot Subagent Tool",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Fetch 4h Candles1": {
      "ai_tool": [
        [
          {
            "node": "WEEX SM REST Snapshot Subagent Tool",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "WEEX Quant AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Fetch 15m Candles1": {
      "ai_tool": [
        [
          {
            "node": "WEEX SM 15min AI Agent Tool",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "WEEX Spot Market Quant AI Agent tool",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model2": {
      "ai_languageModel": [
        [
          {
            "node": "News & Sentiment Tool",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model4": {
      "ai_languageModel": [
        [
          {
            "node": "WEEX SM Raw Data AI Agent Tool",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model5": {
      "ai_languageModel": [
        [
          {
            "node": "WEEX SM 15min AI Agent Tool",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model6": {
      "ai_languageModel": [
        [
          {
            "node": "WEEX SM 1hour AI Agent Tool",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model7": {
      "ai_languageModel": [
        [
          {
            "node": "WEEX SM 4hour AI Agent Tool",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model8": {
      "ai_languageModel": [
        [
          {
            "node": "WEEX SM 1day AI Agent Tool",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "WEEX SM 1day Think": {
      "ai_tool": [
        [
          {
            "node": "WEEX SM 1day AI Agent Tool",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Fetch single ticker": {
      "ai_tool": [
        [
          {
            "node": "WEEX SM REST Snapshot Subagent Tool",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model14": {
      "ai_languageModel": [
        [
          {
            "node": "WEEX SM REST Snapshot Subagent Tool",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "WEEX Quant AI Agent": {
      "main": [
        [
          {
            "node": "Splits message is more than 4000 characters",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "WEEX SM 1day Memory": {
      "ai_memory": [
        [
          {
            "node": "WEEX SM 1day AI Agent Tool",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "WEEX SM 1hour Think": {
      "ai_tool": [
        [
          {
            "node": "WEEX SM 1hour AI Agent Tool",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "WEEX SM 4hour Think": {
      "ai_tool": [
        [
          {
            "node": "WEEX SM 4hour AI Agent Tool",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "WEEX SM 15min Memory": {
      "ai_memory": [
        [
          {
            "node": "WEEX SM 15min AI Agent Tool",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "WEEX SM 1hour Memory": {
      "ai_memory": [
        [
          {
            "node": "WEEX SM 1hour AI Agent Tool",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "WEEX SM 4hour Memory": {
      "ai_memory": [
        [
          {
            "node": "WEEX SM 4hour AI Agent Tool",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Fetch OrderBook Depth": {
      "ai_tool": [
        [
          {
            "node": "WEEX SM REST Snapshot Subagent Tool",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "News & Sentiment Tool": {
      "ai_tool": [
        [
          {
            "node": "WEEX Quant AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "RSS NewBTC News Feeds": {
      "ai_tool": [
        [
          {
            "node": "News

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

This multi-agent n8n workflow delivers an automated, intelligent trading analysis system for the WEEX Spot Market. It uses GPT-4o to interpret user prompts, route them to the correct sub-agent tools, analyze technical indicators, price data, sentiment insights, and return…

Source: https://n8n.io/workflows/7928/ — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

Who is this for? Agencies, consultants, and service providers who conduct discovery calls and need to quickly turn conversations into professional proposals.

Tool Think, Tool Calculator, Agent Tool +18
AI & RAG

Jarvis is a powerful multi-agent productivity assistant built in n8n. It works directly from Telegram and can understand both text messages and voice notes.

Telegram Trigger, Telegram, OpenAI +10
AI & RAG

This n8n workflow is designed for Telegram bot administrators and customer service managers who want to automate customer support and payment verification processes. The workflow creates an intelligen

Telegram Trigger, Agent Tool, Tool Think +6
AI & RAG

This n8n workflow creates an intelligent WhatsApp customer support bot that can handle text, image, audio, and document messages. The workflow automatically processes incoming messages through differe

HTTP Request, N8N Nodes Rapiwa, Agent Tool +9
AI & RAG

AI-powered Telegram bot for effortless expense tracking. Send receipts, voice messages, or text - the bot automatically extracts and categorizes your expenses. 📸 Receipt & Invoice OCR - Send photos of

Telegram Trigger, Mcp Client Tool, Tool Calculator +7