OPEN-SOURCE SCRIPT
Dynamic Take Profit Stop Loss

Dynamic Take Profit Stop Loss
Dynamic Take Profit Stop Loss is designed to move beyond static take profit levels by dynamically adapting profit projections to changing market conditions.
Instead of relying on fixed R:R targets or ATR values alone, this indicator uses an internal Efficiency Engine to measure how effectively price is moving and adjusts projected targets accordingly.
As market efficiency strengthens, targets can expand. As efficiency weakens or deteriorates, targets can tighten to help preserve gains and reduce exposure.
Key Features
• Adaptive TP projections based on market efficiency
• SL-based R:R projection mode
• ATR-based projection mode
• Dynamic TP expansion and contraction logic
• Automatic Optimal TP selection (TP1 / TP2 / TP3)
• Local High / Low stop-loss calculation with adjustable buffers
• Optional manual entry price input
• Multiple TP display combinations:
TP1 Only
TP2 Only
TP3 Only
Optimal Only
TP + Optimal combinations
Multi-TP combinations
Show All
• Long and Short trade projections
• Dynamic TP multiplier engine
• Efficiency state analysis:
Improving
Mixed
Worsening
• Live information table showing:
Efficiency Score
Market State
TP Multiplier
Optimal TP
Long SL Distance
Short SL Distance
• Adjustable colors, table placement, text sizing, labels, and projection length
How It Works
The internal Efficiency Engine analyzes recent price behavior by comparing:
• Net directional movement
• Total movement path traveled
• Historical improvement or deterioration in efficiency
A weighted score is generated and translated into a dynamic TP multiplier.
Typical behavior:
Strong efficiency + improving conditions
→ Expand targets
Neutral conditions
→ Hold targets
Weakening efficiency
→ Tighten targets
Weak and deteriorating conditions
→ Exit or reduce exposure
Example Use
A standard 2R target may become:
Strong conditions:
2R → 3R+
Weak conditions:
2R → 1.2R–1.5R
The goal is to align profit expectations with how price is actually behaving instead of assuming all trades deserve identical targets.
Best Used For
• Trend continuation trading
• Breakout strategies
• Intraday trading
• Swing trading
• Futures
• Forex
• Indices
• Crypto
• Stocks
About TrendGenY Indicators
TrendGenY indicators are built from market experience, creative concepts, and a constant pursuit of unique perspectives. Rather than following conventional ideas, the focus is on uncovering alternative insights and viewing market behavior through different angles to reveal information that traditional tools may overlook and help traders build a more meaningful edge in the market.
Dynamic Take Profit Stop Loss is designed to move beyond static take profit levels by dynamically adapting profit projections to changing market conditions.
Instead of relying on fixed R:R targets or ATR values alone, this indicator uses an internal Efficiency Engine to measure how effectively price is moving and adjusts projected targets accordingly.
As market efficiency strengthens, targets can expand. As efficiency weakens or deteriorates, targets can tighten to help preserve gains and reduce exposure.
Key Features
• Adaptive TP projections based on market efficiency
• SL-based R:R projection mode
• ATR-based projection mode
• Dynamic TP expansion and contraction logic
• Automatic Optimal TP selection (TP1 / TP2 / TP3)
• Local High / Low stop-loss calculation with adjustable buffers
• Optional manual entry price input
• Multiple TP display combinations:
TP1 Only
TP2 Only
TP3 Only
Optimal Only
TP + Optimal combinations
Multi-TP combinations
Show All
• Long and Short trade projections
• Dynamic TP multiplier engine
• Efficiency state analysis:
Improving
Mixed
Worsening
• Live information table showing:
Efficiency Score
Market State
TP Multiplier
Optimal TP
Long SL Distance
Short SL Distance
• Adjustable colors, table placement, text sizing, labels, and projection length
How It Works
The internal Efficiency Engine analyzes recent price behavior by comparing:
• Net directional movement
• Total movement path traveled
• Historical improvement or deterioration in efficiency
A weighted score is generated and translated into a dynamic TP multiplier.
Typical behavior:
Strong efficiency + improving conditions
→ Expand targets
Neutral conditions
→ Hold targets
Weakening efficiency
→ Tighten targets
Weak and deteriorating conditions
→ Exit or reduce exposure
Example Use
A standard 2R target may become:
Strong conditions:
2R → 3R+
Weak conditions:
2R → 1.2R–1.5R
The goal is to align profit expectations with how price is actually behaving instead of assuming all trades deserve identical targets.
Best Used For
• Trend continuation trading
• Breakout strategies
• Intraday trading
• Swing trading
• Futures
• Forex
• Indices
• Crypto
• Stocks
About TrendGenY Indicators
TrendGenY indicators are built from market experience, creative concepts, and a constant pursuit of unique perspectives. Rather than following conventional ideas, the focus is on uncovering alternative insights and viewing market behavior through different angles to reveal information that traditional tools may overlook and help traders build a more meaningful edge in the market.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.