I built a Pine Script Python transpiler — and just opened it up for paying users
Hi dev.to — I'm Ray, a retail trader with a day job, and this is my weekend side project: Pine2Py (pine2py.com). The problem was my own. I'd prototype a strategy in Pine Script on TradingView, then want to backtest it properly in Python — on my own data, across more symbols, with parameters swept systematically. Hand-rewriting worked, but every rewrite risked quietly changing the strategy's…
I, Ray, am a retail trader with a day job, and this is my weekend side project: Pine2Py (pine2py.com). The motivation behind this endeavor was my need to prototype trading strategies in Pine Script on TradingView and then backtest them accurately in Python, using my own data and testing across multiple symbols with systematic parameter sweeps.
While hand-rewriting strategies worked, there was always a risk of unintentionally altering the strategy's logic, and I never fully trusted backtests generated from code that may not have been the exact same as what I had originally charted.
To address this issue, I built the converter I envisioned. It is a genuine transpiler, a comprehensive Pine front-end parser, rather than a simple regex find-and-replace. Users can simply paste a Pine Script v5 or v6 indicator or strategy, and the converter will output a single, readable Python file (with types annotated and structure preserved) that can run bar-by-bar on their own OHLCV data using the PyneCore runtime.
To ensure accuracy, I tested the converter against a corpus of 1,909 real-world scripts. In my testing, 99.7% of scripts compiled successfully, and 98.4% were fully translated. The remaining scripts failed with clear diagnostics, which I prefer over providing subtly incorrect code or a backtest that cannot be trusted.
A key insight from this project is that a transpiler's correctness is only as good as the runtime it is built on. There were two classes of scripts that crashed due to bugs in the stock runtime, not because of issues in the translation. To mitigate this problem, I shipped a patched runtime build alongside the converter for free download on the site.
It is essential to explicitly state that the stock PyPI PyneCore is not supported. Rigorous testing of the translator and runtime as a pair on adversarial scripts should be done from the beginning of the project.
As for monetization, I kept it intentionally straightforward: a free account (sign-in by email code, no password or card required) includes three conversions, while the Pro plan costs $12/month for unlimited conversions, paid through Paddle. I opened the paid tier a few days ago, so the current honest revenue figure is: just launched.
It is crucial to understand that this converter is not a signal provider; it merely faithfully moves your code so that your backtests accurately reflect what you believe they mean. If you have ported trading code between languages or are developing dev tools solo, I would love to hear about your experiences and if you try Pine2Py, please share your results, particularly any issues you encounter. Your feedback is invaluable, as these reports will help me fix the last few percent of bugs.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.
This story
This is one outlet's version. Read the fullest account.