OPEN-SOURCE SCRIPT
Mis à jour Candle Countdown & Position Sizer

Candle Countdown & Position Sizer
A compact on-chart table that keeps the two things a scalper checks most in one place: time and size.
It shows:
- Live clock with seconds, in the timezone you pick (Exchange, UTC, NY, London, Tokyo, Sydney).
- Countdown to the next 1m, 5m and 15m candle — so you always know how long the current bar has left. Each row turns to your chosen alert color in the final seconds before the candle closes.
- Suggested lot size based on ATR volatility, so your risk stays constant trade to trade.
How the sizing works
Tell it three things:
- how many dollars you're willing to lose on the trade,
- how wide your stop is, as a multiple of ATR (default 2× ATR),
- the ATR length and smoothing (Wilder or exponential — default EMA 100).
It computes the stop distance from current ATR and returns the lot size that caps your loss at that dollar amount if the stop is hit, rounded to a whole number. Flip on the debug toggle to also see the raw ATR and stop
distance behind the calculation.
Notes
- Updates arrive on price ticks, so during very quiet periods the clock may skip a second.
- Lot size uses the symbol's point value — always confirm it against your broker's contract specs before trading.
- Candle countdowns are anchored to UTC and are exact for intraday timeframes on 24h markets.
Not financial advice — a position-sizing aid. You are responsible for your own risk.
A compact on-chart table that keeps the two things a scalper checks most in one place: time and size.
It shows:
- Live clock with seconds, in the timezone you pick (Exchange, UTC, NY, London, Tokyo, Sydney).
- Countdown to the next 1m, 5m and 15m candle — so you always know how long the current bar has left. Each row turns to your chosen alert color in the final seconds before the candle closes.
- Suggested lot size based on ATR volatility, so your risk stays constant trade to trade.
How the sizing works
Tell it three things:
- how many dollars you're willing to lose on the trade,
- how wide your stop is, as a multiple of ATR (default 2× ATR),
- the ATR length and smoothing (Wilder or exponential — default EMA 100).
It computes the stop distance from current ATR and returns the lot size that caps your loss at that dollar amount if the stop is hit, rounded to a whole number. Flip on the debug toggle to also see the raw ATR and stop
distance behind the calculation.
Notes
- Updates arrive on price ticks, so during very quiet periods the clock may skip a second.
- Lot size uses the symbol's point value — always confirm it against your broker's contract specs before trading.
- Candle countdowns are anchored to UTC and are exact for intraday timeframes on 24h markets.
Not financial advice — a position-sizing aid. You are responsible for your own risk.
Notes de version
- Risk Mode: Fixed $ or % of Account. Size your position by a fixed dollar risk, or by a percentage of your account balance (new Account Size and Risk % inputs).- Stop split into two rows. Stop ATR (n) shows the stop distance in points (n = your ATR multiple). Stop Cash (x%) shows the actual cash at risk for the suggested lot count — displayed only in % of Account mode, where it's meaningful.
- ATR & Stop now shown by default (the old debug toggle is gone).
- Configurable countdowns. Master show/hide plus three timeframe slots you can each pick and toggle — no longer locked to 1m/5m/15m.
- ATR default is now EMA length 5 (was EMA 100) for a faster read on current volatility.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.