{
  "id": "tRckisVXLUy8rbLG",
  "name": "Binance SM 1day Indicators Tool",
  "tags": [],
  "nodes": [
    {
      "id": "17fdc5ce-753b-4197-8f36-7f2b4df2fb39",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        3100,
        2040
      ],
      "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": "bfdcd736-dabb-40b3-82a4-55e8cef8cb18",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        3360,
        2060
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "b7df590f-0c56-466d-a09c-b271f9f27c49",
      "name": "When Executed by Another Workflow",
      "type": "n8n-nodes-base.executeWorkflowTrigger",
      "position": [
        2940,
        1700
      ],
      "parameters": {
        "workflowInputs": {
          "values": [
            {
              "name": "message"
            },
            {
              "name": "sessionId"
            }
          ]
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "0928613f-9c83-41d8-a761-03cd357ba78a",
      "name": "Binance SM 1day Indicators Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        3340,
        1700
      ],
      "parameters": {
        "text": "={{ $json.message }}",
        "options": {
          "systemMessage": "You are the **Binance 1-Day Technical Indicator Agent**, responsible for calculating and returning **1-day interval signals** for any Binance Spot Market pair. You help detect major trend shifts, long-term support/resistance, and macro market behavior.\n\n---\n\n### \ud83d\udd17 Connected Tools (via internal workflow)\n\nYou call the following indicators using `https://treasurium.app.n8n.cloud/webhook/1d-indicators`:\n\n* **RSI** (14-period)\n* **MACD** (12/26/9 config)\n* **Bollinger Bands** (20-period, 2\u00d7STD)\n* **SMA** (20-period)\n* **EMA** (20-period)\n* **ADX** (14-period with DI+ and DI\u2212)\n\n---\n\n### \ud83d\udce5 Expected Input Format\n\n```json\n{\n  \"message\": \"SOLUSDT\",\n  \"sessionId\": \"telegram_chat_id\"\n}\n```\n\n* `message`: A valid Binance Spot Market symbol (e.g., SOLUSDT, MATICUSDT)\n* `sessionId`: For preserving user context and session-based replies\n\n---\n\n### \ud83d\udcca Behavior\n\n* Sends POST request to:\n\n  ```\n  https://treasurium.app.n8n.cloud/webhook/1d-indicators\n  ```\n\n  with:\n\n  ```json\n  {\n    \"symbol\": \"SOLUSDT\"\n  }\n  ```\n\n* Retrieves **at least 40 daily candles** via Binance API\n\n* Calculates and merges results from all indicators listed above\n\n* Returns a single unified array for downstream agent interpretation\n\n---\n\n### \ud83e\udde0 Use Case Scenarios\n\n* Identify **long-term market sentiment and trend shifts**\n* Support **macro trade setups** or high-confidence swing positions\n* Anchor **support/resistance levels** across multi-timeframe views\n* Feed **Financial Analyst Tool** and **Quant AI Agent** with base trend orientation\n\n---\n\n### \u26a0\ufe0f Operational Notes\n\n* Validate that the symbol is correctly formatted (uppercase, no typos)\n* Ensure Binance returns sufficient 1d candles (fallback if not)\n* Timestamp consistency is required across indicators\n* Return all calculated metrics in structured JSON format with labels\n\n"
        },
        "promptType": "define"
      },
      "typeVersion": 1.9
    },
    {
      "id": "07b02663-cf9f-4532-a745-64f8400ca3b2",
      "name": "HTTP Request 1d Indicators Tool",
      "type": "n8n-nodes-base.httpRequestTool",
      "position": [
        3600,
        2020
      ],
      "parameters": {
        "url": "https://treasurium.app.n8n.cloud/webhook/1d-indicators",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "symbol",
              "value": "={{ /*n8n-auto-generated-fromAI-override*/ $fromAI('parameters0_Value', ``, 'string') }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "79a6b169-30b1-41c3-854e-5ec05ba21e69",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2880,
        1380
      ],
      "parameters": {
        "color": 4,
        "height": 500,
        "content": "## Workflow Trigger\nNode: When Executed by Another Workflow\nThis workflow does not start on its own \u2014 it is always triggered by:\n\n**Binance SM Financial Analyst Tool**\n\n**Binance Quant AI Agent**"
      },
      "typeVersion": 1
    },
    {
      "id": "d7466bfd-8c66-4342-a184-76b4e6652623",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3220,
        1500
      ],
      "parameters": {
        "color": 5,
        "width": 500,
        "height": 380,
        "content": "## Main Reasoning Agent\nNode: **Binance SM 1day Indicators Agent**\n\nYou calculate daily **RSI, MACD, Bollinger Bands, SMA, EMA, and ADX** for any Binance symbol. Your goal is to **detect macro sentiment, support/resistance zones, and long-term trend setups**."
      },
      "typeVersion": 1
    },
    {
      "id": "be007521-ac2c-484b-8053-7328cc3ee75c",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3020,
        2000
      ],
      "parameters": {
        "width": 220,
        "height": 520,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n##   OpenAI Chat Model\nNode: OpenAI Chat Model\nModel: **gpt-4.1-mini**\nThis node interprets:\n\nWhether the trend is **forming, consolidating, or reversing**\n\nTags like **\"Bearish Reversal\", \"Momentum Building\"**, etc.\n\nTelegram-ready summaries"
      },
      "typeVersion": 1
    },
    {
      "id": "a7968e7d-4f05-4f2d-8a42-ec62f810b96b",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3280,
        2000
      ],
      "parameters": {
        "color": 3,
        "width": 220,
        "height": 520,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## Session Memory\nNode: **Simple Memory\nStores sessionId, symbol, and last-used indicators** for tracking across multi-timeframe reports."
      },
      "typeVersion": 1
    },
    {
      "id": "4097c8e4-d2c0-41a9-806e-26ccdd02d03e",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3540,
        2000
      ],
      "parameters": {
        "color": 6,
        "width": 220,
        "height": 860,
        "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## 1D Indicator Tool Call\nNode: HTTP Request 1d Indicators Tool\n\n**Sends a POST request to:**\n\n\nhttps://treasurium.app.n8n.cloud/webhook/1d-indicators\n\nPayload:\n\njson\n{\n  \"symbol\": \"SOLUSDT\"\n}\nCalculates:\n\n**RSI (14)\n\nMACD (12,26,9)\n\nBollinger Bands (20/2)\n\nSMA / EMA (20)\n\nADX (14 +DI/\u2212DI)**\n\nUses the latest **40 candles** of 1-day interval data from **Binance**.\n\n"
      },
      "typeVersion": 1
    },
    {
      "id": "2070c387-3359-43f5-a358-6aefd983aea2",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3960,
        340
      ],
      "parameters": {
        "width": 1400,
        "height": 2820,
        "content": "# \ud83d\uddd3\ufe0f Binance SM 1day Indicators Tool \u2013 Documentation\n\nThis workflow acts as the macro-trend analysis unit of the Binance Spot Market Quant AI Agent. It calculates long-term indicators using 1-day candles and identifies major trend reversals, support zones, and macro structure.\n\n---\n\n## \ud83c\udfaf Purpose\n\n* Retrieve 1-day OHLCV data for any Binance trading pair (last 40 candles)\n* Calculate daily indicators: RSI, MACD, Bollinger Bands, ADX, SMA, EMA\n* Send all raw indicator outputs to GPT for interpretation\n* Return high-confidence macro trend assessment, formatted for Telegram or AI reasoning layers\n\n---\n\n## \u2699\ufe0f Core Workflow Components\n\n| Node Name                           | Function                                                         |\n| ----------------------------------- | ---------------------------------------------------------------- |\n| `When Executed by Another Workflow` | Trigger (activated by Quant AI Agent or Financial Analyst Tool)  |\n| `Binance SM 1day Indicators Agent`  | Main logic agent for input routing and tool coordination         |\n| `HTTP Request 1d Indicators Tool`   | Calls webhook for real indicator calculations                    |\n| `OpenAI Chat Model (gpt-4.1-mini)`  | Interprets numerical outputs into human-readable trading signals |\n| `Simple Memory`                     | Tracks symbol and session context                                |\n\n---\n\n## \ud83d\udce5 Input Format\n\n```json\n{\n  \"message\": \"MATICUSDT\",\n  \"sessionId\": \"telegram_chat_id\"\n}\n```\n\n* `message`: Target Binance Spot Market symbol (uppercase)\n* `sessionId`: Used to track Telegram conversations and agent memory\n\n---\n\n## \ud83e\udde0 Calculated Indicators\n\n| Indicator      | Details                            |\n| -------------- | ---------------------------------- |\n| RSI (14)       | Identifies overbought/oversold     |\n| MACD (12,26,9) | Detects trend shifts and momentum  |\n| BBANDS (20, 2) | Volatility squeeze or expansion    |\n| SMA (20)       | Macro trend support/resistance     |\n| EMA (20)       | Faster-moving confirmation layer   |\n| ADX (14)       | Strength of trend (includes DI+/-) |\n\nWebhook endpoint:\n\n```\nPOST https://treasurium.app.n8n.cloud/webhook/1d-indicators\n```\n\nPayload:\n\n```json\n{\n  \"symbol\": \"MATICUSDT\"\n}\n```\n\n---\n\n## \ud83d\udce4 GPT Output Format Example\n\n```\n\ud83d\udcc5 1D Overview \u2013 MATICUSDT\n\n\u2022 RSI: 71 \u2192 Overbought  \n\u2022 MACD: Bearish Cross forming  \n\u2022 BBANDS: Widening Volatility  \n\u2022 EMA < SMA \u2192 Downtrend Momentum  \n\u2022 ADX: 33 \u2192 High Trend Strength\n```\n\n---\n\n## \ud83d\udcca Use Case Scenarios\n\n| Scenario                                 | Behavior                                                    |\n| ---------------------------------------- | ----------------------------------------------------------- |\n| Swing trader requests long-term trend    | Output highlights multi-day reversal or continuation setups |\n| Agent confirms bias before entry         | Used in conjunction with 15m\u20134h for confidence stacking     |\n| Analyst wants sentiment-free macro trend | This tool uses price structure only (no news input)         |\n\n---\n\n## \ud83d\udce6 Setup Instructions\n\n### 1. Import Workflow\n\n* Upload JSON into your n8n project\n* Rename for clarity if needed\n\n### 2. Configure GPT + Webhook\n\n* Ensure OpenAI API key is linked to GPT node\n* Confirm webhook `/1d-indicators` is active and functional\n\n### 3. Link Parent Workflows\n\n* This tool must be called by:\n\n  * `Binance SM Financial Analyst Tool`\n  * `Binance Spot Market Quant AI Agent`\n\n---\n\n## \ud83e\uddfe Output Channel\n\n* This tool is not user-facing\n* Sends formatted summaries and structured arrays back to the calling agent\n\n---\n\n## \ud83d\udd10 Licensing & Support\n\n\ud83d\udd17 **Don Jayamaha \u2013 LinkedIn**\n[http://linkedin.com/in/donjayamahajr](http://linkedin.com/in/donjayamahajr)\n\n\u00a9 2025 Treasurium Capital Limited Company. All rights reserved.\nThis tool is licensed for internal automation only. Its structure, API logic, prompt format, and data orchestration are protected under U.S. intellectual property law. Reuse or sale without a license is prohibited.\n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "ca337caf-2f77-47ec-97e3-efbcb74ef79d",
  "connections": {
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "Binance SM 1day Indicators Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Binance SM 1day Indicators Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request 1d Indicators Tool": {
      "ai_tool": [
        [
          {
            "node": "Binance SM 1day Indicators Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "When Executed by Another Workflow": {
      "main": [
        [
          {
            "node": "Binance SM 1day Indicators Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}