feat: Make Smart Validation Queue thresholds adaptive in Telegram notifications
CHANGES:
- Extended sendValidationNotification interface with confirmationThreshold, maxDrawdown, entryWindowMinutes
- Updated telegram.ts to display actual queued signal thresholds instead of hardcoded values
- Modified smart-validation-queue.ts to pass dynamic threshold values to Telegram
- Messages now show exact thresholds used for each signal (not fixed 0.3%/1.0%/90min)
PURPOSE:
- User requested adaptive display instead of hardcoded values
- Enables future per-signal threshold customization
- Each signal can have different thresholds based on characteristics
EXAMPLE:
Before: 'Will enter if +0.3% confirms' (all signals)
After: 'Will enter if +0.25% confirms' (high ADX signal)
'Will enter if +0.4% confirms' (low ADX signal)
STATUS: Ready for deployment - will show actual threshold per signal
This commit is contained in:
@@ -99,6 +99,9 @@ export async function sendValidationNotification(options: {
|
||||
qualityScore: number
|
||||
validationTime?: number // seconds
|
||||
priceChange?: number // percentage
|
||||
confirmationThreshold?: number // percentage for queued event
|
||||
maxDrawdown?: number // percentage for queued event
|
||||
entryWindowMinutes?: number // minutes for queued event
|
||||
}): Promise<void> {
|
||||
try {
|
||||
const token = process.env.TELEGRAM_BOT_TOKEN
|
||||
@@ -113,17 +116,18 @@ export async function sendValidationNotification(options: {
|
||||
|
||||
switch (options.event) {
|
||||
case 'queued':
|
||||
message = `⏰ SIGNAL QUEUED FOR VALIDATION
|
||||
|
||||
${directionEmoji} ${options.symbol} ${options.direction.toUpperCase()}
|
||||
|
||||
📊 Quality Score: ${options.qualityScore}/100
|
||||
📍 Price: $${options.originalPrice.toFixed(2)}
|
||||
|
||||
🧠 Watching for price confirmation...
|
||||
✅ Will enter if ${options.direction === 'long' ? '+0.3%' : '-0.3%'}
|
||||
❌ Will abandon if ${options.direction === 'long' ? '-1.0%' : '+1.0%'}
|
||||
`
|
||||
message = [
|
||||
'⏰ SIGNAL QUEUED FOR VALIDATION ⏰',
|
||||
'',
|
||||
`📊 ${options.symbol}`,
|
||||
`📍 ${options.direction === 'long' ? 'LONG' : 'SHORT'} @ $${options.originalPrice.toFixed(2)}`,
|
||||
`🎯 Quality Score: ${options.qualityScore}`,
|
||||
'',
|
||||
'⏱️ Smart Entry System Active',
|
||||
`✅ Will enter if ${options.direction === 'long' ? '+' : '-'}${options.confirmationThreshold || 0.3}% confirms`,
|
||||
`❌ Will abandon if ${options.direction === 'long' ? '' : '+'}${Math.abs(options.maxDrawdown || -1.0)}% against`,
|
||||
`⏳ Monitoring for ${options.entryWindowMinutes || 90} minutes`,
|
||||
].join('\n')
|
||||
break
|
||||
|
||||
case 'confirmed':
|
||||
|
||||
@@ -123,6 +123,9 @@ class SmartValidationQueue {
|
||||
direction: params.direction,
|
||||
originalPrice: params.originalPrice,
|
||||
qualityScore: params.qualityScore,
|
||||
confirmationThreshold: queuedSignal.confirmationThreshold,
|
||||
maxDrawdown: queuedSignal.maxDrawdown,
|
||||
entryWindowMinutes: queuedSignal.entryWindowMinutes,
|
||||
})
|
||||
|
||||
// Start monitoring if not already running
|
||||
|
||||
Reference in New Issue
Block a user