OPEN-SOURCE SCRIPT
Seykota Trend System

Here's a breakdown of everything the script does:
EMA Engine
Three EMAs: fast (default 15), slow (default 150), and a signal EMA (default 9) used as a confirmation layer. The 150/15 pairing mirrors Seykota's published S&P model on his TSP website. The cloud fill between fast and slow gives an instant read on trend health — teal when bullish, red when bearish.
Trailing Stop — Two Modes
ATR mode ratchets the stop upward in a long (or downward in a short) so it can never move against you. Swing mode uses the highest/lowest bar over a lookback period instead — closer to how Seykota described using support/resistance corridors in his Gold model. Switch between them in settings.
Position Sizing Output
The core Seykota formula: Units = (Account × Risk%) ÷ Stop Distance. Every entry label shows the calculated position size live on the chart. As volatility expands (wider ATR → wider stop → fewer units), the system automatically sizes down. As volatility contracts, it sizes up. This is the mechanism behind "keep bets small" — it's dynamic, not a fixed number.
ADX Filter
Seykota only wanted to be in trending markets. The ADX filter blocks signals when ADX is below your threshold (default 20), keeping the system out of choppy sideways conditions where trend-following underperforms.
Volume Filter
Optional confirmation that the move has institutional participation behind it — volume must be above its MA multiplied by a factor you control.
HUD Table
Bottom-right panel shows live: trend state, both EMAs, ATR, trailing stop level, ADX reading, risk dollars per trade, and current position size.
Alerts
Four alert conditions are wired up — long signal, short signal, trend flip to bull, trend flip to bear — ready to connect to TradingView webhooks or notifications.
Suggested starting parameters by market:
Futures/commodities: 150/15 EMA, ATR ×3.0, ADX 20
Equities (daily): 200/50 EMA, ATR ×2.5, ADX 20
Crypto (daily): 100/25 EMA, ATR ×2.0, ADX 25 (crypto is noisier)
EMA Engine
Three EMAs: fast (default 15), slow (default 150), and a signal EMA (default 9) used as a confirmation layer. The 150/15 pairing mirrors Seykota's published S&P model on his TSP website. The cloud fill between fast and slow gives an instant read on trend health — teal when bullish, red when bearish.
Trailing Stop — Two Modes
ATR mode ratchets the stop upward in a long (or downward in a short) so it can never move against you. Swing mode uses the highest/lowest bar over a lookback period instead — closer to how Seykota described using support/resistance corridors in his Gold model. Switch between them in settings.
Position Sizing Output
The core Seykota formula: Units = (Account × Risk%) ÷ Stop Distance. Every entry label shows the calculated position size live on the chart. As volatility expands (wider ATR → wider stop → fewer units), the system automatically sizes down. As volatility contracts, it sizes up. This is the mechanism behind "keep bets small" — it's dynamic, not a fixed number.
ADX Filter
Seykota only wanted to be in trending markets. The ADX filter blocks signals when ADX is below your threshold (default 20), keeping the system out of choppy sideways conditions where trend-following underperforms.
Volume Filter
Optional confirmation that the move has institutional participation behind it — volume must be above its MA multiplied by a factor you control.
HUD Table
Bottom-right panel shows live: trend state, both EMAs, ATR, trailing stop level, ADX reading, risk dollars per trade, and current position size.
Alerts
Four alert conditions are wired up — long signal, short signal, trend flip to bull, trend flip to bear — ready to connect to TradingView webhooks or notifications.
Suggested starting parameters by market:
Futures/commodities: 150/15 EMA, ATR ×3.0, ADX 20
Equities (daily): 200/50 EMA, ATR ×2.5, ADX 20
Crypto (daily): 100/25 EMA, ATR ×2.0, ADX 25 (crypto is noisier)
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.