PitchHut logo
Fast and reliable PineScript v6 backtesting engine.
Pitch

PineForge offers a deterministic backtest runtime for PineScript v6, validated on a trade-for-trade basis against TradingView. With its rapid execution and local setup, it enables users to harness AI for writing and optimizing strategies without the hassle of external APIs. Experience seamless backtesting that integrates with your existing PineScript workflows.

Description

Overview

PineForge is the fastest deterministic PineScript v6 backtest runtime designed to deliver validated trade-for-trade results against TradingView. The project implements a robust backtesting engine, enabling users to efficiently test and optimize trading strategies without the complexity of external dependencies. PineForge stands out for its accuracy, speed, and comprehensive feature set, making it a valuable tool for traders and developers alike.

Key Features

  • Precision and Parity: PineForge achieves a remarkable 245 out of 246 reference strategies matching TradingView's outcomes. The few discrepancies are documented and correspond to edge cases in TradingView's broker emulator.
  • High Performance: On average, PineForge runs 104 times faster than competing solutions such as PyneCore. The engine processes input data rapidly, yielding bit-reproducible results for parameter sweeps without rebuilding.
  • Deterministic Trading Logic: This runtime ensures consistent results, with deterministic float ordering and internal state management, allowing for bit-identical outcomes across runs.
  • Cross-Platform Support: The engine supports multiple programming environments, including Python, Rust, Go, Node.js, and Julia, facilitating integration with diverse applications.
  • User-Friendly API: The library exposes a straightforward C API, allowing developers to easily interact with the engine using a wide range of languages.

Workflow

Utilizing PineForge is streamlined and efficient:

  1. Parameters or scripts in PineScript v6 are inputted.
  2. The engine transpiles the Pine script into C++ leveraging the bundled transpiler.
  3. The strategy compiles and runs locally in Docker, delivering results with microsecond-class speed.
  4. AI can be leveraged to enhance strategies based on past performance and suggest optimizations.

Example Usage

Users can interact with PineForge via commands to execute various tasks:

claude mcp add pineforge-codegen \
  --transport stdio \
  -- npx -y @pineforge/codegen-mcp

Benefits of Using PineForge

  • Accurate Backtesting: Trading strategies can be validated against actual TradingView executions, ensuring that results are reliable and meaningful.
  • Speed up Strategy Development: With its advanced performance optimization, traders can iterate and refine strategies faster than ever.
  • Ease of Integration: The well-defined C API allows for seamless connections with existing tools and workflows, accommodating a variety of programming languages and environments.

Comprehensive Documentation

Extensive documentation is available, detailing the API, installation process, and various usage scenarios. Resources include:

Conclusion

PineForge offers an innovative solution for backtesting PineScript v6 strategies with unprecedented speed and accuracy. By employing a stable C runtime, it equips developers and traders with the tools necessary for effective strategy optimization and validation.

0 comments

No comments yet.

Sign in to be the first to comment.