Fix presets to match frontend UI exactly
FRONTEND PRESET CORRECTIONS: - Scalp Trading: 5m, 15m, 30m (was 5m, 15m) → 3 timeframes - Day Trading: 1h, 2h (was 1h, 4h) → 2 timeframes - Swing Trading: 4h, 1D (correct) → 2 timeframes UPDATED FILES: - lib/superior-screenshot-service.ts → Correct timeframe definitions - lib/auto-trading-service.ts → TRADING_CONFIGS match frontend - app/api/superior-screenshot/route.js → API presets corrected - Verification and test scripts updated PERFORMANCE ESTIMATES: - Scalp (3 timeframes): ~90s → ~30-40s parallel - Day Trading (2 timeframes): ~60s → ~20-30s parallel - Swing Trading (2 timeframes): ~60s → ~20-30s parallel - Extended (9 timeframes): ~270s → ~70-100s parallel System now matches frontend UI exactly with superior parallel capture!
This commit is contained in:
@@ -88,15 +88,15 @@ export class AutoTradingService {
|
||||
let preset: 'scalp' | 'day-trading' | 'swing-trading' | 'custom' = 'custom'
|
||||
|
||||
// Detect strategy based on timeframe patterns
|
||||
if (timeframeSet.has('5') && timeframeSet.has('15') && config.timeframes.length === 2) {
|
||||
if (timeframeSet.has('5') && timeframeSet.has('15') && timeframeSet.has('30') && config.timeframes.length === 3) {
|
||||
preset = 'scalp'
|
||||
console.log('🎯 Detected: SCALP trading strategy')
|
||||
} else if (timeframeSet.has('60') && timeframeSet.has('240') && config.timeframes.length === 2) {
|
||||
console.log('🎯 Detected: SCALP trading strategy (5m, 15m, 30m)')
|
||||
} else if (timeframeSet.has('60') && timeframeSet.has('120') && config.timeframes.length === 2) {
|
||||
preset = 'day-trading'
|
||||
console.log('🎯 Detected: DAY TRADING strategy')
|
||||
console.log('🎯 Detected: DAY TRADING strategy (1h, 2h)')
|
||||
} else if (timeframeSet.has('240') && timeframeSet.has('1D') && config.timeframes.length === 2) {
|
||||
preset = 'swing-trading'
|
||||
console.log('🎯 Detected: SWING TRADING strategy')
|
||||
console.log('🎯 Detected: SWING TRADING strategy (4h, 1d)')
|
||||
} else {
|
||||
preset = 'custom'
|
||||
console.log('🎯 Using: CUSTOM timeframe configuration')
|
||||
@@ -260,7 +260,7 @@ export const TRADING_CONFIGS = {
|
||||
// Scalping configuration - frequent analysis of short timeframes
|
||||
scalping: {
|
||||
symbol: 'SOLUSD',
|
||||
timeframes: ['5m', '15m'],
|
||||
timeframes: ['5m', '15m', '30m'], // Updated to match frontend: 5m, 15m, 30m
|
||||
layouts: ['ai', 'diy'],
|
||||
intervalMs: 5 * 60 * 1000, // Every 5 minutes
|
||||
maxCycles: 100 // Limit for testing
|
||||
@@ -269,7 +269,7 @@ export const TRADING_CONFIGS = {
|
||||
// Day trading configuration - moderate frequency on intraday timeframes
|
||||
dayTrading: {
|
||||
symbol: 'SOLUSD',
|
||||
timeframes: ['1h', '4h'],
|
||||
timeframes: ['1h', '2h'], // Updated to match frontend: 1h, 2h
|
||||
layouts: ['ai', 'diy'],
|
||||
intervalMs: 30 * 60 * 1000, // Every 30 minutes
|
||||
maxCycles: 50 // Limit for testing
|
||||
@@ -278,7 +278,7 @@ export const TRADING_CONFIGS = {
|
||||
// Swing trading configuration - less frequent analysis of longer timeframes
|
||||
swingTrading: {
|
||||
symbol: 'SOLUSD',
|
||||
timeframes: ['4h', '1d'],
|
||||
timeframes: ['4h', '1d'], // Matches frontend: 4h, 1d
|
||||
layouts: ['ai', 'diy'],
|
||||
intervalMs: 2 * 60 * 60 * 1000, // Every 2 hours
|
||||
maxCycles: 24 // Limit for testing
|
||||
|
||||
Reference in New Issue
Block a user