<reponame>akhabibd/myStock<filename>util.py
import streamlit as st
import yfinance as yf 
from datetime import date
from fbprophet import Prophet
from fbprophet.plot import plot_plotly
from plotly import graph_objs as go

# Plot stock data
def plot_raw_data(data):
    fig = go.Figure()
    fig.add_trace(go.Scatter(x=data['Date'], y=data['Open'], name="stock_open"))
    fig.add_trace(go.Scatter(x=data['Date'], y=data['Close'], name="stock_close"))
    fig.layout.update(title_text='Intraday Trading Data', xaxis_rangeslider_visible=True)
    st.plotly_chart(fig)

@st.cache(show_spinner=False)
def load_data(ticker, START, TODAY):
    data = yf.download(ticker, START, TODAY, threads=False)
    data.reset_index(inplace=True)
    return data

import streamlit as st
import yfinance as yf 
from datetime import date
from fbprophet import Prophet
from fbprophet.plot import plot_plotly
from plotly import graph_objs as go

# Plot stock data
def plot_raw_data(data):
    fig = go.Figure()
    fig.add_trace(go.Scatter(x=data['Date'], y=data['Open'], name="stock_open"))
    fig.add_trace(go.Scatter(x=data['Date'], y=data['Close'], name="stock_close"))
    fig.layout.update(title_text='Intraday Trading Data', xaxis_rangeslider_visible=True)
    st.plotly_chart(fig)

@st.cache(show_spinner=False)
def load_data(ticker, START, TODAY):
    data = yf.download(ticker, START, TODAY, threads=False)
    data.reset_index(inplace=True)
    return data
# Plot stock data