Skip to content

IrishRugbyman/commo-multiasset-quant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Commodity Multi-Asset Strategy Python Project

This school project implements a basic quantitative analysis of historical commodity prices and constructs a multi-asset strategy optimization. The code demonstrates data acquisition, technical indicator computation, visualization, and a simple strategy backtest using randomly generated portfolio weights.


Project Summary

  • Aim: Analyze historical price data for major commodities and build a random-weighted strategy index to maximize portfolio value over the past 10 years.
  • Instruments Covered:
    • Crude Oil (CL=F)
    • Gold (GC=F)
    • Silver (SI=F)
    • Copper (HG=F)
    • Wheat (ZW=F)
  • Techniques Demonstrated: Data retrieval, price visualization, moving averages, Bollinger Bands, Relative Strength Index (RSI), random portfolio construction, and strategy index optimization.

Project Structure

  1. Data Acquisition:
    Download 10 years of daily adjusted close prices for chosen commodities using the Yahoo Finance API (yfinance).
  2. Visualization and Analysis:
    • Plot raw historical price data.
    • Compute and plot 50-day simple moving averages (SMA).
    • Calculate and visualize Bollinger Bands.
    • Compute and display the RSI (Relative Strength Index) for trend analysis.
  3. Strategy Simulation:
    • Generate 100 random combinations of asset weights (using Dirichlet distribution).
    • Compute the performance index of strategies rebalancing daily by these weights.
    • Select and display the best-performing strategy and its weights.

Key Features

  • Python Libraries: yfinance, pandas, matplotlib, numpy, dateutil
  • Technical Indicators: SMA, RSI, Bollinger Bands
  • Portfolio Construction: Daily rebalancing, random portfolio simulation, index tracking
  • Visualization: Matplotlib-based, with clear legends and axis labels

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors