Tags: PyneSys/pynecore
Tags
fix(core): ensure compatibility with Python < 3.12 for Buffer import Use try/except to import Buffer from collections.abc, falling back to bytes for older Python versions where Buffer is unavailable. This improves backwards compatibility of ohlcv_file.py.
fix(tests): ensure import hook is registered before pynecore imports Register the import hook at the top of conftest.py to guarantee AST transformations work, even if __pycache__ is deleted. This change prevents issues with module imports during test execution.
fix(strategy): use prefixed order IDs to avoid entry/exit collisions - Add "entry_" and "exit_" prefixes to order IDs in position.orders to prevent collisions between entry and exit orders. - Update all logic for adding, removing, and accessing orders to use the new prefixed keys. - Adjust commission handling and order deletion to account for prefixed IDs.
fix: resolve order leak in position direction change and implement tr… …ailing stop - Fix critical bug where orders were not deleted from orders dict when position fully closed during direction change - Add 'and new_size != 0.0' condition to prevent unnecessary split when closing to zero position - Implement complete trailing stop functionality with trail_price and trail_offset parameters - Add trailing stop activation and dynamic stop price updates based on high/low movements - Enhance Order class with trail_price, trail_offset, and trail_triggered attributes - Update exit() function to support trailing stop parameters - Add _check_close() method for trailing stop execution at close price - Improve price rounding logic to avoid unnecessary rounding when price is already at tick level - Update check methods to use 'is None' instead of falsy checks for proper None comparison - Add trailing stop support in both high and low price checks for long and short positions
feat: rename equity_path to trade_path and fix strategy statistics Breaking changes: - Rename equity_path parameter to trade_path in ScriptRunner and CLI - Change CLI flags from --equity/-ep to --trade/-tp - Update default filename from _equity.csv to _trade.csv - Fix strategy statistics CSV export with proper headers and numeric values - Add comprehensive TradingView-compatible statistics calculation - Version bump to 6.1.0 for breaking API changes
PreviousNext