I have read such codes as below in buyandsell strategy
from backtesting import Backtest, Strategy
class BuyAndSellSwitch(Strategy):
def init(self):
pass
def next(self):
if self.position.size == 0:
self.buy(size=1)
else:
self.sell(size=1)
bt = Backtest(data, BuyAndSellSwitch, cash=10000)
output = bt.run()
output
What does the strategy mean on earth?