Running backtests
Prepare the ticker list, check one set of settings and let PineBag test each ticker in order.
Build the bag
- Search in TradingView.
Choose Search, find a market and use the PineBag add action. The exchange prefix is preserved. - Paste a list.
Choose Paste or press ⌘V/Ctrl+V. New lines, commas, semicolons and spaces are accepted; duplicates are ignored. - Copy or reuse it.
Copy returns one ticker per line. Clear copies the bag before removing it, so Paste can restore it. - Review the tags.
Use × on a tag to remove one mistake and confirm the count before starting.
NASDAQ:AAPL
NASDAQ:MSFT
BINANCE:BTCUSDT
CME_MINI:ES1!NASDAQ:AAPL
NASDAQ:MSFT
BINANCE:BTCUSDT
CME_MINI:ES1!- Up to 500 tickers per run.
- Supported: stocks, crypto, forex, futures, indices and other TradingView symbols.
- Market data and delayed quotes still follow your TradingView account entitlements.
Choose where strategy properties come from
Open PineBag Settings and choose TradingView or Script under Strategy properties. The selected source wins when the same value exists in both places; TradingView is the default.
strategy().TradingView priority
Use this when you tune capital, order size, commission and execution assumptions in TradingView. The chart values override matching script values.
Script priority
Use this when every run must carry the same assumptions inside the .pine file. TradingView only supplies a property that the declaration does not set.
Change parameters in TradingView
- Add the strategy to the chart.
Open its settings with the gear icon and choose the Properties tab. - Set account assumptions.
Check Initial capital, Base currency and Order size. - Set trading costs.
Enter Commission and Slippage. These apply to every ticker in the bag. - Check leverage and fills.
Set long/short margin, recalculation and order-fill behavior only when the strategy needs them. - Return to PineBag.
Keep TradingView priority selected, confirm the summary in the side panel and start the run.
Or keep the parameters in Pine Script
With Script priority, the strategy() declaration becomes the portable source of truth. This template includes the main properties and a small, valid EMA-breakout example.
Open the strategy template with every Properties variable →
↓Download the editable .pine template4 KB · Pine Script v6Choose the history mode
Chart history
Uses up to 5,000 loaded bars. It works with any TradingView plan, but ticker start dates can differ.
Exact shared range
Tests every ticker between the same dates. It requires a TradingView plan with Deep Backtesting.
What happens during a test
PineBag checks the strategy and settings.
TradingView calculates one ticker after another.
PineBag saves the results in one local portfolio report.
Start and monitor the run
-
Confirm the strategy and bag.
Check the file, timeframe, capital and ticker count. -
Select the history mode.
Choose fast chart history or an exact shared date range. -
Choose Run backtest.
Keep the TradingView tab open while the progress counter is moving. -
Review warnings.
PineBag names a failed ticker and keeps the completed results. -
Open the report.
The result and tested strategy version are stored locally.