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.
This commit is contained in:
@@ -32,7 +32,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "timeframe",
|
"name": "timeframe",
|
||||||
"stringValue": "5"
|
"stringValue": "={{ $json.body.match(/\\.P\\s+(\\d+)/)?.[1] || '15' }}"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -44,6 +44,24 @@
|
|||||||
"typeVersion": 3.2,
|
"typeVersion": 3.2,
|
||||||
"position": [440, 400]
|
"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": {
|
"parameters": {
|
||||||
"method": "POST",
|
"method": "POST",
|
||||||
@@ -72,7 +90,7 @@
|
|||||||
"name": "Check Risk",
|
"name": "Check Risk",
|
||||||
"type": "n8n-nodes-base.httpRequest",
|
"type": "n8n-nodes-base.httpRequest",
|
||||||
"typeVersion": 4,
|
"typeVersion": 4,
|
||||||
"position": [640, 400]
|
"position": [740, 400]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"parameters": {
|
"parameters": {
|
||||||
@@ -89,7 +107,7 @@
|
|||||||
"name": "Risk Passed?",
|
"name": "Risk Passed?",
|
||||||
"type": "n8n-nodes-base.if",
|
"type": "n8n-nodes-base.if",
|
||||||
"typeVersion": 1,
|
"typeVersion": 1,
|
||||||
"position": [840, 400]
|
"position": [940, 400]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"parameters": {
|
"parameters": {
|
||||||
|
|||||||
Reference in New Issue
Block a user