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
|
qualityScore: number
|
||||||
validationTime?: number // seconds
|
validationTime?: number // seconds
|
||||||
priceChange?: number // percentage
|
priceChange?: number // percentage
|
||||||
|
confirmationThreshold?: number // percentage for queued event
|
||||||
|
maxDrawdown?: number // percentage for queued event
|
||||||
|
entryWindowMinutes?: number // minutes for queued event
|
||||||
}): Promise<void> {
|
}): Promise<void> {
|
||||||
try {
|
try {
|
||||||
const token = process.env.TELEGRAM_BOT_TOKEN
|
const token = process.env.TELEGRAM_BOT_TOKEN
|
||||||
@@ -113,17 +116,18 @@ export async function sendValidationNotification(options: {
|
|||||||
|
|
||||||
switch (options.event) {
|
switch (options.event) {
|
||||||
case 'queued':
|
case 'queued':
|
||||||
message = `⏰ SIGNAL QUEUED FOR VALIDATION
|
message = [
|
||||||
|
'⏰ SIGNAL QUEUED FOR VALIDATION ⏰',
|
||||||
${directionEmoji} ${options.symbol} ${options.direction.toUpperCase()}
|
'',
|
||||||
|
`📊 ${options.symbol}`,
|
||||||
📊 Quality Score: ${options.qualityScore}/100
|
`📍 ${options.direction === 'long' ? 'LONG' : 'SHORT'} @ $${options.originalPrice.toFixed(2)}`,
|
||||||
📍 Price: $${options.originalPrice.toFixed(2)}
|
`🎯 Quality Score: ${options.qualityScore}`,
|
||||||
|
'',
|
||||||
🧠 Watching for price confirmation...
|
'⏱️ Smart Entry System Active',
|
||||||
✅ Will enter if ${options.direction === 'long' ? '+0.3%' : '-0.3%'}
|
`✅ Will enter if ${options.direction === 'long' ? '+' : '-'}${options.confirmationThreshold || 0.3}% confirms`,
|
||||||
❌ Will abandon if ${options.direction === 'long' ? '-1.0%' : '+1.0%'}
|
`❌ Will abandon if ${options.direction === 'long' ? '' : '+'}${Math.abs(options.maxDrawdown || -1.0)}% against`,
|
||||||
`
|
`⏳ Monitoring for ${options.entryWindowMinutes || 90} minutes`,
|
||||||
|
].join('\n')
|
||||||
break
|
break
|
||||||
|
|
||||||
case 'confirmed':
|
case 'confirmed':
|
||||||
|
|||||||
@@ -123,6 +123,9 @@ class SmartValidationQueue {
|
|||||||
direction: params.direction,
|
direction: params.direction,
|
||||||
originalPrice: params.originalPrice,
|
originalPrice: params.originalPrice,
|
||||||
qualityScore: params.qualityScore,
|
qualityScore: params.qualityScore,
|
||||||
|
confirmationThreshold: queuedSignal.confirmationThreshold,
|
||||||
|
maxDrawdown: queuedSignal.maxDrawdown,
|
||||||
|
entryWindowMinutes: queuedSignal.entryWindowMinutes,
|
||||||
})
|
})
|
||||||
|
|
||||||
// Start monitoring if not already running
|
// Start monitoring if not already running
|
||||||
|
|||||||
Reference in New Issue
Block a user