PyneCore v6.3.1
What's Changed
π Bug Fixes
Strategy System
- Fixed critical order leak in position direction changes: Resolved a bug where orders were not properly deleted from the orders dictionary when a position was fully closed during a direction change
- Fixed unnecessary position split: Added condition to prevent unnecessary splitting when closing to zero position
Provider System
- Improved CCXT ticker extraction robustness: Enhanced ticker extraction logic for better market details handling
- Fixed symbol casing in output paths: Ensured symbols are properly uppercased in provider output paths
β¨ New Features
Trailing Stop Implementation
- Complete trailing stop functionality: Added full support for trailing stop orders with
trail_priceandtrail_offsetparameters - Dynamic stop price updates: Trailing stops now automatically adjust based on high/low price movements
- Enhanced Order class: Added
trail_price,trail_offset, andtrail_triggeredattributes - Exit function improvements: Updated
exit()function to support trailing stop parameters - Close price execution: Added
_check_close()method for trailing stop execution at close price
Logging Enhancements
- Pine Script timezone support: Added custom
PineRichHandlerthat formats log timestamps usingsyminfo.timezone - Improved time handling: Modified
PineLogFormatterto use Pine Script time when available, with fallback to UTC or system time - Better log formatting: Replaced default RichHandler with custom PineRichHandler for improved time display
π Improvements
CLI Enhancements
- Added 120-minute interval support: Extended
TimeframeEnumto include 120-minute intervals for data commands
Code Quality
- Improved price rounding logic: Avoided unnecessary rounding when prices are already at tick level
- Better None comparison: Updated check methods to use
is Noneinstead of falsy checks for proper None comparison - Enhanced trailing stop checks: Added trailing stop support in both high and low price checks for long and short positions
Technical Details
The main changes focus on fixing critical order management issues and implementing comprehensive trailing stop functionality. The order leak fix prevents memory issues and incorrect order state during position direction changes. The new trailing stop feature provides advanced order management capabilities matching Pine Script v6 functionality.