Skip to content

L1ZLe/Quantitative_Electricity

Repository files navigation

QUANTITATIVE_ELECTRICITY

► An advanced platform for forecasting electricity prices and developing trading strategies. Link to the web app: (https://quantitative-electricity.streamlit.app/)

license last-commit repo-top-language repo-language-count

Developed with the software and tools below.

Python


🔗 Quick Links


📍 Overview

► Welcome to the Electricity Trading Strategy Project! This platform provides comprehensive tools and models to forecast electricity prices and develop trading strategies. We utilize advanced machine learning models including SARIMA and GRU to predict price movements and assess trading strategies. Explore live predictions, backtesting tools, and performance metrics to understand and improve trading strategies in the electricity market.


📦 Features

► Explore a range of features designed to enhance your trading strategy:

  • Model Overview: Detailed descriptions of the models used for forecasting electricity prices.
  • Data Exploration: Interactive visualizations of historical electricity prices and influencing factors.
  • Predictions: Live forecasts of next-day electricity prices using various models.
  • Trading Strategy: Insights into the logic and implementation of trading strategies.
  • Performance Metrics: Evaluation of strategies using metrics such as Sharpe ratio, ROI, and more.
  • Backtesting: Assess the performance of strategies on historical data.

📂 Repository Structure

└── Quantitative_Electricity/
    ├── README.md
    ├── app.py
    ├── assets
    │   ├── ARIMA_predictions.png
    │   ├── Average Electricity price by Month.png
    │   ├── BOS.png
    │   ├── Correlations between variables1.png
    │   ├── Correlations between variables2.png
    │   ├── Electricity seasonal decomposition.png
    │   ├── LinearRegression.png
    │   ├── Natural Gas seasonal decomposition.png
    │   ├── Net_generated electricity and Temperature.png
    │   ├── PACF_ACF.png
    │   ├── RandomForest.png
    │   ├── Relation between Electricity price and Temperature.png
    │   ├── gru_predictions.png
    │   └── lstm_predictions.png
    ├── datasets
    │   ├── Data_cleaned_Dataset.csv
    │   ├── Net_generation_United_States_all_sectors_monthly.csv
    │   ├── Net_generation_by places.csv
    │   └── Retail_sales_of_electricity_United_States_monthly.csv
    ├── model_module.py
    ├── models
    │   ├── price_ARIMA_model.pkl
    │   ├── price_gru_model.h5
    │   ├── price_lstm_model.h5
    │   ├── scaler.pkl
    │   ├── sign_LSTM_model.keras
    │   ├── sign_gru_model.keras
    │   ├── sign_linearRegression_model.pkl
    │   └── sign_randomForest_model.pkl
    ├── requirements.txt
    ├── trading_strategies.py
    └── visualizations.py

🧩 Modules

.
File Summary
model_module.py ► Contains functions for model training and predictions.
visualizations.py ► Generates interactive visualizations for data exploration.
trading_strategies.py ► Implements various trading strategies based on predictions.
app.py ► Main entry point for running the Streamlit application.

⚙️ Installation

  1. Clone the Quantitative_Electricity repository:
git clone https://github.com/L1ZLe/Quantitative_Electricity
  1. Change to the project directory:
cd Quantitative_Electricity
  1. Install the dependencies:
pip install -r requirements.txt

🤖 Running Quantitative_Electricity

Use the following command to run Quantitative_Electricity:

streamlit run app.py

🛠 Project Roadmap

  • ► Initial setup and model development
  • ► Implementation of trading strategies
  • ► Enhance user interface and visualizations
  • ► Deploy and monitor application

🤝 Contributing

Contributions are welcome! Here are several ways you can contribute:

  • Join the Discussions: Share your insights, provide feedback, or ask questions.
  • Report Issues: Submit bugs found or log feature requests for Quantitative_Electricity.
Contributing Guidelines
  1. Fork the Repository: Start by forking the project repository to your GitHub account.
  2. Clone Locally: Clone the forked repository to your local machine using a Git client.
    git clone https://github.com/L1ZLe/Quantitative_Electricity
  3. Create a New Branch: Always work on a new branch, giving it a descriptive name.
    git checkout -b new-feature-x
  4. Make Your Changes: Develop and test your changes locally.
  5. Commit Your Changes: Commit with a clear message describing your updates.
    git commit -m 'Implemented new feature x.'
  6. Push to GitHub: Push the changes to your forked repository.
    git push origin new-feature-x
  7. Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.

Once your PR is reviewed and approved, it will be merged into the main branch.


📄 License

This project is protected under the MIT License. For more details, refer to the LICENSE file.


👏 Acknowledgments

  • Pandas: For providing the data manipulation tools.
  • TensorFlow: For enabling deep learning models.
  • Streamlit: For allowing easy deployment of the web application.
  • eia.gov: For providing electricity data.

Thank you for exploring Quantitative_Electricity. We hope you find it valuable for your trading strategy development!

```