Skip to main content

provide technical analysis of financial markets

Project description

Technical Analysis Project

A Python-based project for performing technical analysis on financial data. This project includes various indicators and strategies, along with backtesting capabilities.

Features

  • Volume-Price Divergence Signal
  • Bollinger Bands, ATR, Stochastic Oscillator
  • Fibonacci Retracement Levels
  • Sharpe Ratio Calculation
  • Portfolio Performance Visualization with Plotly

Installation

  1. Clone the repository:

    git clone https://github.com/charleschou99/TechnicalAnalysis.git
    cd TechnicalAnalysis
    
  2. Install the required packages:

    pip install -r requirements.txt
    

Usage

1. Backtest a Trading Strategy

Run the backtest_volume_signal.py script to backtest the volume-price divergence strategy on a stock (e.g., AMD):

python backtest_volume_signal.py

Example Output:

Final Portfolio Value: $12,345.67
Total Profit: $2,345.67
Return: 23.46%
Sharpe Ratio: 1.45

2. Customize Backtest Parameters

You can modify the ticker, time range, and initial capital in backtest_strategy:

backtest_strategy(ticker="AMD", start_date="2022-11-01", end_date="2023-11-01", initial_capital=10000)

3. Visualize Portfolio Performance

After running the backtest, a Plotly graph will appear, showing:

  • Portfolio Value over time
  • Cash Balance
  • Stock Holdings Value

Project Structure


├── dataGetter                  # Data retrieval from Yahoo Finance (v0)
├── signal                      # Signal generation scripts
├── backtest                    # Backtest and example script
├── tests                       # Example script for base functions
├── requirements.txt            # Python package dependencies
├── README.md                   # Project documentation

Dependencies

Install all dependencies with:

pip install -r requirements.txt

License

This project is licensed under the MIT License.


Feel free to contribute, report issues, or suggest improvements!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

charles_chou_technicalanalysis-0.1.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file charles_chou_technicalanalysis-0.1.0.tar.gz.

File metadata

File hashes

Hashes for charles_chou_technicalanalysis-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d250e8155a4ea0dff309081bcc9bdc5fb41ddf0021bb3d86e1b5a8a8eb5db67a
MD5 9e9145e21650d66ae55437c95e52177f
BLAKE2b-256 ff0caacf1ccfb06fc967bdbdbbda620e62ef94cf6c26144dc840652e94bc14df

See more details on using hashes here.

File details

Details for the file charles_chou_technicalanalysis-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for charles_chou_technicalanalysis-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 431fd983b406cd790fcabfc391038538163c19274235d57e44ccf54f5d123066
MD5 b76e8e43d89e79a1827522d6d9e306e5
BLAKE2b-256 51212373236ce4f46f15dd2e684fd7105d386415c6e7adc69c08b22c96651b17

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page