A collection of trading strategies for Lumibot. Browse, fork, backtest, and share your own.
| Strategy | Asset Class | Description |
|---|---|---|
| Stock Buy and Hold | Stocks | Simple buy-and-hold with portfolio allocation |
| SMA Crossover | Stocks | Classic moving average crossover signal |
| Stock Momentum | Stocks | Momentum rotation across a stock universe |
| Classic 60/40 | Stocks + Bonds | Traditional 60% stocks, 40% bonds with rebalancing |
| Crypto 50/50 | Crypto | Equal-weight Bitcoin and Ethereum |
| Options Strangle | Options | Short strangle strategy for premium collection |
| Drift Rebalancer | Multi-Asset | Rebalance portfolio when drift exceeds threshold |
pip install lumibot
# Run any strategy
python strategies/sma_crossover.pyWe welcome community strategies! To submit yours:
- Fork this repo
- Add your strategy to the
strategies/folder - Include a docstring with:
- Strategy description (1-2 sentences)
- Asset class (stocks, options, crypto, futures, forex)
- Required data source (Yahoo is free, or specify ThetaData/Polygon/etc.)
- Expected behavior (what it buys/sells and why)
- Make sure it runs with
python strategies/your_strategy.py - Open a pull request
"""
My Strategy Name
Asset class: Stocks
Data source: Yahoo Finance (free)
Description: Brief description of what this strategy does.
"""
from datetime import datetime
from lumibot.strategies import Strategy
from lumibot.backtesting import YahooDataBacktesting
class MyStrategy(Strategy):
parameters = {}
def initialize(self):
self.sleeptime = "1D"
def on_trading_iteration(self):
# Your strategy logic here
pass
if __name__ == "__main__":
MyStrategy.backtest(
YahooDataBacktesting,
datetime(2023, 1, 1),
datetime(2024, 1, 1),
)- Lumibot Documentation
- Lumibot GitHub
- BotSpot Platform (deploy strategies with AI, no code required)
- Discord Community
MIT