How to use the backtesting.backtest_broker.BacktestBroker function in Backtesting

To help you get started, we’ve selected a few Backtesting examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github paperduck / algo / src / backtesting / strategies / demo.py View on Github external
def _babysit(self):
        """Monitor open positions. Check if any have closed.
        """
        for otid in self.open_trade_ids:
            if broker.is_closed(otid):
                self.open_trade_ids.remove(otid) # mark status