SmartTP User Guide | Smart Trailing Take Profit for Crypto Bots

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 trade
  • peak_profit_seen: Highest profit for each SmartTP level
  • smart_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:

  1. Price moves 8.82% β†’ Database writes
  2. Bot processes next tick (1-2 seconds later)
  3. Price spikes to 9.07% β†’ Log captures this
  4. Price reverses to 6.44% β†’ Trigger fires
  5. 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

  1. Backtest your TrailingGap: Too tight = early exits, too wide = give back too much profit
  2. Use wider gaps in trending markets: Let winners run
  3. Use tighter gaps in ranging markets: Lock profits quickly
  4. Combine with DynamicSL: Maximum protection + maximum profit
  5. Monitor highest_profit_seen: Track how much you're capturing vs leaving on table
  6. For extreme volatility (UNI, DOGE, etc.): Use 3-5% gaps and always set MinProfitLock
  7. Always use market orders: Especially in volatile assets - execution > price optimization
  8. Test in demo first: At least 10 trades before going live
  9. Adjust per asset: What works for BTC might not work for SHIB
  10. 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
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:

  1. Check logs for "SmartTP ACTIVATED" messages
  2. Verify smart_tp_active_levels in database
  3. Ensure highest_profit_seen is updating
  4. Confirm TrailingGapPer is appropriate for your asset's volatility
  5. Check for log discrepancies in extreme volatility (this is normal!)
  6. Verify UseMarketOrder: true for 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! πŸŽ‰

πŸ“Ž Related Topics