@with_bloomberg<EOL>def active_futures(ticker: str, dt) -> str:
t_info = ticker.split()<EOL>prefix, asset = '<STR_LIT:U+0020>'.join(t_info[:-<NUM_LIT:1>]), t_info[-<NUM_LIT:1>]<EOL>info = const.market_info(f'<STR_LIT>')<EOL>f1, f2 = f'<STR_LIT>', f'<STR_LIT>'<EOL>fut_2 = fut_ticker(gen_ticker=f2, dt=dt, freq=info['<STR_LIT>'])<EOL>fut_1 = fut_ticker(gen_ticker=f1, dt=dt, freq=info['<STR_LIT>'])<EOL>fut_tk = bdp(tickers=[fut_1, fut_2], flds='<STR_LIT>', cache=True)<EOL>if pd.Timestamp(dt).month < pd.Timestamp(fut_tk.last_tradeable_dt[<NUM_LIT:0>]).month: return fut_1<EOL>d1 = bdib(ticker=f1, dt=dt)<EOL>d2 = bdib(ticker=f2, dt=dt)<EOL>return fut_1 if d1[f1].volume.sum() > d2[f2].volume.sum() else fut_2<EOL>
Active futures contract

Args:
    ticker: futures ticker, i.e., ESA Index, Z A Index, CLA Comdty, etc.
    dt: date

Returns:
    str: ticker name