I have a program that convert api live tick data to a 15 Sec time Dataframe. But in the new dataframe some old columns are missing which is very much necessary from my further work. How can fetch those old columns to my new dataframe. I want to add ts, tk ...which are very important for me.
def df_tech(df, interval):
df = df[['ts','tk','lp', 'pc', 'ltq']]
df.index = pd.to_datetime(df['ft'], format='%Y-%m-%d %H:%M:%S')
df1 = df['lp'].resample(interval).ohlc().bfill()
df1['ShortEMA'] = df1.close.ewm(span=10, adjust=False).mean()
df1['LongEMA'] = df1.close.ewm(span=21, adjust=False).mean()
return df1