/Binance

Binance automated stock investments and portfolio management through Options Trading

Primary LanguagePython

Automated Binance API Options Trader

This project is an Automated Binance API Options Trader, designed to interact with the Binance API for options trading. It includes modules for data fetching, trade execution, risk management, and tracking of options trades.

Directory Structure

Binance/
└── Options/
    ├── .env
    ├── .gitignore
    ├── Dockerfile
    ├── README.md
    ├── requirements.txt
    ├── src/
    │   ├── __init__.py
    │   ├── main.py
    │   ├── api/
    │   │   ├── __init__.py
    │   │   ├── binance_api.py
    │   │   └── auth.py
    │   ├── trading/
    │   │   ├── __init__.py
    │   │   ├── strategy.py
    │   │   ├── execution.py
    │   │   ├── risk_management/
    │   │   │   ├── __init__.py
    │   │   │   ├── stop_loss.py
    │   │   │   ├── position_sizing.py
    │   │   │   ├── diversification.py
    │   │   │   ├── hedging.py
    │   │   │   ├── risk_parity.py
    │   │   │   ├── var.py
    │   │   │   ├── cvar.py
    │   │   │   ├── stress_testing.py
    │   │   │   ├── scenario_analysis.py
    │   │   │   ├── sharpe_ratio_optimization.py
    │   │   │   ├── drawdown_control.py
    │   │   │   ├── portfolio_rebalancing.py
    │   │   │   ├── dynamic_hedging.py
    │   │   │   ├── algo_risk_management.py
    │   │   │   ├── risk_limits_alerts.py
    │   │   │   ├── statistical_arbitrage.py
    │   │   │   ├── beta_hedging.py
    │   │   │   ├── credit_risk.py
    │   │   │   ├── liquidity_risk.py
    │   │   │   ├── regulatory_compliance.py
    │   │   │   ├── algorithmic_throttling.py
    │   │   │   ├── market_sentiment_analysis.py
    │   │   │   ├── transaction_cost_analysis.py
    │   │   │   ├── counterparty_risk.py
    │   │   │   ├── esg_risk.py
    │   │   │   ├── hft_risk_controls.py
    │   │   │   ├── risk_overlay.py
    │   │   │   ├── factor_exposure.py
    │   │   ├── options_trading/
    │   │   │   ├── __init__.py
    │   │   │   ├── options_data_fetcher.py
    │   │   │   ├── options_execution.py
    │   │   │   ├── options_tracking.py
    │   ├── data/
    │   │   ├── __init__.py
    │   │   ├── data_fetcher.py
    │   │   ├── data_processor.py
    │   │   ├── database.py
    │   │   └── metrics.py
    │   ├── ml/
    │   │   ├── __init__.py
    │   │   ├── model.py
    │   │   ├── train.py
    │   │   └── evaluate.py
    │   ├── utils/
    │   │   ├── __init__.py
    │   │   ├── logger.py
    │   │   ├── config.py
    │   │   └── notifier.py
    ├── tests/
    │   ├── __init__.py
    │   ├── test_binance_api.py
    │   ├── test_strategy.py
    │   ├── test_execution.py
    │   ├── test_risk_management/
    │   │   ├── __init__.py
    │   │   ├── test_stop_loss.py
    │   │   ├── test_position_sizing.py
    │   │   ├── test_diversification.py
    │   │   ├── test_hedging.py
    │   │   ├── test_risk_parity.py
    │   │   ├── test_var.py
    │   │   ├── test_cvar.py
    │   │   ├── test_stress_testing.py
    │   │   ├── test_scenario_analysis.py
    │   │   ├── test_sharpe_ratio_optimization.py
    │   │   ├── test_drawdown_control.py
    │   │   ├── test_portfolio_rebalancing.py
    │   │   ├── test_dynamic_hedging.py
    │   │   ├── test_algo_risk_management.py
    │   │   ├── test_risk_limits_alerts.py
    │   │   ├── test_statistical_arbitrage.py
    │   │   ├── test_beta_hedging.py
    │   │   ├── test_credit_risk.py
    │   │   ├── test_liquidity_risk.py
    │   │   ├── test_regulatory_compliance.py
    │   │   ├── test_algorithmic_throttling.py
    │   │   ├── test_market_sentiment_analysis.py
    │   │   ├── test_transaction_cost_analysis.py
    │   │   ├── test_counterparty_risk.py
    │   │   ├── test_esg_risk.py
    │   │   ├── test_hft_risk_controls.py
    │   │   ├── test_risk_overlay.py
    │   │   ├── test_factor_exposure.py
    │   ├── test_options_trading/
    │   │   ├── __init__.py
    │   │   ├── test_options_data_fetcher.py
    │   │   ├── test_options_execution.py
    │   │   ├── test_options_tracking.py
    ├── .github/
    │   ├── workflows/
    │   │   ├── ci.yml
    │   │   └── cd.yml

Installation

  1. Clone the repository:
git clone <repository_url>
cd Binance/Options
  1. Create a virtual environment and activate it:
python -m venv venv
source venv/bin/activate  # On Windows, use `venv\Scripts�ctivate`
  1. Install the required dependencies:
pip install -r requirements.txt

Configuration

Create a .env file in the root directory and add your Binance API credentials:

API_KEY=your_api_key
API_SECRET=your_api_secret

Usage

  1. Start the application:
python src/main.py

Running Tests

To run the tests, use the following command:

pytest

Docker

To build and run the application using Docker:

  1. Build the Docker image:
docker build -t binance-options-trader .
  1. Run the Docker container:
docker run -d binance-options-trader

Contributing

Contributions are welcome! Please create a pull request with your changes.

License

This project is licensed under the MIT License.