Paste a target-weights CSV, preview the rebalance, execute it on your Tastytrade account.
Project description
msts-trader
Paste a target-weights CSV, preview the rebalance, execute it on your Tastytrade account.
$ msts-trader
Paste CSV (ticker,weight), then Ctrl+D:
ticker,weight
SPY,0.42
GLD,0.18
SHV,0.20
EEM,0.20
^D
✓ loaded 4 targets.
Account 5W****** · NAV $48,213.42 · cash $2,150.00 · BP $46,290.00
Market: open · closes in 23 min
Rebalance preview
┃ Symbol ┃ Current % ┃ Target % ┃ Δ $ ┃ Action ┃ Note ┃
┃ SPY ┃ 18.2% ┃ 42.0% ┃ +$11k ┃ BUY 22.00 @ ~$521.34 ┃ ┃
┃ EEM ┃ 31.5% ┃ 20.0% ┃ -$5k ┃ SELL 119.00 @ ~$47.21 ┃ ┃
...
Execute 4 orders? [y/N]: y
[1/4] SPY BUY 22.00 @ MKT ... ROUTED id=4f8...
...
Done. sent: 4 · failed: 0 · log: ~/.msts-trader/fills/
Install
pip install msts-trader
Python ≥3.11 required.
Install from source (development):
git clone https://github.com/markudevelop/msts-trader.git
cd msts-trader
pip install -e .
One-time setup
You need Tastytrade OAuth credentials. This is your app, not ours — we never see your keys.
- Sign in at https://developer.tastytrade.com → My Apps
- Create an OAuth application — copy the provider secret
- Run their OAuth authorization flow to obtain a refresh token
- Look up your account number in the Tastytrade web dashboard (optional — leave blank to auto-pick your first account)
- Run:
msts-trader login
Paste the three values when prompted. They are stored in your OS keychain (macOS Keychain / Windows Credential Manager / libsecret). The app never writes them to disk in plaintext.
Daily usage
-
Get your CSV. On a supported weights site, click Copy CSV. Or build one yourself:
ticker,weight SPY,0.42 GLD,0.18 EEM,0.20 SHV,0.20
weightis a fraction (0–1), not a percent.- Sum should be ≤ 1.0 (the remainder is held as cash).
- Comments starting with
#are ignored.
-
Run:
msts-trader
-
Paste the CSV, hit
Ctrl+D(Ctrl+Zthen Enter on Windows). -
Review the preview table carefully.
-
Type
yto execute, anything else to cancel.
Useful flags
msts-trader rebalance --dry-run # preview only, never sends
msts-trader rebalance --yes # skip the confirm prompt
msts-trader rebalance --threshold 0.02 # tighter rebalance (default 4%)
msts-trader rebalance --csv-file targets.csv # read from a file instead of stdin
Other commands
msts-trader status # show NAV, positions, market status
msts-trader logout # clear stored creds
msts-trader --version # print version
What it does
- Parses your CSV into
{ticker: target_weight}. - Pulls live NAV, cash, buying power, and current positions from Tastytrade.
- Quotes every relevant symbol via the Tastytrade market-data API.
- Computes the dollar delta per ticker, skips anything within the drift threshold (default 4% of NAV).
- Sells tickers no longer in your targets.
- Sizes buys at the current quote, rounded to 2 decimals (Tastytrade fractional shares on MARKET orders).
- Shows the full plan and waits for
ybefore sending anything. - Submits MARKET DAY orders. Logs results to
~/.msts-trader/fills/.
What it does NOT do (v1)
- Pre-market or after-hours execution — refuses to send outside 09:30–16:00 ET.
- Shorting — negative weights are rejected.
- Options, futures, crypto.
- Multi-account or per-strategy ledger.
- Margin-aware uniform scaling (warns instead; Tastytrade's own BP pre-flight will scale down at submit if needed).
- Automatic CSV polling. You paste each rebalance manually.
Security
- Your Tastytrade OAuth credentials live only in your OS keychain on your own machine. The app does not phone home, does not log credentials, and is not connected to any service operated by the author.
- The author of this app cannot view, recover, or revoke your Tastytrade access. Revoke via your own Tastytrade OAuth app dashboard if a refresh token leaks.
- Trades are user-initiated: every execution requires you to paste a CSV
and confirm with
y. There is no background trading loop.
Disclaimer
This tool sends real orders to your live brokerage account. You are responsible for the CSV you paste and the rebalance you confirm. Past performance of any signal source is not indicative of future results. The author makes no warranty of any kind; use at your own risk.
License
Apache-2.0.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file msts_trader-0.1.1.tar.gz.
File metadata
- Download URL: msts_trader-0.1.1.tar.gz
- Upload date:
- Size: 15.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fbb3a6528e4f2440aced01d31f830678d5ef5bb9807fdecf959f276f5dd937a2
|
|
| MD5 |
d6c7ac9abe8da4df89414c2b8845b7e6
|
|
| BLAKE2b-256 |
246b0527f9e87856cc2a8f9eba6961eede4e7433bf4f7405478b7596054ee530
|
Provenance
The following attestation bundles were made for msts_trader-0.1.1.tar.gz:
Publisher:
release.yml on markudevelop/msts-trader
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
msts_trader-0.1.1.tar.gz -
Subject digest:
fbb3a6528e4f2440aced01d31f830678d5ef5bb9807fdecf959f276f5dd937a2 - Sigstore transparency entry: 1732125437
- Sigstore integration time:
-
Permalink:
markudevelop/msts-trader@6f4241b6f1c3ce511fadcac140268b766053b5ef -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/markudevelop
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6f4241b6f1c3ce511fadcac140268b766053b5ef -
Trigger Event:
push
-
Statement type:
File details
Details for the file msts_trader-0.1.1-py3-none-any.whl.
File metadata
- Download URL: msts_trader-0.1.1-py3-none-any.whl
- Upload date:
- Size: 16.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18f47e32a2cd4a1a450077820c92ba1184b5f83580318b0a8bf048651ba35432
|
|
| MD5 |
2e0972718bdff712bb8ab30e0218b9b0
|
|
| BLAKE2b-256 |
b94e641960c7cf5ac5132de12519fb00a1d00cf15cec0b790caf0d08d2f73561
|
Provenance
The following attestation bundles were made for msts_trader-0.1.1-py3-none-any.whl:
Publisher:
release.yml on markudevelop/msts-trader
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
msts_trader-0.1.1-py3-none-any.whl -
Subject digest:
18f47e32a2cd4a1a450077820c92ba1184b5f83580318b0a8bf048651ba35432 - Sigstore transparency entry: 1732125507
- Sigstore integration time:
-
Permalink:
markudevelop/msts-trader@6f4241b6f1c3ce511fadcac140268b766053b5ef -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/markudevelop
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6f4241b6f1c3ce511fadcac140268b766053b5ef -
Trigger Event:
push
-
Statement type: