Skip to content

ferranbt/pinecone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pinecone

A modular PineScript interpreter written in Rust.

Pinecone executes PineScript code (TradingView's scripting language) with support for technical analysis, custom indicators, and strategy backtesting. The interpreter is designed to be extensible - you can add custom builtin functions and output types to integrate with your own systems.

Features

  • PineScript v4 and v5 language support
  • Technical analysis functions (moving averages, oscillators, etc.)
  • Drawing objects (plots, labels, boxes)
  • Market data from CSV files, or any source you implement
  • Modular output system - extend with custom types and builtins
  • Type-safe generic architecture

Example

A script is replayed over a whole series of bars — series history and indicator state build up as they execute.

use pine::data::{CsvSource, DataSource};
use pine::{RunResult, ScriptBuilder};

let data = CsvSource::from_path("btc_1h.csv")?.load()?;

let outputs = ScriptBuilder::with_code(r#"
    fast = ta.sma(close, 10)
    slow = ta.sma(close, 20)
    plot(fast, title="fast")
    plot(slow, title="slow")
"#)
.with_data(data)
.compile()?
.run()?;

About

Pinescript runtime written in Rust

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages