使用MyFxBook数据追踪外汇新闻发布并发送提醒到Telegram和Google Sheets
高级
这是一个Crypto Trading领域的自动化工作流,包含 32 个节点。主要使用 If, Set, Wait, Airtop, SplitOut 等节点。 使用MyFxBook数据追踪外汇新闻发布并发送提醒到Telegram和Google Sheets
前置要求
- •Telegram Bot Token
- •可能需要目标 API 的认证凭证
- •Google Sheets API 凭证
分类
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"meta": {
"instanceId": "84b390fbc5fa25072285b148d9fdc04a69134c7197b10b734c5b01fb008ddd54",
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "af7c942c-32e0-4972-89c6-91797ad51c0a",
"name": "Google Calendar 触发器",
"type": "n8n-nodes-base.googleCalendarTrigger",
"position": [
64,
416
],
"parameters": {
"options": {},
"pollTimes": {
"item": [
{
"mode": "everyMinute"
}
]
},
"triggerOn": "eventStarted",
"calendarId": {
"__rl": true,
"mode": "list",
"value": " ",
"cachedResultName": " "
}
},
"typeVersion": 1
},
{
"id": "e933bb50-acc3-459f-b967-5107757ef37b",
"name": "条件判断",
"type": "n8n-nodes-base.if",
"position": [
1840,
432
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "or",
"conditions": [
{
"id": "f5c0d425-c86e-4456-b272-0ade1b6d747d",
"operator": {
"type": "string",
"operation": "contains"
},
"leftValue": "={{ $json.forecast }}",
"rightValue": "%"
},
{
"id": "95a2f60e-c880-4ec9-b810-3e53fdf3642b",
"operator": {
"type": "string",
"operation": "contains"
},
"leftValue": "={{ $json.forecast }}",
"rightValue": "K"
},
{
"id": "c59e9ffc-8e0d-457a-a247-b3388bed9780",
"operator": {
"type": "string",
"operation": "contains"
},
"leftValue": "={{ $json.forecast }}",
"rightValue": "M"
},
{
"id": "75aee0fb-55d7-4965-a364-877edf9bf215",
"operator": {
"type": "string",
"operation": "contains"
},
"leftValue": "={{ $json.forecast }}",
"rightValue": "B"
},
{
"id": "2319659f-6637-4476-a0ee-c45fb880c231",
"operator": {
"type": "string",
"operation": "contains"
},
"leftValue": "={{ $json.forecast }}",
"rightValue": "T"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "d003ef59-6664-4244-9d42-286341177bea",
"name": "转换为数字",
"type": "n8n-nodes-base.set",
"position": [
2064,
512
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "3c47e85b-5eae-4c49-8569-8e875cab9f70",
"name": "actual",
"type": "number",
"value": "={{ $json.actual.toNumber() }}"
},
{
"id": "3c36f4c5-79e9-4864-af35-a8421e15f3a0",
"name": "forecast",
"type": "number",
"value": "={{ $json.forecast.toNumber() }}"
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "7dfbc85e-0a16-415d-9d87-8046bcb2da21",
"name": "获取实际数据?",
"type": "n8n-nodes-base.if",
"position": [
1408,
240
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "or",
"conditions": [
{
"id": "13f60780-09c2-432e-9e80-a69212f27682",
"operator": {
"type": "string",
"operation": "contains"
},
"leftValue": "={{ $json.data.modelResponse.scrapedContent.text.substring($json.data.modelResponse.scrapedContent.text.indexOf(\"| --- | --- | --- | --- |\")+29, $json.data.modelResponse.scrapedContent.text.indexOf(\"| --- | --- | --- | --- |\")+140) }}",
"rightValue": "={{ $('Get News Details').item.json.month+\" \"+$('Get News Details').item.json.day+\", \"+$('Get News Details').item.json.year }}"
},
{
"id": "ce61b3b3-19c1-4dbc-b985-41d0f084fb79",
"operator": {
"type": "string",
"operation": "contains"
},
"leftValue": "={{ $json.data.modelResponse.scrapedContent.text.substring($json.data.modelResponse.scrapedContent.text.indexOf(\"| --- | --- | --- | --- |\")+29, $json.data.modelResponse.scrapedContent.text.indexOf(\"| --- | --- | --- | --- |\")+140) }}",
"rightValue": "={{ $('Get News Details').item.json.month+\" \"+$('Get News Details').item.json['day-1']+\", \"+$('Get News Details').item.json.year }}"
},
{
"id": "a0ac0845-f24f-476b-a25c-40aba9662561",
"operator": {
"type": "string",
"operation": "contains"
},
"leftValue": "={{ $json.data.modelResponse.scrapedContent.text.substring($json.data.modelResponse.scrapedContent.text.indexOf(\"| --- | --- | --- | --- |\")+29, $json.data.modelResponse.scrapedContent.text.indexOf(\"| --- | --- | --- | --- |\")+140) }}",
"rightValue": "={{ $('Get News Details').item.json['month-1']+\" \"+\"28\"+\", \"+$('Get News Details').item.json.year }}"
},
{
"id": "b2b89cec-1f73-4fa0-8360-2a6d94e22f79",
"operator": {
"type": "string",
"operation": "contains"
},
"leftValue": "={{ $json.data.modelResponse.scrapedContent.text.substring($json.data.modelResponse.scrapedContent.text.indexOf(\"| --- | --- | --- | --- |\")+29, $json.data.modelResponse.scrapedContent.text.indexOf(\"| --- | --- | --- | --- |\")+140) }}",
"rightValue": "={{ $('Get News Details').item.json['month-1']+\" \"+\"29\"+\", \"+$('Get News Details').item.json.year }}"
},
{
"id": "035adc96-e70d-4819-bd6a-961fc1327a41",
"operator": {
"type": "string",
"operation": "contains"
},
"leftValue": "={{ $json.data.modelResponse.scrapedContent.text.substring($json.data.modelResponse.scrapedContent.text.indexOf(\"| --- | --- | --- | --- |\")+29, $json.data.modelResponse.scrapedContent.text.indexOf(\"| --- | --- | --- | --- |\")+140) }}",
"rightValue": "={{ $('Get News Details').item.json['month-1']+\" \"+\"30\"+\", \"+$('Get News Details').item.json.year }}"
},
{
"id": "bfb56a75-23f3-4d4d-bdc3-c77cf1bfcdb7",
"operator": {
"type": "string",
"operation": "contains"
},
"leftValue": "={{ $json.data.modelResponse.scrapedContent.text.substring($json.data.modelResponse.scrapedContent.text.indexOf(\"| --- | --- | --- | --- |\")+29, $json.data.modelResponse.scrapedContent.text.indexOf(\"| --- | --- | --- | --- |\")+140) }}",
"rightValue": "={{ $('Get News Details').item.json['month-1']+\" \"+\"31\"+\", \"+$('Get News Details').item.json.year }}"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "ce8525f5-ce34-46fb-8785-d3f0e9df7f6d",
"name": "实际值,预测值",
"type": "n8n-nodes-base.set",
"position": [
1632,
192
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "f98f97f1-f9cd-4a4a-a987-79bf7cefd75c",
"name": "actual",
"type": "string",
"value": "={{ $if($json.data.modelResponse.scrapedContent.text.substring($json.data.modelResponse.scrapedContent.text.indexOf(\"| --- | --- | --- | --- |\")+29, $json.data.modelResponse.scrapedContent.text.indexOf(\"| --- | --- | --- | --- |\")+135).split(\" | \")[1].includes(\"\\\\\"),$json.data.modelResponse.scrapedContent.text.substring($json.data.modelResponse.scrapedContent.text.indexOf(\"| --- | --- | --- | --- |\")+29, $json.data.modelResponse.scrapedContent.text.indexOf(\"| --- | --- | --- | --- |\")+135).split(\" | \")[1].replace(\"\\\\\",\"\"),$json.data.modelResponse.scrapedContent.text.substring($json.data.modelResponse.scrapedContent.text.indexOf(\"| --- | --- | --- | --- |\")+29, $json.data.modelResponse.scrapedContent.text.indexOf(\"| --- | --- | --- | --- |\")+135).split(\" | \")[1]) }}"
},
{
"id": "0f1aaafa-b164-4f5b-8efa-0bf0adde1750",
"name": "forecast",
"type": "string",
"value": "={{ $if($json.data.modelResponse.scrapedContent.text.substring($json.data.modelResponse.scrapedContent.text.indexOf(\"| --- | --- | --- | --- |\")+29, $json.data.modelResponse.scrapedContent.text.indexOf(\"| --- | --- | --- | --- |\")+135).split(\" | \")[2].includes(\"\\\\\"),$json.data.modelResponse.scrapedContent.text.substring($json.data.modelResponse.scrapedContent.text.indexOf(\"| --- | --- | --- | --- |\")+29, $json.data.modelResponse.scrapedContent.text.indexOf(\"| --- | --- | --- | --- |\")+135).split(\" | \")[2].replace(\"\\\\\",\"\"),$json.data.modelResponse.scrapedContent.text.substring($json.data.modelResponse.scrapedContent.text.indexOf(\"| --- | --- | --- | --- |\")+29, $json.data.modelResponse.scrapedContent.text.indexOf(\"| --- | --- | --- | --- |\")+135).split(\" | \")[2]) }}"
},
{
"id": "51802300-10bc-485d-b7aa-fa1a237ef345",
"name": "currency",
"type": "string",
"value": "={{ $('Get News Details').item.json.currency }}"
},
{
"id": "11adb8fe-3f25-46aa-b46f-87d17cd1e0f9",
"name": "affectedPairs",
"type": "array",
"value": "={{ $('Affected Pairs').item.json.affectedPairs.split(\",\") }}"
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "13a8f171-3e2d-43a1-bdc7-fdea8996a214",
"name": "删除 %KMBT,转换为数字",
"type": "n8n-nodes-base.set",
"position": [
2064,
320
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "09efa7c8-fda5-4b95-be29-354d7568cb90",
"name": "actual",
"type": "number",
"value": "={{ $json.actual.substring(0, $json.actual.length-1).toNumber() }}"
},
{
"id": "7af14224-e13e-43e0-bbc7-f4b4052ac0e9",
"name": "forecast",
"type": "number",
"value": "={{ $json.forecast.substring(0,$json.forecast.length-1).toNumber() }}"
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "06be2ed6-9df2-4172-874b-a1207512c856",
"name": "'实际值'低于'预测值'对货币有利?",
"type": "n8n-nodes-base.if",
"position": [
2288,
432
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "eb3a077d-03ab-4b01-bee6-6963302255e1",
"operator": {
"type": "string",
"operation": "contains"
},
"leftValue": "={{ $('Actual, Forecast Value').item.json.data.modelResponse.scrapedContent.text }}",
"rightValue": "'Actual' less than 'Forecast' is good for currency;"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "9a72cfc8-e8f9-45e9-9cfa-08c48d9fb7ca",
"name": "IF 有预测值",
"type": "n8n-nodes-base.if",
"position": [
288,
416
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "5f6b43c6-bb28-4ab1-a0c8-57d2da8308b6",
"operator": {
"type": "string",
"operation": "contains"
},
"leftValue": "={{ $json.description }}",
"rightValue": "Forecast: "
}
]
}
},
"typeVersion": 2.2
},
{
"id": "17d2473e-4f36-42f6-b66a-373f87726820",
"name": "无操作,不执行任何操作1",
"type": "n8n-nodes-base.noOp",
"position": [
512,
512
],
"parameters": {},
"typeVersion": 1
},
{
"id": "c02d5a3c-2362-4804-a092-92f5fc1e1e76",
"name": "获取新闻详情",
"type": "n8n-nodes-base.set",
"position": [
512,
320
],
"parameters": {
"options": {
"ignoreConversionErrors": true
},
"assignments": {
"assignments": [
{
"id": "890b530e-df58-414a-98b9-0c0b18796749",
"name": "newsLink",
"type": "string",
"value": "={{ $json.description.extractUrl() }}"
},
{
"id": "08e16e2f-7731-420c-bb41-705b784cb740",
"name": "forecast",
"type": "string",
"value": "={{ $json.description.split(\"\\\\n\\\\n\")[1].split(\" \")[1] }}"
},
{
"id": "c36de21c-1e9b-46da-8f8f-740f8f001239",
"name": "previous",
"type": "string",
"value": "={{ $json.description.split(\"\\\\n\\\\n\")[2].split(\" \")[1] }}"
},
{
"id": "a34addab-19bd-4efd-a347-dbc37722e181",
"name": "year",
"type": "string",
"value": "={{ $json.start.dateTime.substring(0, 4).toNumber() }}"
},
{
"id": "d3954244-99af-466f-b5e8-bbce6417d783",
"name": "month",
"type": "string",
"value": "={{ $if($json.start.dateTime.substring(5, 7).toNumber() == \"1\",\"Jan\",$if($json.start.dateTime.substring(5, 7).toNumber() == \"2\",\"Feb\",$if($json.start.dateTime.substring(5, 7).toNumber() == \"3\",\"Mar\",$if($json.start.dateTime.substring(5, 7).toNumber() == \"4\",\"Apr\",$if($json.start.dateTime.substring(5, 7).toNumber() == \"5\",\"May\",$if($json.start.dateTime.substring(5, 7).toNumber() == \"6\",\"Jun\",$if($json.start.dateTime.substring(5, 7).toNumber() == \"7\",\"Jul\",$if($json.start.dateTime.substring(5, 7).toNumber() == \"8\",\"Aug\",$if($json.start.dateTime.substring(5, 7).toNumber() == \"9\",\"Sep\",$if($json.start.dateTime.substring(5, 7).toNumber() == \"10\",\"Oct\",$if($json.start.dateTime.substring(5, 7).toNumber() == \"11\",\"Nov\",\"Dec\"))))))))))) }}"
},
{
"id": "463fb1ff-03ef-46d0-a33f-04de1d2d8c32",
"name": "month-1",
"type": "string",
"value": "={{ $if($json.start.dateTime.substring(5, 7).toNumber()-1 == \"1\",\"Jan\",$if($json.start.dateTime.substring(5, 7).toNumber()-1 == \"2\",\"Feb\",$if($json.start.dateTime.substring(5, 7).toNumber()-1 == \"3\",\"Mar\",$if($json.start.dateTime.substring(5, 7).toNumber()-1 == \"4\",\"Apr\",$if($json.start.dateTime.substring(5, 7).toNumber()-1 == \"5\",\"May\",$if($json.start.dateTime.substring(5, 7).toNumber()-1 == \"6\",\"Jun\",$if($json.start.dateTime.substring(5, 7).toNumber()-1 == \"7\",\"Jul\",$if($json.start.dateTime.substring(5, 7).toNumber()-1 == \"8\",\"Aug\",$if($json.start.dateTime.substring(5, 7).toNumber()-1 == \"9\",\"Sep\",$if($json.start.dateTime.substring(5, 7).toNumber()-1 == \"10\",\"Oct\",$if($json.start.dateTime.substring(5, 7).toNumber()-1 == \"11\",\"Nov\",\"Dec\"))))))))))) }}"
},
{
"id": "53a1391a-1eb7-4eef-ace0-4df75a4b7f56",
"name": "day",
"type": "string",
"value": "={{ $json.start.dateTime.substring(8, 10).toNumber() }}"
},
{
"id": "053228c0-6a3f-419f-85fd-0cd935e0677b",
"name": "day-1",
"type": "string",
"value": "={{ $if($json.start.dateTime.substring(8, 10).toNumber()-1 == 0, \"30\", $json.start.dateTime.substring(8, 10).toNumber()-1) }}"
},
{
"id": "876b25b1-121e-445f-a3c0-f9704a539e44",
"name": "currency",
"type": "string",
"value": "={{\n$if($json.summary.split(\" \")[1] == \"US\",\"USD\",\n$if($json.summary.split(\" \")[1] == \"AU\",\"AUD\",\n$if($json.summary.split(\" \")[1] == \"CA\",\"CAD\",\n$if($json.summary.split(\" \")[1] == \"SZ\",\"CHF\",\n$if($json.summary.split(\" \")[1] == \"UK\",\"GBP\",\n$if($json.summary.split(\" \")[1] == \"JN\",\"JPY\",\n$if($json.summary.split(\" \")[1] == \"NZ\",\"NZD\",\n$if($json.summary.split(\" \")[1] == \"GE\" || $json.summary.split(\" \")[1] == \"BE\" || $json.summary.split(\" \")[1] == \"EZ\" || $json.summary.split(\" \")[1] == \"IT\" || $json.summary.split(\" \")[1] == \"FR\" || $json.summary.split(\" \")[1] == \"SP\" ,\"EUR\", \"XXX\"\n))))))))\n}}"
},
{
"id": "3404bca5-0c9c-4c0e-b7d2-f2e1f8386e02",
"name": "impact",
"type": "string",
"value": "={{ $json.description.split(\"\\\\n\\\\n\")[0].split(\" \")[1] }}"
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "5fcf46dd-6fb3-4900-a664-af55baa05b9f",
"name": "抓取新闻链接",
"type": "n8n-nodes-base.airtop",
"position": [
1184,
320
],
"parameters": {
"url": "={{ $json.newsLink }}",
"resource": "extraction",
"operation": "scrape",
"sessionMode": "new"
},
"typeVersion": 1
},
{
"id": "ba3b2271-90d5-4cb2-ba69-0e9546618330",
"name": "便签 7",
"type": "n8n-nodes-base.stickyNote",
"position": [
-608,
192
],
"parameters": {
"width": 460,
"height": 1488,
"content": "## 获取 Forex Factory 新闻发布至 Telegram、Google Sheets。记录受影响货币对的新闻数据及 MyFxBook 实时价格。"
},
"typeVersion": 1
},
{
"id": "1762cc53-6fb0-438e-b7d9-0f895cbf7157",
"name": "等待 5 秒",
"type": "n8n-nodes-base.wait",
"position": [
1632,
416
],
"webhookId": "c090ab28-e750-4918-ad67-4efecddb1e12",
"parameters": {},
"typeVersion": 1.1
},
{
"id": "e86276ac-21b9-4ea2-95a9-d93f9f4b7273",
"name": "较差",
"type": "n8n-nodes-base.telegram",
"position": [
2512,
320
],
"webhookId": "dc8e4340-4e03-46cd-bd33-bd6fed92ba7e",
"parameters": {
"text": "={{ $('Google Calendar Trigger').item.json.summary+\"\\nImpact: \"+$('Get News Details').item.json.impact+\"\\n\"+\n\"Actual: \"+$json.actual+\"\\n\"+\n\"Forecast: \"+$json.forecast+\"\\n\"+\n$if($json.actual == $json.forecast,\"NEUTRAL for \"+$json.currency,\n$if($json.actual < $json.forecast,\"GOOD for \"+$json.currency,\"BAD for \"+$json.currency))}}",
"chatId": " ",
"additionalFields": {
"appendAttribution": false
}
},
"typeVersion": 1.2
},
{
"id": "7b715235-e2a9-460e-b7a6-cf67174d57d5",
"name": "较好",
"type": "n8n-nodes-base.telegram",
"position": [
2512,
512
],
"webhookId": "bcd2849e-503a-455b-b1e8-1d8da6a78a69",
"parameters": {
"text": "={{ $('Google Calendar Trigger').item.json.summary+\"\\nImpact: \"+$('Get News Details').item.json.impact+\"\\n\"+\n\"Actual: \"+$json.actual+\"\\n\"+\n\"Forecast: \"+$json.forecast+\"\\n\"+\n$if($json.actual == $json.forecast,\"NEUTRAL for \"+$json.currency,\n$if($json.actual > $json.forecast,\"GOOD for \"+$json.currency,\"BAD for \"+$json.currency))}}",
"chatId": " ",
"additionalFields": {
"appendAttribution": false
}
},
"typeVersion": 1.2
},
{
"id": "c1fbda38-d8da-45ca-aded-ad35f397dac4",
"name": "受影响货币对",
"type": "n8n-nodes-base.set",
"position": [
736,
320
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "c45c0138-b044-478a-9a08-db939b863c48",
"name": "affectedPairs",
"type": "string",
"value": "={{ $if($('Get News Details').item.json.currency == \"USD\",\"EURUSD,GBPUSD,AUDUSD,NZDUSD,USDJPY,USDCHF,USDCAD,XAUUSD\", $if($('Get News Details').item.json.currency == \"EUR\",\"EURUSD\", $if($('Get News Details').item.json.currency == \"GBP\",\"GBPUSD\", $if($('Get News Details').item.json.currency == \"AUD\",\"AUDUSD\", $if($('Get News Details').item.json.currency == \"NZD\",\"NZDUSD\", $if($('Get News Details').item.json.currency == \"JPY\",\"USDJPY\", $if($('Get News Details').item.json.currency == \"CHF\",\"USDCHF\", $if($('Get News Details').item.json.currency == \"CAD\",\"USDCAD\", )))))))) }}"
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "7250ed6b-c58a-4123-b913-7018dc5d5d8a",
"name": "拆分输出",
"type": "n8n-nodes-base.splitOut",
"position": [
16,
1152
],
"parameters": {
"options": {},
"fieldToSplitOut": "affectedPairs"
},
"typeVersion": 1
},
{
"id": "cfc66736-f391-43d8-bd89-51f8630d7e54",
"name": "新闻结果",
"type": "n8n-nodes-base.set",
"position": [
2736,
512
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "1b349427-abe3-4793-b8b4-150018d93547",
"name": "newsResult",
"type": "string",
"value": "={{ $if($json.result.text.includes(\"GOOD\"),\"GOOD\",\"BAD\") }}"
},
{
"id": "973fce2f-c555-4703-820a-9baed0b3de40",
"name": "affectedPairs",
"type": "array",
"value": "={{ $('Actual, Forecast Value').item.json.affectedPairs }}"
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "7474731e-f17a-4905-97df-80cf513068ab",
"name": "基础货币=新闻货币,利好",
"type": "n8n-nodes-base.if",
"position": [
240,
800
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "4c6caced-3fa4-4e53-a455-569392d34aee",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $('Split Out').item.json.affectedPairs.substring(0,3) }}",
"rightValue": "={{ $('Actual, Forecast Value').item.json.currency }}"
},
{
"id": "4999ee22-82f0-4ced-9355-99ff973fde09",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $('News Result').item.json.newsResult }}",
"rightValue": "GOOD"
},
{
"id": "bf0047b0-b40f-4b4c-bcb1-22c36725615b",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "b2b31d53-a05d-4595-96bb-3e728e93baca",
"name": "基础货币=新闻货币,利空",
"type": "n8n-nodes-base.if",
"position": [
240,
1040
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "49bd356c-090d-4614-b969-1707069f5d8f",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.affectedPairs.substring(0,3) }}",
"rightValue": "={{ $('Actual, Forecast Value').item.json.currency }}"
},
{
"id": "ad19d58d-6dbb-4237-8bcb-0a4af1910eef",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $('News Result').item.json.newsResult }}",
"rightValue": "BAD"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "d7dfdd0f-25e3-4372-baa6-ed6e4a8739d7",
"name": "报价货币=新闻货币,利好",
"type": "n8n-nodes-base.if",
"position": [
240,
1296
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "a50e3a5a-5a7e-4a50-9ae3-04f00da956d3",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.affectedPairs.substring(3,6) }}",
"rightValue": "={{ $('Actual, Forecast Value').item.json.currency }}"
},
{
"id": "9c29a9bd-638e-45a9-b70b-39660af2701f",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $('News Result').item.json.newsResult }}",
"rightValue": "GOOD"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "e78ae77d-a4e9-4445-9eda-7c0b66d9f27b",
"name": "报价货币=新闻货币,利空",
"type": "n8n-nodes-base.if",
"position": [
240,
1488
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "07719d15-d1aa-4698-b7d3-cc064bcf16fb",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.affectedPairs.substring(3,6) }}",
"rightValue": "={{ $('Actual, Forecast Value').item.json.currency }}"
},
{
"id": "7b348fec-ba10-4f8d-932f-ede550a12e52",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $('News Result').item.json.newsResult }}",
"rightValue": "BAD"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "91127ba8-c7f8-4b44-87eb-2389b4e25fd6",
"name": "无操作,不执行任何操作",
"type": "n8n-nodes-base.noOp",
"position": [
1360,
960
],
"parameters": {},
"typeVersion": 1
},
{
"id": "b06cd955-3caa-4795-8d21-a90572a97ef0",
"name": "买入",
"type": "n8n-nodes-base.set",
"position": [
464,
720
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "a510b35a-466b-4e81-9f61-e5acf133f69c",
"name": "DATE",
"type": "string",
"value": "={{ $('Get News Details').item.json.month+\" \"+$('Get News Details').item.json.day+\", \"+$('Get News Details').item.json.year }}"
},
{
"id": "ae10ff0d-2b41-4518-b1a8-98f4e9038faf",
"name": "NEWS",
"type": "string",
"value": "={{ $('Affected Pairs').item.json.summary }}"
},
{
"id": "3e2302f7-aaed-409a-8855-0217dd1a073a",
"name": "IMPACT",
"type": "string",
"value": "={{ $('Affected Pairs').item.json.impact }}"
},
{
"id": "66434859-ce59-492f-96fd-0c23be814028",
"name": "POSITION",
"type": "string",
"value": "BUY"
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "a0079352-f642-49ab-b700-5caced2206c8",
"name": "卖出",
"type": "n8n-nodes-base.set",
"position": [
464,
1104
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "a510b35a-466b-4e81-9f61-e5acf133f69c",
"name": "DATE",
"type": "string",
"value": "={{ $('Get News Details').item.json.month+\" \"+$('Get News Details').item.json.day+\", \"+$('Get News Details').item.json.year }}"
},
{
"id": "ae10ff0d-2b41-4518-b1a8-98f4e9038faf",
"name": "NEWS",
"type": "string",
"value": "={{ $('Affected Pairs').item.json.summary }}"
},
{
"id": "3e2302f7-aaed-409a-8855-0217dd1a073a",
"name": "IMPACT",
"type": "string",
"value": "={{ $('Affected Pairs').item.json.impact }}"
},
{
"id": "66434859-ce59-492f-96fd-0c23be814028",
"name": "POSITION",
"type": "string",
"value": "SELL"
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "5d12d533-471b-41db-9acb-088a9ada44eb",
"name": "MyFxBook",
"type": "n8n-nodes-base.httpRequest",
"position": [
688,
720
],
"parameters": {
"url": "=https://www.myfxbook.com/forex-market/currencies/{{ $('Split Out').item.json.affectedPairs }}-historical-data",
"options": {}
},
"typeVersion": 4.2
},
{
"id": "3161a0d1-4b5a-4098-a4a5-9ae28a30a9fa",
"name": "MyFxBook2",
"type": "n8n-nodes-base.httpRequest",
"position": [
688,
1104
],
"parameters": {
"url": "=https://www.myfxbook.com/forex-market/currencies/{{ $('Split Out').item.json.affectedPairs }}-historical-data",
"options": {}
},
"typeVersion": 4.2
},
{
"id": "9bee1d11-90ca-4dfd-a295-f2f3f172695f",
"name": "获取价格",
"type": "n8n-nodes-base.set",
"position": [
912,
720
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "11d7cfed-faee-46e0-8212-6cf45a6acbb2",
"name": "PRICE",
"type": "number",
"value": "={{ $json.data.substring($json.data.indexOf('data-value=\"'),$json.data.indexOf('data-value=\"')+50).split('\"')[1] }}"
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "bfc4c770-6656-45e0-98fa-258376f800e8",
"name": "获取价格2",
"type": "n8n-nodes-base.set",
"position": [
912,
1104
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "11d7cfed-faee-46e0-8212-6cf45a6acbb2",
"name": "PRICE",
"type": "number",
"value": "={{ $json.data.substring($json.data.indexOf('data-value=\"'),$json.data.indexOf('data-value=\"')+50).split('\"')[1] }}"
}
]
},
"includeOtherFields": true
},
"typeVersion": 3.4
},
{
"id": "9997adff-6bc4-413b-95e0-dc936d8f57ca",
"name": "输入到 Sheets",
"type": "n8n-nodes-base.googleSheets",
"position": [
1136,
720
],
"parameters": {
"columns": {
"value": {
"DATE": "={{ $('BUY').item.json.DATE }}",
"NEWS": "={{ $('BUY').item.json.NEWS }}",
"PAIRS": "={{ $('BUY').item.json.affectedPairs }}",
"PRICE": "={{ $json.PRICE }}",
"IMPACT": "={{ $('BUY').item.json.IMPACT }}",
"POSITION": "={{ $('BUY').item.json.POSITION }}"
},
"schema": [
{
"id": "DATE",
"type": "string",
"display": true,
"required": false,
"displayName": "DATE",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "PAIRS",
"type": "string",
"display": true,
"required": false,
"displayName": "PAIRS",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "NEWS",
"type": "string",
"display": true,
"required": false,
"displayName": "NEWS",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "IMPACT",
"type": "string",
"display": true,
"required": false,
"displayName": "IMPACT",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "POSITION",
"type": "string",
"display": true,
"required": false,
"displayName": "POSITION",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "PRICE",
"type": "string",
"display": true,
"required": false,
"displayName": "PRICE",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "HIGH",
"type": "string",
"display": true,
"required": false,
"displayName": "HIGH",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "LOW",
"type": "string",
"display": true,
"required": false,
"displayName": "LOW",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "POINTS UP",
"type": "string",
"display": true,
"required": false,
"displayName": "POINTS UP",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "POINTS DOWN",
"type": "string",
"display": true,
"required": false,
"displayName": "POINTS DOWN",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "PROFIT/LOSS",
"type": "string",
"display": true,
"required": false,
"displayName": "PROFIT/LOSS",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": " ",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1f6SS-WVj3p2rZJ6SOawzWsXm5l796vQaNyGFIwABlqQ",
"cachedResultUrl": " ",
"cachedResultName": "ForexFactory News Data"
}
},
"typeVersion": 4.7
},
{
"id": "072cdb18-ad04-4035-b1a1-ceef2c6b4f18",
"name": "输入到 Sheets2",
"type": "n8n-nodes-base.googleSheets",
"position": [
1136,
1104
],
"parameters": {
"columns": {
"value": {
"DATE": "={{ $('SELL').item.json.DATE }}",
"NEWS": "={{ $('SELL').item.json.NEWS }}",
"PAIRS": "={{ $('SELL').item.json.affectedPairs }}",
"PRICE": "={{ $json.PRICE }}",
"IMPACT": "={{ $('SELL').item.json.IMPACT }}",
"POSITION": "={{ $('SELL').item.json.POSITION }}"
},
"schema": [
{
"id": "DATE",
"type": "string",
"display": true,
"required": false,
"displayName": "DATE",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "PAIRS",
"type": "string",
"display": true,
"required": false,
"displayName": "PAIRS",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "NEWS",
"type": "string",
"display": true,
"required": false,
"displayName": "NEWS",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "IMPACT",
"type": "string",
"display": true,
"required": false,
"displayName": "IMPACT",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "POSITION",
"type": "string",
"display": true,
"required": false,
"displayName": "POSITION",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "PRICE",
"type": "string",
"display": true,
"required": false,
"displayName": "PRICE",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "HIGH",
"type": "string",
"display": true,
"required": false,
"displayName": "HIGH",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "LOW",
"type": "string",
"display": true,
"required": false,
"displayName": "LOW",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "POINTS UP",
"type": "string",
"display": true,
"required": false,
"displayName": "POINTS UP",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "POINTS DOWN",
"type": "string",
"display": true,
"required": false,
"displayName": "POINTS DOWN",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "PROFIT/LOSS",
"type": "string",
"display": true,
"required": false,
"displayName": "PROFIT/LOSS",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": " ",
"cachedResultName": "Sheet1"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1f6SS-WVj3p2rZJ6SOawzWsXm5l796vQaNyGFIwABlqQ",
"cachedResultUrl": " ",
"cachedResultName": "ForexFactory News Data"
}
},
"typeVersion": 4.7
},
{
"id": "8781614a-c72d-4bda-925d-38bb121028ac",
"name": "等待",
"type": "n8n-nodes-base.wait",
"position": [
960,
320
],
"webhookId": "f0708eb7-3680-4015-b6d2-7b741aff29a4",
"parameters": {
"amount": 10
},
"typeVersion": 1.1
}
],
"pinData": {},
"connections": {
"If": {
"main": [
[
{
"node": "Delete %KMBT, To Number",
"type": "main",
"index": 0
}
],
[
{
"node": "To Number",
"type": "main",
"index": 0
}
]
]
},
"BUY": {
"main": [
[
{
"node": "MyFxBook",
"type": "main",
"index": 0
}
]
]
},
"SELL": {
"main": [
[
{
"node": "MyFxBook2",
"type": "main",
"index": 0
}
]
]
},
"Wait": {
"main": [
[
{
"node": "Scrape News Link",
"type": "main",
"index": 0
}
]
]
},
"Wait 5s": {
"main": [
[
{
"node": "Scrape News Link",
"type": "main",
"index": 0
}
]
]
},
"MyFxBook": {
"main": [
[
{
"node": "Get Price",
"type": "main",
"index": 0
}
]
]
},
"Get Price": {
"main": [
[
{
"node": "Input to Sheets",
"type": "main",
"index": 0
}
]
]
},
"Less Good": {
"main": [
[
{
"node": "News Result",
"type": "main",
"index": 0
}
]
]
},
"MyFxBook2": {
"main": [
[
{
"node": "Get Price2",
"type": "main",
"index": 0
}
]
]
},
"Split Out": {
"main": [
[
{
"node": "Base=NewsCurrency, Good",
"type": "main",
"index": 0
},
{
"node": "Base=NewsCurrency, Bad",
"type": "main",
"index": 0
},
{
"node": "Quote=NewsCurrency, Good",
"type": "main",
"index": 0
},
{
"node": "Quote=NewsCurrency, Bad",
"type": "main",
"index": 0
}
]
]
},
"To Number": {
"main": [
[
{
"node": "'Actual' less than 'Forecast' is good for currency?",
"type": "main",
"index": 0
}
]
]
},
"Get Price2": {
"main": [
[
{
"node": "Input to Sheets2",
"type": "main",
"index": 0
}
]
]
},
"News Result": {
"main": [
[
{
"node": "Split Out",
"type": "main",
"index": 0
}
]
]
},
"Greater Good": {
"main": [
[
{
"node": "News Result",
"type": "main",
"index": 0
}
]
]
},
"Affected Pairs": {
"main": [
[
{
"node": "Wait",
"type": "main",
"index": 0
}
]
]
},
"IF Has Forecast": {
"main": [
[
{
"node": "Get News Details",
"type": "main",
"index": 0
}
],
[
{
"node": "No Operation, do nothing1",
"type": "main",
"index": 0
}
]
]
},
"Input to Sheets": {
"main": [
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
},
"Get Actual Data?": {
"main": [
[
{
"node": "Actual, Forecast Value",
"type": "main",
"index": 0
}
],
[
{
"node": "Wait 5s",
"type": "main",
"index": 0
}
]
]
},
"Get News Details": {
"main": [
[
{
"node": "Affected Pairs",
"type": "main",
"index": 0
}
]
]
},
"Input to Sheets2": {
"main": [
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
},
"Scrape News Link": {
"main": [
[
{
"node": "Get Actual Data?",
"type": "main",
"index": 0
}
]
]
},
"Actual, Forecast Value": {
"main": [
[
{
"node": "If",
"type": "main",
"index": 0
}
]
]
},
"Base=NewsCurrency, Bad": {
"main": [
[
{
"node": "SELL",
"type": "main",
"index": 0
}
],
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
},
"Base=NewsCurrency, Good": {
"main": [
[
{
"node": "BUY",
"type": "main",
"index": 0
}
],
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
},
"Delete %KMBT, To Number": {
"main": [
[
{
"node": "'Actual' less than 'Forecast' is good for currency?",
"type": "main",
"index": 0
}
]
]
},
"Google Calendar Trigger": {
"main": [
[
{
"node": "IF Has Forecast",
"type": "main",
"index": 0
}
]
]
},
"Quote=NewsCurrency, Bad": {
"main": [
[
{
"node": "BUY",
"type": "main",
"index": 0
}
],
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
},
"Quote=NewsCurrency, Good": {
"main": [
[
{
"node": "SELL",
"type": "main",
"index": 0
}
],
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
},
"'Actual' less than 'Forecast' is good for currency?": {
"main": [
[
{
"node": "Less Good",
"type": "main",
"index": 0
}
],
[
{
"node": "Greater Good",
"type": "main",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
高级 - 加密货币交易
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
自动化外汇新闻提醒系统
使用Forex Factory和Telegram的自动化外汇新闻提醒系统
If
Set
Wait
+4
16 节点Harry Gunadi Permana
加密货币交易
追踪并分析外汇新闻交易结果
使用 MyFxBook 和 Google Sheets 追踪并分析外汇新闻交易结果
If
Set
Markdown
+5
17 节点Harry Gunadi Permana
杂项
Facebook页面评论管理机器人:回复、删除、封禁和通知
AI驱动的Facebook评论管理:自动回复、删除、封禁和通知
If
Set
Code
+18
59 节点SpaGreen Creative
社交媒体
潜在客户开发与邮件工作流
使用Google Maps、SendGrid和AI自动化B2B潜在客户开发与邮件营销
If
Set
Code
+21
141 节点Ezema Kingsley Chibuzo
潜在客户开发
使用Groq、Gemini和Slack审批系统自动化RSS到Medium发布
通过Groq、Gemini和Slack审批系统实现RSS到Medium发布的自动化流程
If
Set
Code
+16
41 节点ObisDev
内容创作
OCR Telegram - SAP
基于Telegram、GPT-4o、OCR和SAP集成的自动化发票处理
Set
Code
Wait
+12
29 节点Raquel Giugliano
人工智能