cerebro.resampledata(data, timeframe=bt.TimeFrame.Weeks, compression=1) builds weekly bars from daily bars: open of the first day, high and low of the week, close of the last day.
You first add the daily feed with adddata, then resample it: the daily feed becomes self.data0 and the weekly one self.data1. You can compute an indicator on each, for example bt.ind.SMA(self.data1, period=10).
Compression groups several units: timeframe=bt.TimeFrame.Minutes, compression=60 makes one-hour bars from one-minute bars. You can only go from a small timescale to a larger one, never the reverse.
A weekly bar is only complete at the end of the week. To decide on a Wednesday, rely on the last finished week, otherwise you use a close that did not exist yet. cerebro.replaydata(), on the other hand, lets you watch the bar form step by step.
Examples
ETA-X (fictional market) : Each rectangle combines 5 daily candles into a single weekly candle. On the weekly view the underlying trend stands out more clearly; on the daily view you pick your entry point more precisely.
1980s: Alexander Elder’s “Triple Screen” : Psychiatrist and trader Alexander Elder popularised his “Triple Screen” method in the 1980s: identify the trend on a long timescale (weekly), then look for the entry on a shorter one (daily). That is exactly what a resampled feed lets you code.