- Python 3.9+
- Dependencies:
pandas,requests,pyyaml,yfinance,python-dotenv - Email Configuration: Gmail App Password required in
.env. - News Sentiment (Optional): Local fallback scoring is built in (no external LLM key required).
- AI Trading Bot: Remote trained-model inference endpoint URL in
.envor GitHub secrets.
- Move the
trading_botfolder to your desired location (e.g., home folder). pip install -r requirements.txt.- Fill in your email credentials in
.env. - Create
.envfrom the template and paste your keys:cp .env.example .env
- AI trading endpoint:
TRAINED_MODEL_INFERENCE_URLpoints the AI trading bot at the hosted trained-model service.TRAINED_MODEL_API_KEYoptionally protects that endpoint.- Do not commit
.env(it is gitignored).
The bot is fully automated:
- Start Scheduler:
python3 scheduler.py - Automated Cycle:
- Checks for Wi-Fi and 8 AM start time.
- Runs
main.py(Price/News Ingest -> Features -> Train -> Backtest). - Sends Daily Email Report (combined pipeline + backtest details).
- Updates Meta-Learner state.
Use the backtesting engine for historical runs and PineScript-ready strategy configuration.
- Runner:
python3 backtesting_runner.py backtest - Config:
backtesting/config.yaml - Dependencies:
backtesting/requirements.txt
Note: PineScript translation is a placeholder; set strategy.type: pine with a script path when ready.
- State: Positions are tracked in
data/trading_bot.db. - Learning: Adaptations are saved in
meta_learner_state.json. - Logs: View progress in
scheduler.log.
- No Email: Verify
SENDER_EMAILandSENDER_PASSWORDin.env. - No Data: Ensure internet connection is active (Wi-Fi check).
- AI Strategy Not Trading:
- If the trained-model endpoint call fails, the run continues but new AI entries are blocked.
- Check that
TRAINED_MODEL_INFERENCE_URLis set and the hosted service is healthy.