This repository contains a Flask-based API (app.py) and CLI (predict.py) that leverages financial data and generative AI to provide intelligent stock options trade recommendations.
Clone the project repository:
git clone https://github.com/mouratony/OptionsAI.git
cd OptionAI_ProjectWe recommend using Miniconda to manage dependencies.
If you don't have Miniconda installed, use the provided shell scripts according to your Mac's processor:
Intel-based Mac:
chmod +x setup_intel_mac.sh
./setup_intel_mac.shApple Silicon (M-chip) Mac:
chmod +x setup_mchip_mac.sh
./setup_mchip_mac.shManual Conda Setup (Alternative method):
conda create -n OptionAI_env python=3.10
conda activate OptionAI_env
pip install -r requirements.txtCreate a .env file in the project's root directory to securely store your API keys. Your .env file structure:
ALPHA_VANTAGE_API_KEY=your_alpha_vantage_api_key
GEMINI_API_KEY=your_google_gemini_api_key
FRED_API_KEY=your_fred_api_keyGet your own API keys from:
Start the Flask API server:
conda activate OptionAI_env
python app.py⚠️ Important: Only one process can listen on a specific port at a time. If app.py fails to run due to a port conflict, ensure no other processes or applications use the same port (default: 8002). If necessary, adjust the port number in the app.py file.
In a separate terminal window, run the CLI tool:
conda activate OptionAI_env
python predict.py-
API Limitations:
Some stock tickers may lack certain information due to unavailable data from APIs. In this early-stage version, attempting to query incomplete data may result in errors or incomplete recommendations. -
Buying Power Limitations:
When using very low buying power as input, the AI model may generate suboptimal or unrealistic trade recommendations to fit within the limited budget. To ensure meaningful and reliable trade suggestions, it's best to provide a realistic buying power amount that aligns closely with actual trading scenarios. -
Future Updates:
We're planning future enhancements that allow users to specify investment goals or strategies. You'll soon be able to indicate whether you're looking for quick profits, long-term investments, day trading strategies, short positions, or specific return targets (e.g., doubling or tripling your investment). Stay tuned!
OptionAI_Project/
├── app.py
├── predict.py
├── requirements.txt
├── setup_intel_mac.sh
├── setup_mchip_mac.sh
└── .env