Create app.py
Browse files










@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
|
3 |
+
# Tickers to choose from
|
4 |
+
tickers = ['AAPL', 'AMZN', 'NIO', 'AMD', 'NVDA', 'META', 'PLUG', 'INTC', 'FORD', 'TSLA', 'GOOGL']
|
5 |
+
|
6 |
+
# Image options for each ticker
|
7 |
+
image_options = {
|
8 |
+
'AAPL': 'AAPL.jpg',
|
9 |
+
'AMZN': 'AMZN.jpg',
|
10 |
+
'NIO': 'NIO.jpg',
|
11 |
+
'AMD': 'AMD.jpg',
|
12 |
+
'NVDA': 'NVDA.jpg',
|
13 |
+
'META': 'META.jpg',
|
14 |
+
'PLUG': 'PLUG.jpg',
|
15 |
+
'INTC': 'INTC.jpg',
|
16 |
+
'FORD': 'FORD.jpg',
|
17 |
+
'TSLA': 'TSLA.jpg',
|
18 |
+
'GOOGL': 'GOOGL.jpg',
|
19 |
+
}
|
20 |
+
|
21 |
+
# Stock names for each ticker
|
22 |
+
stock_names = {
|
23 |
+
'AAPL': 'Apple Inc.',
|
24 |
+
'AMZN': 'Amazon.com Inc.',
|
25 |
+
'NIO': 'NIO Inc.',
|
26 |
+
'AMD': 'Advanced Micro Devices Inc.',
|
27 |
+
'NVDA': 'NVIDIA Corporation',
|
28 |
+
'META': 'Meta Platforms Inc.',
|
29 |
+
'PLUG': 'Plug Power Inc.',
|
30 |
+
'INTC': 'Intel Corporation',
|
31 |
+
'FORD': 'Ford Motor Company',
|
32 |
+
'TSLA': 'Tesla Inc.',
|
33 |
+
'GOOGL': 'Alphabet Inc. (Google)',
|
34 |
+
}
|
35 |
+
|
36 |
+
|
37 |
+
st.title("Stock Forecaster")
|
38 |
+
|
39 |
+
# Create a dropdown to select a ticker
|
40 |
+
selected_ticker = st.selectbox("Select a ticker:", tickers)
|
41 |
+
|
42 |
+
# Display the image for the selected ticker
|
43 |
+
if selected_ticker:
|
44 |
+
image_path = image_options[selected_ticker]
|
45 |
+
image = st.image(image_path)
|
46 |
+
|
47 |
+
# Display the stock name for the selected ticker
|
48 |
+
stock_name = stock_names[selected_ticker]
|
49 |
+
st.write(f"Stock name: {stock_name}")
|
50 |
+
|
51 |
+
st.markdown("This app has been trained on the past 6 years of data until November 22nd, 2023 for each of the selected stocks. For a more comprehensive analysis with a different date range, access to thousands of stocks, hundreds of cryptocurrencies, and more up-to-date predictions, please visit our website: https://stock.quu.fr")
|
52 |
+
|