What is Algorithmic Trading?
Algorithmic trading means using computer programs to execute trades based on predefined rules. Instead of watching charts and clicking buttons, you write code that does it for you. The rules can be as simple as "buy when RSI drops below 30" or as complex as machine learning models analyzing dozens of features.
The key advantage is consistency. A bot never gets emotional, never hesitates, and never takes a revenge trade after a loss. It executes the same strategy 24 hours a day with zero deviation.
Do You Need to Be a Programmer?
You need basic Python skills — not expert-level. If you can write a for loop and call an API, you can build a trading bot. This guide assumes you know the basics and walks you through the rest.
Skill checklist
- Variables, loops, and conditionals in Python
- Installing packages with
pip - Making HTTP requests (we will teach this part)
- Basic understanding of what a stock price chart shows
The 5 Components of Every Trading Bot
1. Data Source
Real-time price and indicator data. This is what the TickAtlas API provides — pre-calculated indicators so you do not need to compute RSI or MACD yourself.
2. Strategy Logic
The rules that decide when to buy, sell, or do nothing. Start simple. A two-indicator confluence strategy beats a complex system you do not understand.
3. Risk Management
How much to risk per trade, where to place stops, and when to cut losses. This is more important than the strategy itself.
4. Execution
Connecting to your broker or exchange to place actual orders. Many brokers provide Python APIs.
5. Logging and Monitoring
Recording every decision and trade so you can review performance and debug issues.
Your First Strategy: RSI Mean Reversion
The simplest profitable strategy for beginners is RSI mean reversion. When RSI (Relative Strength Index) drops below 30, the instrument is oversold and likely to bounce. When it rises above 70, it is overbought and likely to pull back.
import requests
import time
API_KEY = "your_api_key_here"
BASE_URL = "https://tickatlas.com/v1"
def check_rsi(symbol: str, timeframe: str = "H1") -> dict:
"""Fetch RSI from the TickAtlas API."""
resp = requests.get(f"{BASE_URL}/indicators", params={
"symbol": symbol,
"timeframe": timeframe,
}, headers={"X-API-Key": API_KEY})
resp.raise_for_status()
return resp.json()
def simple_rsi_strategy(rsi_value: float) -> str:
"""The simplest possible strategy."""
if rsi_value < 30:
return "BUY"
elif rsi_value > 70:
return "SELL"
return "HOLD" Understanding the API Response
When you call the indicators endpoint, you get back structured data that is easy to parse:
// GET /v1/indicators?symbol=EURUSD&timeframe=H1
{
"success": true,
"data": {
"symbol": "EURUSD",
"timeframe": "H1",
"indicators": {
"RSI_14": 27.4
},
"updated_at": 1787229614
}
}
Each indicator is returned as a raw number under its key (for example RSI_14); a bot applies its own thresholds to that number.
Putting It All Together
def run_first_bot():
symbols = ["EURUSD", "GBPUSD", "USDJPY"]
print("Starting RSI bot...")
while True:
for symbol in symbols:
try:
data = check_rsi(symbol)
rsi = data["data"]["indicators"]["RSI_14"]
signal = simple_rsi_strategy(rsi)
print(f"{symbol}: RSI={rsi:.1f} -> {signal}")
if signal == "BUY":
print(f" >>> BUY SIGNAL on {symbol}!")
# In production: place order via broker API
elif signal == "SELL":
print(f" >>> SELL SIGNAL on {symbol}!")
except Exception as e:
print(f"Error on {symbol}: {e}")
print("---")
time.sleep(3600) # Check every hour
if __name__ == "__main__":
run_first_bot() The Beginner's Roadmap
Do not try to build everything at once. Follow this sequence:
- Week 1: Get the API working. Fetch data, print it, understand the response format. Start here.
- Week 2: Code a simple RSI strategy. Run it in paper-trading mode (log signals, do not execute).
- Week 3: Backtest your strategy on historical data. Check if it actually makes money.
- Week 4: Add a second indicator for confirmation (MACD or Bollinger Bands). Read our top 10 indicators guide.
- Week 5+: Connect to a broker API, add risk management, and go live with minimal size.
Mistakes Every Beginner Makes
Starting with live money
Paper trade for at least a month. Your first bot will have bugs. Better to discover them with fake money.
Over-optimizing the strategy
If your strategy has 15 parameters, it is curve-fitted to the past and will fail in the future. Two or three indicators is enough.
Skipping risk management
A 50% win rate with a 2:1 reward-to-risk ratio is profitable. A 90% win rate with no stop loss will blow up your account.
Not logging trades
If you cannot review what the bot did and why, you cannot improve it. Log everything.
Recommended Next Steps
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.