Skip to content

Instantly share code, notes, and snippets.

@natyrix
Created October 15, 2022 22:28
Show Gist options
  • Save natyrix/3215cf4c4f677b2e5a96214ad9d66e84 to your computer and use it in GitHub Desktop.
Save natyrix/3215cf4c4f677b2e5a96214ad9d66e84 to your computer and use it in GitHub Desktop.
def setup_bbands(self):
bbands = vbt.BBANDS.run(self.price)
entries = bbands.close_crossed_below(bbands.lower)
exits = bbands.close_crossed_above(bbands.upper)
self.pf = vbt.Portfolio.from_signals(self.price, entries, exits)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment