refactor: Move strategy guide to dedicated page module
This commit is contained in:
parent
b35349c885
commit
417dbbc596
90
src/pages/rules/strategy_guide_page.py
Normal file
90
src/pages/rules/strategy_guide_page.py
Normal file
@ -0,0 +1,90 @@
|
||||
import streamlit as st
|
||||
|
||||
def strategy_guide_page():
|
||||
st.header("Trading Strategy Guide")
|
||||
|
||||
# Pre-Market Section
|
||||
with st.expander("1. Pre-Market Preparation (Night Before)", expanded=True):
|
||||
st.markdown("""
|
||||
* Run SunnyBands Screener (Daily Timeframe)
|
||||
* Add strong setups to watchlist
|
||||
* Focus on:
|
||||
- Stocks near key SunnyBands levels
|
||||
- SMA crossovers
|
||||
- RSI confirmation
|
||||
* Mark key levels:
|
||||
- Support
|
||||
- Resistance
|
||||
- Potential breakout zones
|
||||
* Set price alerts
|
||||
""")
|
||||
|
||||
# Morning Trading Section
|
||||
with st.expander("2. Trading Strategy (6:30-7:30 AM PST)"):
|
||||
st.markdown("""
|
||||
**Objective:** Capture early momentum plays
|
||||
|
||||
**Best Setups:**
|
||||
1. Gap and Go
|
||||
- Stock gaps up with high volume
|
||||
- Breaks pre-market high
|
||||
2. Opening Range Breakout (ORB)
|
||||
- 5-15 min consolidation
|
||||
- Clean breakout
|
||||
3. Pullback to Key Support
|
||||
- Dips to major MA or VWAP
|
||||
- Shows bounce potential
|
||||
|
||||
**Rules:**
|
||||
* Focus on 2x+ relative volume
|
||||
* Tight stops (1-2% max)
|
||||
* Partial exits at 3-5%
|
||||
* Avoid chasing gaps
|
||||
""")
|
||||
|
||||
# Midday Trading Section
|
||||
with st.expander("2. Trading Strategy (12:00-1:00 PM PST)"):
|
||||
st.markdown("""
|
||||
**Objective:** Identify clear trends for swing trades
|
||||
|
||||
**Best Setups:**
|
||||
1. Trend Continuation
|
||||
- Holding above VWAP/SMA50
|
||||
- Shows consistent strength
|
||||
2. Reversal Entry
|
||||
- RSI/MACD divergence
|
||||
- Near SunnyBands lower level
|
||||
3. Breakout Retest
|
||||
- Morning breakout
|
||||
- Clean retest of level
|
||||
|
||||
**Rules:**
|
||||
* Confirm morning runners
|
||||
* Wait for pattern confirmation
|
||||
* Clear stop loss placement
|
||||
* Focus on SunnyBands levels
|
||||
""")
|
||||
|
||||
# Execution Rules Section
|
||||
with st.expander("4. Trade Execution Rules"):
|
||||
st.markdown("""
|
||||
* Risk Management:
|
||||
- 1-2% account risk per trade
|
||||
- No overleverage
|
||||
* Order Types:
|
||||
- Use limit orders for entries
|
||||
- Set OCO orders for exits
|
||||
* Position Management:
|
||||
- Follow stop-loss plan
|
||||
- Take partial profits at 5-10%
|
||||
- Trail stops on runners
|
||||
""")
|
||||
|
||||
# Review Section
|
||||
with st.expander("5. Post-Trading Review"):
|
||||
st.markdown("""
|
||||
* Journal every trade
|
||||
* Review performance
|
||||
* Check scanner results
|
||||
* Refine strategies
|
||||
""")
|
||||
@ -17,6 +17,7 @@ from trading.trading_plan import (
|
||||
link_trades_to_plan, calculate_plan_metrics, unlink_trades_from_plan
|
||||
)
|
||||
from trading.position_calculator import PositionCalculator
|
||||
from pages.rules.strategy_guide_page import strategy_guide_page
|
||||
from screener.scanner_controller import run_technical_scanner
|
||||
from screener.canslim_controller import run_canslim_screener
|
||||
from trading.portfolio import Portfolio, Position
|
||||
@ -730,94 +731,6 @@ def trading_system_page():
|
||||
except Exception as e:
|
||||
st.error(f"Error updating portfolio value: {str(e)}")
|
||||
|
||||
def strategy_guide_page():
|
||||
st.header("Trading Strategy Guide")
|
||||
|
||||
# Pre-Market Section
|
||||
with st.expander("1. Pre-Market Preparation (Night Before)", expanded=True):
|
||||
st.markdown("""
|
||||
* Run SunnyBands Screener (Daily Timeframe)
|
||||
* Add strong setups to watchlist
|
||||
* Focus on:
|
||||
- Stocks near key SunnyBands levels
|
||||
- SMA crossovers
|
||||
- RSI confirmation
|
||||
* Mark key levels:
|
||||
- Support
|
||||
- Resistance
|
||||
- Potential breakout zones
|
||||
* Set price alerts
|
||||
""")
|
||||
|
||||
# Morning Trading Section
|
||||
with st.expander("2. Trading Strategy (6:30-7:30 AM PST)"):
|
||||
st.markdown("""
|
||||
**Objective:** Capture early momentum plays
|
||||
|
||||
**Best Setups:**
|
||||
1. Gap and Go
|
||||
- Stock gaps up with high volume
|
||||
- Breaks pre-market high
|
||||
2. Opening Range Breakout (ORB)
|
||||
- 5-15 min consolidation
|
||||
- Clean breakout
|
||||
3. Pullback to Key Support
|
||||
- Dips to major MA or VWAP
|
||||
- Shows bounce potential
|
||||
|
||||
**Rules:**
|
||||
* Focus on 2x+ relative volume
|
||||
* Tight stops (1-2% max)
|
||||
* Partial exits at 3-5%
|
||||
* Avoid chasing gaps
|
||||
""")
|
||||
|
||||
# Midday Trading Section
|
||||
with st.expander("2. Trading Strategy (12:00-1:00 PM PST)"):
|
||||
st.markdown("""
|
||||
**Objective:** Identify clear trends for swing trades
|
||||
|
||||
**Best Setups:**
|
||||
1. Trend Continuation
|
||||
- Holding above VWAP/SMA50
|
||||
- Shows consistent strength
|
||||
2. Reversal Entry
|
||||
- RSI/MACD divergence
|
||||
- Near SunnyBands lower level
|
||||
3. Breakout Retest
|
||||
- Morning breakout
|
||||
- Clean retest of level
|
||||
|
||||
**Rules:**
|
||||
* Confirm morning runners
|
||||
* Wait for pattern confirmation
|
||||
* Clear stop loss placement
|
||||
* Focus on SunnyBands levels
|
||||
""")
|
||||
|
||||
# Execution Rules Section
|
||||
with st.expander("4. Trade Execution Rules"):
|
||||
st.markdown("""
|
||||
* Risk Management:
|
||||
- 1-2% account risk per trade
|
||||
- No overleverage
|
||||
* Order Types:
|
||||
- Use limit orders for entries
|
||||
- Set OCO orders for exits
|
||||
* Position Management:
|
||||
- Follow stop-loss plan
|
||||
- Take partial profits at 5-10%
|
||||
- Trail stops on runners
|
||||
""")
|
||||
|
||||
# Review Section
|
||||
with st.expander("5. Post-Trading Review"):
|
||||
st.markdown("""
|
||||
* Journal every trade
|
||||
* Review performance
|
||||
* Check scanner results
|
||||
* Refine strategies
|
||||
""")
|
||||
|
||||
def trading_plan_page():
|
||||
st.header("Trading Plans")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user