create_trading_universe_for_tokens#

API documentation for tradeexecutor.strategy.pandas_trader.token_mapper.create_trading_universe_for_tokens Python function.

create_trading_universe_for_tokens(client, execution_context, universe_options, time_bucket, tokens, reserve_token, intermediate_token=None, volume_30d_threshold_today=0, stop_loss_time_bucket=None, name=None)[source]#

Create a trading universe based on a list of ERC-20 tokens addresses only.

  • Takes a full trading universe and a list of ERC-20 addresses input, and returns a new trading pair universe with the best match for the tradeable tokens.

  • The good trading pair is picked by today’s 30 days USD volume. The pick may fail if the trading pair has ceased in the past.

  • Display TQDM progress bar for the load.

  • Stablecoin-stablecoin pairs are discarded.

Parameters:
  • client (Client) – Trading Strategy data client

  • execution_context (ExecutionContext) – Needed to know if backtesting or live trading

  • universe_options (UniverseOptions) – Backtesting date range or historical live trading look back needed.

  • time_bucket (TimeBucket) –

    Candle time bucket to use.

    E.g. TimeBucket.d1.

  • stop_loss_time_bucket (tradingstrategy.timebucket.TimeBucket | None) –

    Backtest stop loss simulation time bucket.

    Optional.

  • tokens (Iterable[TokenTuple]) – Tokens we want to load

  • reserve_token (str) –

    The reserve currency of a strategy.

    E.g. USDC on Polygon ``.

  • intermediate_token (str | None) –

    Intermediate token which we trade through.

    E.g. WMATIC on Polygon ``.

  • volume_30d_threshold_today (float) – Volume filter threshold.

  • name (str | None) –

    Optional name for this trading universe.

    Autogenerated if not given.

Return type:

TradingStrategyUniverse