Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -69,6 +69,7 @@ def calculate_volume_ratio(data: pd.DataFrame, percentile_threshold: float = 0.9
|
|
| 69 |
# Streamlit app
|
| 70 |
st.set_page_config(page_title="Unusual Volatility and Volume", layout="wide")
|
| 71 |
st.title('Unusual Volatility and Volume')
|
|
|
|
| 72 |
|
| 73 |
# Sidebar for method selection
|
| 74 |
selected = st.sidebar.radio("Select Analysis", ["Volatility Ratio", "Volume Ratio"])
|
|
@@ -95,7 +96,6 @@ with st.sidebar.expander("How to Use", expanded=False):
|
|
| 95 |
5. The chart will display the Volume Ratio and highlight points where the ratio exceeds the percentile threshold.
|
| 96 |
""")
|
| 97 |
|
| 98 |
-
# Input parameters inside an expander
|
| 99 |
# Input parameters inside an expander
|
| 100 |
with st.sidebar.expander("Input Parameters", expanded=True):
|
| 101 |
ticker = st.text_input('Enter Stock or Crypto Symbol (e.g., AAPL or BTC-USD)', 'AAPL', help="Enter the ticker symbol for the stock or cryptocurrency you want to analyze.")
|
|
@@ -122,6 +122,8 @@ data = st.session_state.data
|
|
| 122 |
# Display results based on the selected method
|
| 123 |
if selected == "Volatility Ratio":
|
| 124 |
st.markdown("### Volatility Ratio")
|
|
|
|
|
|
|
| 125 |
|
| 126 |
with st.expander("How it Works", expanded=False):
|
| 127 |
st.markdown("""
|
|
@@ -151,6 +153,8 @@ if selected == "Volatility Ratio":
|
|
| 151 |
|
| 152 |
elif selected == "Volume Ratio":
|
| 153 |
st.markdown("### Volume Ratio with Dynamic Percentile")
|
|
|
|
|
|
|
| 154 |
|
| 155 |
with st.expander("How it Works", expanded=False):
|
| 156 |
st.markdown("""
|
|
|
|
| 69 |
# Streamlit app
|
| 70 |
st.set_page_config(page_title="Unusual Volatility and Volume", layout="wide")
|
| 71 |
st.title('Unusual Volatility and Volume')
|
| 72 |
+
st.markdown("""
|
| 73 |
|
| 74 |
# Sidebar for method selection
|
| 75 |
selected = st.sidebar.radio("Select Analysis", ["Volatility Ratio", "Volume Ratio"])
|
|
|
|
| 96 |
5. The chart will display the Volume Ratio and highlight points where the ratio exceeds the percentile threshold.
|
| 97 |
""")
|
| 98 |
|
|
|
|
| 99 |
# Input parameters inside an expander
|
| 100 |
with st.sidebar.expander("Input Parameters", expanded=True):
|
| 101 |
ticker = st.text_input('Enter Stock or Crypto Symbol (e.g., AAPL or BTC-USD)', 'AAPL', help="Enter the ticker symbol for the stock or cryptocurrency you want to analyze.")
|
|
|
|
| 122 |
# Display results based on the selected method
|
| 123 |
if selected == "Volatility Ratio":
|
| 124 |
st.markdown("### Volatility Ratio")
|
| 125 |
+
|
| 126 |
+
st.markdown("""This method calculates the True Range Volatility Ratio, which helps identify periods of high volatility. A ratio above a specified threshold indicates high volatility.""")
|
| 127 |
|
| 128 |
with st.expander("How it Works", expanded=False):
|
| 129 |
st.markdown("""
|
|
|
|
| 153 |
|
| 154 |
elif selected == "Volume Ratio":
|
| 155 |
st.markdown("### Volume Ratio with Dynamic Percentile")
|
| 156 |
+
|
| 157 |
+
st.markdown("""This method calculates the Volume Ratio and uses a dynamic percentile threshold to identify high volume periods. A volume ratio above the specified percentile indicates high trading activity.""")
|
| 158 |
|
| 159 |
with st.expander("How it Works", expanded=False):
|
| 160 |
st.markdown("""
|