fix: Change 1-min indicator to use trading signal format (timeframe filtering)

Now follows same pattern as 15min/1H/Daily data collection:
- Sends trading signal format: 'SOLUSDT buy 1 | ATR:X | ADX:Y...'
- Bot's execute endpoint filters by timeframe='1' (no trades executed)
- Saves to BlockedSignal table for analysis
- Uses SAME webhook as trading signals (no separate webhook needed)

This is simpler than separate market_data endpoint approach.
Bot already handles this pattern for multi-timeframe data collection.
This commit is contained in:
mindesbunister
2025-11-27 09:30:08 +01:00
parent 75069802bf
commit cb0297607b

View File

@@ -2,9 +2,10 @@
indicator("Money Line - 1min Data Feed", overlay=false)
// ==========================================
// PURPOSE: Send market data every 1 minute
// PURPOSE: Send market data every 1 minute for cache updates
// USAGE: Create alert on indicator with "alert() function calls"
// WEBHOOK: https://flow.egonetix.de/webhook/tradingview-bot-v4
// WEBHOOK: https://flow.egonetix.de/webhook/tradingview-bot-v4 (SAME as trading signals)
// FORMAT: Uses trading signal format with timeframe="1" (gets filtered like 15min/1H/Daily)
// ==========================================
// Calculate indicators (same as v9 for consistency)
@@ -24,8 +25,10 @@ plot(adx, "ADX", color=color.blue, linewidth=2)
hline(20, "ADX 20", color=color.gray, linestyle=hline.style_dashed)
hline(25, "ADX 25", color=color.orange, linestyle=hline.style_dashed)
// Build JSON message dynamically (single line - Pine v6 doesn't support multi-line concatenation)
jsonMessage = '{"action":"market_data_1min","symbol":"' + syminfo.ticker + '","timeframe":"1","atr":' + str.tostring(atr) + ',"adx":' + str.tostring(adx) + ',"rsi":' + str.tostring(rsi) + ',"volumeRatio":' + str.tostring(volumeRatio) + ',"pricePosition":' + str.tostring(pricePosition) + ',"currentPrice":' + str.tostring(close) + ',"maGap":' + str.tostring(maGap) + ',"timestamp":' + str.tostring(time) + ',"indicatorVersion":"v9"}'
// Build JSON message using TRADING SIGNAL format (gets filtered by timeframe="1")
// Direction doesn't matter - bot filters by timeframe before executing
// This follows same pattern as 15min/1H/Daily data collection
jsonMessage = 'SOLUSDT buy 1 | ATR:' + str.tostring(atr) + ' | ADX:' + str.tostring(adx) + ' | RSI:' + str.tostring(rsi) + ' | VOL:' + str.tostring(volumeRatio) + ' | POS:' + str.tostring(pricePosition) + ' | IND:v9'
// Send alert every bar close
if barstate.isconfirmed