Automated trading eliminates emotion and executes strategies consistently. In this tutorial, we build a Python trading bot from scratch using the TickAtlas API for real-time indicator data.
Why Automate?
Manual trading is subject to emotional bias, fatigue, and inconsistency. An automated bot executes the same strategy 24/5, never hesitates on entries, and never revenge-trades after a loss.
Always watching the market
No hesitation on signals
Strategy discipline
Architecture
Python Bot (runs in loop)
|-- Fetch indicators from TickAtlas API
|-- Evaluate strategy rules
|-- Generate buy/sell signals
|-- Execute via broker API (OANDA, Interactive Brokers, etc.)
|-- Log trades and performance The Strategy: RSI + MACD Confluence
Our bot uses a simple but effective confluence strategy:
- Buy signal: RSI crosses above 30 (leaving oversold) AND MACD histogram turns positive
- Sell signal: RSI crosses below 70 (leaving overbought) AND MACD histogram turns negative
- Stop loss: 2x ATR below entry (for longs)
- Take profit: 3x ATR above entry (1.5:1 reward-to-risk)
Key Components
1. API Client
Wrapper around the TickAtlas REST API with error handling and rate limit awareness.
2. Strategy Engine
Evaluates indicator values against your rules and generates signals.
3. Risk Manager
Calculates position size based on ATR and account risk percentage.
4. Execution Layer
Connects to your broker's API (OANDA, Interactive Brokers, etc.).
5. Logger
Records every signal, trade, and error for performance analysis.
Full Tutorial
For the complete implementation with code, see our detailed step-by-step guide:
Run this against live data.
Every account starts pay-as-you-go with $2.50 of credit and no card. Paste the key into the samples above and the requests work unchanged.