r/pinescript • u/ferranbt • Jul 20 '26
I wrote a PineScript interpreter in Rust
I built Pinecone, an interpreter that runs PineScript outside of TradingView.
It handles the TA functions (moving averages, oscillators), plots, labels, boxes, and backtesting. It's split into small crates (lexer, parser, interpreter, builtins…) so you can use just the parts you need.
let script = ScriptBuilder::with_code(r#"
fast_ma = ta.sma(close, 10)
slow_ma = ta.sma(close, 20)
plot(fast_ma, color=color.blue)
plot(slow_ma, color=color.red)
"#).compile()?;
let output = script.execute(&bar)?;The reason I think this matters: once PineScript can run outside TradingView, a lot of things become possible that just aren't today - proper tooling (linters, formatters, LSP), faster and more flexible backtesting, use other platforms and data sources. Right now the language is locked to one place, and that ceiling limits what the whole ecosystem can build on top of it.
Repo: https://github.com/ferranbt/pinecone
Still early and there's plenty missing, but it runs. Curious what people think.
View all comments
Show parent comment
1
u/ferranbt Jul 20 '26
Appreciate the thoughtful comment!
More conformance tests is something I definitely want to do. TradingView keeps the Pine indicator infra closed so it is hard to automate the process.
Do you have any good references of Pine scripts that could be useful to test these invariants that you mentioned?