Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
# Copyright
|
2 |
#
|
3 |
# Licensed under the Apache License, Version 2.0 (the "License");
|
4 |
# you may not use this file except in compliance with the License.
|
@@ -17,29 +17,42 @@ import streamlit as st
|
|
17 |
|
18 |
def run():
|
19 |
st.set_page_config(
|
20 |
-
page_title="
|
21 |
-
page_icon="
|
|
|
22 |
)
|
23 |
|
24 |
-
st.write("# Welcome to
|
25 |
|
26 |
-
st.sidebar.success("Select a
|
27 |
|
28 |
st.markdown(
|
29 |
"""
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
"""
|
44 |
)
|
45 |
|
|
|
1 |
+
# Copyright Yiqiao Yin.
|
2 |
#
|
3 |
# Licensed under the Apache License, Version 2.0 (the "License");
|
4 |
# you may not use this file except in compliance with the License.
|
|
|
17 |
|
18 |
def run():
|
19 |
st.set_page_config(
|
20 |
+
page_title="Momentum-Strategy",
|
21 |
+
page_icon="πΉ",
|
22 |
+
layout="wide"
|
23 |
)
|
24 |
|
25 |
+
st.write("# Welcome to the Momentum Strategy Simulator! πΉ")
|
26 |
|
27 |
+
st.sidebar.success("Select a language above.")
|
28 |
|
29 |
st.markdown(
|
30 |
"""
|
31 |
+
# Stock Return Simulation App
|
32 |
+
|
33 |
+
This application is a return simulation tool for selected stocks. It allows users to simulate returns based on a momentum strategy using the 4th factor from the Carhart 4-factor model. The application automatically downloads stock data from Yahoo Finance live when the user presses the button, ensuring that the data is always refreshed to the most recent trading day records.
|
34 |
+
|
35 |
+
## Usage
|
36 |
+
|
37 |
+
1. **Downloading Data**: Click the "Download Data" button to fetch stock data from Yahoo Finance live. This action ensures that the data is up-to-date with the most recent trading day records.
|
38 |
+
|
39 |
+
2. **Select Language**: The application supports multiple languages. Simply click on the desired language option on the left-hand side of the interface. The default language is English.
|
40 |
+
|
41 |
+
3. **Momentum Strategy**: The application runs a momentum strategy based on the 4th factor from the Carhart 4-factor model. The strategy balances the portfolio once a month. Each month, the strategy selects a portfolio consisting of stocks that have performed the best in the past month in terms of stock growth rate.
|
42 |
+
|
43 |
+
4. **Input Custom Stocks**: Users are free to input any stocks they like. Please separate the stock tickers using commas and ensure that the tickers are in capital letters.
|
44 |
+
|
45 |
+
5. **No AI Involved**: Please note that there is no artificial intelligence involved in the strategy. It selects the strongest performing stocks based on the most recent records.
|
46 |
+
|
47 |
+
## Instructions
|
48 |
+
|
49 |
+
1. Click the "Download Data" button to fetch the latest stock data.
|
50 |
+
2. Select your preferred language from the options provided.
|
51 |
+
3. Input your desired stocks into the designated field, separated by commas.
|
52 |
+
4. Explore the simulated returns based on the momentum strategy.
|
53 |
+
5. Repeat the process as needed to adjust your stock selection and language preference.
|
54 |
+
|
55 |
+
**Note**: This application is for simulation purposes only and does not provide investment advice. Always perform your own research or consult with a financial advisor before making investment decisions.
|
56 |
"""
|
57 |
)
|
58 |
|