Getting Started
This guide will walk you through installing Pinecone and creating your first multi-file PineScript project.
Installation
Prerequisites
- Python 3.10 or higher
- Git
Install Pinecone
Clone the repository and install in development mode:
git clone https://github.com/claudianadalin/pinecone.git
cd pinecone
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -e .
Verify the installation:
Create Your First Project
1. Set up the project structure
Create a new directory for your PineScript project:
Create the following structure:
2. Configure your project
Create pine.config.json in your project root:
| Field | Description |
|---|---|
entry |
Path to your main PineScript file (relative to config) |
output |
Where to write the bundled output |
3. Create a utility module
Create src/utils.pine with some reusable functions:
Export Directive
The // @export comment tells Pinecone which functions should be available for import by other files.
4. Create your main file
Create src/main.pine:
//@version=5
// @import { double } from "./utils.pine"
indicator("My First Bundled Indicator", overlay=true)
result = double(close)
plot(result, "Doubled Close", color=color.blue)
Import Directive
The // @import { ... } from "..." syntax imports specific functions from another file. The path is relative to the current file.
5. Bundle your project
Run the bundler:
You should see:
6. Use in TradingView
- Open
dist/bundle.pine - Copy the entire contents
- Paste into TradingView's Pine Editor
- Click "Add to Chart"
Quick Copy
Use pinecone build --copy to automatically copy the output to your clipboard.
Next Steps
- Learn about all configuration options
- Explore the CLI commands
- Understand how the bundler works