I need a straightforward Python bot that connects to MetaTrader and applies a mean-reversion strategy to index symbols. The goal is a lean, reliable foundation I can later expand, so please focus on clean structure and clear documentation rather than complex bells and whistles. Core requirements • Build in Python and link to MetaTrader (MT4 or MT5 is fine) using the standard MetaTrader5/MetaTrader-Python API. • Trade only on indices—no currencies or commodities—using a configurable mean-reversion logic (look-back window, entry threshold, exit criteria). • Execute market or limit orders, then manage each position with basic risk controls: position size parameter, stop-loss, and take-profit. • Log every trade decision, order response, and error to console and file for easy debugging. Deliverables 1. Well-commented Python script(s) ready to run. 2. A simple config or JSON file so I can tweak symbols, thresholds, and risk parameters without touching the code. 3. README that walks through installation, MetaTrader connection setup, and a quick test run. Keep external libraries light—pandas, numpy, MetaTrader5, and logging are all that’s really needed. Once the bot places live (or demo) trades on an index and follows the specified risk rules, the job is done.