finished converter

This commit is contained in:
2022-05-17 15:58:20 +03:00
parent 1b00f9500a
commit e080b70c80
6 changed files with 187 additions and 6 deletions

View File

@@ -0,0 +1,28 @@
import pandas as pd
class DukaMTInterface:
"""
Interface between my askbid candlesticks and sasha's price candlesticks
has two attributes -- bids and asks
"""
def __init__(self, duka_candlesticks_filepath):
# reading index from column 0 and header takes two rows, because of multirow indexers
self.duka_dataset = pd.read_csv(duka_candlesticks_filepath, index_col=0, header=[0, 1], parse_dates=True)
# renaming timestamp to date
self.duka_dataset['date'] = self.duka_dataset.index
# droppnig old timestamp index
self.duka_dataset.reset_index(inplace=True, drop=True)
# adding bids
self.bid_candlesticks = self.duka_dataset['bid'].copy()
self.bid_candlesticks['date'] = self.duka_dataset['date']
# adding asks
self.ask_candlesticks = self.duka_dataset['ask'].copy()
self.ask_candlesticks['date'] = self.duka_dataset['date']