QuantumLearner commited on
Commit
9906fcd
·
verified ·
1 Parent(s): d450307

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -14
app.py CHANGED
@@ -151,23 +151,29 @@ st.title(f"Hull Moving Average Cross-Over Strategy Optimizer - {st.session_state
151
 
152
  # Explanation with LaTeX formulas
153
  st.write("""
154
- This application optimizes a trading strategy based on the Hull Moving Average. The strategy uses a cross-over method to generate buy and sell signals by finding the best MA parameters in a given horizon. To read more about moving averages methodologies, visit [this link](https://entreprenerdly.com/top-36-moving-averages-methods-for-stock-prices-in-python/).
155
- """)
156
- st.latex(r"""
157
- \text{HMA} = \text{WMA}(2 \times \text{WMA}(n/2) - \text{WMA}(n), \sqrt{n})
158
  """)
159
 
160
- st.write("""
161
- The cross-over signals are generated based on the following rule:
162
- """)
163
- st.latex(r"""
164
- \text{Signal} =
165
- \begin{cases}
166
- \text{Buy} & \text{if } \text{Short HMA} > \text{Long HMA} \\
167
- \text{Sell} & \text{if } \text{Short HMA} < \text{Long HMA}
168
- \end{cases}
169
- """)
170
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
171
  # Main application logic
172
  if run_button:
173
  if 'data' not in st.session_state or st.session_state.get('ticker') != ticker or st.session_state.get('start_date') != start_date or st.session_state.get('end_date') != end_date:
 
151
 
152
  # Explanation with LaTeX formulas
153
  st.write("""
154
+ This application optimizes a trading strategy based on the Hull Moving Average. The strategy uses a cross-over method to generate buy and sell signals by finding the best MA parameters in a given horizon.
 
 
 
155
  """)
156
 
157
+ with st.expander("Hull Moving Average Methodology", expanded=False):
 
 
 
 
 
 
 
 
 
158
 
159
+ st.latex(r"""
160
+ \text{HMA} = \text{WMA}(2 \times \text{WMA}(n/2) - \text{WMA}(n), \sqrt{n})
161
+ """)
162
+
163
+ st.write("""
164
+ The cross-over signals are generated based on the following rule:
165
+ """)
166
+ st.latex(r"""
167
+ \text{Signal} =
168
+ \begin{cases}
169
+ \text{Buy} & \text{if } \text{Short HMA} > \text{Long HMA} \\
170
+ \text{Sell} & \text{if } \text{Short HMA} < \text{Long HMA}
171
+ \end{cases}
172
+ """)
173
+ st.write("""
174
+ To read more about moving averages methodologies, visit [this link](https://entreprenerdly.com/top-36-moving-averages-methods-for-stock-prices-in-python/).
175
+ """)
176
+
177
  # Main application logic
178
  if run_button:
179
  if 'data' not in st.session_state or st.session_state.get('ticker') != ticker or st.session_state.get('start_date') != start_date or st.session_state.get('end_date') != end_date: