Hide navigation sidebar
Hide table of contents sidebar
Back to top
Toggle table of contents sidebar

# Traders

## Trader

class lumibot.traders.trader.Trader(logfile='', backtest=False, debug=False, strategies=None)

  Bases: `object`

  add_strategy(strategy)

    Adds a strategy to the trader

  property is_backtest_broker
  run_all(async_=False, show_plot=True, show_tearsheet=True, save_tearsheet=True)

    run all strategies

    Parameters:

      - async (bool) – Whether to run the strategies asynchronously or not. This is not implemented yet.

      - show_plot (bool) – Whether to disply the plot in the user’s web browser. This is only used for backtesting.

      - show_tearsheet (bool) – Whether to display the tearsheet in user’s web browser. This is only used for backtesting.

      - save_tearsheet (bool) – Whether to save the tearsheet or not. This is only used for backtesting.

    Returns:

      A dictionary with the keys being the strategy names and the values being the strategy analysis.

    Return type:

      dict

  run_all_async(backtest=False)

    run all strategies

  stop_all()