vectorbt icon indicating copy to clipboard operation
vectorbt copied to clipboard

Problems getting started

Open thebadguyfromstarwars opened this issue 3 years ago • 1 comments

Love the sentiment and intiative of this module - keep it up!

To my problem,

I am a novice and having a hard time getting started - it there are so much functions and classes. If I would just get a simple MACD running one a 100 days dataset and then fetch see all the stats - how do I do?

I have taken a peak on the MACD example, with the heatmap, and tried to just delete the heatmap - but it's just running to inifinity. Nothing happends.

thebadguyfromstarwars avatar Apr 29 '21 09:04 thebadguyfromstarwars

Hi @thebadguyfromstarwars,

it's pretty much the same as running a MA crossover example from the readme:

import vectorbt as vbt

price = vbt.YFData.download('BTC-USD').get('Close')
macd_ind = vbt.MACD.run(price)
entries = macd_ind.macd_above(0) & macd_ind.macd_above(macd_ind.signal)
exits = macd_ind.macd_below(0) | macd_ind.macd_below(macd_ind.signal)
portfolio = vbt.Portfolio.from_signals(price, entries, exits, freq='d')
portfolio.stats()

I will mark this issue and create a "Getting started" notebook in the near future.

polakowo avatar Apr 29 '21 22:04 polakowo