Overview
SmartTP (Smart Take Profit) is an intelligent trailing take-profit system that maximizes your profits by letting winning trades run while protecting your gains. Unlike traditional fixed take-profit targets that close positions at predetermined levels, SmartTP activates a trailing mechanism that follows the price movement and only closes when the market pulls back by a specified amount.
π Traditional TP vs SmartTP
Traditional Take Profit
- TargetProfitPer: 5
SellPer: 50
EnableSmartTP: false
What happens:
- Trade reaches 5% profit β Immediately sells 50%
- Trade continues to 15% profit β You missed 10% additional gains β
SmartTP
- TargetProfitPer: 5
SellPer: 50
EnableSmartTP: true
TrailingGapPer: 2.0
What happens:
- Trade reaches 5% profit β SmartTP activates (no sale yet)
- Trade continues to 15% profit β SmartTP tracks the peak π
- Trade pulls back to 13% (15% - 2% = 13%) β Sells 50% at 13% profit β
- You captured an extra 8% profit!
π Configuration Parameters
Required Parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
TargetProfitPer |
Float | Activation threshold - profit % where SmartTP begins tracking | 5.0 |
SellPer |
Integer | Percentage of position to sell when triggered | 50 |
EnableSmartTP |
Boolean | Enable/disable SmartTP for this rule | true |
TrailingGapPer |
Float | Pullback % from peak that triggers the sale | 2.0 |
Optional Parameters
| Parameter | Type | Description | Example |
|---|---|---|---|
MinProfitLock |
Float | Minimum guaranteed profit (safety net) | 4.0 |
RuleName |
String | Descriptive name for logging | "Smart Partial TP" |
UseMarketOrder |
Boolean | Use market order (true) or limit order (false) | true |
IsEnabled |
Boolean | Enable/disable this entire rule | true |
π Configuration Examples
Example 1: Conservative SmartTP (Tight Trailing)
Use Case: You want to secure profits quickly but still capture some upside.
LongTrade:
TakeProfitRules:
- TargetProfitPer: 3 # Activate at 3% profit
SellPer: 50 # Sell half position
RuleName: "Conservative Smart TP"
IsEnabled: true
UseMarketOrder: true
EnableSmartTP: true
TrailingGapPer: 1.0 # Close on 1% pullback (tight)
MinProfitLock: 2.5 # Guarantee at least 2.5%
Behavior:
- β Activates at 3% profit
- β Tracks price as it rises (4%, 5%, 6%...)
- β If price reaches 6% then drops to 5%, sells 50% at 5% profit
- β If price crashes below 2.5%, sells immediately (safety net)
Example 2: Aggressive SmartTP (Wide Trailing)
Use Case: You believe in strong trends and want to ride them longer.
LongTrade:
TakeProfitRules:
- TargetProfitPer: 5 # Activate at 5% profit
SellPer: 30 # Sell only 30%
RuleName: "Aggressive Smart TP"
IsEnabled: true
UseMarketOrder: true
EnableSmartTP: true
TrailingGapPer: 3.0 # Close on 3% pullback (wide)
MinProfitLock: 4.0 # Guarantee at least 4%
Behavior:
- β Activates at 5% profit
- β Allows 3% pullback before closing (lets trade breathe)
- β If price reaches 20% then drops to 17%, sells 30% at 17% profit
- β Still protects with 4% minimum
Example 3: Multi-Level SmartTP Strategy
Use Case: Scale out of position at different levels with different trailing gaps.
LongTrade:
TakeProfitRules:
# Level 1: Quick partial exit with tight trailing
- TargetProfitPer: 3
SellPer: 25
RuleName: "Smart TP Level 1"
IsEnabled: true
UseMarketOrder: true
EnableSmartTP: true
TrailingGapPer: 1.0
MinProfitLock: 2.5
# Level 2: Medium exit with moderate trailing
- TargetProfitPer: 7
SellPer: 35
RuleName: "Smart TP Level 2"
IsEnabled: true
UseMarketOrder: true
EnableSmartTP: true
TrailingGapPer: 2.0
MinProfitLock: 5.0
# Level 3: Final exit with wide trailing (let winners run!)
- TargetProfitPer: 15
SellPer: 100
RuleName: "Smart TP Level 3"
IsEnabled: true
UseMarketOrder: true
EnableSmartTP: true
TrailingGapPer: 4.0
MinProfitLock: 10.0
Behavior:
- π At 3% profit: Level 1 activates, trails with 1% gap
- π At 7% profit: Level 2 activates, trails with 2% gap
- π At 15% profit: Level 3 activates, trails with 4% gap
- π Each level independently tracks and closes when its gap is hit
Example 4: Mixing Traditional TP + SmartTP
Use Case: Secure some profit immediately, then let the rest trail.
LongTrade:
TakeProfitRules:
# Traditional TP: Immediate partial close
- TargetProfitPer: 2
SellPer: 20
RuleName: "Quick Traditional TP"
IsEnabled: true
UseMarketOrder: true
EnableSmartTP: false # Traditional fixed TP
# SmartTP: Trail the remaining position
- TargetProfitPer: 5
SellPer: 80 # Sell remaining 80%
RuleName: "Smart Trailing TP"
IsEnabled: true
UseMarketOrder: true
EnableSmartTP: true
TrailingGapPer: 2.5
MinProfitLock: 4.0
Behavior:
- β At 2% profit: Immediately sells 20% (locks in quick gain)
- β At 5% profit: SmartTP activates for remaining 80%
- β Trails the market and closes when price pulls back 2.5%
Example 5: High Volatility Assets (Crypto/Meme Coins)
Use Case: Trading extremely volatile assets like UNI, DOGE, SHIB, or new listings.
ShortTrade:
TakeProfitRules:
- TargetProfitPer: 6 # Activate at 6% profit
SellPer: 100 # Close entire position
RuleName: "High Vol Smart TP - Short"
IsEnabled: true
UseMarketOrder: true # Critical for fast execution
EnableSmartTP: true
TrailingGapPer: 3.0 # Wider gap for volatility spikes
MinProfitLock: 5.0 # Safety net at 5%
Why wider TrailingGap for high volatility?
- β Price can swing 2-3% in seconds (normal noise)
- β 2% gap might trigger on volatility spike, not real reversal
- β 3-4% gap filters out noise while protecting from reversals
- β Bot has 1-3 second processing delay - wider gap accounts for this
Performance Example (Real UNI Trade):
Entry: $4.4186
Peak: 9.07% profit (in extreme volatility)
Exit: 6.44% profit (after 2.63% pullback)
Result: Captured 71% of peak move β
Protected 2.63% from reversal β
Example 6: Hybrid Strategy for Extreme Volatility
Use Case: Split between immediate profit-taking and trailing for volatile assets.
ShortTrade:
TakeProfitRules:
# Fast scalp for quick profit (no SmartTP delay)
- TargetProfitPer: 4
SellPer: 40
RuleName: "Quick Scalp - Short"
IsEnabled: true
EnableSmartTP: false # Traditional fixed TP
UseMarketOrder: true
# SmartTP for the rest with wider gap
- TargetProfitPer: 6
SellPer: 60
RuleName: "Smart Trail - Short"
IsEnabled: true
UseMarketOrder: true
EnableSmartTP: true
TrailingGapPer: 3.5 # Wide gap for volatility
MinProfitLock: 5.0 # Safety net
Strategy Benefits:
- β Lock 40% at 4% immediately (avoid volatility risk)
- β Trail remaining 60% to capture big moves
- β Best of both worlds - security + upside potential
π Real-World Scenarios
Scenario 1: Strong Uptrend
Configuration:
- TargetProfitPer: 5%
- TrailingGapPer: 2%
- SellPer: 50%
Timeline:
T+0: Entry at $100
T+1: Price hits $105 (5% profit) β SmartTP ACTIVATES π’
T+2: Price rises to $110 (10% profit) β Tracking...
T+3: Price rises to $115 (15% profit) β Peak recorded π
T+4: Price rises to $120 (20% profit) β New peak! π
T+5: Price drops to $118 (18% profit) β Still OK (< 2% pullback)
T+6: Price drops to $117.60 (17.6% profit) β TRIGGER! π―
β Sells 50% at 17.6% profit
Result: You captured 17.6% instead of 5%! π
Scenario 2: False Breakout (MinProfitLock Saves You)
Configuration:
- TargetProfitPer: 5%
- TrailingGapPer: 2%
- MinProfitLock: 4%
- SellPer: 50%
Timeline:
T+0: Entry at $100
T+1: Price hits $107 (7% profit) β SmartTP ACTIVATES π’
T+2: Price rises to $108 (8% profit) β Peak recorded π
T+3: Price CRASHES to $103 (3% profit) β Below MinProfitLock! β οΈ
β Emergency close at 3% profit (MinProfitLock prevented worse loss)
Without MinProfitLock: Would wait for 8% - 2% = 6% trigger
With MinProfitLock: Exits at 3% when safety net is hit β
Scenario 3: Choppy Market
Configuration:
- TargetProfitPer: 5%
- TrailingGapPer: 1.5%
- SellPer: 100%
Timeline:
T+0: Entry at $100
T+1: Price hits $105.50 (5.5% profit) β SmartTP ACTIVATES π’
T+2: Price rises to $106 (6% profit) β Peak π
T+3: Price drops to $105 (5% profit) β OK (< 1.5% pullback)
T+4: Price rises to $107 (7% profit) β New peak! π
T+5: Price drops to $105.30 (5.3% profit) β TRIGGER! π―
β Sells 100% at 5.3% profit
Result: Captured 5.3% in choppy market (vs 5.5% immediate)
Note: In choppy markets, tighter TrailingGap is better
Scenario 4: Extreme Volatility (Real UNI Case Study) π₯
Asset: UNIUSDT
Direction: Short
Configuration:
- TargetProfitPer: 6%
- TrailingGapPer: 2%
- SellPer: 100%
- MinProfitLock: Not set
Timeline:
T+0: Entry (DCA average): $4.4186
T+5min: Price drops, profit at 4%
T+10min: Price drops to $4.2140, profit ~5%
T+15min: Price hits target β SmartTP ACTIVATES at 6.12% π’
T+20min: EXTREME VOLATILITY - price swings wildly
Peak profit reaches: 9.07% π
Price at: ~$4.02
T+21min: Price rebounds sharply
T+22min: Current profit: 6.44%
Pullback from peak: 9.07% - 6.44% = 2.63%
Pullback > 2% TrailingGap β TRIGGER! π―
T+23min: Exit at $4.1340 (6.44% profit)
Results:
β
Activated correctly at 6.12%
β
Tracked peak at 9.07% during volatility
β
Captured 6.44% vs 6% fixed TP (+7.3% more)
β
Protected from 2.63% reversal
β
Peak capture efficiency: 71% (excellent in extreme volatility)
Lessons Learned:
β οΈ Small discrepancy in logs (8.82% vs 9.07%) is NORMAL
β Caused by 1-3 second bot processing delay
β Peak updated faster than database writes
β Not a bug - expected in extreme volatility
π‘ For UNI and similar volatile assets, consider:
β TrailingGapPer: 3.0% (wider gap for volatility)
β MinProfitLock: 5.0% (safety net)
β UseMarketOrder: true (critical for fast execution)
Visual Representation:
Price Movement (Short Trade - Lower is Better):
$4.5760 βββββββββββββββββββββββββββ DCA Entry #2
β
$4.4186 βββββββββββββββββββββββββββ Average Entry
β
β β Price drops (profit increases)
β
$4.1536 β β β β β β β β β β β β β Fixed 6% TP (missed opportunity!)
β
β β SmartTP ACTIVATED at 6.12%
β
$4.1340 βββββββββββββββββββββββββββ Exit at 6.44% β
β (after 2.63% pullback)
β β Price continued (extreme volatility)
β
$4.0284 βββββββββββββββββββββββββββ Peak ~9.07% profit π
β (SmartTP tracked this!)
β
β β Price rebounds sharply
β
Back to $4.13 region β Trigger fired correctly
βοΈ Best Practices
1. Choose TrailingGapPer Based on Volatility
| Market Condition | Asset Examples | Recommended TrailingGap | MinProfitLock |
|---|---|---|---|
| Ultra Low Volatility | Stablecoins, forex majors | 0.3% - 0.8% | Target - 0.2% |
| Low Volatility | Blue chip stocks, BTC/ETH | 0.5% - 1.5% | Target - 0.5% |
| Medium Volatility | Mid-cap stocks, altcoins | 1.5% - 2.5% | Target - 1% |
| High Volatility | Small-cap crypto, meme coins | 2.5% - 4.0% | Target - 1.5% |
| Extreme Volatility | UNI, DOGE, new listings, pumps | 3.0% - 5.0% | Target - 1% |
Important: Bot has 1-3 second processing delay. In extreme volatility, price can move 2-3% in that time!
2. Set MinProfitLock for Safety
# Good: MinProfitLock slightly below TargetProfitPer
TargetProfitPer: 5.0
MinProfitLock: 4.0 # Guarantees at least 4%
# Better: For volatile assets, wider safety margin
TargetProfitPer: 6.0
MinProfitLock: 5.0 # Guarantees at least 5%
# Risky: No MinProfitLock
TargetProfitPer: 5.0
MinProfitLock: null # Price could crash back to 0%
Why MinProfitLock matters:
- Flash crashes happen (especially in crypto)
- Market orders can slip during extreme volatility
- Acts as stop-loss for your take-profit strategy
- Peace of mind during overnight trades
3. Scale Position Size with TrailingGap
# Tight trailing = Smaller position (lower risk)
- TargetProfitPer: 3
SellPer: 50
TrailingGapPer: 1.0
# Wide trailing = Larger position (higher risk/reward)
- TargetProfitPer: 10
SellPer: 100
TrailingGapPer: 5.0
4. Always Use Market Orders for High Volatility
# For volatile assets (UNI, DOGE, SHIB, etc.)
UseMarketOrder: true # β
CRITICAL - ensures execution
# For stable assets (BTC, ETH, stocks)
UseMarketOrder: true # β
Still recommended
Why Market Orders?
- Limit orders might not fill during fast moves
- You could miss your exit during volatility spikes
- Market orders guarantee execution (small slippage OK)
5. Test in Demo Mode First
# In your global settings
general:
demo_mode: true # Test SmartTP without real money
Testing Checklist:
- [ ] Run for at least 10 trades
- [ ] Test in different volatility conditions
- [ ] Verify TrailingGapPer is not too tight/wide
- [ ] Check MinProfitLock saves you in crashes
- [ ] Monitor peak capture efficiency (aim for 60-80%)
6. Monitor Peak Capture Efficiency
Peak Capture Efficiency = (Exit Profit / Peak Profit) Γ 100
Target Ranges:
- Low volatility: 80-95% β
- Medium volatility: 70-85% β
- High volatility: 60-75% β
- Extreme volatility: 50-70% β
Example (UNI Trade):
Exit: 6.44%
Peak: 9.07%
Efficiency: 6.44 / 9.07 = 71% β
Excellent for extreme volatility!
π Monitoring SmartTP
Log Messages to Watch For
β
"SmartTP ACTIVATED - Trailing mode engaged"
β SmartTP is now tracking the price
π "SmartTP level peak updated"
β New profit peak recorded
π― "SmartTP TRAILING STOP TRIGGERED"
β TrailingGap hit, position closing
β οΈ "SmartTP MIN PROFIT LOCK TRIGGERED"
β Safety net activated
Key Metrics Tracked
highest_profit_seen: Global highest profit for this tradepeak_profit_seen: Highest profit for each SmartTP levelsmart_tp_active_levels: Currently active trailing levels
Database Fields
{
"smart_tp_active_levels": [
{
"target_profit_per": "6",
"trailing_gap_per": "2",
"sell_per": 100,
"activated_at_profit": "6.12429645373322",
"peak_profit_seen": "8.81745188333924",
"min_profit_lock": null
}
],
"highest_profit_seen": "8.81745188333924"
}
Understanding Log Discrepancies
Normal in Extreme Volatility:
Database peak: 8.82%
Log message peak: 9.07%
Difference: 0.25%
Why this happens:
- Price moves 8.82% β Database writes
- Bot processes next tick (1-2 seconds later)
- Price spikes to 9.07% β Log captures this
- Price reverses to 6.44% β Trigger fires
- Close reason shows 9.07% (most recent peak)
This is NOT a bug! It proves SmartTP is tracking real-time accurately. The bot has inherent 1-3 second delays in extreme volatility.
β FAQ
Q: Can I have multiple SmartTP levels active at once?
A: Yes! Each level independently tracks its own peak and trailing gap.
Q: What happens if price gaps down below MinProfitLock?
A: The system triggers immediately at the current price, even if below MinProfitLock. The lock is checked continuously, not just at exact price levels.
Q: Should I use SmartTP for short trades?
A: Yes! SmartTP works for both long and short trades. For shorts, it activates when your profit % reaches the target (e.g., 5% profit on a short = price dropped 5%).
Q: Can I disable SmartTP mid-trade?
A: Not recommended. Once activated, SmartTP levels remain active until triggered. You can close the trade manually via emergency_close.
Q: What's the difference between TrailingGapPer and DynamicSL?
A:
- SmartTP TrailingGap: Trails profit upward, closes on pullback from peak
- DynamicSL: Trails stop-loss upward to protect profits
They work together! DynamicSL prevents losses, SmartTP maximizes gains.
Q: Why did my SmartTP exit early in a volatile move?
A: Your TrailingGapPer might be too tight for the asset's volatility. Check the asset's typical price swings and increase the gap. For high volatility assets (UNI, DOGE, etc.), use 3-5% gaps instead of 1-2%.
Q: I see different peak values in logs vs database. Is this a bug?
A: No! This is normal in extreme volatility. The bot has 1-3 second processing delays. The database might capture 8.82% while logs show 9.07% because the peak updated between database writes. Both are correctβjust different snapshots in time.
Q: How do I know if my TrailingGap is optimal?
A: Monitor your Peak Capture Efficiency over 10+ trades:
- If consistently < 60%: Gap too tight, increase by 0.5-1%
- If consistently > 90%: Gap too wide, decrease by 0.5-1%
- Target: 60-80% for volatile assets, 70-90% for stable assets
Q: Should I use SmartTP for scalping (1-5 minute trades)?
A: Only with very tight gaps (0.5-1.5%). For sub-minute scalping, traditional fixed TP is better due to bot processing delays. SmartTP excels in 5+ minute timeframes.
Q: Can SmartTP work with DCA trades?
A: Yes! SmartTP uses the DCA average entry price to calculate profit %. It works seamlessly with DCA strategies.
π― Quick Start Templates
Template 1: Conservative Day Trading
LongTrade:
TakeProfitRules:
- TargetProfitPer: 2
SellPer: 40
RuleName: "Quick Smart TP"
IsEnabled: true
UseMarketOrder: true
EnableSmartTP: true
TrailingGapPer: 0.8
MinProfitLock: 1.5
Template 2: Aggressive Swing Trading
LongTrade:
TakeProfitRules:
- TargetProfitPer: 10
SellPer: 100
RuleName: "Big Runner Smart TP"
IsEnabled: true
UseMarketOrder: true
EnableSmartTP: true
TrailingGapPer: 4.0
MinProfitLock: 7.0
Template 3: Crypto High Volatility (UNI, DOGE, SHIB)
ShortTrade:
TakeProfitRules:
- TargetProfitPer: 6
SellPer: 100
RuleName: "Crypto Volatile Smart TP"
IsEnabled: true
UseMarketOrder: true # Critical!
EnableSmartTP: true
TrailingGapPer: 3.0 # Wide for volatility
MinProfitLock: 5.0 # Safety net
Template 4: Extreme Volatility Hybrid
ShortTrade:
TakeProfitRules:
# Lock quick profit
- TargetProfitPer: 4
SellPer: 40
RuleName: "Quick Lock"
IsEnabled: true
UseMarketOrder: true
EnableSmartTP: false # Fixed TP
# Trail the rest
- TargetProfitPer: 6
SellPer: 60
RuleName: "Trail Rest"
IsEnabled: true
UseMarketOrder: true
EnableSmartTP: true
TrailingGapPer: 3.5
MinProfitLock: 5.0
Template 5: BTC/ETH Stable
LongTrade:
TakeProfitRules:
- TargetProfitPer: 5
SellPer: 50
RuleName: "BTC Smart TP"
IsEnabled: true
UseMarketOrder: true
EnableSmartTP: true
TrailingGapPer: 2.0
MinProfitLock: 4.0
- TargetProfitPer: 10
SellPer: 100
RuleName: "BTC Final Exit"
IsEnabled: true
UseMarketOrder: true
EnableSmartTP: true
TrailingGapPer: 3.0
MinProfitLock: 8.0
π Pro Tips
- Backtest your TrailingGap: Too tight = early exits, too wide = give back too much profit
- Use wider gaps in trending markets: Let winners run
- Use tighter gaps in ranging markets: Lock profits quickly
- Combine with DynamicSL: Maximum protection + maximum profit
- Monitor
highest_profit_seen: Track how much you're capturing vs leaving on table - For extreme volatility (UNI, DOGE, etc.): Use 3-5% gaps and always set MinProfitLock
- Always use market orders: Especially in volatile assets - execution > price optimization
- Test in demo first: At least 10 trades before going live
- Adjust per asset: What works for BTC might not work for SHIB
- Peak capture 60-80% is excellent: Don't expect to catch 100% of moves
π Asset-Specific Recommendations
Bitcoin (BTC)
TargetProfitPer: 3-5%
TrailingGapPer: 1.5-2.5%
MinProfitLock: Target - 1%
UseMarketOrder: true
Ethereum (ETH)
TargetProfitPer: 4-6%
TrailingGapPer: 2.0-3.0%
MinProfitLock: Target - 1%
UseMarketOrder: true
High Volatility Altcoins (UNI, LINK, AAVE)
TargetProfitPer: 6-8%
TrailingGapPer: 3.0-4.0%
MinProfitLock: Target - 1.5%
UseMarketOrder: true
Meme Coins (DOGE, SHIB, PEPE)
TargetProfitPer: 8-15%
TrailingGapPer: 4.0-6.0%
MinProfitLock: Target - 2%
UseMarketOrder: true
Stocks (SPY, AAPL, TSLA)
TargetProfitPer: 1-3%
TrailingGapPer: 0.5-1.5%
MinProfitLock: Target - 0.5%
UseMarketOrder: false (limit OK)
π Support
If SmartTP isn't behaving as expected:
- Check logs for "SmartTP ACTIVATED" messages
- Verify
smart_tp_active_levelsin database - Ensure
highest_profit_seenis updating - Confirm
TrailingGapPeris appropriate for your asset's volatility - Check for log discrepancies in extreme volatility (this is normal!)
- Verify
UseMarketOrder: truefor fast-moving assets
Remember: In extreme volatility, small discrepancies between database and logs are NORMAL due to bot processing delays (1-3 seconds). This doesn't affect SmartTP's effectivenessβthe UNI case study proves it works perfectly even in chaos! π―
Happy trading! π