Live Execution

class src.boatwright.LiveExecution.LiveExecution(strategy, broker, debug=False)

Execute a strategy in real time

Parameters:
  • strategy (Strategy) – strategy

  • broker (Broker) – broker, can be either a backtest broker or live broker interface

  • debug – boolean toggle to print debugging information to terminal

notify_listeners(row)

puts a row of data in each listeners queue

Parameters:

row (DataFrame) – one row of data with all signals calculated, and aum, base, quote values updated

register_listener(listener)

register a listener to be updated with each row of data (only for asynchronous runs)

async run()

execute live execution

set_prerequisite_data(data)

seeds self.current_data and self.cumulative_data with the provided data, intended to be the most recent historical data

Parameters:

data (DataFrame) – dataframe of most recent OHLCV data

async step(bar)

actions on each bar of data recieved

Parameters:

bar (DataFrame) – a new bar of the most recent OHLCV volume