Skip to main content

A simple Python toolkit for algorithmic trading

Project description

RiskOptimix

A Python toolkit for algorithmic trading focused on data management and technical analysis. RiskOptimix provides utilities for downloading financial data and calculating technical indicators, designed to help algorithmic traders and financial enthusiasts with their analysis workflows.

Features

Data Management

  • Historical Data Fetching: Download price data for stocks, cryptocurrencies, and other financial instruments using Yahoo Finance
  • Data Validation: Built-in validation and error handling for data integrity
  • Flexible Time Ranges: Support for various intervals (1m, 5m, 15m, 30m, 1h, 1d, 1wk, 1mo)

Technical Indicators

  • Moving Averages: Simple Moving Average (SMA), Exponential Moving Average (EMA), Weighted Moving Average (WMA)
  • Momentum Indicators: RSI, Stochastic Oscillator, Williams %R, Rate of Change (ROC)
  • Volatility Indicators: Bollinger Bands, Average True Range (ATR), Standard Deviation
  • Volume Indicators: Volume Weighted Average Price (VWAP), On-Balance Volume (OBV)
  • Trend Indicators: MACD, Parabolic SAR, Average Directional Index (ADX)
  • Support/Resistance: Pivot Points, Fibonacci Retracements
  • Batch Processing: Apply multiple indicators at once using predefined profiles

Installation

pip install riskoptimix

Quick Start

Basic Data Fetching

import riskoptimix as ro

# Fetch one year of daily data for Apple
df = ro.get_data('AAPL')

# Fetch specific date range with hourly data
df = ro.get_data('BTC-USD', start='2024-01-01', end='2024-12-31', interval='1h')

Technical Indicators

from riskoptimix.indicators import sma, ema, rsi, bollinger_bands

# Calculate individual indicators
df['SMA_20'] = sma(df['close'], period=20)
df['EMA_20'] = ema(df['close'], period=20)
df['RSI_14'] = rsi(df['close'], period=14)

# Calculate Bollinger Bands
bb_upper, bb_middle, bb_lower = bollinger_bands(df['close'], period=20, std_dev=2)
df['BB_Upper'] = bb_upper
df['BB_Middle'] = bb_middle
df['BB_Lower'] = bb_lower

Batch Indicator Processing

from riskoptimix.indicators import prepare_data

# Apply basic indicators (SMA, EMA, RSI)
df_basic = prepare_data(df, profile='basic')

# Apply momentum-focused indicators
df_momentum = prepare_data(df, profile='momentum')

# Apply custom set of indicators
df_custom = prepare_data(
    df, 
    profile='custom',
    custom_indicators=['sma_10', 'sma_30', 'rsi_21', 'bb', 'vwap']
)

# Apply all available indicators
df_full = prepare_data(df, profile='all')

Examples

Check the examples/ directory for detailed usage examples:

  • basic_example.py: Simple data fetching and indicator calculation
  • indicators_example.py: Various indicator profiles and batch processing

Requirements

  • Python >=3.8
  • pandas >=1.5.0
  • numpy >=1.20.0
  • yfinance >=0.2.0
  • requests >=2.28.0

Development Status

RiskOptimix is currently in alpha stage (v0.1.0). The package includes:

Current Features:

  • Data fetching from Yahoo Finance
  • 25+ technical indicators
  • Batch indicator processing
  • Error handling and validation

Planned Features:

  • Backtesting framework
  • Risk management tools
  • Portfolio optimization
  • Plotting and visualization utilities
  • Additional data sources
  • Strategy templates
  • Performance metrics

Contributing

This is an early-stage project. Contributions, suggestions, and feedback are welcome. Please feel free to open issues or submit pull requests.

License

MIT License - see LICENSE file for details.

Disclaimer

This software is for educational and research purposes only. It is not intended as financial advice. Trading financial instruments involves substantial risk of loss. Past performance does not guarantee future results.

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

riskoptimix-0.1.0.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

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

riskoptimix-0.1.0-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: riskoptimix-0.1.0.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for riskoptimix-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d6b50037da4ea766e77745cc831e29e2356897b9fd211bfaf2970855498662c8
MD5 022eab4a3af95c092e9c92c3f2c9e566
BLAKE2b-256 facdb4f15c2242adb5c5e145195696fdd8acdb7829ca46dc169aafae5216f4be

See more details on using hashes here.

File details

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

File metadata

  • Download URL: riskoptimix-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for riskoptimix-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0c5b71f0826c54cafe5628920b13850e40605ea287c10af56ae61e3346d5b305
MD5 5edc0f9109a0730d1e532c289c321a2a
BLAKE2b-256 f9e19526b3a3923814db7ed9488be43f8780a1b77c17c6aacb829562b9e34c0d

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