Skip to main content

The package is designed to signal traders, and thus helping with streamlining investment decision-making and optimizing trading strategies.

Project description

traders_copilot_mzza_25

Documentation Status

This package is a streamlined application designed to assist in investment decision-making. It provides trading signals for stock markets by leveraging two key technical indicators: Simple Moving Average (SMA), which smooths price data to identify trends, and Relative Strength Index (RSI), which measures the speed and magnitude of price movements to determine overbought or oversold conditions.

Contributors

Mingyang Zhang, Zanan Pech, Ziyuan Zhao and Abeba Nigussie Turi

Installation

  1. Clone the Repository git clone https://github.com/UBC-MDS/traders_copilot_mzza_25.git cd traders_copilot_mzza_25

  2. Install the Package: $ pip install traders_copilot_mzza_25

Features

traders_copilot_mzza_25 package is a specialized tool for traders and investors fitting into a Python ecosystem of a similar vein. The package augments the existing trading and financial analysis packages like TA-Lib, Backtrader, and PyAlgoTrade by combining trading signal generation, strategy optimization, and built-in visualization tools into one place for a comprehensive trading workflow.

  • simulate_market_data: Simulates stock market data for analysis and testing.
  • Technical Indicators: Implements:
    • Simple Moving Average (SMA): Smooths price data to identify trends.
    • Relative Strength Index (RSI): Measures the speed and magnitude of price movements to assess overbought/oversold conditions.
  • generate_signals: Identifies buy/sell signals based on SMA and RSI thresholds:
    • Buy Signal:
      • SMA_50 > SMA_200 (short-term trend is stronger)
      • RSI < 30 (stock is oversold)
    • Sell Signal:
      • SMA_50 < SMA_200 (long-term trend is stronger)
      • RSI > 70 (stock is overbought)
  • plot_signals: Visualizes stock data with buy/sell signals marked on the chart.

Usage

traders_copilot_mzza_25 can be used to simulate market data, generate trading signals, and visualize results. Here are examples of usage:

Simulate Market Data

from traders_copilot_mzza_25 import simulate_market_data

data = generate_synthetic_data("2021-01-01", "2021-12-31", num_records=252, seed=40)
print(data.head())

Calculate Indicators

from traders_copilot_mzza_25 import calculate_sma, calculate_rsi

data = pd.DataFrame({'Close': [100, 102, 104, 106, 108]})
result = calculate_sma(data, window=3)
print(result['SMA_3'])

data = pd.DataFrame({'Close': [100, 102, 104, 106, 108]})
result = calculate_rsi(data, window=3)
print(result['RSI'])

Generate Trading Signals

from traders_copilot_mzza_25 import generate_signals

data = pd.DataFrame({
'SMA_50': [100, 102, 104, 106, 108],
'SMA_200': [98, 99, 100, 101, 102],
'RSI': [25, 30, 35, 40, 45]
})
result = generate_signals(data)
print(result['Signal'])

Visualize Signals

from traders_copilot_mzza_25 import plot_signals

data = pd.DataFrame({"Date": ["2023-01-01", "2023-01-02", "2023-01-03"], 
                     "Close": [100, 102, 104]})
fig = plot_signals(data)
fig.show()

Python Ecosystem

The traders_copilot_mzza_25 package positions itself within the Python ecosystem as a practical and user-friendly tool tailored to traders and investors seeking to make informed decisions in the stock market. While the ecosystem already includes powerful libraries like TA-Lib, Backtrader, and PyAlgoTrade, this package stands out by combining trading signal generation, strategy optimization, and visualization into an integrated workflow. With intuitive function names such as simulate_market_data, generate_signals, and plot_signals, it simplifies the process of applying technical indicators like SMA and RSI for both novice and experienced traders. This package is not only a comprehensive resource for trading strategies but also a hands-on tool for Python enthusiasts eager to deepen their skills in financial analysis and programming, making it a versatile addition to the Python finance ecosystem.

Contributing

Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

License

traders_copilot_mzza_25 was created by Mingyang Zhang, Zanan Pech, Ziyuan Zhao and Abeba Nigussie Turi. It is licensed under the terms of the MIT license.

Credits

traders_copilot_mzza_25 was created with cookiecutter and the py-pkgs-cookiecutter template.

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

traders_copilot_mzza_25-0.1.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

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

traders_copilot_mzza_25-0.1.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: traders_copilot_mzza_25-0.1.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for traders_copilot_mzza_25-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fffc16ff622132ddab90c635eeec5d33b4d2f631a3bbb473c6b6c98ec734e7c4
MD5 afa06fdfc295389df18389dded1d81dc
BLAKE2b-256 4a3792c09089a47bec4a40b3223fb1739f16dab73782cd43caad139469a8562e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for traders_copilot_mzza_25-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5baa5fce84732859f9a8534435927108f24fb8700d8ddcacac6b3be7be51e0cc
MD5 c017b59a2dce0c1ab6b0876161a19d41
BLAKE2b-256 71d963d613208b069db9b719cd76ed4888a0032f5c534bbe96f0f0f1b01a78f2

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