Trailing Stop Loss Using Price Values from TradingView

1 min read

PickMyTrade now supports trailing Stop Loss (SL) derived directly from price values sent by TradingView. Instead of treating TP and SL as fixed prices, PickMyTrade first calculates the point distance between the entry price sent in the alert and the TP/SL prices, then applies those distances dynamically from the actual fill price.

This ensures accurate trailing behavior even when the fill price differs from the alert price.


How It Works (High-Level) #

  1. TradingView sends absolute TP and SL prices via JSON.
  2. PickMyTrade calculates the point distance between:
    • Entry Price (alert price)
    • TP price
    • SL price
  3. When the order fills, PickMyTrade:
    • Rebuilds TP and SL from the actual fill price
    • Applies trail trigger, trail stoploss and trail frequency
  4. Trailing logic is handled entirely by Tradovate.

JSON Example from TradingView #

 'symbol': 'MNQ1!',
 'data': 'buy',
 'price': '26000',
 'sl': 25990,
 'tp': 26030,
 'trail': 1,
 'trail_stop': 2,
 'trail_trigger': 5,
 'trail_freq': 1,

Market Context #

  • Alert Price: 26000
  • Direction: BUY

Step 1: Calculate Point Distance (From Alert Price) #

TypePriceDistance
Take Profit2603030 points
Stop Loss2599010 points

PickMyTrade stores only the distances, not the raw prices.


Step 2: Order Gets Filled (Real Fill Price) #

Due to slippage or market conditions, the actual fill happens at:

Fill Price: 26018.5

PickMyTrade now rebuilds TP & SL from this price.


Step 3: Rebuild Initial TP & SL from Fill Price #

TypeCalculationNew Price
Take Profit26018.5 + 3026048.5
Stop Loss26018.5 − 1026008.5

These are the true working orders placed at the broker.


Step 4: Trailing Configuration #

Example trailing settings:

  • Trail Trigger: 5 points
  • Trail Distance: 2 points
  • Trail Frequency: 1 points

Step 5: Trailing Activation Logic (BUY Trade) #

Initial rebuilt values after fill:

  • Entry: 26018.5
  • TP: 26048.5
  • SL: 26008.5

Trail Trigger #

Price must move 5 points in profit before trailing starts:

26018.5 + 5 = 26023.5

Trailing becomes active once price reaches 26023.5.


Step 6: Trailing Stop Updates #

After activation, the stop loss trails the price using:

  • Trail Stop: 2 points
  • Trail Frequency: 1 point

Trailing Behavior #

Market PriceStop Loss
26023.526021.5
26024.526022.5
26025.526023.5
26026.526024.5

✔ Stop loss only moves up
✖ Never moves backward
✔ Profit is progressively locked in


Step 7: Take Profit Behavior #

  • TP remains fixed at 26048.5
  • Trade closes when:
    • Price hits TP, or
    • Price reverses and hits the trailing SL

Key Advantages of This Approach #

  • Works with any TradingView strategy or indicator
  • Accurate even with partial fills or slippage
  • TradingView stays simple — just send prices

Important Notes #

  • TradingView does NOT trail orders
  • TradingView prices are used only to calculate distance
  • Actual TP/SL prices are rebuilt after fill
  • Trailing logic starts only after trigger is reached

Best Use Cases #

  • Automated strategies using limit or market orders
  • Traders who want price-based alerts, not tick math
  • Accounts where fill price accuracy matters
  • Consistent trailing across multiple brokers