WORK IN PROGRESS
This repository is a group project for CPE-595 that leverages the Alpaca API to fetch cryptocurrency/stock data and uses three different machine learning algorithms to analyze and predict market trends. The project includes data fetching, preprocessing, and training.
- Fetch crypto/stock data using the Alpaca API
- Preprocess data for machine learning
- Train model to predict stock prices
- Visualize actual vs predicted stock prices
- Python 3.8+ (please note that this project uses tensorflow and at the time of writing this, only supports Python 3.9-3.12)
- Alpaca API key and secret
- Required Python packages (listed in
requirements.txt
)
-
Clone the repository:
git clone https://github.com/yourusername/alpaca-ml-crypto-stock-analysis.git cd alpaca-ml-crypto-stock-analysis
-
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate
-
Install the required packages:
pip install -r requirements.txt
-
Create a .env file in the root directory and add your Alpaca API credentials:
ALPACA_API_KEY=your_api_key ALPACA_SECRET_KEY=your_secret_key
-
Run the main script:
python main.py
-
The script will fetch cryptocurrency data for BTC/USD, train an LSTM model, and plot the actual vs predicted stock prices.
- main.py: Main script to fetch data, train the model, and visualize results.
- requirements.txt: List of required Python packages.
This project is licensed under the MIT License. See the LICENSE
file for details.