import streamlit as st
import time, datetime
from Utils.benchmark import get_spy
from Utils.UTT import get_utt_prices
from Utils.Formatter import plot_fuctions
import pandas as pd
import plotly.express as px




"""
# Mbone's Investing Dashboard
"""
"""
### SPY vs  LIQUID FUND
"""





start_date,end_date =st.date_input('Pick a date range',[datetime.date(2013, 3, 28),datetime.date(2021, 3, 28)])

date_range =pd.date_range(start_date,end_date)
main=pd.DataFrame(index=date_range)

df =get_utt_prices()
liquid =df.div(df.iloc[0]['Prices'])
data=get_spy()
spy = data.div(data.iloc[0]['Adj Close'])
spy = spy[['Adj Close']]
main=main.join(liquid)
main=main.join(spy)
main.columns = ['liquid Fund','SPY']
main_plot=plot_fuctions(main,'Liquid Fund vs Spy')

st.plotly_chart(main_plot)

