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
179 lines
4.1 KiB
JSON
179 lines
4.1 KiB
JSON
{
|
|
"name": "Telegram Manual Trade (Polling) - Import to Money Machine",
|
|
"nodes": [
|
|
{
|
|
"parameters": {
|
|
"resource": "message",
|
|
"operation": "get",
|
|
"chatId": "579304651",
|
|
"returnAll": false,
|
|
"limit": 1,
|
|
"options": {}
|
|
},
|
|
"id": "telegram-poll-messages",
|
|
"name": "Poll Telegram Messages",
|
|
"type": "n8n-nodes-base.telegram",
|
|
"typeVersion": 1.1,
|
|
"position": [
|
|
-1020,
|
|
460
|
|
],
|
|
"credentials": {
|
|
"telegramApi": {
|
|
"id": "Csk5cg4HtaSqP5jJ",
|
|
"name": "Telegram account"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"parameters": {
|
|
"conditions": {
|
|
"string": [
|
|
{
|
|
"value1": "={{ $json.text }}",
|
|
"operation": "regex",
|
|
"value2": "\\b(buy|sell|long|short)\\b"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"id": "filter-trade-commands",
|
|
"name": "Filter Trade Commands",
|
|
"type": "n8n-nodes-base.if",
|
|
"typeVersion": 1,
|
|
"position": [
|
|
-840,
|
|
460
|
|
]
|
|
},
|
|
{
|
|
"parameters": {
|
|
"fields": {
|
|
"values": [
|
|
{
|
|
"name": "rawMessage",
|
|
"stringValue": "={{ $json.text }}"
|
|
},
|
|
{
|
|
"name": "symbol",
|
|
"stringValue": "={{ $json.text.match(/\\b(SOL|BTC|ETH)\\b/i) ? $json.text.match(/\\b(SOL|BTC|ETH)\\b/i)[0].toUpperCase() + '-PERP' : 'SOL-PERP' }}"
|
|
},
|
|
{
|
|
"name": "direction",
|
|
"stringValue": "={{ $json.text.match(/\\b(sell|short)\\b/i) ? 'short' : 'long' }}"
|
|
},
|
|
{
|
|
"name": "timeframe",
|
|
"stringValue": "5"
|
|
}
|
|
]
|
|
},
|
|
"options": {}
|
|
},
|
|
"id": "parse-command",
|
|
"name": "Parse Trade Command",
|
|
"type": "n8n-nodes-base.set",
|
|
"typeVersion": 3.2,
|
|
"position": [
|
|
-660,
|
|
460
|
|
]
|
|
},
|
|
{
|
|
"parameters": {
|
|
"chatId": "579304651",
|
|
"text": "🤖 Manual trade:\n\n📊 {{ $json.symbol }}\n{{ $json.direction === 'long' ? '📈' : '📉' }} {{ $json.direction.toUpperCase() }}\n⏰ {{ $now.toFormat('HH:mm:ss') }}\n\n⏳ Processing...",
|
|
"additionalFields": {
|
|
"appendAttribution": false
|
|
}
|
|
},
|
|
"id": "send-ack",
|
|
"name": "Send Acknowledgment",
|
|
"type": "n8n-nodes-base.telegram",
|
|
"typeVersion": 1.1,
|
|
"position": [
|
|
-480,
|
|
460
|
|
],
|
|
"credentials": {
|
|
"telegramApi": {
|
|
"id": "Csk5cg4HtaSqP5jJ",
|
|
"name": "Telegram account"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"parameters": {
|
|
"mode": "raw",
|
|
"jsonOutput": "={{ $json }}",
|
|
"options": {}
|
|
},
|
|
"id": "output-node",
|
|
"name": "➡️ Connect to Check Risk",
|
|
"type": "n8n-nodes-base.set",
|
|
"typeVersion": 3.3,
|
|
"position": [
|
|
-300,
|
|
460
|
|
],
|
|
"notes": "Connect this node's output to Money Machine's Check Risk node"
|
|
}
|
|
],
|
|
"pinData": {},
|
|
"connections": {
|
|
"Poll Telegram Messages": {
|
|
"main": [
|
|
[
|
|
{
|
|
"node": "Filter Trade Commands",
|
|
"type": "main",
|
|
"index": 0
|
|
}
|
|
]
|
|
]
|
|
},
|
|
"Filter Trade Commands": {
|
|
"main": [
|
|
[
|
|
{
|
|
"node": "Parse Trade Command",
|
|
"type": "main",
|
|
"index": 0
|
|
}
|
|
]
|
|
]
|
|
},
|
|
"Parse Trade Command": {
|
|
"main": [
|
|
[
|
|
{
|
|
"node": "Send Acknowledgment",
|
|
"type": "main",
|
|
"index": 0
|
|
}
|
|
]
|
|
]
|
|
},
|
|
"Send Acknowledgment": {
|
|
"main": [
|
|
[
|
|
{
|
|
"node": "➡️ Connect to Check Risk",
|
|
"type": "main",
|
|
"index": 0
|
|
}
|
|
]
|
|
]
|
|
}
|
|
},
|
|
"active": false,
|
|
"settings": {
|
|
"executionOrder": "v1"
|
|
},
|
|
"versionId": "telegram-polling-v1",
|
|
"meta": {
|
|
"instanceId": "e766d4f0b5def8ee8cb8561cd9d2b9ba7733e1907990b6987bca40175f82c379"
|
|
},
|
|
"tags": []
|
|
}
|