Organization: - Created docs/ with setup/, guides/, history/ subdirectories - Created workflows/ with trading/, analytics/, telegram/, archive/ subdirectories - Created scripts/ with docker/, setup/, testing/ subdirectories - Created tests/ for TypeScript test files - Created archive/ for unused reference files Moved files: - 17 documentation files → docs/ - 16 workflow JSON files → workflows/ - 10 shell scripts → scripts/ - 4 test files → tests/ - 5 unused files → archive/ Updated: - README.md with new file structure and documentation paths Deleted: - data/ (empty directory) - screenshots/ (empty directory) Critical files remain in root: - telegram_command_bot.py (active bot - used by Dockerfile) - watch-restart.sh (systemd service dependency) - All Dockerfiles and docker-compose files - All environment files Validation: Containers running (trading-bot-v4, telegram-trade-bot, postgres) API responding (positions endpoint tested) Telegram bot functional (/status command tested) All critical files present in root No code changes - purely organizational. System continues running without interruption. Recovery: git revert HEAD or git reset --hard cleanup-before
129 lines
3.5 KiB
JSON
129 lines
3.5 KiB
JSON
{
|
|
"name": "Telegram Manual Trade - ADD TO MONEY MACHINE",
|
|
"nodes": [
|
|
{
|
|
"parameters": {
|
|
"httpMethod": "POST",
|
|
"path": "telegram-trade",
|
|
"responseMode": "responseNode",
|
|
"options": {}
|
|
},
|
|
"id": "webhook",
|
|
"name": "Webhook Receiver",
|
|
"type": "n8n-nodes-base.webhook",
|
|
"typeVersion": 1.1,
|
|
"position": [200, 300],
|
|
"webhookId": "telegram-trade-webhook"
|
|
},
|
|
{
|
|
"parameters": {
|
|
"conditions": {
|
|
"string": [
|
|
{
|
|
"value1": "={{ $json.body.message || $json.body.text || '' }}",
|
|
"operation": "regex",
|
|
"value2": "(buy|sell|long|short).*(sol|btc|eth)"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"id": "filter-trades",
|
|
"name": "Is Trade Command?",
|
|
"type": "n8n-nodes-base.if",
|
|
"typeVersion": 1,
|
|
"position": [400, 300]
|
|
},
|
|
{
|
|
"parameters": {
|
|
"values": {
|
|
"string": [
|
|
{
|
|
"name": "symbol",
|
|
"value": "={{ ($json.body.message || $json.body.text).toString().match(/\\b(SOL|BTC|ETH)\\b/i)[0].toUpperCase() }}-PERP"
|
|
},
|
|
{
|
|
"name": "direction",
|
|
"value": "={{ ($json.body.message || $json.body.text).toString().match(/\\b(sell|short)\\b/i) ? 'short' : 'long' }}"
|
|
},
|
|
{
|
|
"name": "timeframe",
|
|
"value": "5"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"id": "parse-command",
|
|
"name": "Parse Trade",
|
|
"type": "n8n-nodes-base.set",
|
|
"typeVersion": 1,
|
|
"position": [600, 300]
|
|
},
|
|
{
|
|
"parameters": {
|
|
"respondWith": "json",
|
|
"responseBody": "={{ { \"status\": \"received\", \"symbol\": $json.symbol, \"direction\": $json.direction } }}"
|
|
},
|
|
"id": "webhook-response",
|
|
"name": "Webhook Response",
|
|
"type": "n8n-nodes-base.respondToWebhook",
|
|
"typeVersion": 1,
|
|
"position": [800, 450]
|
|
},
|
|
{
|
|
"parameters": {
|
|
"chatId": "579304651",
|
|
"text": "🤖 Manual Trade\\n\\n📊 {{ $json.symbol }}\\n{{ $json.direction === 'long' ? '📈' : '📉' }} {{ $json.direction.toUpperCase() }}\\n⏰ {{ $now.format('HH:mm:ss') }}\\n\\n✅ Executing...",
|
|
"additionalFields": {
|
|
"appendAttribution": false
|
|
}
|
|
},
|
|
"id": "confirm",
|
|
"name": "Send Telegram Confirm",
|
|
"type": "n8n-nodes-base.telegram",
|
|
"typeVersion": 1.1,
|
|
"position": [800, 300],
|
|
"credentials": {
|
|
"telegramApi": {
|
|
"id": "Csk5cg4HtaSqP5jJ",
|
|
"name": "Telegram account"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"parameters": {},
|
|
"id": "output",
|
|
"name": "➡️ Connect to Check Risk",
|
|
"type": "n8n-nodes-base.noOp",
|
|
"typeVersion": 1,
|
|
"position": [1000, 300],
|
|
"notes": "Connect this output to your Money Machine's Check Risk node"
|
|
}
|
|
],
|
|
"connections": {
|
|
"Webhook Receiver": {
|
|
"main": [[
|
|
{"node": "Is Trade Command?", "type": "main", "index": 0}
|
|
]]
|
|
},
|
|
"Is Trade Command?": {
|
|
"main": [[
|
|
{"node": "Parse Trade", "type": "main", "index": 0}
|
|
]]
|
|
},
|
|
"Parse Trade": {
|
|
"main": [[
|
|
{"node": "Webhook Response", "type": "main", "index": 0},
|
|
{"node": "Send Telegram Confirm", "type": "main", "index": 0}
|
|
]]
|
|
},
|
|
"Send Telegram Confirm": {
|
|
"main": [[
|
|
{"node": "➡️ Connect to Check Risk", "type": "main", "index": 0}
|
|
]]
|
|
}
|
|
},
|
|
"active": false,
|
|
"settings": {},
|
|
"versionId": "telegram-webhook-final"
|
|
}
|