⚠️ Important Before You Begin
This bot trades real money in your Schwab account automatically. Trading involves significant risk of loss. Never trade with money you cannot afford to lose. Start with the smallest possible position size and monitor every trade carefully.
apex_bot.py
Main trading engine — runs all the logic and places orders
apex_signals.py
Signal calculator — EMA, VWAP, RSI, ADX, volume analysis
apex_risk.py
Risk manager — daily loss limits, position sizing, PDT protection
apex_logger.py
Trade journal — logs every entry and exit to a CSV file
config.env
Your settings — API keys, risk limits, trading symbol
start_bot.bat
One-click starter — double click to launch the bot
What the bot does automatically: Scans /MYM futures every 60 seconds → calculates a 6-point signal score → enters a trade when score hits 5/6 or 6/6 → monitors stop loss and profit targets → closes the position automatically → logs everything to a spreadsheet.
- A Schwab or TDAmeritrade brokerage account with futures trading enabled
- A computer running Windows 10 or Windows 11
- An internet connection that stays on while the bot is running
- At least $200 in your account (bot is set to risk max $50/day)
- Futures trading permissions enabled on your Schwab account (call Schwab if not sure)
Step 2a
Check if Python is already installed
Press the Windows key + R on your keyboard. Type cmd and press Enter. A black window opens. Type this and press Enter:
python --version
If you see Python 3.x.x — Python is installed. Skip to Step 3.
If you see an error — continue with Step 2b.
Step 2b
Download and install Python
Go to python.org/downloads in your browser. Click the big yellow Download button. Run the downloaded file. IMPORTANT: Check the box that says "Add Python to PATH" before clicking Install.
Step 2c
Verify installation
Close and reopen Command Prompt. Type this and press Enter:
python --version
✅ You should see: Python 3.11.x or higher
How to do this: Open Command Prompt (Windows key + R → type cmd → Enter). Type or paste each command below ONE AT A TIME. Press Enter after each one. Wait for it to finish before typing the next.
Copy and run — one at a time
pip install schwab-py
pip install pandas
pip install numpy
pip install schedule
pip install python-dotenv
pip install requests
pip install ta
pip install colorama
pip install pytz
Each command will show text scrolling past. This is normal. Wait for it to stop and show a new prompt before typing the next command.
✅ When each one finishes you will see: Successfully installed [name]
Step 4a — Create the folder
In Command Prompt type these two commands:
mkdir C:\APEX_Bot
mkdir C:\APEX_Bot\trades
Step 4b — Verify it worked
dir C:\APEX_Bot
✅ You should see the trades folder listed
Step 5a
Open File Explorer
Find the bot_files folder that came with this package. You will see 6 files inside it.
Step 5b
Copy all 6 files
Select all 6 files (Ctrl+A to select all), then copy them (Ctrl+C).
Step 5c
Paste into C:\APEX_Bot
Navigate to C:\APEX_Bot in File Explorer. Paste the files there (Ctrl+V).
Step 5d — Verify
dir C:\APEX_Bot
✅ You should see all 6 files listed plus the trades folder
Step 6a
Go to the Schwab Developer Portal
Open your browser and go to: developer.schwab.com
Sign in with your regular Schwab account username and password.
Step 6b
Create or find your App
If you already have an app — click on it. If not — click Create App and fill out the form with any name you want.
Step 6c — IMPORTANT
Set the Callback URL
Find the Callback URL field. Make sure it is set to exactly this:
https://127.0.0.1:8182
Click Modify or Save to save it.
Step 6d
Copy your App Key and Secret
On the App Details page find App Key and Secret. Click the eye icon next to each one to reveal the values. Copy them somewhere safe — you will need them in the next step.
Step 7a — Open config.env
In Command Prompt type:
notepad C:\APEX_Bot\config.env
The config file will open in Notepad.
Step 7b — Fill in your credentials
Replace the placeholder text with your real information:
SCHWAB_APP_KEY=paste_your_app_key_here
SCHWAB_APP_SECRET=paste_your_secret_here
SCHWAB_CALLBACK_URL=https://127.0.0.1:8182
ACCOUNT_NUMBER=your_schwab_account_number
MAX_POSITION_SIZE=1
MAX_DAILY_LOSS=50
MAX_TRADES_PER_DAY=5
RISK_PER_TRADE=50
DEFAULT_SYMBOL=/MYM
TRADE_STOCKS=False
TRADE_FUTURES=True
TRADE_OPTIONS=False
SWING_MODE=False
MIN_HOLD_HOURS=0
Where to find your account number: Log in to Schwab → your account number shows on the main dashboard. It is usually 8 digits.
Step 7c
Save the file
Click File → Save in Notepad. Close Notepad.
Step 8a — Navigate to the bot folder
cd C:\APEX_Bot
Step 8b — Start the bot
python apex_bot.py
The bot will start and show the authentication instructions in your terminal.
Step 8c — Complete authentication
Follow these steps carefully and quickly:
- 1. The terminal shows a long URL starting with https://api.schwabapi.com/...
- 2. Copy that entire URL and paste it into your browser
- 3. Log in to Schwab in the browser
- 4. Accept the terms and select your account
- 5. Click Continue then click Done
- 6. Your browser address bar changes to https://127.0.0.1:8182/?code=...
- 7. Copy that ENTIRE URL from the browser address bar
- 8. Go back to the terminal — you will see Redirect URL>
- 9. Paste the URL and press Enter
✅ Success looks like this in your terminal:
Authentication successful
Bot running — scanning every 1 minute
Press Ctrl+C to stop the bot
Every 60 seconds the bot prints a scan like this:
==================================================
Scanning /MYM — 09:30:01
Trend: BULL
VWAP: ABOVE
RSI: 54.3
ADX: 28.1
Long Score: 3/6
Short Score: 2/6
Vol Surge: no
No signal — waiting for confirmation
| Reading | What it means | Good for buying |
| Trend: BULL | Price moving upward overall | ✅ Yes |
| VWAP: ABOVE | Price above today's average — institutions buying | ✅ Yes |
| RSI: 50–65 | Momentum is bullish but not overbought | ✅ Yes |
| ADX: above 22 | Trend is strong enough to trade | ✅ Yes |
| Long Score: 5/6 | 5 out of 6 conditions confirmed | ⚡ Almost |
| Long Score: 6/6 | All 6 conditions confirmed — strongest signal | ✅ Trade fires |
| Vol Surge: YES | Volume is 1.6x above average — real money moving | ✅ Yes |
A confirmed trade looks like this:
LONG SIGNAL CONFIRMED — /MYM
Score: 6/6
Entry: 46500
Stop: 46358
Target1: 46713
Target2: 46926
Contracts: 1
Futures order placed: LONG 1 contract(s) of /MYM
Trade logged: /MYM LONG @ 46500
What happens next — automatically
- 🟡 Every minute the bot checks the current price against stop and targets
- 🟢 If price hits Target 1 — stop moves to breakeven (trade is now risk free)
- 🟢 If price hits Target 2 — bot closes the position and logs the profit
- 🔴 If price hits the Stop — bot closes the position and logs the loss
To start the bot
Option A — Open Command Prompt and type:
cd C:\APEX_Bot
python apex_bot.py
Option B — Double click the start_bot.bat file in your C:\APEX_Bot folder
To stop the bot
Click inside the terminal window and press:
Ctrl + C
If you see token_invalid error
Run these commands to reset authentication:
del C:\APEX_Bot\schwab_token.json
python apex_bot.py
Then complete the browser authentication again.
To check your trade history
Open this file in Excel at any time:
C:\APEX_Bot\trades\trade_log.csv
⚠️ Current Risk Settings (Conservative for Testing)
MAX_DAILY_LOSS = $50 — Bot stops automatically if you lose $50 in a day
MAX_TRADES_PER_DAY = 5 — Maximum 5 trades per day
CONTRACTS = 1 — Only 1 micro contract per trade
SYMBOL = /MYM — Micro Dow Jones ($0.50 per tick)
- Keep the terminal open at all times while the bot is running — closing it stops the bot
- Check your Schwab account every hour to verify positions match what the bot shows
- Never leave the bot running overnight until you have watched at least 10 live trades complete
- If something looks wrong — press Ctrl+C immediately to stop the bot
- Do not change the config.env file while the bot is running
- Never risk money you cannot afford to lose
RISK DISCLAIMER
Trading futures involves substantial risk of loss and is not appropriate for all investors. Past performance is not indicative of future results. The APEX Breakout System is provided as a technological tool only and does not constitute financial advice, investment advice, or a recommendation to buy or sell any financial instrument. All trading decisions and their consequences are solely the responsibility of the user. You should carefully consider your investment objectives, level of experience, and risk appetite before using automated trading software. There is a possibility that you may sustain a loss equal to or greater than your entire investment. Therefore, you should not invest or risk money that you cannot afford to lose.