Skip to content

Add TradeLocker automated trading bot with EMA/RSI/ATR strategy#26

Open
TheBrimberry wants to merge 1 commit intocodewithdark-git:mainfrom
TheBrimberry:claude/trading-bot-tradelocker-JnBDS
Open

Add TradeLocker automated trading bot with EMA/RSI/ATR strategy#26
TheBrimberry wants to merge 1 commit intocodewithdark-git:mainfrom
TheBrimberry:claude/trading-bot-tradelocker-JnBDS

Conversation

@TheBrimberry
Copy link

Summary

This PR introduces a complete automated trading bot for TradeLocker (Atlas Funded Accounts) that implements an EMA crossover strategy with RSI confirmation and ATR-based risk management.

Key Changes

  • TradeLocker API wrapper (tradelocker_api.py): Handles JWT authentication with automatic token refresh, candle/quote fetching, order placement, and position management via REST API
  • Main bot loop (bot.py): Polling-based trading engine that evaluates signals, sizes positions, and executes trades with proper error handling and logging
  • Technical indicators (indicators.py): Pure-Python implementations of EMA, RSI, and ATR with signal generation logic (EMA crossover + RSI momentum filter)
  • Risk manager (risk_manager.py): Enforces Atlas compliance rules including per-trade risk limits (0.5%), daily loss ceiling (2%), total drawdown cap (4%), and max concurrent positions (2)
  • Session filter (session_filter.py): Restricts trading to high-liquidity windows (London 07-12 UTC, New York 13-17 UTC)
  • Configuration (config.py): Centralized settings for API credentials, strategy parameters, risk limits, and trading symbols
  • Documentation (README.md): Setup instructions, strategy overview, and usage guide

Notable Implementation Details

  • Token management: Automatic refresh 5 minutes before expiry to prevent auth failures mid-cycle
  • Position sizing: Risk-based lot calculation using ATR distance and configurable pip values
  • Daily reset: Risk manager tracks daily balance separately and resets at midnight UTC
  • Duplicate prevention: Tracks open instrument IDs to avoid re-entry on the same symbol within a cycle
  • Graceful degradation: Logs warnings for missing instruments/data rather than crashing; continues with available symbols
  • Dual logging: Output to both stdout and persistent bot.log file for monitoring and debugging

https://claude.ai/code/session_01AVzJhsgKbFEDqP5nboYkA1

EMA(9/21) crossover strategy with RSI(14) confirmation and ATR-based
dynamic SL/TP. Built-in Atlas risk rules: 0.5% per-trade risk,
2% daily loss cap, 4% total drawdown ceiling, max 2 concurrent positions.
Trades only during London/NY sessions for maximum liquidity.

https://claude.ai/code/session_01AVzJhsgKbFEDqP5nboYkA1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants