Help / Trading and testing
The Strategy Lab
The Strategy Lab is for trading systems as a whole: bring in the trades a system made (from a file, or from the strategy tester), then track, compare and combine them into portfolios. It shows and tests; it never places trades.
| Tab | What it’s for |
|---|---|
| Uploads | Your strategies’ files, in folders, with tags and versions |
| Portfolio | One strategy or portfolio’s results: equity, drawdown, trades |
| Combined | Your portfolios together as one fund, each against its own buy and hold |
| Compare | Strategies side by side |
| Tracker | A portfolio’s money in and out, and each investor’s share |
If you have ai-algo, the bar under the tabs chooses its folder (Aggressive, Main, Conservative) and its models’ year. Each year’s models are a portfolio of their own, and “All years” is them together. Every tab but Uploads and the Tracker follows it.
Uploading a strategy#
- Open the Uploads tab and press Upload a CSV…
- Choose what the file is: a trade list, a position log, a TradingView “List of trades” export, or a signal log.
- Match its columns to what each one means (the Lab guesses most), and say which time zone times without an offset are in.
- For position logs, choose whether a change of position trades at the next bar’s open or this bar’s close. Missing prices are filled from the market’s candles.
- Save it. Uploading a new file to the same strategy keeps the old one as a version.
From the strategy tester#
In the chart’s Strategy tester, press Send to Strategy Lab. It’s saved under Uploads › Strategy Tester.
Portfolios#
Put strategies together in a portfolio, choose how it splits its money between them, and the Lab works out how they’d have done together. The portfolio builder can suggest one: the best strategy first, then each next best that doesn’t move with those already picked. Treat its pick as a starting point and test it on a later stretch of history.
Leave the start date blank and the run begins on the first signal of any of its strategies; each later one joins on its own first day, bringing its share of the capital. The returns are time-weighted, so money added as strategies join isn’t counted as a gain.
The Tracker follows a real portfolio: money each investor put in and took out, the unit price (its time-weighted return) against buy and hold, and each investor’s share and return.
Combined adds your portfolios up as one fund, each with its own money and rebalancing. Every portfolio is shown against its own buy and hold: its strategies’ tickers held at its weights, rebalanced on its dates, with the same money in and out. Tick Draw each portfolio’s buy & hold to see those on the chart. Buy & hold (combined) adds them up, and an ETF of your choice (SPY by default) is the other benchmark.
TradingView and Pine Script are trademarks of TradingView, Inc. OpenTapefolio is not affiliated with or endorsed by TradingView.