@magenta-kabuto Hi, maybe this can help with your strategy also:
In your function regime_trade() before returning signals_df, convert it to pandas.Series structure, and name it to corresponding asset (e.g. "NAS: AAPL").
series = signals_df.squeeze().rename(asset_name) return series
After putting it to trades = dict(), you can concatenate trades.values(), which will create pandas.DataFrame of signals by assets:
pd_signals = pd.concat(trades.values(), axis=1)
Then, convert it to xarray.DataArray and pass it as weights to backtester.
import xarray as xr xr_signals = xr.DataArray(pd_signals, dims=('time', 'asset'))