OPEN-SOURCE SCRIPT
MA wiht Logistic [Jsk]

This script is published for educational purposes only and does not constitute financial advice. Past performance does not guarantee future results. Trade at your own risk; the author accepts no liability for any financial loss incurred.
Concept
• Direction is defined by the relationship between price and two moving averages (Fast & Slow).
Long: Close > Fast MA > Slow MA
Short: Close < Fast MA < Slow MA
• Three independent exit modes are available:
1) None – positions are closed only when an opposite signal appears.
2) Percentage – fixed take-profit / stop-loss expressed in % of entry price (default +20 % / –5 %).
3) Logistic – a dynamic take-profit / stop-loss based on a logistic transformation of unrealised P&L.
Key Inputs
• MA Type: EMA, SMA or WMA
• Fast / Slow MA length
• Exit Mode: None | Percentage | Logistic
• Percentage TP / SL values (active when Exit Mode = Percentage)
• Logistic settings: slope k, midpoint, TP / SL probability thresholds (active when Exit Mode = Logistic)
Recommended Use
The script works on any market or timeframe, but MA-based trend filters usually perform better in assets with smooth, directional moves. Always verify results in the Strategy Tester and account for commissions and slippage.
Concept
• Direction is defined by the relationship between price and two moving averages (Fast & Slow).
Long: Close > Fast MA > Slow MA
Short: Close < Fast MA < Slow MA
• Three independent exit modes are available:
1) None – positions are closed only when an opposite signal appears.
2) Percentage – fixed take-profit / stop-loss expressed in % of entry price (default +20 % / –5 %).
3) Logistic – a dynamic take-profit / stop-loss based on a logistic transformation of unrealised P&L.
Key Inputs
• MA Type: EMA, SMA or WMA
• Fast / Slow MA length
• Exit Mode: None | Percentage | Logistic
• Percentage TP / SL values (active when Exit Mode = Percentage)
• Logistic settings: slope k, midpoint, TP / SL probability thresholds (active when Exit Mode = Logistic)
Recommended Use
The script works on any market or timeframe, but MA-based trend filters usually perform better in assets with smooth, directional moves. Always verify results in the Strategy Tester and account for commissions and slippage.
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.