{"repo":"amstrdm/mlm-trend-following","free":true,"listed":false,"github":"https://github.com/amstrdm/mlm-trend-following","clone":"git clone https://github.com/amstrdm/mlm-trend-following.git","description":"Automated Python implementation of a Mount Lucas Management (MLM) style trend-following strategy for futures using the IBKR API (ib_insync). Calculates 200-day MA signals on Continuous Futures, filters trades by volatility, and executes on front-month contracts.","language":"Python","stars":44,"topics":["finance","ibkr","ibkr-api","quantitative-finance","trading","trend-following"],"license":null,"category":"trading","readme_excerpt":"MLM Trend-Following Strategy with IBKR This repository provides an automated system in Python that replicates a trend-following approach similar to the Mount Lucas Management (MLM) Index methodology. The Mount Lucas Management Index works using a Moving average 200 Day Crossover Strategy applied to 25 liquid futures contracts and is a trend following strategy. It's obvious that trend following strategies work best in volatile environments so I built upon the strategy by introducing a function which checks the volatility of the futures contracts and only trades the strategy if volatility is above a certain (by the user specified) threshold. Since I'm currently busy with other bigger projects I wrote this up quickly in a few hours. I did want to do this project because I thought it was interesting how a fund like MLM would use such a simplistic strategy. However this means the code is far from production ready. I listed the main features that are missing down below I may return to this when I have more time on my hands but for now if you'd like to contribute just send me a PR The script: 1. Connects to Interactive Brokers (IBKR) 2. Retrieves historical data from Continuous Futures contracts ( ContFuture ) for computing signals (e.g., a 200-day Moving Average crossover) 3. Determines the front-month (actual, dated) futures contract to place trades 4. Filters trades based on a volatility threshold 5. Executes buys/sells on IBKR’s paper or live environment Disclaimer : This code i","default_branch":null,"files":null,"tree":[],"storefront":"/r/amstrdm","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/amstrdm/mlm-trend-following/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."}