File size: 4,602 Bytes
004b923
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
import pandas as pd
import streamlit as st
import numpy as np
from streamlit_card import card
import yfinance as yf
import altair as alt

# Set the background color and opacity for the container
container_style = """
    background-color: rgba(55, 65, 82, 0.7);
    padding: 100px;
    border-radius: 10px;
    margin-top: 20px;
    margin-bottom: 20px;
"""

st.markdown("<h1 style='text-align: center;'>Volatility Indicator</h1>", unsafe_allow_html=True)
st.write(""" ### Economic Volitility Examination""")
# Create a translucent container
x = card(title="", text = "When we talk about stock volitility, we typically need fundamental data like company earning reports, interest rates, and technical analysis trends",
         styles = {
            "card": {
                "width": "650px",
                "height": "200px",
                "background-color": "rgba(55, 65, 82, 1)",
                "padding": "20px",
                "margin-top": "20px",
                #"margin-bottom": "20px",
            },
            
         }

         )


# Download historical stock data for Tesla
ticker = "TSLA"
start_date = "2021-09-29"
end_date = "2022-09-29"

stock_data = yf.download(ticker, start=start_date, end=end_date)



# Calculate daily returns
stock_data["Daily_Return"] = stock_data["Close"].pct_change()

# Calculate historical volatility (standard deviation)
historical_volatility = stock_data["Daily_Return"].std()

# Streamlit app
st.markdown("<h1 style='text-align: center;'>Tesla Stock Volatility Analysis</h1>", unsafe_allow_html=True)


# Display historical stock data
st.subheader("Historical Stock Data")
st.write(stock_data)



stock_data = yf.download(ticker, start=start_date, end=end_date)

# Calculate daily returns
stock_data["Daily_Return"] = ((stock_data["Close"] / stock_data["Open"]) - 1)
notable = []
days = []
for day in stock_data["Daily_Return"]:
    if day > 0.1:
        notable.append(day)
        days.append("Date")
    elif day < -0.1:
        notable.append(day)
        days.append("Date")




# Line chart for stock prices
st.subheader("Tesla Stock Prices Over Time")
line_chart = alt.Chart(stock_data.reset_index()).mark_line().encode(
    x="Date:T",
    y="Daily_Return",
    tooltip=["Date", "Daily_Return"]
).properties(width=800, height=400)
st.altair_chart(line_chart, use_container_width=True)

st.write("2021-11-09 00:00:00: \"Telsa fire in Stanford took 42 minutes to extinguish\" ")
st.write("2022-01-27 00:00:00: \"Tesla drops more than 11% as investors digest new vehicle delays\"")
st.write("2022-02-23 00:00:00: \"Tesla model Y wins EV award\"")
st.write("2022-04-26 00:00:00: \"Elon Musk says people might download their personalities onto a human robot constructed by Tesla\"")


st.markdown("<h1 style='text-align: center;'>Our Approach</h1>", unsafe_allow_html=True)

x = card(title="", 
         text = "How can we predict the potential social impact on stock volitility? Qualitative tabular data poses a challenge concerning data processing resources",
         styles = {
            "card": {
                "width": "650px",
                "height": "200px",
                "background-color": "rgba(55, 65, 82, 1)",
                "padding": "50px",
                "margin-top": "10px",
                "margin-bottom": "10px",
            },
            
         }

         )
st.write("")


# Streamlit app
st.title('First Model')
model1 = card(title="", 
         text = "",
         styles = {
            "card": {
                "width": "650px",
                "height": "200px",
                "margin-top": "10px",
                "margin-bottom": "10px",
            },
         },
         image="https://i.postimg.cc/Bn8q0Ddy/XBoost.png",
         on_click=lambda: st.write("The model generating embeddings represent the data in the prompt. Each embedding captures an immense amount of training data that is then used to project desired data")

         )
st.title('Second Model')
mod2 = card(title="", 
         text = "",
         styles = {
            "card": {
                "width": "700px",
                "height": "400px",
                "margin-top": "20px",
                "margin-bottom": "20px",
            }
         },
         image="https://miro.medium.com/v2/resize:fit:976/1*oc1gaCFvgWXq_gHQFM63UQ.png",
         on_click=lambda: st.write("A neural network learns to map input data to output by adjusting the strengths of connections (weights) between nodes during a training process. This enables the network to recognize patterns and make predictions on new data.")

         )