Python Lab

Test your trading ideas with real data — before they cost you money.

Python Lab gives you a research workspace built into the terminal. Load your actual chart data, run backtests, check if your edge is real, and export your results directly to a trading script — without copying and pasting data between tools.

Download Terminal Python Lab Guide
analysis.py
1# Dome Terminal — Python Lab
2import dome as dt
3import pandas as pd
4import numpy as np
5 
6# Fetch 4H candle data directly from terminal
7df = dt.data("BTC/USDT", "4h", 500)
8 
9# Rolling Sharpe ratio
10returns = df['close'].pct_change()
11sharpe = (returns.rolling(90).mean() /
12          returns.rolling(90).std()) * np.sqrt(6)
13 
14# Walk-forward validation
15result = dt.backtest(df, strategy=entry_fn, wf=True)
16print(result.summary)
// output
Sharpe (annualized)1.48
Max Drawdown-14.2%
Win Rate58.3%
WF out-of-sample1.21
Capabilities

Research that connects directly to your trading.

Your chart data is already loaded. Your journal is already accessible. No CSV exports, no switching tabs, no disconnected environments.

Load charts straight from the terminal — no CSV exports

Call dt.data(symbol, timeframe, bars) and your chart data is ready as a table. No file downloading, no manual export, no reformatting.

See if your strategy would have worked before you run it live

Built-in dt.backtest() tests your strategy against real history with realistic costs and out-of-sample checks — all in one call.

Find out if your trading behavior matches your strategy

Read your tagged journal entries as data. Spot the gap between what your strategy says and what you actually did — revenge trades, oversized entries, rule breaks.

Check whether your results are luck or edge

Statistical tools measure whether your backtest results would hold up on new data, or whether you've just found patterns in noise. Know before you go live.

Turn a validated research idea into a real trading script

Use dt.export() to convert your tested Python logic into a Dome Script — ready to run in the Script Library immediately.

See your results in charts that match your terminal style

Your research output renders inside the terminal with the same colors and layout as the rest of your workspace — not in a separate Jupyter window that loses context.

Research output

Your backtest results at a glance.

Research output renders alongside your chart — not in a separate window. You see the numbers and the chart at the same time.

// rolling sharpe · BTC/USDT 4H · 90-bar
WF SPLIT: 70/30 BARS: 500

Annualized Sharpe

1.48
PASS

Max Drawdown

-14.2%
REVIEW

OOS Sharpe (WF)

1.21
STABLE

Win Rate

58.3%
GOOD
Research workflow

Start with an idea. End with a validated script.

Start with an idea

You notice a pattern in your chart or your journal. Something that might be a real edge. You want to find out if it holds up.

Load the data

Pull your actual chart history using dt.data(). No exports, no formatting — your data is already there.

Test it

Run your idea against the data. Use standard Python tools to check if the pattern is real or if you're seeing things that aren't there.

Validate it

Run a backtest that checks if your results would hold on data the strategy hasn't seen — so you know if it's an edge or just luck.

Use it

Export your validated idea to a Dome Script with dt.export(). It's ready to run in the Script Library immediately.

Supported libraries

If you know Python, you're already ready.

Python Lab runs on the standard stack. No new languages, no proprietary environment. Your existing skills work here.

LibraryWhat it does for youHow to use it
pandasWork with your chart data as tables — slice, filter, calculate rolling statsStandard import — all data comes back as DataFrames
numpyNumber crunching — the math behind your indicators and statisticsStandard import — works alongside pandas as usual
scipyStatistical tests to check if your results are real, not noiseStandard import — already available in the Python Lab environment
matplotlibDraw your results as charts that appear inside the terminal, not a separate windowStandard import — output automatically styled to match the terminal
domeLoad your chart data, run backtests, and export validated ideas to Dome Scriptimport dome as dt

Stop testing ideas in your head. Try them with real data.

Python Lab gives you your actual chart history, your journal, and a direct path from research to a live trading script — all in one place. No disconnected tools.

Download Terminal Python Lab Docs