vectorbt icon indicating copy to clipboard operation
vectorbt copied to clipboard

It is hard to use an outside data

Open UmarIgan opened this issue 2 years ago • 2 comments

Great library but I have my own data source and can't properly use it with vectorbt, it is all wrapped around yfinance and vectorbt data api. the data has to be a vectorbt object such as <vectorbt.data.custom.YFData at 0x1486f1640> and there is no clear documentation around using external data.

UmarIgan avatar Aug 23 '22 06:08 UmarIgan

vbt supports any time series irrespective of source of data. All it needs is pandas series. What I typically do is either read from csv or make a call to api and fetch data into a df.

df = pd.read_csv(..) or api then pass df['close] or df['open'] etc to indicator based on strategy

vbandaru avatar Aug 24 '22 04:08 vbandaru

@UmarIgan

Greetings,

After trying vectorpro, just use data class for migrating to the pro version easily!

Before (edited)

After playing with vectorbt for several weeks, I may give you two cents.

  1. Implement your own Data class.
  2. Using Pandas Pivot table to make sure each stock has its own column for ohlcv values.

After conquering this stage, you can enjoy the rest part of journey. Good luck!

Thanks, Greg

guhuajun avatar Aug 31 '22 03:08 guhuajun