OPEN-SOURCE SCRIPT

Prop Firm Session Guard [EmpArchitect]

1 032
█ OVERVIEW

The Prop Firm Session Guard keeps you inside your funded account rules — automatically. It calculates your position size, shows R:R levels on the chart, tracks how much daily loss budget you've consumed, and tells you when your trading session opens and closes.

Most prop firm traders get disqualified not because of bad analysis — but because of one emotional trade that broke a rule. This indicator makes the rules visible so you see the boundary before you cross it.

This is a risk management tool. It does not suggest entries, stop losses, or take profits. It shows your limits — you trade within them.

█ HOW IT WORKS

Enter your account balance and prop firm rules (daily max loss, total drawdown, profit target). The indicator calculates everything from there.

Position sizing adapts to instrument type automatically. Futures use point value per contract. Crypto shows coins. Forex shows lots. The math: risk per trade ($) divided by stop loss distance (ATR × multiplier) divided by point value = your position size. On a $100K account with 1% risk and 1.5× ATR stop on NQ, that comes out to roughly 0.5 contracts — the indicator shows you the exact number.

R:R levels draw directly on the chart as dashed lines. Long levels in teal (▲), short levels in amber (▼), stop levels in red. The shaded risk zone box shows exactly where your capital is exposed. Select Long, Short, or Both in settings based on your bias.

Tip: use Long or Short mode on tighter instruments where both directions would overlap. Both mode works best on volatile instruments like NQ and BTC where the R-unit creates enough vertical space.

█ DAILY LOSS TRACKING

The dashboard tracks instrument price change from daily open as a proxy for session exposure. A visual bar shows how much of your daily loss limit has been consumed: ████░░░░░░ means you've used 40% of your allowed daily drawdown.

Three risk states drive the background and bar coloring: SAFE (teal, under 50%), WARNING (amber, 50-80%), DANGER (red, above 80%). When you're in DANGER, the chart background tints red — you cannot miss it.

The "Trades Left" row shows how many more trades you can afford at your current risk setting before hitting the daily loss limit. When it shows 1, that is your last shot today.

Note: this tracks instrument price movement from daily open, not your actual account equity. Your real P&L depends on position size, direction, and entry timing. Use this as a session awareness tool alongside your broker's account dashboard.

█ SESSION AWARENESS

Set your allowed trading hours. The indicator marks session open with a green ▶ SESSION label and close with a red ◼ STOP label. Bars outside your session window are grayed out — a constant visual reminder that you should not be trading.

Friday cutoff support: set a separate Friday close time for weekend risk rules. A ⚠ FRI CUTOFF label appears at that hour.

The dashboard shows session time remaining and warns during the last hour. No more "I didn't realize the session was about to close" blown rules.

█ DASHBOARD

The top-right dashboard shows at a glance: risk status (SAFE/WARNING/DANGER), account balance and risk per trade, instrument daily move and percentage of daily limit consumed, visual limit bar, total drawdown reference, position size in the correct units for your instrument, 1R size in price, trades remaining in daily budget, session timer, and profit target reference.

█ PROP FIRM DEFAULTS

Configure for any firm by adjusting three inputs:
FTMO: 5% daily, 10% total, 10% target (Phase 1) or 5% target (Phase 2)
The5ers: 5% daily, 10% total, 6-8% target
Apex: 2.5-5% daily, 6-8% total
MyFundedFX: 5% daily, 12% total

v1.1 will add a preset dropdown that auto-fills these values.

█ FEATURES

— Automatic position sizing for futures (contracts), forex (lots), and crypto (coins)
— Bidirectional R:R overlay: Long (teal ▲) and Short (amber ▼) levels with risk zone box
— Daily loss tracking with visual limit bar
— Three risk states with background and bar coloring
— Trades remaining before hitting daily loss limit
— Session open/close markers with configurable hours
— Friday cutoff support
— Total drawdown reference display
— Configurable for any prop firm's rules
— Alert conditions for 50% warning, 80% danger, session open/close, last trade budget

█ HOW TO USE

Add to your chart before every session. Check the dashboard: are you SAFE? How many trades can you afford today? Is the session open?

Before every trade, check position size — the indicator already calculated it based on your risk rules and current ATR. Use the R:R levels to visualize where your 1R, 2R, 3R targets sit relative to current price structure.

If the background turns amber, slow down. If it turns red, stop. The indicator exists to prevent the one trade that ends your funded account.

Combine with the Smart Liquidity Map and FVG Detector to identify high-quality setups, and use this indicator to size and manage them within your rules.

█ NOTES

— Works on all instruments and timeframes
— Best on 5M-15M for intraday session management
— Position sizing uses syminfo.pointvalue for accurate futures calculations
— Pine Script v6, open-source
— Built by EmpArchitect

Pernyataan Penyangkalan

Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.