PyneCore v6.3.5
Strategy Simulator — Major Improvements
TradingView-Compatible Margin Call System
Complete implementation of margin call simulation matching TradingView's exact algorithm:
- Creation-time margin check with slippage at
strategy.entry()call - Fill-time margin validation during order processing
- Multi-phase margin call handling: immediate at open, immediate at worst-case, and deferred to close
- Correct deferral skip when OHLC extremum equals close price
- Default
margin_longandmargin_shortset to 100.0
Order Processing Fixes
- Fill gap-through take-profit exits instead of incorrectly cancelling entry+exit pairs
- Correct gap-through exit handling distinguishing pending entries vs open positions
- Preserve orphan exit orders from margin-rejected entries across bars
- Tick-based exit order calculation and position flip exit preservation
- Mintick division in
round_to_mintickto match TradingView behavior
Exit Support
strategy.exit()now supportscommentandalerttype parameters
Technical Analysis
- New
ta.pivot_point_levels()function with full TradingView compatibility (Traditional, Fibonacci, Woodie, Classic, DM, Camarilla)
Data & OHLCV
- Enhanced timezone handling with automatic DST-aware detection from CSV timestamps
- Additional date format support for broader CSV compatibility
- Significant-digit rounding for OHLCV prices (preserves sub-mintick data like US stock midpoint prices)
- Accurate
barstate.islastdetection using peek-ahead pattern - Correct handling of
end_timestampbeyond last record in gap-filled files - Direct last-record timestamp reading for non-uniform intervals
CLI
--chunk-sizeoption for data download commandPYNESYS_API_URLenvironment variable for API URL override- Reduced demo OHLCV data generation from 20,000 to 2,000 rows for faster setup
Bug Fixes
- Handle builtin price series (
open,high,low,close) as global scope in nested functions - Set
syminfoproperties before importing script to ensure availability during initialization - Fix matrix optional arguments, script TOML escaping, and
plot.style_steplinebr - Add missing
limitparameter to Capital.comdownload_ohlcvmethod