v0.4.4 - Parser Database Fixes & Validation Improvements
🔧 Pine Script v6 Extension - v0.4.4
Critical Parser Database Fixes
This release fixes two important false positive validation errors that were affecting users working with mathematical functions and strategy scripts.
✨ What's Fixed
1. math.round() Parameter Definition ✅
Problem: Validator incorrectly reported "Too many arguments for 'math.round'" when using precision parameter.
Fixed: math.round() now correctly accepts optional precision parameter.
Before (v0.4.3):
rounded = math.round(close, 2) // ❌ ERROR: Too many arguments
After (v0.4.4):
rounded = math.round(close, 2) // ✅ Valid - rounds to 2 decimal places
2. strategy. Variable Properties* ✅
Problem: Validator reported "Unknown strategy constant or function 'position_size'" for valid strategy variables.
Fixed: Added 32 missing strategy.* runtime state variables.
Now Supported:
// Position tracking
strategy.position_size // Current position size
strategy.position_avg_price // Average entry price
strategy.position_entry_name // Entry signal name
// Account metrics
strategy.equity // Current account equity
strategy.netprofit // Net profit/loss
strategy.grossprofit // Gross profit
strategy.grossloss // Gross loss
// Trade statistics
strategy.closedtrades // Number of closed trades
strategy.opentrades // Number of open trades
strategy.wintrades // Number of winning trades
strategy.losstrades // Number of losing trades
// ... and 20 more variables
Example Usage:
//@version=6
strategy("My Strategy")
// No more false positives! ✅
if strategy.position_size > 0
strategy.close("Long")
plot(strategy.equity, "Equity")
plot(strategy.netprofit, "Net Profit")
🧹 Project Improvements
Cleaned Up Project Structure
- Organized 26 dev/debug/test scripts into
dev-tools/folderdev-tools/debug/- 10 debugging scriptsdev-tools/analysis/- 6 analysis scriptsdev-tools/testing/- 10 test scripts
- Moved test Pine files to
examples/ - Removed legacy session documentation (preserved in git history)
📊 Testing & Validation
Comprehensive Testing ✅
- 67/67 unit tests passing (100%)
- 7/8 example files validated (1 intentionally has errors for testing)
- All v0.4.4 fixes verified with dedicated test suite
Test Results
✅ Test 1: math.round(value, precision) - PASS
✅ Test 2: strategy.position_size - PASS
✅ Test 3: Other strategy.* variables - PASS
📦 Files Modified
v6/parameter-requirements-generated.ts: Added precision parameter to math.roundv6/pine-constants-complete.ts: Added STRATEGY_VARIABLES set with 32 runtime state variables
🚀 Installation
From VSIX
- Download
pinescript-v6-extension-0.4.4.vsixfrom assets below - In VS Code: Extensions → ⋯ (More Actions) → Install from VSIX...
- Select the downloaded file
From Marketplace
Search for "Pine Script v6 IDE Tools" in VS Code Extensions
📝 Full Changelog
See CHANGELOG.md for complete details.
🙏 Credits
Thanks to all users who reported validation issues. Your feedback helps improve the extension!
Full Language Coverage: 6,665 Pine Script v6 constructs
Test Coverage: 67 comprehensive tests
Package Size: 1.79 MB