ETRADE Bot is a desktop-based automated trading platform built for US equity markets. Unlike cryptocurrency bots that operate on simple REST or WebSocket APIs, US stock brokers use OAuth-based authentication — a more involved but more secure authorization flow. ETRADE Bot handles the full OAuth handshake automatically, manages token refresh cycles, and provides a clean graphical interface for configuring and running automated trading strategies across multiple brokers.
Whether you want to automate simple moving average crossovers on individual stocks, run momentum-based strategies across a watchlist, or test your ideas risk-free in a paper trading sandbox, ETRADE Bot gives you the infrastructure to do it without writing code.
| Component | Minimum | Recommended |
|---|---|---|
| Operating System | Windows 10 (64-bit) | Windows 11 |
| RAM | 4 GB | 8 GB |
| Python | Python 3.10+ | Python 3.11+ |
| Internet | Required (OAuth) | Stable broadband |
ETRADE_BOT folder in PowerShell or a terminal.python -m venv .venv && .venv\Scripts\Activate.ps1pip install -r requirements.txt (includes pyetrade, ttkbootstrap, and broker-specific libraries).python main.pyThe compiled EXE (if available via the build release script) bundles all dependencies and can be run directly without Python installed.
| Broker | Module | Auth Type | Asset Classes |
|---|---|---|---|
| E*TRADE | etrade_conn.py | OAuth 1.0a | Stocks, Options, ETFs |
| Alpaca | alpaca_conn.py | API Key | Stocks, Crypto |
| Charles Schwab | schwab_conn.py | OAuth 2.0 | Stocks, Options, ETFs |
| Interactive Brokers | ibkr_conn.py | TWS/Gateway | Stocks, Options, Futures, Forex |
| Tradovate | tradovate_conn.py | OAuth 2.0 | Futures |
| Webull | webull_conn.py | Device Token | Stocks, Options |
| CBOE | cboe_conn.py | API Key | Options Data |
Each broker module implements a shared ExchangeBase interface, meaning strategy logic works identically regardless of which broker you connect to.
E*TRADE uses OAuth 1.0a for API access. This is a three-step authorization process that must be completed once per session (production) or once per day (sandbox). ETRADE Bot automates every step of this flow.
After clicking Save & Get Auth URL, the bot generates an OAuth authorization URL and automatically opens it in your default web browser. You will be directed to E*TRADE's login page. Log into your E*TRADE account and click Accept to authorize the bot. E*TRADE displays a 5-digit authorization PIN on the confirmation page.
To obtain API keys from E*TRADE:
developer.etrade.com and create a developer account (linked to your E*TRADE brokerage account).https://localhost if no web server is involved).Sandbox mode connects to E*TRADE's simulated trading environment. Your sandbox account has a pre-funded virtual balance, and all orders are executed against real-time market data but produce no actual financial transactions. This is ideal for:
In the API Settings dialog, check the Use Sandbox API toggle before saving credentials and connecting. The main window title bar displays [SANDBOX] when sandbox mode is active. All log entries are prefixed with [SANDBOX] to clearly distinguish simulated activity from real activity.
Sandbox balances and positions are separate from your live account. Positions opened in sandbox mode will never appear in your real E*TRADE account.
The ETRADE Bot interface is built with Tkinter and ttkbootstrap for a clean, professional dark-themed look. The main window is organized into four primary areas.
A scrollable, auto-updating log of all bot events. Every quote received, every signal evaluated, every order placed or filled, and every error is recorded here with a timestamp. Use the Clear Log button to reset the display. The log is also written to a file for persistent review.
The watchlist is the set of symbols the bot actively monitors for trading signals. You can add any stock, ETF, or option symbol that your connected broker supports.
Type a ticker symbol (e.g., AAPL, SPY, TSLA) into the symbol search field at the top of the watchlist panel and press Enter or click Add. The bot immediately fetches a real-time quote and subscribes to streaming price updates for the symbol. The quote refreshes at the interval configured in Settings (default: 10 seconds).
Each symbol in the watchlist can have its own strategy. Click a symbol to select it, then choose a strategy from the Strategy dropdown on the left panel. The strategy assignment is saved and persists across sessions. This allows you to run, for example, RSI on AAPL and MACD on SPY simultaneously from a single bot instance.
Select any symbol in the watchlist and click Remove. The bot stops monitoring that symbol and cancels any pending orders for it. Open positions for removed symbols are not automatically closed — you must close them manually or via the Positions panel.
The bot is aware of US market hours (9:30 AM – 4:00 PM ET, Monday–Friday). Outside of market hours, quote requests return the previous day's closing price. The bot can be configured to queue signals generated pre-market and execute them at market open via Settings → Pre-Market Queue.
ETRADE Bot includes several technical analysis strategies adapted specifically for US equity markets. Stock market price action differs from crypto in that it is subject to earnings, news events, dividends, and macroeconomic forces — the strategy parameters are tuned accordingly.
Uses a 14-period RSI. Generates a buy signal when RSI drops below 30 (oversold) and a sell signal when RSI rises above 70 (overbought). Recommended for stable large-cap stocks that tend to revert to the mean after short-term extremes. Not recommended during strong trend conditions.
Uses a fast EMA (default 9-period) and slow EMA (default 21-period). Buys on bullish crossover (fast above slow) and sells on bearish crossover. Well-suited for trending stocks after a breakout. Works best on daily or 1-hour timeframes.
Uses a 50-day and 200-day SMA for the classic "golden cross" (buy) and "death cross" (sell) signals. This is a long-term strategy best suited for position trading rather than day trading. Signals are rare but historically reliable on major indices and blue-chip stocks.
Standard MACD (12, 26, 9) configuration. Generates buy signals when the MACD line crosses above the signal line and sell signals on the reverse cross. The histogram provides momentum confirmation — strong histogram bars validate the signal, weak bars suggest caution.
Ranks watchlist symbols by recent price momentum (N-day rate of change) and buys the top performers while selling or avoiding the laggards. Rebalances at configurable intervals. Best for a diversified watchlist of 10+ symbols.
Identifies stocks trading significantly below their N-day average (using Bollinger Bands or Z-score deviation) and buys the dip, expecting prices to return toward the mean. Sets a target exit at the mean or at a fixed percentage gain. Carries the risk of catching falling knives — use stop losses.
ETRADE Bot places orders through the connected broker's API. Orders are typically market orders for immediate execution, but limit orders can be configured in Settings for tighter price control.
When the bot is running and detects a strategy signal for a watchlist symbol, it automatically calculates the order quantity based on your configured trade amount, then places the order. The order ID, type, quantity, and price are logged to the Activity Log and the Recent Orders panel updates in real time.
Use the Manual Buy and Manual Sell buttons to place orders independently of strategy signals. Enter the symbol, quantity, and order type in the dialog that appears. Manual orders are logged with a [MANUAL] prefix in the Activity Log.
For accounts under $25,000 at US brokers, the Pattern Day Trader rule limits accounts to 3 day trades (buy and sell the same security in the same day) within a rolling 5-day window. ETRADE Bot displays your current day trade count in the Account Summary panel and warns you when you are approaching the PDT limit to prevent unintentional violations.
The Positions table displays all open positions managed by the bot, including positions opened manually outside the bot that exist in your account. Columns include: Symbol, Quantity, Entry Price, Current Price, Market Value, Unrealized P&L ($), and Unrealized P&L (%).
Right-click any position to access the context menu. Options include: Close Full Position (market sell entire quantity), Close Half Position, and Set Stop Loss (set or update the stop loss level for that specific position).
At the bottom of the Positions panel, a running total shows today's realized P&L (from closed positions) and total unrealized P&L (from open positions). This resets at midnight each trading day.
The built-in sentiment module (sentiment.py) provides a supplementary signal layer based on news and market sentiment rather than price action alone. It is not a standalone trading engine but can be used to filter or confirm technical signals.
In Settings → Strategy Options, enable Sentiment Filter. When enabled, the bot only executes buy signals when the sentiment score for the symbol is positive or neutral. It suppresses buy signals during negative sentiment periods (e.g., during earnings disappointments or sector-wide sell-offs). Sell signals are unaffected by the filter.
Demo mode runs the bot with a fully simulated broker connection — no real API keys are needed, no network requests are made, and all prices are generated from a pre-loaded demo state. This is designed for first-time users who want to learn the interface before connecting a real account.
At the main window, click Try Demo Mode (visible before any broker connection is established). The bot loads demo state from demo_state.json, populating the watchlist with sample symbols and simulated portfolio positions. All strategy signals, order placements, and P&L calculations behave identically to a live session.
Click Stop Demo or close and reopen the application to exit demo mode. Demo state can be reset via Settings → Reset Demo State, which purges the demo_state.json file and restarts fresh.
Access the Settings dialog from the main window's top toolbar or via the Settings button. Key configurable options include:
All settings are saved to etrade_config.json in the application directory and persist across sessions.
| File | Contents |
|---|---|
etrade_config.json | All settings and configuration |
demo_state.json | Demo mode portfolio state |
.oauth_state.json | OAuth token state (auto-managed) |
exchange_config.json | Per-broker connection parameters |
grok_logs.csv | Full trade and signal history CSV export |
.oauth_state.json and .oauth_state.pkl files store active OAuth tokens. Do not delete these while a session is active — doing so forces a full re-authorization on the next action.Ensure your Consumer Key and Secret match the environment (production vs. sandbox) that you have selected. Check that your system clock is accurate — OAuth signatures are time-sensitive. If the browser page shows "Application not found," the keys may not yet be approved for production use.
The OAuth PIN from E*TRADE is valid for only 5 minutes. If you take longer than 5 minutes between opening the browser and submitting the PIN, restart the authorization flow by clicking Save & Get Auth URL again. A new URL and PIN will be generated.
Verify market hours (9:30 AM – 4:00 PM ET). Limit orders may not fill if the market moves away from your limit price — switch to market orders if immediate execution is required. Check the Recent Orders panel for error codes returned by the broker.
Your E*TRADE developer application may not yet have production approval. Use sandbox mode until approval is granted, or check the E*TRADE developer portal for your application status.
Check the Activity Log for an error message. Common causes include: OAuth token expiry (re-authorize), network disconnection (reconnect), or the daily loss limit being hit (restart manually after reviewing trades). Set log level to Verbose for more detailed diagnostic output.
ETRADE Bot User Manual — DennTech Trading Solutions — May 2026