Files
trading_bot_v3/test-ai-leverage-simple.js
mindesbunister 221baf3baa test: add AI leverage calculator validation tests
Core Logic Tests:
- Conservative long position: 6.7x leverage with safe liquidation
- Aggressive short position: 6.3x leverage with proper buffer
- Tight stop loss (2%): 8.5x leverage while maintaining safety
- Balance strategies: 100% for <k, 50% for >k accounts

- 10% safety buffer maintained between liquidation and stop loss
- Smart leverage calculation prevents dangerous liquidation prices
- Account-based strategy correctly implemented
- Risk assessment logic working as designed

- test-ai-leverage-simple.js: Core calculation algorithms
- Liquidation price calculations for long/short positions
- Safety buffer validation across different scenarios
- Balance strategy verification for various account sizes

All tests passing - AI leverage system ready for production use!
2025-07-24 12:27:31 +02:00

3.9 KiB