-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
46 lines (38 loc) · 2.2 KB
/
Copy pathconfig.py
File metadata and controls
46 lines (38 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
"""Strategy parameters.
Every tunable constant lives here so the strategy logic stays free of magic
numbers and a parameter sweep only needs to touch one file.
"""
# --- Universe -------------------------------------------------------------
# Twenty large-cap US technology names. Chosen for liquidity: each trades far
# above the volume floor below, so fills are realistic at the position sizes
# this system generates.
UNIVERSE = [
"AAPL", "MSFT", "GOOGL", "NVDA", "AMZN",
"META", "TSLA", "ADBE", "NFLX", "CSCO",
"INTC", "PYPL", "CRM", "ORCL", "IBM",
"QCOM", "AMD", "NOW", "INTU", "MU",
]
# --- Data ------------------------------------------------------------------
LOOKBACK_CALENDAR_DAYS = 400 # ~1 trading year plus weekend/holiday buffer
MIN_BARS_REQUIRED = 100 # reject a ticker with too little history to screen
# --- Stage 1: liquidity screen --------------------------------------------
MIN_PRICE = 3.00 # avoid sub-penny microstructure noise
MIN_AVG_VOLUME = 300_000 # 50-day average shares/day
TREND_SMA_PERIOD = 50 # price must sit above this SMA to be considered
# --- Stage 2: breakout signal ---------------------------------------------
# The pattern is an impulse leg, then a shallow consolidation, then a breakout
# to new highs -- a volatility-contraction setup.
BREAKOUT_LOOKBACK = 63 # trading days (~3 months) defining the prior high
MIN_IMPULSE_GAIN = 0.30 # impulse leg must run at least +30% into the peak
MIN_CONSOLIDATION_DAYS = 4 # too short is noise, not a base
MAX_CONSOLIDATION_DAYS = 40 # too long and the momentum has decayed
MAX_RETRACEMENT = 0.25 # a base deeper than 25% is a failed setup
ATR_PERIOD = 14
# --- Stage 3: position sizing ---------------------------------------------
ACCOUNT_EQUITY = 100_000.0
RISK_PER_TRADE = 0.02 # fixed-fractional: risk 2% of equity per position
MAX_STOP_ATR_MULTIPLE = 1.0 # reject setups whose stop is wider than 1x ATR
# --- Stage 4: exit ---------------------------------------------------------
EXIT_SMA_PERIOD = 10 # close below the 10-day SMA ends the trade
# --- Persistence -----------------------------------------------------------
PORTFOLIO_FILE = "active_positions.csv"