8
n8n 中文网amn8n.com

特斯拉1小时和1日K线工具 n8n

中级

这是一个Finance, AI领域的自动化工作流,包含 13 个节点。主要使用 Agent, LmChatOpenAi, ExecuteWorkflowTrigger, ToolHttpRequest, MemoryBufferWindow 等节点,结合人工智能技术实现智能自动化。 特斯拉1小时和1日K线工具(K线和成交量AI模式检测)

前置要求
  • OpenAI API Key
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "iEfixTQ5cn9rjJCk",
  "meta": {
    "instanceId": "a5283507e1917a33cc3ae615b2e7d5ad2c1e50955e6f831272ddd5ab816f3fb6",
    "templateCredsSetupCompleted": true
  },
  "name": "Tesla 1小时和1日K线工具 n8n",
  "tags": [],
  "nodes": [
    {
      "id": "65efda46-19c2-4d14-9893-84645c894978",
      "name": "当被另一个工作流执行时",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        -160,
        320
      ],
      "parameters": {
        "workflowInputs": {
          "values": [
            {
              "name": "message"
            },
            {
              "name": "sessionId"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "7204ef90-e523-444d-b13d-5bf73ca11a45",
      "name": "简单记忆",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        120,
        680
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "1696dad4-cbfc-4eb1-9764-8bf5ec423fbe",
      "name": "Tesla 1小时和1日K线智能体",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        240,
        320
      ],
      "parameters": {
        "text": "={{ $json.message }}",
        "options": {
          "systemMessage": "You are a Tesla Candlestick Pattern and Volume Divergence Analyst AI.\n\nYour role is to analyze Tesla (TSLA) candlestick data across 1-hour and 1-day timeframes. Your goal is to identify key reversal signals, trend continuation structures, and volume-based anomalies to assist in mid- and long-term trading decisions.\n\nYou are connected to the following tools:\n1. **1-Hour Candlestick Data Tool** – Queries TSLA 60-minute OHLCV candles from Alpha Vantage.\n2. **1-Day Candlestick Data Tool** – Queries TSLA daily OHLCV candles from Alpha Vantage.\n\nYou also use:\n- Open ChatGPT (as your reasoning engine)\n- A short-term memory buffer\n- Upstream execution trigger from the Tesla Financial Market Analyst Tool\n\nYour tasks are:\n1. Parse the latest candles from both 1-hour and 1-day datasets.\n2. Detect potential **reversal candlestick patterns** such as:\n   - Hammer / Inverted Hammer\n   - Shooting Star\n   - Doji\n   - Bullish/Bearish Engulfing\n3. Identify any **volume divergence**:\n   - Bullish: Price decreasing but volume falling slower or rising\n   - Bearish: Price increasing while volume fades\n4. Output a structured analysis that can be passed to the Financial Market Analyst Tool\n\n### Output Format:\n\n```json\n{\n  \"summary\": \"Bearish signs detected on 1-day chart. A shooting star formed on high volume while RSI is elevated. Volume divergence seen on 1h chart as price rises but volume weakens.\",\n  \"candlestickPatterns\": {\n    \"1h\": \"None\",\n    \"1d\": \"Shooting Star\"\n  },\n  \"volumeDivergence\": {\n    \"1h\": \"Bearish\",\n    \"1d\": \"None\"\n  },\n  \"ohlcv\": {\n    \"1h\": {\n      \"close\": 174.1,\n      \"volume\": 1430000,\n      \"high\": 175.0,\n      \"low\": 173.8\n    },\n    \"1d\": {\n      \"close\": 188.3,\n      \"volume\": 21234000,\n      \"high\": 189.9,\n      \"low\": 183.7\n    }\n  }\n}"
        },
        "promptType": "define"
      },
      "typeVersion": 1.8
    },
    {
      "id": "26d3cdab-95b0-41bc-8d64-6e0d42fb36a5",
      "name": "小时K线数据",
      "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
      "position": [
        440,
        660
      ],
      "parameters": {
        "url": "https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=TSLA&interval=60min&outputsize=compact",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpQueryAuth",
        "toolDescription": "1-Hour Candles"
      },
      "credentials": {
        "httpQueryAuth": {
          "id": "cDmyrlGDH8qhKXPx",
          "name": "Alpha Vantage Premium"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "751d452a-1a42-466a-9068-7f378f61994a",
      "name": "日K线数据",
      "type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
      "position": [
        740,
        680
      ],
      "parameters": {
        "url": "https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&symbol=TSLA&outputsize=compact",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpQueryAuth",
        "toolDescription": "1-Day Candles"
      },
      "credentials": {
        "httpQueryAuth": {
          "id": "cDmyrlGDH8qhKXPx",
          "name": "Alpha Vantage Premium"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "395840a9-294e-40dc-ad19-06baa23b9c8c",
      "name": "OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        -180,
        680
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1",
          "cachedResultName": "gpt-4.1"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "yUizd8t0sD5wMYVG",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "f2bcdbe8-3388-40f2-bf0f-d251c06e87ab",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -240,
        120
      ],
      "parameters": {
        "color": 4,
        "width": 280,
        "height": 380,
        "content": "## 从父工作流触发"
      },
      "typeVersion": 1
    },
    {
      "id": "16408ce0-3f62-4223-bb8d-9e768f49b009",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        40,
        620
      ],
      "parameters": {
        "color": 3,
        "height": 420,
        "content": "## 短期记忆模块"
      },
      "typeVersion": 1
    },
    {
      "id": "b48c9a20-ba57-417f-a2d4-3e21d25c5e33",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        180,
        100
      ],
      "parameters": {
        "color": 5,
        "width": 400,
        "height": 400,
        "content": "## Tesla K线模式与成交量 AI"
      },
      "typeVersion": 1
    },
    {
      "id": "0169c8c2-1eb1-440d-b165-c4cc90b4f92c",
      "name": "便签3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        360,
        620
      ],
      "parameters": {
        "color": 6,
        "height": 420,
        "content": "## 来自 Alpha Vantage 的 1 小时 OHLCV 数据"
      },
      "typeVersion": 1
    },
    {
      "id": "ae9e8586-3aa0-4b36-ad06-8b0d9a35d188",
      "name": "便签4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        660,
        620
      ],
      "parameters": {
        "color": 6,
        "height": 440,
        "content": "## 来自 Alpha Vantage 的 1 日 OHLCV 数据"
      },
      "typeVersion": 1
    },
    {
      "id": "2655d097-987a-4f49-8aa2-8cc95fca6ce8",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -260,
        620
      ],
      "parameters": {
        "color": 2,
        "height": 400,
        "content": "## 用于推理的 GPT 模型"
      },
      "typeVersion": 1
    },
    {
      "id": "66ce45b7-932a-4acc-b46d-9de679440aa3",
      "name": "便签6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1040,
        -600
      ],
      "parameters": {
        "width": 1060,
        "height": 1660,
        "content": "## 📘 Tesla 1小时和1日K线工具"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "dbf24a40-9c35-4395-bbc7-9c9e8870ac66",
  "connections": {
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "Tesla 1hour and 1day Klines Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Tesla 1hour and 1day Klines Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Candlestick Data Day": {
      "ai_tool": [
        [
          {
            "node": "Tesla 1hour and 1day Klines Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Candlestick Data Hour": {
      "ai_tool": [
        [
          {
            "node": "Tesla 1hour and 1day Klines Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "Tesla 1hour and 1day Klines Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 财务, 人工智能

需要付费吗?

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

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

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
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 查看

分享此工作流