Crypto Influencer Workflow Decoded (English Edition)


创建日期: 2025-09-22 09:19:31 最后修改: 2025-09-22 13:10:19
复制: 0 点击次数: 118
avatar of 发明者量化-小小梦 发明者量化-小小梦
4
关注
1271
关注者
策略源码
{"type":"n8n","content":"{\"workflowData\":{\"nodes\":[{\"parameters\":{\"operation\":\"sendMessage\",\"chatId\":{\"__rl\":true,\"value\":\"-4847871297\",\"mode\":\"id\"},\"text\":\"={{ $json.content }}\",\"parseMode\":\"HTML\"},\"type\":\"n8n-nodes-base.telegram\",\"typeVersion\":1.2,\"position\":[784,176],\"id\":\"af885bc2-c605-49d9-a757-3d7e2f5913c5\",\"name\":\"Telegram\",\"credentials\":{\"telegramApi\":{\"id\":\"8f6a5210-a771-4981-b0a0-09e62769828b\",\"name\":\"Telegram account\"}}},{\"parameters\":{\"operation\":\"getRecords\",\"exchange\":0,\"symbol\":{\"__rl\":true,\"value\":\"={{ $vars.pair}}\",\"mode\":\"id\"},\"period\":900,\"limit\":200},\"type\":\"n8n-nodes-base.marketInfo\",\"typeVersion\":1,\"position\":[-1024,-144],\"id\":\"45097069-ea2c-4cce-8f14-23875d3733bb\",\"name\":\"15m\"},{\"parameters\":{\"operation\":\"getRecords\",\"exchange\":0,\"symbol\":{\"__rl\":true,\"value\":\"={{ $vars.pair}}\",\"mode\":\"id\"},\"period\":3600,\"limit\":200},\"type\":\"n8n-nodes-base.marketInfo\",\"typeVersion\":1,\"position\":[-1024,48],\"id\":\"e451a59c-4dc8-4995-a3cb-026077e55ce3\",\"name\":\"1h\"},{\"parameters\":{\"operation\":\"getRecords\",\"exchange\":0,\"symbol\":{\"__rl\":true,\"value\":\"={{ $vars.pair }}\",\"mode\":\"id\"},\"period\":86400,\"limit\":200},\"type\":\"n8n-nodes-base.marketInfo\",\"typeVersion\":1,\"position\":[-1008,224],\"id\":\"87d44ec1-d765-4908-b614-70d1c942f608\",\"name\":\"1d\"},{\"parameters\":{\"method\":\"GET\",\"url\":\"https://newsapi.org/v2/everything\",\"authentication\":\"none\",\"sendQuery\":true,\"specifyQuery\":\"keypair\",\"queryParameters\":{\"parameters\":[{\"name\":\"q\",\"value\":\"Crypto OR Bitcoin OR Coindesk\"},{\"name\":\"from \",\"value\":\"={{\\n  new Date(Date.now() - 3 * 24 * 60 * 60 * 1000).toISOString().split('T')[0]\\n}}\"}]},\"sendHeaders\":true,\"specifyHeaders\":\"keypair\",\"headerParameters\":{\"parameters\":[{\"name\":\"x-api-key\",\"value\":\"a1f504ea6e4e4d9aad68a383b9a1c1d8\"}]},\"sendBody\":false,\"options\":{},\"infoMessage\":\"\"},\"type\":\"n8n-nodes-base.httpRequest\",\"typeVersion\":4.2,\"position\":[-1008,384],\"id\":\"ec6cce19-0357-4f6b-ab25-7c353c62117f\",\"name\":\"HTTP request\"},{\"parameters\":{\"mode\":\"runOnceForAllItems\",\"language\":\"javaScript\",\"jsCode\":\"const result = [];\\nconst data = $input.first().json.result || [];\\n\\ndata.forEach(item => {\\n  result.push({\\n    timeframe: \\\"15m\\\",\\n    candles: item\\n  });\\n});\\n\\nreturn result;\",\"notice\":\"\"},\"type\":\"n8n-nodes-base.code\",\"typeVersion\":2,\"position\":[-816,-112],\"id\":\"3250ca58-f9bb-42ce-a3e9-5f760fb8a687\",\"name\":\"code1\"},{\"parameters\":{\"mode\":\"runOnceForAllItems\",\"language\":\"javaScript\",\"jsCode\":\"const result = [];\\nconst data = $input.first().json.result || [];\\n\\ndata.forEach(item => {\\n  result.push({\\n    timeframe: \\\"1h\\\",\\n    candles: item\\n  });\\n});\\n\\nreturn result;\",\"notice\":\"\"},\"type\":\"n8n-nodes-base.code\",\"typeVersion\":2,\"position\":[-816,32],\"id\":\"a60c637a-2401-45a5-9afc-c3d56c5be7b0\",\"name\":\"code2\"},{\"parameters\":{\"mode\":\"runOnceForAllItems\",\"language\":\"javaScript\",\"jsCode\":\"const result = [];\\nconst data = $input.first().json.result || [];\\n\\ndata.forEach(item => {\\n  result.push({\\n    timeframe: \\\"1d\\\",\\n    candles: item\\n  });\\n});\\n\\nreturn result;\",\"notice\":\"\"},\"type\":\"n8n-nodes-base.code\",\"typeVersion\":2,\"position\":[-816,160],\"id\":\"9181d1e1-1d1b-480b-9888-989b5f67b818\",\"name\":\"code3\"},{\"parameters\":{\"mode\":\"runOnceForAllItems\",\"language\":\"javaScript\",\"jsCode\":\"const articles = $input.first().json.data.articles || [];\\nconst filteredArticles = articles.map(article => ({\\n  title: article.title,\\n  description: article.description,\\n}));\\nreturn [{\\n  json:{\\n    filteredArticles\\n  } \\n}]\",\"notice\":\"\"},\"type\":\"n8n-nodes-base.code\",\"typeVersion\":2,\"position\":[-800,320],\"id\":\"472df491-45c6-4502-b59f-98bd9272bd1f\",\"name\":\"code4\"},{\"parameters\":{\"mode\":\"append\",\"numberInputs\":3},\"type\":\"n8n-nodes-base.merge\",\"typeVersion\":3.2,\"position\":[-560,16],\"id\":\"63c8f428-b82b-4c9a-bf78-c96b04b828e9\",\"name\":\"merge\"},{\"parameters\":{\"mode\":\"runOnceForAllItems\",\"language\":\"javaScript\",\"jsCode\":\"const allCandles = [];\\n\\nfor (const item of items){\\n  allCandles.push(item.json)\\n}\\n\\nreturn [{\\n  json:{\\n    allCandles\\n  }\\n}];\",\"notice\":\"\"},\"type\":\"n8n-nodes-base.code\",\"typeVersion\":2,\"position\":[-400,32],\"id\":\"d3b4d33e-ab44-48e0-a71d-4fec52e8dff1\",\"name\":\"code5\"},{\"parameters\":{\"mode\":\"append\",\"numberInputs\":2},\"type\":\"n8n-nodes-base.merge\",\"typeVersion\":3.2,\"position\":[-144,176],\"id\":\"c53d4aaa-a96e-488d-8425-5f595c2b17d3\",\"name\":\"merge1\"},{\"parameters\":{\"mode\":\"runOnceForAllItems\",\"language\":\"javaScript\",\"jsCode\":\"// Initialize containers for each set of data.\\nconst allCandles = [];\\nlet contentData = null;\\n// Loop over each item from the merge node.\\nfor (const item of items) {\\n    // If the item has candlestick data, add it to the array.\\n    if (item.json.allCandles !== undefined) {\\n        // Assuming item.json.allCandles is an array.\\n        allCandles.push(...item.json.allCandles);\\n    }\\n    // If the item has embedded content (in message.content), store it.\\n    if (item.json.output !== undefined) {\\n        contentData = item.json.output;\\n    }\\n}\\n// Return a single item with both candlestick data and content.\\nreturn [{\\n    json: {\\n        allCandles,\\n        content: contentData\\n    }\\n}];\",\"notice\":\"\"},\"type\":\"n8n-nodes-base.code\",\"typeVersion\":2,\"position\":[32,176],\"id\":\"b98215d9-378f-43bd-b780-a744263872ab\",\"name\":\"code6\"},{\"parameters\":{\"model\":{\"__rl\":true,\"value\":\"anthropic/claude-3.7-sonnet:thinking\",\"mode\":\"list\",\"cachedResultName\":\"anthropic/claude-3.7-sonnet:thinking\"}},\"type\":\"n8n-nodes-base.lmOpenAi\",\"typeVersion\":1,\"position\":[240,352],\"id\":\"9d8f5a5c-c2da-44f9-a757-05a47fd3ea07\",\"name\":\"OpenAI Model 1\",\"credentials\":{\"openAiApi\":{\"id\":\"0122a64b-d4f0-4143-b8cb-39ff326c9c4e\",\"name\":\"OpenAi account\"}}},{\"parameters\":{\"mode\":\"runOnceForAllItems\",\"language\":\"javaScript\",\"jsCode\":\"// Get the input text, use an empty string if it doesn't exist.\\nconst inputText = $input.first().json.output || \\\"\\\";\\n\\n// Validate input type\\nif (typeof inputText !== \\\"string\\\") {\\n  throw new Error(\\\"Input must be a string\\\");\\n}\\n\\n// \\\"Remove '#' and '*' symbols\\\"\\nconst cleanedText = inputText.replace(/[#*]/g, \\\"\\\");\\n\\n// \\\"Find the position of 'Leverage Trading Recommendations'\\\"\\nconst leveragedIndex = cleanedText.indexOf(\\\"Leverage Trading Recommendations\\\");\\n\\n// \\\"If no split marker is found, split in the original way\\\"\\nif (leveragedIndex === -1) {\\n  const mid = Math.ceil(cleanedText.length / 2);\\n  const firstHalf = cleanedText.substring(0, mid);\\n  const secondHalf = cleanedText.substring(mid);\\n  \\n  return [\\n    { json: { blockNumber: 1, content: firstHalf } },\\n    { json: { blockNumber: 2, content: secondHalf } }\\n  ];\\n}\\n\\n// \\\"Split text based on 'Leverage Trading Recommendations'\\\"\\nconst firstBlock = cleanedText.substring(0, leveragedIndex).trim();\\nconst secondBlock = cleanedText.substring(leveragedIndex).trim();\\n\\n// \\\"Return an array containing two blocks\\\"\\nreturn [\\n  { json: { blockNumber: 1, content: firstBlock } },\\n  { json: { blockNumber: 2, content: secondBlock } }\\n];\\n\",\"notice\":\"\"},\"type\":\"n8n-nodes-base.code\",\"typeVersion\":2,\"position\":[592,176],\"id\":\"19dc370d-6709-4dd3-bfa7-6cd63050249c\",\"name\":\"code7\"},{\"parameters\":{\"text\":\"=You are a highly intelligent and precise sentiment analyzer specializing in cryptocurrency markets. You will analyze the sentiment of provided text using a two-part approach:\\n\\nShort-term Sentiment:\\n- Assess immediate market reactions, recent news impact, and technical volatility\\n- Determine sentiment category: \\\"Positive\\\", \\\"Neutral\\\", or \\\"Negative\\\"\\n- Calculate a numerical score between -1 (extremely negative) and 1 (extremely positive)\\n- Provide concise reasoning for short-term sentiment (give detailed responses and appropriate headlines for major events and cryptocurrencies)\\n\\nLong-term Sentiment:\\n- Evaluate overall market outlook, fundamentals, and regulatory or macroeconomic factors\\n- Determine sentiment category: \\\"Positive\\\", \\\"Neutral\\\", or \\\"Negative\\\"\\n- Calculate a numerical score between -1 (extremely negative) and 1 (extremely positive)\\n- Provide detailed reasoning for long-term sentiment (give detailed responses and appropriate headlines for major events and cryptocurrencies)\\n\\nYour output must be exactly a JSON object with two keys: \\\"shortTermSentiment\\\" and \\\"longTermSentiment\\\". Each key's value must be an object containing three keys: \\\"category\\\", \\\"score\\\", and \\\"rationale\\\". Do not output any additional text.\\n\\nNow, analyze the following text and generate your JSON output:\\n{{ JSON.stringify($json.filteredArticles) }}\\n\",\"options\":{}},\"type\":\"@n8n/n8n-nodes-langchain.agent\",\"typeVersion\":1,\"position\":[-624,320],\"id\":\"b44a2870-b39d-4e10-b727-a22eef6e1fd2\",\"name\":\"AI agent2\"},{\"parameters\":{\"text\":\"=## Trading Analysis Instructions\\n**Data Structure:**\\n{{ $vars.pair}} comprehensive market data:\\n\\n- Technical Data: {{ JSON.stringify($json[\\\"allCandles\\\"]) }}\\n- Sentiment Analysis: {{ JSON.stringify($json[\\\"content\\\"]) }}\\n\\nK-line Format: Timeframe (\\\"15m\\\", \\\"1h\\\", \\\"1d\\\") + K-line array\\nSentiment: Short-term/long-term analysis from cryptocurrency news\\n\\n**Analysis Framework:**\\n**Short-term (15m + 1h data):**\\n\\n- Identify immediate support/resistance levels\\n- Price action signals + lagging indicators\\n- Focus on entry/exit timing\\n\\n**Long-term (1d + 1h data):**\\n\\n- Primary trend direction\\n- Structural price levels\\n- Broader market context\\n\\n**Output Requirements:**\\n**Format:** Plain text, Telegram HTML style\\n**Date:** {{ $vars.pair}} Analysis {{ $now }} (Format: mm/dd/yyyy at xx:xxpm)\\n\\n**Structure:**\\n**Spot Trading Recommendations:**\\n**Short-term:**\\n\\n- Action: [Buy/Sell/Hold]\\n- Entry: $X\\n- Stop Loss: $X\\n- Target: $X\\n- Rationale: [2-3 concise sentences covering key signals, indicators, sentiment]\\n\\n**Long-term:**\\n\\n- Action: [Buy/Sell/Hold]\\n- Entry: $X\\n- Stop Loss: $X\\n- Target: $X\\n- Rationale: [2-3 concise sentences covering key signals, indicators, sentiment]\\n\\n**Leverage Trading Recommendations:**\\n**Short-term:**\\n\\n- Position: [Long/Short]\\n- Leverage: Xx\\n- Entry: $X\\n- Stop Loss: $X\\n- Target: $X\\n- Rationale: [2-3 concise sentences covering price action, confirmation, sentiment]\\n\\n**Long-term:**\\n\\n- Position: [Long/Short]\\n- Leverage: Xx\\n- Entry: $X\\n- Stop Loss: $X\\n- Target: $X\\n- Rationale: [2-3 concise sentences covering price action, confirmation, sentiment]\\n\\n**Key Guiding Principles:**\\n\\n- Keep each rationale under 50 words\\n- Focus on actionable insights\\n- Eliminate redundant explanations\\n- Prioritize high-confidence signals\\n- Use direct, concise language\\n\",\"options\":{}},\"type\":\"@n8n/n8n-nodes-langchain.agent\",\"typeVersion\":1,\"position\":[240,176],\"id\":\"4d2baac6-28f4-4ce7-bb8e-07d66371f9da\",\"name\":\"AI agent1\"},{\"parameters\":{\"model\":{\"__rl\":true,\"value\":\"anthropic/claude-sonnet-4\",\"mode\":\"list\",\"cachedResultName\":\"anthropic/claude-sonnet-4\"}},\"type\":\"n8n-nodes-base.lmOpenAi\",\"typeVersion\":1,\"position\":[-624,496],\"id\":\"a9a6f034-0011-4f6a-96fe-c8cbeeedbee1\",\"name\":\"OpenAI model2\",\"credentials\":{\"openAiApi\":{\"id\":\"0122a64b-d4f0-4143-b8cb-39ff326c9c4e\",\"name\":\"OpenAi account\"}}},{\"parameters\":{\"notice\":\"\"},\"type\":\"n8n-nodes-base.manualTrigger\",\"typeVersion\":1,\"position\":[-1312,144],\"id\":\"a54bd0ab-d70b-4ada-9be9-fde071babd94\",\"name\":\"When clicking ‘Execute workflow’\"}],\"pinData\":{\"AI agent1\":[{\"json\":{\"output\":\"# BTC_USDT.swap Analysis 07/22/2023 at 10:15am\\n\\n## Spot Trading Recommendations:\\n**Short-term:**\\n- Action: Hold\\n- Entry: $114,500\\n- Stop Loss: $113,800\\n- Target: $116,200\\n- Rationale: BTC is consolidating after significant drop from $115,900 to $114,100. RSI showing oversold conditions on 15m charts with potential bounce. Negative short-term sentiment supports cautious approach.\\n\\n**Long-term:**\\n- Action: Buy\\n- Entry: $114,800\\n- Stop Loss: $112,000\\n- Target: $120,000\\n- Rationale: Daily chart shows BTC maintaining above key support at $114,000 despite recent volatility. Long-term uptrend remains intact with higher lows. Positive institutional adoption trends support bullish long-term outlook.\\n\\n## Leverage Trading Recommendations:\\n**Short-term:**\\n- Position: Long\\n- Leverage: 3x\\n- Entry: $114,600\\n- Stop Loss: $114,000\\n- Target: $115,800\\n- Rationale: Hourly chart shows potential double bottom formation at $114,100 with increasing volume. Wait for confirmation above $115,000 before entry. Current market conditions suggest limited downside with potential short squeeze.\\n\\n**Long-term:**\\n- Position: Long\\n- Leverage: 5x\\n- Entry: $114,200\\n- Stop Loss: $111,500\\n- Target: $122,000\\n- Rationale: BTC holding above 50-day MA despite recent correction. Strong institutional buying as evidenced by ETF inflows creates solid support. Multiple technical indicators showing bullish divergence on daily timeframe.\"}}]},\"connections\":{\"15m\":{\"main\":[[{\"node\":\"code1\",\"type\":\"main\",\"index\":0}]]},\"1h\":{\"main\":[[{\"node\":\"code2\",\"type\":\"main\",\"index\":0}]]},\"1d\":{\"main\":[[{\"node\":\"code3\",\"type\":\"main\",\"index\":0}]]},\"HTTP request\":{\"main\":[[{\"node\":\"code4\",\"type\":\"main\",\"index\":0}]]},\"code1\":{\"main\":[[{\"node\":\"merge\",\"type\":\"main\",\"index\":0}]]},\"code2\":{\"main\":[[{\"node\":\"merge\",\"type\":\"main\",\"index\":1}]]},\"code3\":{\"main\":[[{\"node\":\"merge\",\"type\":\"main\",\"index\":2}]]},\"code4\":{\"main\":[[{\"node\":\"AI agent2\",\"type\":\"main\",\"index\":0}]]},\"merge\":{\"main\":[[{\"node\":\"code5\",\"type\":\"main\",\"index\":0}]]},\"code5\":{\"main\":[[{\"node\":\"merge1\",\"type\":\"main\",\"index\":0}]]},\"merge1\":{\"main\":[[{\"node\":\"code6\",\"type\":\"main\",\"index\":0}]]},\"code6\":{\"main\":[[{\"node\":\"AI agent1\",\"type\":\"main\",\"index\":0}]]},\"OpenAI Model 1\":{\"ai_languageModel\":[[{\"node\":\"AI agent1\",\"type\":\"ai_languageModel\",\"index\":0}]]},\"code7\":{\"main\":[[{\"node\":\"Telegram\",\"type\":\"main\",\"index\":0}]]},\"AI agent2\":{\"main\":[[{\"node\":\"merge1\",\"type\":\"main\",\"index\":1}]]},\"AI agent1\":{\"main\":[[{\"node\":\"code7\",\"type\":\"main\",\"index\":0}]]},\"OpenAI model2\":{\"ai_languageModel\":[[{\"node\":\"AI agent2\",\"type\":\"ai_languageModel\",\"index\":0}]]},\"When clicking ‘Execute workflow’\":{\"main\":[[{\"node\":\"15m\",\"type\":\"main\",\"index\":0},{\"node\":\"1h\",\"type\":\"main\",\"index\":0},{\"node\":\"1d\",\"type\":\"main\",\"index\":0},{\"node\":\"HTTP request\",\"type\":\"main\",\"index\":0}]]}},\"active\":false,\"settings\":{\"timezone\":\"Asia/Shanghai\"},\"tags\":[],\"meta\":{\"templateCredsSetupCompleted\":true},\"credentials\":{},\"id\":\"e2f01ed8-68f9-4bdd-8a64-90f2b8215882\",\"plugins\":{},\"mcpClients\":{}},\"startNodes\":[],\"triggerToStartFrom\":{\"name\":\"When clicking ‘Execute workflow’\"}}"}