Change cooldown unit from seconds to minutes
- Updated minTimeBetweenTrades config to use minutes instead of seconds - Changed default from 600 seconds to 10 minutes - Updated Settings UI label from 'seconds' to 'minutes' and adjusted range (0-60 min) - Updated .env comments to reflect new unit - No functional change since cooldown enforcement not yet implemented (TODO in check-risk route)
This commit is contained in:
@@ -38,7 +38,7 @@ export interface TradingConfig {
|
||||
// Risk limits
|
||||
maxDailyDrawdown: number // USD stop trading threshold
|
||||
maxTradesPerHour: number // Limit overtrading
|
||||
minTimeBetweenTrades: number // Cooldown period (seconds)
|
||||
minTimeBetweenTrades: number // Cooldown period (minutes)
|
||||
|
||||
// Execution
|
||||
useMarketOrders: boolean // true = instant execution
|
||||
@@ -91,7 +91,7 @@ export const DEFAULT_TRADING_CONFIG: TradingConfig = {
|
||||
// Risk limits
|
||||
maxDailyDrawdown: -150, // Stop trading if daily loss exceeds $150 (-15%)
|
||||
maxTradesPerHour: 6, // Max 6 trades per hour
|
||||
minTimeBetweenTrades: 600, // 10 minutes cooldown
|
||||
minTimeBetweenTrades: 10, // 10 minutes cooldown
|
||||
|
||||
// Execution
|
||||
useMarketOrders: true, // Use market orders for reliable fills
|
||||
@@ -234,6 +234,9 @@ export function getConfigFromEnv(): Partial<TradingConfig> {
|
||||
maxTradesPerHour: process.env.MAX_TRADES_PER_HOUR
|
||||
? parseInt(process.env.MAX_TRADES_PER_HOUR)
|
||||
: undefined,
|
||||
minTimeBetweenTrades: process.env.MIN_TIME_BETWEEN_TRADES
|
||||
? parseInt(process.env.MIN_TIME_BETWEEN_TRADES)
|
||||
: undefined,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user