Data Management
Click Data in the top navigation bar to open the Data Management page. This is where you back up your data, restore it, and clear out files that build up over time from simulations and caching.
What's on the page
-
Disk usage — a quick breakdown of how much space your strategies, simulation files, logs, and databases are using.
-
External Data Sources — last-updated date for data cached locally from NSE and Yahoo Finance (holiday calendar, regime calibration) and your broker (NFO instrument snapshot). See Data Sources for what each one is and how it's used.
-
Backup & Restore — download a full copy of your data, or replace your current data with a previously downloaded backup.
-
Simulation Cleanup — clears out simulation trade files and history.
- Temp Files Cleanup — clears cached files that rebuild automatically.
Creating a Backup
Click Download Backup. Your browser saves a file named something like
thetaprime-backup-2026-07-04.zip.
This single zip file contains everything the app needs to run exactly as it does now: your strategies, trade state, trade/run/simulation history, your settings, and your saved API credentials and login tokens.
Treat this file like a password — anyone with it can log in to your broker accounts through this app. Store it somewhere private (an encrypted drive, a password manager's file storage, etc.), not in a shared folder or inbox.
Your trade history (run_history.db, performance.db) is encrypted inside
the zip — it's only readable by this app on this computer, same protection as
when the app isn't running. This applies to scheduled backups too, so pointing
one at a OneDrive/Dropbox/Google Drive folder doesn't push your trade history
to the cloud in plaintext. Your strategy files and settings are not encrypted
in the backup — they don't contain trade data or credentials.
When to back up
-
Before restoring a different backup — see the safety net below, but it's good practice regardless.
-
Before upgrading or reinstalling the app, or moving it to a new computer.
-
Periodically, especially after building or tuning a strategy you don't want to lose.
Restoring from a Backup
- Click Choose File and select a backup zip you downloaded earlier.
- Click Restore.
- A confirmation dialog explains that this replaces all current data. Confirm to proceed.
Before touching anything, the app automatically saves a snapshot of your current data to a temporary zip file and shows you its path in the result message — write that path down. If the restore turns out to be the wrong file, or you change your mind, you can restore that snapshot the same way to undo it.
After a successful restore, restart the server. The page shows a banner
reminding you of this — scheduled jobs, cached login state, and other
in-memory data are only reloaded when the app starts up, so a restore won't
fully take effect until you stop and restart it (Ctrl+C, then
python app.py again, or restart the Windows service if you're running it
that way).
If you pick a file that isn't a ThetaPrime backup, you'll see an error ("This does not look like a ThetaPrime backup") and nothing is changed.
Scheduled Backups
Below the manual Backup & Restore controls is a Scheduled backups section that runs the same backup automatically, on a timer, with no browser tab needed.
-
Destination folder — any folder path on this machine. Click Browse… to pick it from a native Windows folder dialog (only works when you're running the app on the same PC you're browsing from and it's not running headless as a background service — in that case, type the path directly). Point it at a folder synced by OneDrive, Dropbox, or Google Drive's desktop app to get an automatic offsite/cloud copy — the app doesn't talk to any cloud service directly, the sync client does that part. It cannot be a folder inside the app's own data folder (that would make every future backup include all prior ones).
-
Time — the daily time (IST) the backup runs.
-
Keep — how many recent backups to retain in that folder; older ones are deleted automatically as new ones are made.
-
Enabled — turn the schedule on or off.
Click Save to apply — it takes effect immediately, no restart needed. The status line below the form shows the timestamp of the last scheduled run (or failure).
Moving to a new computer
- On the old machine, click Download Backup.
- Copy the zip to the new machine (USB drive, cloud storage, etc.).
- Install the app on the new machine and start it once so it creates its data folder.
- Open Data → Restore, select the zip, and confirm.
- Restart the server.
Simulation Cleanup
Running simulations and backtests leaves behind files: a simulation trade state and journal per strategy, plus a growing history of multi-day simulation sessions. None of this affects live or paper trading — it's scratch data from testing.
Click Clear all simulation data to delete all of it in one step. This is useful when:
- You've finished testing a batch of strategies and want a clean slate.
- Your backup is getting large and you don't need old simulation results.
This never touches your active live/paper trade state — only files and history related to simulation runs.
Temp Files Cleanup
The app caches two things that are safe to delete and rebuild automatically:
Python's compiled bytecode (__pycache__), and a snapshot of NFO option
instruments fetched from the broker. Neither holds anything you can lose.
Click Clear cache & temp files to remove both and reclaim the disk space. The instrument cache simply re-downloads the next time a strategy needs it.
Reading the disk usage numbers
The summary table on the page shows, in order: total size of the
strategies folder (strategy files, trade state, journals — with simulation
files broken out separately), the cached instrument snapshot, logs, and each
of the three databases (performance, run history, simulation sessions). Use
it to see at a glance what's taking up space before deciding what to clean up
or back up.