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.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.