Skip to content

Commit

Permalink
Added charts and events page
Browse files Browse the repository at this point in the history
  • Loading branch information
mreddappareddy1 committed Jul 15, 2024
1 parent dc0eda3 commit d136ec5
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 4 deletions.
5 changes: 5 additions & 0 deletions pages/Event_Calendar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import streamlit as st
from nsepython import *

tempdata = nse_events()
st.write(tempdata)
3 changes: 0 additions & 3 deletions pages/Individual_Stock_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ def fetch_fnostock_data():
tempstatus = nsefetch(fnourl)
return tempstatus

def convert_to_crores(value):
return value/10000000

top_row = st.container()

with top_row:
Expand Down
43 changes: 43 additions & 0 deletions pages/Stock_Historical_Data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import streamlit as st
from nsepython import *
from datetime import date
from jugaad_data.nse import stock_csv, stock_df
import plotly.graph_objects as go

st.set_page_config(
page_title="Stock Historical Data",
layout="wide" # Use the entire horizontal space
)

def stock_selection_change():
data = 1

nifty500url = "https://www.nseindia.com/api/equity-stockIndices?index=NIFTY%20500"
data = 0
tempdata = {}
stocksList =[]
flat_data = []
def fetch_marketstatus_data():
tempstatus = nsefetch(nifty500url)
return tempstatus

tempdata = fetch_marketstatus_data()
tempdata = tempdata['data']
marketData = pd.DataFrame(tempdata)
marketData.drop(0,axis=0,inplace=True)
for keys in tempdata:
symbol = keys["symbol"]
if symbol != "NIFTY 500":
stocksList.append(symbol)
stocksListDF = pd.DataFrame(stocksList,columns=["Symbol"])
stocksListDF = stocksListDF.sort_values(by=["Symbol"],ascending=True)
selectedStock = st.selectbox(label="Stocks List",options=stocksListDF,placeholder="Select a stock")
df = stock_df(symbol=selectedStock, from_date=date(2024,4,1),
to_date=date(2024,7,15), series="EQ")
fig = go.Figure(data=[go.Candlestick(x=df['DATE'],
open=df['OPEN'], high=df['HIGH'],
low=df['LOW'], close=df['CLOSE'])
])

fig.update_layout(xaxis_rangeslider_visible=False)
st.plotly_chart(fig, use_container_width=True)
4 changes: 3 additions & 1 deletion streamlit_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
[
Page("streamlit_app.py", "Summary Page", "🏠"),
Page("pages/Industry_Wise_Change.py", "Industry Wise Change", ":books:"),
Page("pages/Individual_Stock_details.py", "Individual Stock Details", ":chart:")
Page("pages/Individual_Stock_details.py", "Individual Stock Details", ":chart:"),
Page("pages/Event_Calendar.py","Event Calendar",":calendar:"),
Page("pages/Stock_Historical_Data.py","Stock Historical Data",":money_with_wings:")
]
)

Expand Down

0 comments on commit d136ec5

Please sign in to comment.