display_strategy_universe#

API documentation for tradeexecutor.analysis.pair.display_strategy_universe Python function.

display_strategy_universe(strategy_universe, show_tvl=True, show_volume=True, show_price=True, now_=None, tolerance=Timedelta('90 days 00:00:00'), sort_key='id', sort_ascending=True, sort_numeric=True)[source]#

Displays a constructed trading strategy universe in table format.

  • Designed for notebook debug and live trading startup checks

  • To be called at the end of create_trading_universe()

  • Returns a human-readable table of selected trading pairs and their nature

  • Contains latest TVL, price and volume figures for the reference

Pairs can be - Part of trading - Benchmarks - Benchmark pairs are detected by pair.other_data.get("benchmark")

Example:

with pd.option_context('display.max_rows', None, 'display.max_columns', None, 'display.width', 140):
    universe_df = display_strategy_universe(universe)
    logger.info("Universe is:

%sā€, str(universe_df))

Example 2:

strategy_universe = create_trading_universe(
    None,
    client,
    notebook_execution_context,
    UniverseOptions.from_strategy_parameters_class(Parameters, notebook_execution_context)
)

display_strategy_universe(
    strategy_universe,
    sort_key="tvl",
    sort_ascending=False,
) 
return:

Human-readable DataFrame for display().

Empty DataFrame returned if the incoming universe is partial.

Parameters:

strategy_universe (TradingStrategyUniverse) ā€“

Return type:

DataFrame