From 0719ecdc4de6f32764c8b7b6b9b2589842fd9673 Mon Sep 17 00:00:00 2001 From: Garfield Date: Mon, 30 Mar 2026 13:08:12 -0400 Subject: [PATCH] Add n8n workflow and validation script for settings monitoring; fix missing weekend protection params --- confluence-audusd.set | 4 + confluence-eurjpy.set | 4 + confluence-gbpusd.set | 4 + confluence-nzdusd.set | 4 + confluence-usdcad.set | 4 + confluence-usdchf.set | 4 + confluence-xauusd.set | 4 + grid-audusd.set | 4 + grid-eurjpy.set | 4 + grid-eurusd.set | 4 + grid-gbpjpy.set | 4 + grid-gbpusd.set | 4 + grid-major.set | 4 + grid-nzdusd.set | 4 + grid-ranging.set | 4 + grid-usdcad.set | 4 + grid-usdchf.set | 4 + grid-usdjpy.set | 4 + grid-volatile.set | 4 + grid-xauusd.set | 4 + n8n-workflow-check-sets.json | 411 +++++++++++++++++++++++++++++++++++ n8n-workflow-simple.json | 88 ++++++++ scripts/validate-settings.sh | 128 +++++++++++ 23 files changed, 707 insertions(+) create mode 100644 n8n-workflow-check-sets.json create mode 100644 n8n-workflow-simple.json create mode 100755 scripts/validate-settings.sh diff --git a/confluence-audusd.set b/confluence-audusd.set index 9610f19..fc262dd 100644 --- a/confluence-audusd.set +++ b/confluence-audusd.set @@ -39,3 +39,7 @@ InpMinADX=20.0 ; Standard trend strength InpMagicNumber=777777 InpSlippage=3 InpDebugMode=false + +; === Weekend Protection === +InpCloseBeforeWeekend=true +InpWeekendCloseHour=17 diff --git a/confluence-eurjpy.set b/confluence-eurjpy.set index 44c17bd..f2ef482 100644 --- a/confluence-eurjpy.set +++ b/confluence-eurjpy.set @@ -39,3 +39,7 @@ InpMinADX=23.0 ; Moderate trend strength InpMagicNumber=777775 InpSlippage=4 InpDebugMode=false + +; === Weekend Protection === +InpCloseBeforeWeekend=true +InpWeekendCloseHour=17 diff --git a/confluence-gbpusd.set b/confluence-gbpusd.set index 047c354..24e1b18 100644 --- a/confluence-gbpusd.set +++ b/confluence-gbpusd.set @@ -34,3 +34,7 @@ InpMinADX=22.0 InpMagicNumber=777773 InpSlippage=5 ; Higher slippage tolerance InpDebugMode=false + +; === Weekend Protection === +InpCloseBeforeWeekend=true +InpWeekendCloseHour=17 diff --git a/confluence-nzdusd.set b/confluence-nzdusd.set index 91f1394..be85ec0 100644 --- a/confluence-nzdusd.set +++ b/confluence-nzdusd.set @@ -35,3 +35,7 @@ InpMinADX=21.0 InpMagicNumber=777778 InpSlippage=4 InpDebugMode=false + +; === Weekend Protection === +InpCloseBeforeWeekend=true +InpWeekendCloseHour=17 diff --git a/confluence-usdcad.set b/confluence-usdcad.set index 05cd9a8..f431176 100644 --- a/confluence-usdcad.set +++ b/confluence-usdcad.set @@ -35,3 +35,7 @@ InpMinADX=22.0 ; Moderate trend strength InpMagicNumber=777776 InpSlippage=4 InpDebugMode=false + +; === Weekend Protection === +InpCloseBeforeWeekend=true +InpWeekendCloseHour=17 diff --git a/confluence-usdchf.set b/confluence-usdchf.set index 02e1c07..ea72f57 100644 --- a/confluence-usdchf.set +++ b/confluence-usdchf.set @@ -39,3 +39,7 @@ InpMinADX=25.0 ; Higher - need strong trend InpMagicNumber=777779 InpSlippage=3 InpDebugMode=false + +; === Weekend Protection === +InpCloseBeforeWeekend=true +InpWeekendCloseHour=17 diff --git a/confluence-xauusd.set b/confluence-xauusd.set index 870cb70..2c2c1cf 100644 --- a/confluence-xauusd.set +++ b/confluence-xauusd.set @@ -34,3 +34,7 @@ InpMinADX=20.0 InpMagicNumber=777774 InpSlippage=10 ; High slippage tolerance for gold InpDebugMode=false + +; === Weekend Protection === +InpCloseBeforeWeekend=true +InpWeekendCloseHour=17 diff --git a/grid-audusd.set b/grid-audusd.set index 3edb1f4..b719473 100644 --- a/grid-audusd.set +++ b/grid-audusd.set @@ -47,3 +47,7 @@ InpMaxDailyDrawdown=2.5 ; === EA Settings === MagicNum=333007 + +; === Weekend Protection === +InpCloseBeforeWeekend=true +InpWeekendCloseHour=17 diff --git a/grid-eurjpy.set b/grid-eurjpy.set index 075e33a..b6499d9 100644 --- a/grid-eurjpy.set +++ b/grid-eurjpy.set @@ -43,3 +43,7 @@ InpMaxDailyDrawdown=2.5 ; === EA Settings === MagicNum=333005 + +; === Weekend Protection === +InpCloseBeforeWeekend=true +InpWeekendCloseHour=17 diff --git a/grid-eurusd.set b/grid-eurusd.set index 08bac93..824c14f 100644 --- a/grid-eurusd.set +++ b/grid-eurusd.set @@ -48,3 +48,7 @@ InpMaxDailyDrawdown=3.0 ; Standard for major pair ; === EA Settings === MagicNum=333011 + +; === Weekend Protection === +InpCloseBeforeWeekend=true +InpWeekendCloseHour=17 diff --git a/grid-gbpjpy.set b/grid-gbpjpy.set index 608f1b3..b631ed8 100644 --- a/grid-gbpjpy.set +++ b/grid-gbpjpy.set @@ -52,3 +52,7 @@ InpMaxDailyDrawdown=1.5 ; VERY conservative ; === EA Settings === MagicNum=333014 + +; === Weekend Protection === +InpCloseBeforeWeekend=true +InpWeekendCloseHour=17 diff --git a/grid-gbpusd.set b/grid-gbpusd.set index af55f02..10b5527 100644 --- a/grid-gbpusd.set +++ b/grid-gbpusd.set @@ -50,3 +50,7 @@ InpMaxDailyDrawdown=2.0 ; Conservative (volatile) ; === EA Settings === MagicNum=333013 + +; === Weekend Protection === +InpCloseBeforeWeekend=true +InpWeekendCloseHour=17 diff --git a/grid-major.set b/grid-major.set index 15c350c..26aeb79 100644 --- a/grid-major.set +++ b/grid-major.set @@ -43,3 +43,7 @@ InpMaxDailyDrawdown=3.0 ; === EA Settings === MagicNum=333003 + +; === Weekend Protection === +InpCloseBeforeWeekend=true +InpWeekendCloseHour=17 diff --git a/grid-nzdusd.set b/grid-nzdusd.set index 264785c..42e12dc 100644 --- a/grid-nzdusd.set +++ b/grid-nzdusd.set @@ -47,3 +47,7 @@ InpMaxDailyDrawdown=2.5 ; === EA Settings === MagicNum=333008 + +; === Weekend Protection === +InpCloseBeforeWeekend=true +InpWeekendCloseHour=17 diff --git a/grid-ranging.set b/grid-ranging.set index 32f92bd..47e36dc 100644 --- a/grid-ranging.set +++ b/grid-ranging.set @@ -43,3 +43,7 @@ InpMaxDailyDrawdown=2.0 ; Conservative daily limit ; === EA Settings === MagicNum=333001 + +; === Weekend Protection === +InpCloseBeforeWeekend=true +InpWeekendCloseHour=17 diff --git a/grid-usdcad.set b/grid-usdcad.set index 736c951..9b9e37e 100644 --- a/grid-usdcad.set +++ b/grid-usdcad.set @@ -47,3 +47,7 @@ InpMaxDailyDrawdown=2.5 ; === EA Settings === MagicNum=333006 + +; === Weekend Protection === +InpCloseBeforeWeekend=true +InpWeekendCloseHour=17 diff --git a/grid-usdchf.set b/grid-usdchf.set index 7935fb5..3653f71 100644 --- a/grid-usdchf.set +++ b/grid-usdchf.set @@ -48,3 +48,7 @@ InpMaxDailyDrawdown=2.0 ; Conservative (SNB risk) ; === EA Settings === MagicNum=333009 + +; === Weekend Protection === +InpCloseBeforeWeekend=true +InpWeekendCloseHour=17 diff --git a/grid-usdjpy.set b/grid-usdjpy.set index b5b60a1..25f02ff 100644 --- a/grid-usdjpy.set +++ b/grid-usdjpy.set @@ -49,3 +49,7 @@ InpMaxDailyDrawdown=2.5 ; Conservative (trending pair) ; === EA Settings === MagicNum=333012 + +; === Weekend Protection === +InpCloseBeforeWeekend=true +InpWeekendCloseHour=17 diff --git a/grid-volatile.set b/grid-volatile.set index 61f9584..eadf8c5 100644 --- a/grid-volatile.set +++ b/grid-volatile.set @@ -43,3 +43,7 @@ InpMaxDailyDrawdown=2.0 ; Conservative limit for volatile pairs ; === EA Settings === MagicNum=333002 + +; === Weekend Protection === +InpCloseBeforeWeekend=true +InpWeekendCloseHour=17 diff --git a/grid-xauusd.set b/grid-xauusd.set index 27e848e..e2bf88b 100644 --- a/grid-xauusd.set +++ b/grid-xauusd.set @@ -49,3 +49,7 @@ InpMaxDailyDrawdown=1.5 ; VERY conservative ; === EA Settings === MagicNum=333010 + +; === Weekend Protection === +InpCloseBeforeWeekend=true +InpWeekendCloseHour=17 diff --git a/n8n-workflow-check-sets.json b/n8n-workflow-check-sets.json new file mode 100644 index 0000000..2e377c5 --- /dev/null +++ b/n8n-workflow-check-sets.json @@ -0,0 +1,411 @@ +{ + "name": "MQL Trading Bots - Settings Validator", + "nodes": [ + { + "parameters": { + "rule": { + "interval": [ + { + "field": "hours", + "hoursInterval": 6 + } + ] + } + }, + "name": "Schedule Trigger", + "type": "n8n-nodes-base.scheduleTrigger", + "typeVersion": 1.1, + "position": [ + 250, + 300 + ] + }, + { + "parameters": { + "command": "cd /home/garfield/mql-trading-bots && ls -la *.set 2>/dev/null | wc -l" + }, + "name": "Count Set Files", + "type": "n8n-nodes-base.executeCommand", + "typeVersion": 1, + "position": [ + 450, + 300 + ] + }, + { + "parameters": { + "conditions": { + "options": { + "caseSensitive": true, + "leftValue": "", + "typeValidation": "strict" + }, + "conditions": [ + { + "id": "8ef4b80d-8c5a-4ea3-9a5a-b8be7355f4a7", + "leftValue": "={{ $json.stdout }}", + "rightValue": "0", + "operator": { + "type": "number", + "operation": "notEquals" + } + } + ] + } + }, + "name": "Files Exist?", + "type": "n8n-nodes-base.if", + "typeVersion": 2, + "position": [ + 650, + 300 + ] + }, + { + "parameters": { + "command": "cd /home/garfield/mql-trading-bots && for f in confluence-*.set; do echo \"=== $f ===\"; grep -E 'InpMinStrength|InpMinConfluence|InpRequireAllAgree|InpDebugMode' \"$f\" | grep -v '^;'; done" + }, + "name": "Check Confluence Sets", + "type": "n8n-nodes-base.executeCommand", + "typeVersion": 1, + "position": [ + 850, + 200 + ] + }, + { + "parameters": { + "command": "cd /home/garfield/mql-trading-bots && for f in grid-*.set; do echo \"=== $f ===\"; grep -E 'MaxLevels|InpMaxDailyDrawdown|InpCloseBeforeWeekend' \"$f\" | grep -v '^;'; done" + }, + "name": "Check Grid Sets", + "type": "n8n-nodes-base.executeCommand", + "typeVersion": 1, + "position": [ + 850, + 400 + ] + }, + { + "parameters": { + "command": "cd /home/garfield/mql-trading-bots && grep -l 'InpMinConfluenceStrength' confluence-*.set 2>/dev/null || echo 'No invalid variables found'" + }, + "name": "Check Invalid Variables", + "type": "n8n-nodes-base.executeCommand", + "typeVersion": 1, + "position": [ + 1050, + 200 + ] + }, + { + "parameters": { + "command": "cd /home/garfield/mql-trading-bots && grep 'InpDebugMode=false' confluence-*.set grid-*.set 2>/dev/null | wc -l" + }, + "name": "Count Debug Off", + "type": "n8n-nodes-base.executeCommand", + "typeVersion": 1, + "position": [ + 1050, + 400 + ] + }, + { + "parameters": { + "conditions": { + "options": { + "caseSensitive": true, + "leftValue": "", + "typeValidation": "strict" + }, + "conditions": [ + { + "id": "e6b7c7d1-6d61-413f-90a4-5ce2e8b7dc2e", + "leftValue": "={{ $json.stdout }}", + "rightValue": "No invalid", + "operator": { + "type": "string", + "operation": "notContains" + } + } + ] + } + }, + "name": "Invalid Vars Found?", + "type": "n8n-nodes-base.if", + "typeVersion": 2, + "position": [ + 1250, + 200 + ] + }, + { + "parameters": { + "conditions": { + "options": { + "caseSensitive": true, + "leftValue": "", + "typeValidation": "strict" + }, + "conditions": [ + { + "id": "b7c8d9e0-f1a2-4b3c-5d6e-7f8a9b0c1d2e", + "leftValue": "={{ $json.stdout }}", + "rightValue": "0", + "operator": { + "type": "number", + "operation": "notEquals" + } + } + ] + } + }, + "name": "Debug Disabled?", + "type": "n8n-nodes-base.if", + "typeVersion": 2, + "position": [ + 1250, + 400 + ] + }, + { + "parameters": { + "options": {} + }, + "name": "Merge Issues", + "type": "n8n-nodes-base.merge", + "typeVersion": 2.1, + "position": [ + 1450, + 300 + ] + }, + { + "parameters": { + "to": "={{ $env.ALERT_EMAIL }}", + "subject": "🚨 MQL Settings Issues Detected", + "text": "=Issues found in MQL Trading Bots settings: + +Invalid Variables Found: +{{ $('Check Invalid Variables').item.json.stdout }} + +Files with Debug Disabled: {{ $('Count Debug Off').item.json.stdout }} + +Confluence Settings: +{{ $('Check Confluence Sets').item.json.stdout }} + +Grid Settings: +{{ $('Check Grid Sets').item.json.stdout }} + +Please review and fix ASAP. + +Server: {{ $env.HOSTNAME }} +Time: {{ $now }}" + }, + "name": "Send Alert Email", + "type": "n8n-nodes-base.emailSend", + "typeVersion": 2.1, + "position": [ + 1650, + 200 + ] + }, + { + "parameters": { + "content": "={{$json}}", + "options": {} + }, + "name": "No Action Needed", + "type": "n8n-nodes-base.noOp", + "typeVersion": 1, + "position": [ + 1650, + 500 + ] + }, + { + "parameters": { + "command": "cd /home/garfield/mql-trading-bots && git diff --name-only HEAD~1 2>/dev/null | grep '\.set$' || echo 'No recent set file changes'" + }, + "name": "Check Recent Changes", + "type": "n8n-nodes-base.executeCommand", + "typeVersion": 1, + "position": [ + 850, + 600 + ] + }, + { + "parameters": { + "webhookUri": "={{ $env.DISCORD_WEBHOOK_URL }}", + "text": "={ '🚨 **MQL Settings Alert**' if $json.stdout != 'No recent set file changes' and $json.stdout != '' else 'āœ… **MQL Settings Check** - All OK' }", + "options": {} + }, + "name": "Discord Notification", + "type": "n8n-nodes-base.discord", + "typeVersion": 2, + "position": [ + 1250, + 600 + ] + } + ], + "pinData": {}, + "settings": { + "executionOrder": "v1" + }, + "staticData": null, + "tags": [ + { + "name": "trading", + "id": "trading-tag", + "createdAt": "2024-01-01T00:00:00.000Z", + "updatedAt": "2024-01-01T00:00:00.000Z" + }, + { + "name": "mql5", + "id": "mql5-tag", + "createdAt": "2024-01-01T00:00:00.000Z", + "updatedAt": "2024-01-01T00:00:00.000Z" + } + ], + "connections": { + "Schedule Trigger": { + "main": [ + [ + { + "node": "Count Set Files", + "type": "main", + "index": 0 + } + ] + ] + }, + "Count Set Files": { + "main": [ + [ + { + "node": "Files Exist?", + "type": "main", + "index": 0 + } + ] + ] + }, + "Files Exist?": { + "main": [ + [ + { + "node": "Check Confluence Sets", + "type": "main", + "index": 0 + }, + { + "node": "Check Grid Sets", + "type": "main", + "index": 0 + }, + { + "node": "Check Recent Changes", + "type": "main", + "index": 0 + } + ], + [ + { + "node": "No Action Needed", + "type": "main", + "index": 0 + } + ] + ] + }, + "Check Confluence Sets": { + "main": [ + [ + { + "node": "Check Invalid Variables", + "type": "main", + "index": 0 + } + ] + ] + }, + "Check Grid Sets": { + "main": [ + [ + { + "node": "Count Debug Off", + "type": "main", + "index": 0 + } + ] + ] + }, + "Check Invalid Variables": { + "main": [ + [ + { + "node": "Invalid Vars Found?", + "type": "main", + "index": 0 + } + ] + ] + }, + "Count Debug Off": { + "main": [ + [ + { + "node": "Debug Disabled?", + "type": "main", + "index": 0 + } + ] + ] + }, + "Invalid Vars Found?": { + "main": [ + [ + { + "node": "Merge Issues", + "type": "main", + "index": 0 + } + ] + ] + }, + "Debug Disabled?": { + "main": [ + [ + { + "node": "Merge Issues", + "type": "main", + "index": 0 + } + ] + ] + }, + "Merge Issues": { + "main": [ + [ + { + "node": "Send Alert Email", + "type": "main", + "index": 0 + } + ] + ] + }, + "Check Recent Changes": { + "main": [ + [ + { + "node": "Discord Notification", + "type": "main", + "index": 0 + } + ] + ] + } + } +} diff --git a/n8n-workflow-simple.json b/n8n-workflow-simple.json new file mode 100644 index 0000000..9e530ea --- /dev/null +++ b/n8n-workflow-simple.json @@ -0,0 +1,88 @@ +{ + "name": "MQL Settings Monitor - Simple", + "nodes": [ + { + "parameters": { + "rule": { + "interval": [ + { + "field": "hours", + "hoursInterval": 6 + } + ] + } + }, + "name": "Every 6 Hours", + "type": "n8n-nodes-base.scheduleTrigger", + "typeVersion": 1.1, + "position": [250, 300] + }, + { + "parameters": { + "command": "cd /home/garfield/mql-trading-bots && ./scripts/validate-settings.sh" + }, + "name": "Run Validation Script", + "type": "n8n-nodes-base.executeCommand", + "typeVersion": 1, + "position": [450, 300] + }, + { + "parameters": { + "conditions": { + "conditions": [ + { + "leftValue": "={{ $json.stdout }}", + "operator": "contains", + "rightValue": "ISSUE" + } + ] + } + }, + "name": "Issues Found?", + "type": "n8n-nodes-base.if", + "typeVersion": 2, + "position": [650, 300] + }, + { + "parameters": { + "chatId": "={{ $env.TELEGRAM_CHAT_ID }}", + "text": "=🚨 MQL Settings Issues Found:\n\n{{ $json.stdout }}\n\nā° {{ $now.format('YYYY-MM-DD HH:mm') }}" + }, + "name": "Send Telegram Alert", + "type": "n8n-nodes-base.telegram", + "typeVersion": 1.1, + "position": [850, 200] + }, + { + "parameters": { + "content": "=āœ… Settings check passed\n\n{{ $json.stdout }}", + "options": {} + }, + "name": "Success - No Action", + "type": "n8n-nodes-base.noOp", + "typeVersion": 1, + "position": [850, 400] + } + ], + "connections": { + "Every 6 Hours": { + "main": [ + [{ "node": "Run Validation Script", "type": "main", "index": 0 }] + ] + }, + "Run Validation Script": { + "main": [ + [{ "node": "Issues Found?", "type": "main", "index": 0 }] + ] + }, + "Issues Found?": { + "main": [ + [{ "node": "Send Telegram Alert", "type": "main", "index": 0 }], + [{ "node": "Success - No Action", "type": "main", "index": 0 }] + ] + } + }, + "settings": { + "executionOrder": "v1" + } +} diff --git a/scripts/validate-settings.sh b/scripts/validate-settings.sh new file mode 100755 index 0000000..255c882 --- /dev/null +++ b/scripts/validate-settings.sh @@ -0,0 +1,128 @@ +#!/bin/bash +# MQL Trading Bot Settings Validator +# This script validates .set files for common issues + +REPO_DIR="/home/garfield/mql-trading-bots" +cd "$REPO_DIR" || exit 1 + +ISSUES=0 +echo "=== MQL Settings Validation Report ===" +echo "Date: $(date)" +echo "" + +# Check 1: Count set files +echo "[INFO] Checking set files..." +CONFLUENCE_COUNT=$(ls -1 confluence-*.set 2>/dev/null | wc -l) +GRID_COUNT=$(ls -1 grid-*.set 2>/dev/null | wc -l) +echo " Confluence settings: $CONFLUENCE_COUNT files" +echo " Grid settings: $GRID_COUNT files" + +if [ $CONFLUENCE_COUNT -eq 0 ] && [ $GRID_COUNT -eq 0 ]; then + echo "ISSUE: No .set files found!" + ISSUES=$((ISSUES + 1)) +fi + +# Check 2: Invalid variable names (typos) +echo "" +echo "[INFO] Checking for invalid variable names..." +INVALID=$(grep -l "InpMinConfluenceStrength\|MinConfluenceStrength\|ConfluenceStrength" confluence-*.set 2>/dev/null) +if [ -n "$INVALID" ]; then + echo "ISSUE: Invalid variable names found:" + echo "$INVALID" | while read -r file; do + echo " - $file" + done + ISSUES=$((ISSUES + 1)) +else + echo " āœ“ No invalid variable names found" +fi + +# Check 3: Missing critical parameters in Confluence sets +echo "" +echo "[INFO] Checking Confluence settings completeness..." +for file in confluence-*.set; do + [ -f "$file" ] || continue + + MISSING="" + grep -q "^InpMinConfluence=" "$file" || MISSING="$MISSING InpMinConfluence" + grep -q "^InpMinStrength=" "$file" || MISSING="$MISSING InpMinStrength" + grep -q "^InpRequireAllAgree=" "$file" || MISSING="$MISSING InpRequireAllAgree" + grep -q "^InpMagicNumber=" "$file" || MISSING="$MISSING InpMagicNumber" + grep -q "^InpMaxDailyDrawdown=" "$file" || MISSING="$MISSING InpMaxDailyDrawdown" + grep -q "^InpCloseBeforeWeekend=" "$file" || MISSING="$MISSING InpCloseBeforeWeekend" + + if [ -n "$MISSING" ]; then + echo "ISSUE: $file missing:$MISSING" + ISSUES=$((ISSUES + 1)) + fi +done + +# Check 4: Missing critical parameters in Grid sets +echo "" +echo "[INFO] Checking Grid settings completeness..." +for file in grid-*.set; do + [ -f "$file" ] || continue + + MISSING="" + grep -q "^InpMaxDailyDrawdown=" "$file" || MISSING="$MISSING InpMaxDailyDrawdown" + grep -q "^InpCloseBeforeWeekend=" "$file" || MISSING="$MISSING InpCloseBeforeWeekend" + + if [ -n "$MISSING" ]; then + echo "ISSUE: $file missing:$MISSING" + ISSUES=$((ISSUES + 1)) + fi +done + +# Check 5: Very restrictive settings (may explain no trades) +echo "" +echo "[INFO] Checking for overly restrictive settings..." +HIGH_STRENGTH=$(grep "InpMinStrength=0.8" confluence-*.set 2>/dev/null | cut -d: -f1) +if [ -n "$HIGH_STRENGTH" ]; then + echo "WARNING: High strength thresholds (may block trades):" + echo "$HIGH_STRENGTH" | while read -r file; do + strength=$(grep "InpMinStrength=" "$file" | head -1) + echo " - $file: $strength" + done +fi + +# Check 6: Debug mode status +echo "" +echo "[INFO] Debug mode status..." +DEBUG_OFF=$(grep "InpDebugMode=false" confluence-*.set grid-*.set 2>/dev/null | wc -l) +DEBUG_ON=$(grep "InpDebugMode=true" confluence-*.set grid-*.set 2>/dev/null | wc -l) +echo " Debug ON: $DEBUG_ON files" +echo " Debug OFF: $DEBUG_OFF files" + +if [ $DEBUG_OFF -gt 5 ]; then + echo "WARNING: Many files have debug disabled - you won't see trade decisions" +fi + +# Check 7: Weekend protection status +echo "" +echo "[INFO] Weekend protection status..." +WEEKEND_OFF=$(grep "InpCloseBeforeWeekend=false" confluence-*.set grid-*.set 2>/dev/null | wc -l) +if [ $WEEKEND_OFF -gt 0 ]; then + echo "WARNING: $WEEKEND_OFF files have weekend protection DISABLED" + ISSUES=$((ISSUES + 1)) +else + echo " āœ“ All files have weekend protection enabled" +fi + +# Check 8: Git status +echo "" +echo "[INFO] Checking git status..." +UNTRACKED=$(git ls-files --others --exclude-standard *.set 2>/dev/null | wc -l) +if [ $UNTRACKED -gt 0 ]; then + echo "WARNING: $UNTRACKED untracked .set files:" + git ls-files --others --exclude-standard *.set 2>/dev/null | head -5 +fi + +# Summary +echo "" +echo "=== Summary ===" +if [ $ISSUES -eq 0 ]; then + echo "āœ… All checks passed!" +else + echo "āŒ Found $ISSUES issue(s)" +fi + +exit $ISSUES