Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Universal Alpaca Paper Trader

A customizable paper-trading dashboard for Alpaca-supported US equities and ETFs. It combines deterministic technical/news scoring, optional local Ollama analysis, manual stock trading, and long-premium options analysis/trading.

Main additions

  • Manage Securities window for adding, editing, disabling, or removing tickers.
  • Alpaca validation before a new ticker is added.
  • A saved data/securities.json universe with a separate profile per ticker.
  • Per-security technical/news weights, buy/exit thresholds, maximum allocation, stock automation toggle, and options automation toggle.
  • Dynamic ticker selectors in the main dashboard, manual trader, and options window.
  • BUY signals can now add shares only until the configured target allocation is reached.
  • EXIT still closes the entire selected stock position.

PNC and SPY are included as starter profiles, but they are no longer hard-coded as the only supported securities.

One-command Windows install, build, and launch

Paste the following command into PowerShell from any folder:

$dir="$HOME\TAPT-Build"; if(Test-Path "$dir\.git"){git -C $dir pull}else{git clone https://github.com/lightningfastcomputing/TAPT.git $dir}; Set-Location $dir; if(!(Test-Path ".\.venv\Scripts\python.exe")){py -3.14 -m venv .venv}; & ".\.venv\Scripts\python.exe" -m pip install --upgrade pip; & ".\.venv\Scripts\python.exe" -m pip install -r requirements.txt pyinstaller; Remove-Item ".\build" -Recurse -Force -ErrorAction SilentlyContinue; & ".\.venv\Scripts\python.exe" -m PyInstaller --clean --noconfirm TAPT.spec; if($LASTEXITCODE -ne 0){throw "TAPT compilation failed."}; $exe=Get-ChildItem ".\dist" -Filter "TAPT.exe" -Recurse | Select-Object -First 1; if(!$exe){throw "Compilation completed, but TAPT.exe was not found in the dist folder."}; Start-Process -FilePath $exe.FullName -WorkingDirectory $exe.DirectoryName

This command:

  • clones TAPT into %USERPROFILE%\TAPT-Build, or pulls the latest changes if it already exists
  • creates an isolated Python virtual environment
  • installs TAPT dependencies and PyInstaller
  • rebuilds the Windows executable using TAPT.spec
  • locates and launches the resulting TAPT.exe

Python 3.14 and Git must already be installed and available from PowerShell.

The first build can take several minutes because Python packages and build dependencies must be downloaded.

Manual Setup on Windows

Requires Python 3.11+.

py -m venv .venv
.\.venv\Scripts\python.exe -m pip install -r requirements.txt
Copy-Item .env.example .env
notepad .env

Add your Alpaca paper keys and Alpha Vantage key. Keep paper orders disabled while checking the installation:

ALLOW_PAPER_ORDERS=false

Launch with:

Run Universal Paper Trader.bat

Use Manage Securities to add a ticker. The manager validates it through Alpaca, loads an equity/ETF default profile, and lets you edit the deterministic parameters.

Per-security profile

Each entry in data/securities.json contains:

  • technical_weight
  • news_weight
  • buy_threshold
  • exit_threshold
  • max_position_pct
  • stock_automation
  • options_automation
  • enabled/disabled state

Technical weight plus news weight must equal 1.00.

Signal behavior

  • BUY: buys enough whole shares to move toward the security's target allocation.
  • HOLD: submits no stock order.
  • EXIT: closes the entire stock position.
  • The one-entry-attempt-per-day safeguard remains active per ticker.

Options remain long-premium only:

  • BUY → call
  • EXIT → put
  • HOLD → no options order

All execution continues to use TradingClient(..., paper=True) and obeys ALLOW_PAPER_ORDERS.

This is an engineering prototype, not evidence of profitability. Validate strategies with logged paper results and backtests before considering live execution.

Built-in schedule

The Schedule button stores recurring jobs in data/schedule.json. Jobs are checked while the main GUI is open and run once per selected day at or after their scheduled Eastern Time. If the application starts after a scheduled time, that day's uncompleted job is run as a catch-up job.

Available scheduled actions:

  • Analyze one configured security
  • Analyze All enabled securities
  • Refresh the Alpaca paper account

The scheduler waits when another analysis or refresh is already running. Add the main GUI launcher to Windows Startup when you want the application available to process the day's schedule automatically.

Scheduled options analysis

For a scheduled Analyze security job, enable Analyze options for this security to run an option-chain analysis immediately after the stock analysis. The scheduled options pass reuses the completed stock/news/LLM decision, so it does not consume a second Alpha Vantage news request or a second Ollama analysis. It selects and logs a candidate call for BUY, a candidate put for EXIT, or no contract for HOLD. Scheduled options analysis is analysis-only and does not automatically place an option order.

Baseline safety controls

The finalized baseline build adds operational controls intended to make paper results auditable:

  • Portfolio-wide stock exposure ceiling (MAX_TOTAL_SECURITIES_PCT).
  • Minimum cash reserve (MIN_CASH_RESERVE_PCT).
  • Duplicate/open-order protection before submitting another order for a symbol.
  • Order-state reconciliation with filled quantity and average fill price recorded when available.
  • Limit-only option entry/exit; option market orders are rejected.
  • Existing same-contract option positions are not automatically increased unless OPTIONS_ALLOW_ADD=true.
  • Scheduler task states and retry handling; failed provider calls are not silently treated as successful daily jobs.
  • Strict OCC-symbol parsing shared by the broker and option manager.
  • Configurable Ollama endpoint (OLLAMA_ENDPOINT).
  • The LLM log records both its requested target allocation and the risk-capped applied target.

Recommended baseline mode remains supervised paper trading. Keep ALLOW_PAPER_ORDERS=false until account refresh, single-symbol analysis, options analysis, logs, and scheduler behavior are verified on the target PC.

v28.7

See patch notes/SIGNAL_ENGINE_V2_AND_HARDENING.md.

About

Python desktop paper-trading platform with technical analysis, options simulation, scheduling, backtesting, risk controls, and optional AI-assisted market analysis.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages