{
  "name": "M1-B-Minute2Daily (15:01)",
  "nodes": [
    {
      "id": "trigger",
      "name": "\u5b9a\u65f6\u89e6\u53d1",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.1,
      "position": [
        0,
        0
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "1 15 * * 1-5"
            }
          ]
        }
      }
    },
    {
      "id": "manual",
      "name": "\u624b\u52a8\u89e6\u53d1",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        200
      ]
    },
    {
      "id": "set-symbols",
      "name": "\u751f\u6210\u516d\u5927\u6307\u6570",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        200,
        100
      ],
      "parameters": {
        "jsCode": "const symbols = ['sh000001', 'sz399001', 'sz399006', 'sh000688', 'sh000300', 'sh000852'];\nreturn symbols.map(s => ({ json: { symbol: s } }));"
      }
    },
    {
      "id": "http",
      "name": "\u8c03\u7528\u672c\u5730 M1-B",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.1,
      "position": [
        400,
        100
      ],
      "parameters": {
        "method": "POST",
        "url": "http://host.docker.internal:8787/api/m1/run",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"script\": \"m1_minute_to_daily.py\",\n  \"symbol\": \"{{ $json.symbol }}\",\n  \"day\": \"{{ $today.toFormat('yyyy-MM-dd') }}\"\n}",
        "options": {}
      }
    },
    {
      "id": "parse",
      "name": "\u8f93\u51fa\u6267\u884c\u7ed3\u679c",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        600,
        100
      ],
      "parameters": {
        "jsCode": "return $input.all().map(item => {\n  let raw = item.json.stdout ? item.json.stdout.join('\\n') : '';\n  let summary = `M1-B \u274c \u672a\u77e5\u9519\u8bef`;\n  if (raw.includes('\u6210\u529f\uff01\u5408\u5e76\u751f\u6210\u4e86')) {\n    const match = raw.match(/\u6210\u529f\uff01\u5408\u5e76\u751f\u6210\u4e86 (.*) \u7684\u65e5\u7ebf: (.*)/);\n    if (match) {\n      summary = `M1-B \u2705 day=${match[1]}\\n\u5408\u5e76\u6210\u529f: ${match[2]}`;\n    }\n  } else if (raw.includes('\u274c')) {\n    const match = raw.match(/\u274c (.*)/);\n    if (match) summary = `M1-B \u274c \u5931\u8d25: ${match[1]}`;\n  }\n  return { json: { summary } };\n});"
      }
    }
  ],
  "connections": {
    "\u5b9a\u65f6\u89e6\u53d1": {
      "main": [
        [
          {
            "node": "\u751f\u6210\u516d\u5927\u6307\u6570",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u624b\u52a8\u89e6\u53d1": {
      "main": [
        [
          {
            "node": "\u751f\u6210\u516d\u5927\u6307\u6570",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u751f\u6210\u516d\u5927\u6307\u6570": {
      "main": [
        [
          {
            "node": "\u8c03\u7528\u672c\u5730 M1-B",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "\u8c03\u7528\u672c\u5730 M1-B": {
      "main": [
        [
          {
            "node": "\u8f93\u51fa\u6267\u884c\u7ed3\u679c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  }
}