AbstractMonitor

class qf_lib.backtesting.monitoring.abstract_monitor.AbstractMonitor[source]

Bases: object

AbstractMonitor is a class providing an interface for all inherited Monitor classes (live, historic, custom, etc). Monitor should be subclassed according to the use.

Methods:

end_of_day_update(timestamp)

Update the statistics after a whole day of trading.

end_of_trading_update([timestamp])

Final update at the end of backtest session

real_time_update(timestamp)

Update a basic statistics.

record_transaction(transaction)

This method is called every time ExecutionHandler creates a new Transaction

abstract end_of_day_update(timestamp: datetime)[source]

Update the statistics after a whole day of trading. Should be used in live trading only

abstract end_of_trading_update(timestamp: Optional[datetime] = None)[source]

Final update at the end of backtest session

abstract real_time_update(timestamp: datetime)[source]

Update a basic statistics. This method should be light as it might be called after every transaction or price update

abstract record_transaction(transaction: Transaction)[source]

This method is called every time ExecutionHandler creates a new Transaction