{
    "name": "AWTRIX Stock Ticker (Shareable)",
    "nodes": [
        {
            "parameters": {
                "triggerTimes": {
                    "item": [
                        {
                            "mode": "custom",
                            "cronExpression": "*/30 6-13 * * 1-5"
                        }
                    ]
                }
            },
            "name": "Schedule",
            "type": "n8n-nodes-base.cron",
            "typeVersion": 1,
            "position": [
                250,
                300
            ]
        },
        {
            "parameters": {
                "url": "https://finnhub.io/api/v1/quote?symbol=SPY&token=YOUR_FINNHUB_API_KEY",
                "options": {}
            },
            "name": "Get Stock Data",
            "type": "n8n-nodes-base.httpRequest",
            "typeVersion": 3,
            "position": [
                450,
                300
            ]
        },
        {
            "parameters": {
                "jsCode": "const percentChange = items[0].json.dp;\nconst symbol = \"SPY\";\nconst isUp = percentChange >= 0;\nconst color = isUp ? '00FF00' : 'FF0000';\nconst sign = isUp ? '+' : '';\n\nreturn [\n  {\n    json: {\n      text: [\n        { t: symbol + \" \", c: \"FFFFFF\" },\n        { t: sign + percentChange.toFixed(2) + \"%\", c: color }\n      ],\n      icon: \"525\", \n      pushIcon: 2,\n      repeat: 2,\n      duration: 10\n    }\n  }\n];"
            },
            "name": "Format for AWTRIX",
            "type": "n8n-nodes-base.code",
            "typeVersion": 1,
            "position": [
                650,
                300
            ]
        },
        {
            "parameters": {
                "method": "POST",
                "url": "http://YOUR_AWTRIX_IP/api/custom?name=stock",
                "sendBody": true,
                "specifyBody": "json",
                "jsonBody": "={{JSON.stringify($json)}}",
                "options": {}
            },
            "name": "Send to AWTRIX",
            "type": "n8n-nodes-base.httpRequest",
            "typeVersion": 3,
            "position": [
                850,
                300
            ]
        }
    ],
    "connections": {
        "Schedule": {
            "main": [
                [
                    {
                        "node": "Get Stock Data",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "Get Stock Data": {
            "main": [
                [
                    {
                        "node": "Format for AWTRIX",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        },
        "Format for AWTRIX": {
            "main": [
                [
                    {
                        "node": "Send to AWTRIX",
                        "type": "main",
                        "index": 0
                    }
                ]
            ]
        }
    }
}