From 17b0806ff354b15cd66a2f774ec2b35b40af36fd Mon Sep 17 00:00:00 2001 From: mindesbunister Date: Mon, 27 Oct 2025 13:11:52 +0100 Subject: [PATCH] feat: Add 15-minute chart filter to n8n workflow - Extract timeframe from TradingView message format: 'SOLUSDT.P 15' - Added 'timeframe-filter' IF node after Parse Signal - Only allows trades on 15-minute chart signals - Blocks 5-minute and other timeframe signals - Regex pattern: \.P\s+(\d+) matches '.P 15' format This prevents bot from trading on wrong timeframe alerts. --- workflows/trading/n8n-complete-workflow.json | 24 +++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/workflows/trading/n8n-complete-workflow.json b/workflows/trading/n8n-complete-workflow.json index f3e1efe..86261a4 100644 --- a/workflows/trading/n8n-complete-workflow.json +++ b/workflows/trading/n8n-complete-workflow.json @@ -32,7 +32,7 @@ }, { "name": "timeframe", - "stringValue": "5" + "stringValue": "={{ $json.body.match(/\\.P\\s+(\\d+)/)?.[1] || '15' }}" } ] }, @@ -44,6 +44,24 @@ "typeVersion": 3.2, "position": [440, 400] }, + { + "parameters": { + "conditions": { + "string": [ + { + "value1": "={{ $json.timeframe }}", + "operation": "equals", + "value2": "15" + } + ] + } + }, + "id": "timeframe-filter", + "name": "15min Chart Only?", + "type": "n8n-nodes-base.if", + "typeVersion": 1, + "position": [540, 400] + }, { "parameters": { "method": "POST", @@ -72,7 +90,7 @@ "name": "Check Risk", "type": "n8n-nodes-base.httpRequest", "typeVersion": 4, - "position": [640, 400] + "position": [740, 400] }, { "parameters": { @@ -89,7 +107,7 @@ "name": "Risk Passed?", "type": "n8n-nodes-base.if", "typeVersion": 1, - "position": [840, 400] + "position": [940, 400] }, { "parameters": {