{"repo":"pinouche/investment_analysis","free":true,"listed":false,"github":"https://github.com/pinouche/investment_analysis","clone":"git clone https://github.com/pinouche/investment_analysis.git","description":"DCA analysis on the s&p 500","language":"Jupyter Notebook","stars":24,"topics":["data-scraping","financial-data","trading","dca"],"license":null,"category":"trading","readme_excerpt":"Dollar-Cost Averaging vs “Buy the Dip” Timing (dca analysis.ipynb) This notebook investigates a practical investing question: if you save a fixed amount every month, is it better to invest on a fixed schedule (classic DCA), or to wait and invest only when the market is “close to a recent low” (i.e., after a drop)? The analysis simulates monthly contributions invested in SPY (S&P 500 ETF) and compares outcomes when you: - Always invest the monthly contribution (pure DCA), versus - Invest the contribution only if the current price is within X% of the rolling low over the last Y years (a simple buy-the-dip rule). Methodology (what the code does) - Data: daily Close prices for SPY loaded from ./data/SPY.csv. - Contributions: one unit added every 21 trading days (approx. monthly). - Decision rule per day (after a warm-up period): - Compute the low over the last Y years (rolling window of Y × 12 × 21 trading days). - If today’s price is within X% of that period low, invest the current contribution balance; otherwise, keep it in cash. - Accounting assumptions: - Uninvested cash earns 0% (cash drag is explicit). - No trading costs, taxes, or slippage. Parameters explored in the notebook: - Y (look-back window in years): 1, 2, 3, 5 - X (proximity to period low): 0% to 100% Outputs produced: - graph dca.png: returns vs. threshold X for multiple Y values. - Additional charts showing when investments were actually made for selected (Y, X) pairs. Key takeaways (based on SPY 2010–2023) Whi","default_branch":null,"files":null,"tree":[],"storefront":"/r/pinouche","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/pinouche/investment_analysis/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}