Closed brankoo124 closed 6 months ago
Hi, you can use pd.read_csv
(https://pandas.pydata.org/docs/reference/api/pandas.read_csv.html) to load the data into a DataFrame
Hi I am trying the same but no luck. I try these:
vbt.Data.from_data(df.close)
@utekakca @brankoo124 you can try something like this:
def get_data(asset="BTCUSD", start=0, end=0):
filename = "data/{}.csv".format(asset)
df = pd.read_csv(filename)
df['Date'] = pd.to_datetime(df['Date'])
df = df.set_index('Date')
if (end != 0):
df = df[start:end]
return df
def get_vector_data(asset="BTCUSD", start=0, end=0):
class CustomData(vbt.Data):
@classmethod
def download_symbol(cls, symbol, start=0, end=0):
return get_data(symbol, start, end)
return CustomData.download([asset], start=start, end=end).get()
data = get_vector_data("BTCUSD")
Hi, I am trying to import data from .csv file, which structure is exactly same as the csv's exported from yahoo finance (cryptocurrencies, so no AdjClose column). Is there any built in way of doing it?