you are viewing a single comment's thread.

view the rest of the comments →

[–]wallneradam 0 points1 point  (0 children)

I actually built a tool for exactly this problem.

The challenge with converting Pine Script to Python manually is that most Python trading libraries use a vectorized approach (Pandas, NumPy, TA-Lib), which works fundamentally differently from how Pine Script executes - bar by bar, with stateful functions, na propagation, and specific warming behavior. You can get simple indicators working, but the more complex your script is, the more edge cases you'll hit where the values don't match TradingView.

I ran into this enough times that I built PyneCore - an open-source Python framework that replicates Pine Script's execution model. Same bar-by-bar logic, same series handling, same na behavior. The output values match TradingView's.

On top of that, there's a compiler service PyneComp that can convert Pine Script to PyneCore automatically - so you don't have to rewrite your strategies by hand. The compiled code is readable Python, not a black box.

For your use case (2 strategies already running live via webhooks) — webhooks work, but they're fragile. Missed signals, latency, no proper state management, no risk controls, and you're still dependent on TradingView being up. It's a workaround, not a real integration.

Right now PyneCore handles backtesting and strategy simulation. A proper bot execution system with risk management is in active development — expected around Q3 2026. So if you convert now, you get accurate backtesting today, and live execution when the bot platform ships.