Risk Management
risk_per_trade_pct 1.0% $1,000
Maximum loss allowed on a single trade. The bot sizes your position so that if your stop-loss gets hit, you lose exactly this amount.
Entry $570, stop $568 ($2 risk) → Position = $1,000 ÷ $2 = 500 shares
Entry $570, stop $569 ($1 risk) → Position = $1,000 ÷ $1 = 1,000 shares
The risk stays constant — the size adjusts automatically.
max_daily_loss_amount 2500
If combined losses for the day reach this number, the bot stops trading and closes everything. Should be at least 2-3× your per-trade risk so you can survive a couple of losing trades.
Trade 1 loses $1,000. Trade 2 loses $800. Total = $1,800 → bot keeps going.
Trade 3 loses $700. Total = $2,500 → bot stops for the day.
max_daily_loss_pct 3.0% $3,000
Same as above but percentage-based. Whichever is lower (dollar amount or percentage) is the binding constraint.
daily_goal_amount 2000
Once you've made this much in a day, the bot stops taking new trades. Open trades ride to their targets. Prevents giving back profits by overtrading on a good day.
Two trades each make $1,100. Total = $2,200 → exceeds $2,000 goal → no new entries.
Open trades continue to their target or stop.
daily_goal_finish_trade true
When goal is hit, don't close open trades immediately — let them finish (hit TP or stop). Only block new entries.
max_open_trades 2
Maximum positions open simultaneously. With $1,000 risk each, worst case = $2,000 exposed. More than 2 on 5-min bars creates too much correlation — QQQ moves tend to hit both positions the same way.
Signal Detection
sd_min_rr 1.5
Minimum reward-to-risk ratio. At 1.5:1, for every $1 risked, you need $1.50 potential reward. You only need a 39% win rate to break even at this ratio.
Risk $1,000 → need at least $1,500 target.
Entry $570, stop $569 ($1 risk). Target must be ≥ $571.50 ($1.50 reward).
If target is only $571 (1:1 RR) → bot rejects the setup.
require_imbalance false
Whether zones must have a Fair Value Gap (FVG) — a price gap in a 3-candle impulse. FVGs indicate institutional buying/selling but are rare on 5-min bars (~50% of zones). Setting to false doubles your opportunity set while still having quality filters (structure + freshness + RR).
sd_lookback_bars 40
How far back (in bars) to scan for supply/demand zones. 40 × 5-min bars = 3h 20min of price history. Covers most of the trading day.
sd_zone_strength 2
Minimum consecutive "base" candles (small bodies, consolidation) before a breakout. A base of 2 candles followed by a strong breakout creates a supply or demand zone.
Two small candles (body < 75% of range) → strong green candle (body > 50% of range) → demand zone formed at the base area.
sd_zone_buffer_pct 0.1% $0.57
Zones are expanded by this amount on each side to catch near-touches.
Market Structure
structure_min_swings 2
Minimum swing points for the entry timeframe (5-min) to declare a trend. 2 swings = one Higher-High + Higher-Low (uptrend) or Lower-Low + Lower-High (downtrend). Bars without a clear trend are marked "consolidation" and blocked from trading.
Uptrend: Low $569 → High $571 → Higher-Low $569.50 = 2 swings → trend confirmed.
Consolidation: Price bounces between $569 and $571 with no clear direction → no trades.
htf_structure_min_swings 3
Same but for the higher timeframe (1-hour). Kept stricter at 3 because hourly data spans 25+ trading days — plenty for 3 swings. The big picture must be clear before acting on 5-min signals.
use_mtf_confirmation true
Higher timeframe trend must agree with (or be neutral to) the 5-min trend. If 5-min says "uptrend" but 1-hour says "downtrend" → no trade. Prevents fighting the bigger picture.
htf_timeframe 1Hour
The higher timeframe for multi-timeframe confirmation. The bot fetches the last 200 hourly bars (~25 trading days) to determine the big-picture direction.
HTF Context Mode
htf_mode context
How the bot uses hourly data. "context" = hourly informs but never blocks trades (adjusts size/RR/trail via tiers). "filter" = legacy blocking mode. "off" = ignore hourly entirely.
htf_opposed_size_pct 70%
When hourly disagrees with 5-min direction (Tier 3), use this % of normal position size. 70% of $1,000 risk = $700 risk per trade.
htf_opposed_rr_multiplier 0.8
When hourly disagrees, multiply the profit target by this. 1.5 RR × 0.8 = 1.2 RR — take profit sooner.
htf_opposed_trail_multiplier 0.7
When hourly disagrees, multiply trailing stop distance by this. 2.0 ATR × 0.7 = 1.4 ATR — tighter stop, faster exit on reversals.
max_position_minutes 45
Maximum minutes any trade can stay open. 0 = disabled. 45 = day-trading mode. Prevents accidental swing trades.
htf_zone_bonus true
When a 5-min zone overlaps an hourly zone, it gets a conviction bonus. These zones have institutional order flow.
htf_key_levels true
Detect HTF swing highs/lows as key levels shown on chart. These are where larger players have orders.
Liquidity & Sweeps
liq_equal_high_low_pct 0.08% $0.46
Two swing highs (or lows) within this range are "equal" — a liquidity pool. Market makers sweep these levels to grab stop-losses. When price pokes through and reverses, it's a high-probability signal.
High at $571.00, another high at $571.40 (within $0.46) → equal highs detected.
Price pushes to $571.50 then reverses → liquidity sweep confirmed.
liq_volume_multiplier 1.2
A sweep must happen with at least 1.2× average volume to be confirmed. Filters out random price pokes with no conviction behind them.
liq_sweep_confirm_bars 2
After a sweep, wait 2 bars (10 min) for price to confirm the reversal before acting.
Session Timing
session_skip_first_minutes 5
No trades in the first 5 minutes after open (9:30-9:35). Lets the opening auction chaos settle. The 9:35-9:45 window has the highest volume and biggest moves — we don't want to miss it.
session_stop_entries_before_close_min 15
No new entries in the last 15 minutes (3:45-4:00 PM). Prevents opening positions you won't have time to manage. The last hour is the second most active period — 15 minutes is enough safety margin.
eod_flatten_before_close_min 10
At 3:50 PM, force-close all open positions. Day trading means nothing stays open overnight. This is the safety net.
Trailing Stop (Chandelier Exit)
trailing_atr_multiplier 2.0
Trailing stop sits 2 × ATR away from the best price since entry. ATR measures "normal" volatility over the last 14 bars. On 5-min QQQ, ATR is typically $0.50-$1.50.
ATR = $0.80. Long entry at $570. Trail starts at $570 − $1.60 = $568.40.
Price rallies to $572 → trail moves to $572 − $1.60 = $570.40.
Price reverses to $570.40 → exit with $0.40/share profit.
trailing_atr_period 14
ATR calculation period. 14 bars × 5 min = 70 minutes of volatility data. The industry standard.
trailing_activation_r 1.0
Trail activates after the trade moves 1R in your favor (profit equals your risk amount). Until then, the fixed stop-loss is used.
Spike Protection
spike_guard_enabled true
Master switch for spike protection. When ON, the bot evaluates whether a stop-out is caused by a genuine breakdown or a false wick spike before exiting.
spike_defer_threshold 0.67
Spike score (0-1) above which the bot waits one more bar before exiting. Default 0.67 means 2 of 3 checks must flag a spike.
spike_widen_threshold 0.34
Spike score above which the stop is widened by spike_stop_buffer_atr instead of triggered. Should be lower than defer_threshold.
spike_stop_buffer_atr 0.3
How much to widen the stop (in ATR multiples) when a WIDEN verdict is issued.
spike_wick_depth_atr 0.5
Maximum wick depth past the stop (in ATR) that still counts as a "spike" rather than a genuine breakdown.
spike_volume_threshold 0.8
Volume ratio (current/average) below which a stop-touch is considered low-conviction. Below this = likely spike.
spike_session_volatile_minutes 30
Minutes from market open and close that are considered high-volatility windows.
spike_session_min_stop_atr 1.5
Minimum stop distance (in ATR) required during volatile session windows. Stops tighter than this trigger spike protection.
spike_max_defers 1
Maximum number of times a single trade can defer a stop exit. After this, the stop executes regardless.
spike_reentry_enabled false
Enable automatic re-entry after a spike-caused stop-out. Experimental — leave off for initial deployment.
spike_reentry_window_bars 3
How many bars after a spike stop-out to watch for price recovery.
spike_reentry_recovery_pct 0.5
Price must recover this percentage of the spike move to trigger a re-entry.
Order Execution
entry_order_type limit
Use limit orders for entries to avoid slippage. Market orders execute instantly but at whatever price is available.
limit_slippage_pct 0.05%
Limit price is set 0.05% from the signal price. On QQQ (~$600), that's about $0.60 of allowed slippage.
poll_interval_sec 30
In live mode, how often the bot checks for new data and evaluates signals. Every 30 seconds on 5-min bars.
7-Day Backtest Results
Mar 26 0 trades $0 No setup (smooth trend, no zones)
Mar 27 2 trades +$385 2 shorts: TP + EOD flatten
Mar 30 2 trades +$1,231 2 shorts: both hit TP
Mar 31 2 trades +$1,038 2 longs: both EOD flatten (winning)
Apr 01 1 trade −$86 1 long: trail stop (small loss)
Apr 02 1 trade −$377 1 short: EOD flatten (losing)
Apr 06 1 trade +$246 1 long: EOD flatten (winning)
Total: 9 trades 7W / 2L 78% win rate Net: +$2,437 Avg: $348/day