Stock-Market-Analysis-Streamlit is a Python application that leverages Streamlit to provide interactive visualizations and insights into stock market data. Utilizing the Alpaca API, this app fetches and displays data on top active stocks by volume and top market movers, including gainers and losers.
- Top Active Stocks by Volume: Displays the top 10 stocks with the highest trading volume. Visualizes this data using bar charts to show both trade count and volume.
- Top Market Movers: Provides insights into the top 10 market movers, separating them into gainers and losers. Displays this information in tabular format.
-
Clone the repository:
git clone https://github.com/yourusername/Stock-Market-Analysis-Streamlit.git
-
Navigate to the project directory:
cd Stock-Market-Analysis-Streamlit
-
Install the required dependencies:
pip install -r requirements.txt
-
Create a
config.py
file: Ensure you have aconfig.py
file in the project directory with your Alpaca API credentials:API_KEY = 'your_alpaca_api_key' SECRET_KEY = 'your_alpaca_secret_key'
-
Run the Streamlit app:
streamlit run app.py
-
Navigate to the local server URL: The app will be available at
http://localhost:8501
or the URL provided in the terminal.
app.py
: The main script that contains theTradingClass
which interacts with the Alpaca API to fetch stock data and visualize it using Streamlit.scan_for_most_active_stocks()
: Retrieves and displays the top 10 stocks by volume.scan_for_top_market_mover_stocks()
: Retrieves and displays top market movers categorized into gainers and losers.
- Python 3.x
- requests
- streamlit
- pandas
- matplotlib
- Ensure your Alpaca API credentials are correctly set in
config.py
. - This app is intended for educational and demonstration purposes.
This project is licensed under the MIT License.