A Python-based stock tracking bot that monitors specified stocks and sends notifications based on price limits.
StockFXBot allows users to track stock prices and receive notifications when stocks reach specified thresholds. This bot is designed for users who want to stay updated on their investments effortlessly.
To install and run the StockFXBot, follow these steps:
-
Clone the repository:
git clone https://github.com/yourusername/StockFXBot.git cd StockFXBot -
Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate -
Install the required packages:
pip install -r requirements.txt
-
Set up the environment variables. Create a
.envfile in the root directory and add your API key:API_KEY=your_api_key_here
To run the bot, use the following command:
```bash
python3 bot_loop.py
```
Once the bot is activated, it will start tracking the stocks specified in stocks.txt and will log notifications to the notifications.log file based on the limits you set.
-
Modify
stocks.txt: This file should contain the stocks you want to track and their respective price limits. Use the following format:TICKER, lower_limit, upper_limit AAPL, 130, 150 GOOGL, 2500, 2800
-
Logging Notifications: Notifications will be logged in
notifications.log. You can check thenotifications.logfile for updates on stock price movements and any notifications logged by the bot.
-
Python 3.9 or higher
-
Required Python packages listed in
requirements.txt
To run the StockFXBot in a Docker container, follow these steps:
-
Build the Docker image:
docker build -t stockfxbot . -
Run the Docker container:
docker run --env-file .env stockfxbot
Make sure your .env file is located in the same directory as your Dockerfile to ensure that the environment variables are properly passed to the container.