`n

FAQ & Setup Guide

Everything You Need to Get Started

Quick Start Guide

Follow these steps to get your ATMA Trading Bot up and running in under 30 minutes!

1

Create a Tradier Account

Sign up for a Tradier brokerage account to execute trades.

→ See detailed instructions
2

Set Up Discord Notifications

Get trade alerts sent directly to your Discord server.

→ See detailed instructions
3

Get API Keys

Obtain API keys for OpenAI (AI features) and FMP (market data).

→ See detailed instructions
4

Configure Settings

Add all your API keys and configure trading preferences.

→ Go to Settings page
5

Start Trading!

Run the bot and watch it execute your strategies automatically.

→ See how to run the bot

Detailed Setup Instructions

How do I get a Tradier account and API token?

Tradier is the brokerage platform that executes your trades. Here's how to set it up:

Step 1: Create Account

  1. Go to tradier.com
  2. Click "Open Account"
  3. Choose account type:
    • Sandbox (Free) - For testing/paper trading (recommended to start)
    • Live Account - For real money trading (requires funding)
  4. Complete the application (takes 5-10 minutes)
  5. Fund account if using live trading (minimum varies)

Step 2: Get API Token

  1. Log into your Tradier account
  2. Go to My Account → API Access
  3. Click "Create New Token" or "Generate Token"
  4. Give it a name (e.g., "ATMA Bot")
  5. Copy the token (long alphanumeric string)
  6. Important: Save this token - you won't see it again!

Step 3: Add to Dashboard

  1. Go to Settings page
  2. Click the "API Keys" tab
  3. Find "Tradier API Token" field
  4. Paste your token
  5. Click "Save API Keys"
  6. Restart the Flask server

💡 Pro Tip: Start with a Sandbox account to test the bot without risking real money. Once you're comfortable, upgrade to a live account.

How do I set up Discord notifications?

Discord notifications keep you updated on all trades and bot activity in real-time.

Step 1: Create Discord Server (if needed)

  1. Open Discord app or go to discord.com
  2. Click the "+" button on left sidebar
  3. Choose "Create My Own"
  4. Name it (e.g., "Trading Bot")
  5. Click "Create"

Step 2: Create Webhook

  1. Right-click on the channel you want notifications in (e.g., #general)
  2. Select "Edit Channel"
  3. Go to "Integrations" tab
  4. Click "Create Webhook" or "New Webhook"
  5. Give it a name (e.g., "Trading Bot")
  6. Optional: Upload a custom avatar
  7. Click "Copy Webhook URL"
  8. Click "Save Changes"

Step 3: Add to Dashboard

  1. Go to Settings page
  2. Click the "API Keys" tab
  3. Find "Discord Webhook URL" field
  4. Paste your webhook URL
  5. Click "Save API Keys"
  6. Restart the Flask server

Example Webhook URL:

https://discord.com/api/webhooks/123456789/AbCdEfGhIjKlMnOpQrStUvWxYz

✅ Test It: After setup, run a test trade. You should see a message appear in your Discord channel!

How do I get OpenAI and FMP API keys?

🤖 OpenAI API Key

Purpose: Powers AI features (Pine Script generation, analytics chat)

Steps:
  1. Go to platform.openai.com
  2. Sign up or log in
  3. Go to "API keys" in the menu
  4. Click "Create new secret key"
  5. Name it (e.g., "Trading Bot")
  6. Copy the key (starts with sk-)
  7. Important: Save immediately - can't view it again!

💰 Cost: Free $5 credit for new accounts. After that, pay-as-you-go (~$0.01-0.05 per Pine Script generation).

📊 Financial Modeling Prep API Key

Purpose: Downloads historical market data for strategy testing

Steps:
  1. Go to financialmodelingprep.com
  2. Click "Get Started" or "Sign Up"
  3. Create a free account
  4. Verify your email
  5. Go to "Dashboard" or "API Keys"
  6. Copy your API key

✅ Free Tier: 250 API calls per day (plenty for casual use). Paid plans available for heavy use.

Adding Keys to Dashboard:
  1. Go to Settings page
  2. Click "API Keys" tab
  3. Paste OpenAI key in "OpenAI API Key" field
  4. Paste FMP key in "Financial Modeling Prep API Key" field
  5. Click "Save API Keys"
  6. Restart Flask server

How do I start the trading bot?

Once you've configured everything, here's how to run the bot:

Start the Dashboard:

python dashboard.py

Then open: http://localhost:8080

Start the Trading Bot (in a new terminal):

python spy_tradier_webhook.py

This script executes trades based on webhook signals

Start Position Monitor (in another terminal):

python position_monitor.py

This monitors open trades and executes exit orders

⚠️ Important: Keep all three terminals running while trading. Use Ctrl+C to stop any script.

How do I install dependencies?

Install Python Dependencies:

pip install -r requirements.txt

Main Dependencies Include:

  • Flask - Web dashboard framework
  • pandas - Data manipulation
  • requests - API calls
  • python-dotenv - Environment variables
  • openai - AI features
  • plotly - Charts and analytics

💡 Pro Tip: Use a virtual environment to keep dependencies isolated:

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt

Common Issues & Solutions

Issue: "Module not found" error

Solution: Install missing dependencies:

pip install -r requirements.txt

Issue: "API key not configured"

Solution: Add API keys to Settings page and restart server

Issue: Trades not executing

Solutions:

  • Check if Tradier token is valid
  • Verify market is open (9:30 AM - 4:00 PM ET)
  • Check if bot scripts are running
  • Review logs for error messages

Issue: Discord notifications not working

Solution: Verify webhook URL is correct and server is restarted

Issue: Dashboard not loading

Solutions:

  • Check if Flask server is running
  • Try: http://127.0.0.1:8080
  • Check for port conflicts
  • Review terminal for error messages

Security Best Practices

🔐 Important Security Rules:

  • Never share your API keys with anyone
  • Never commit .env file to git
  • Use strong passwords for dashboard login
  • Start with paper trading before using real money
  • Set trading limits (max daily loss, position size)
  • Monitor regularly - check trades daily
  • Keep software updated - pull latest changes regularly

💡 Recommended: Use the Settings page to configure max daily loss and position size limits to protect your account.

Still Need Help?

If you're stuck or have questions not covered here:

📧 Check the documentation files in your project folder

🔍 Review the terminal logs for error messages

⚙️ Double-check all Settings are configured correctly