backtesting.py
backtesting.py copied to clipboard
Buy order not creating a position ?
Expected Behavior
Hi, here is the simplest strategy code you can ever imagine :
class newStrategy(Strategy):
def next(self):
if not self.position:
self.buy()
assert self.position
I am not passing the assert ! Meaning that self.buy() is not creating a position. Am I not understanding something ?