Limit Order + ATR Stop-Loss [TANHEF]

TanHef ที่อัปเดต:   
This indicator enables interactive placement of limit or stop-limit orders with a trailing ATR stop-loss and optional profit target (with alerts). Refer to the images below for further clarification.

Why use a trailing stop-loss?
A trailing stop-loss serves as an exit strategy when price moves against you, while also allowing you to adjust the exit point further into profit when price moves favorably. The ATR (Average True Range), a reliable measure of volatility, acts as an effective risk management tool, functioning as a trailing stop-loss.

Indicator Explanation
  • Initial indicator placement: Select Long Limit or Long-Stop Limit order.
  • Change Entry Type: Switch between Long and Short within settings.
  • Modify entry price: Drag circle, adjust in settings, or re-add indicator to chart.
  • Optional Profit Target: Use Risk/Reward ratio or specify price.
  • Entry anticipation: Estimated ATR stop-loss and profit target as blue circles (fluctuates with volatility changes).
  • Entry triggered: Actual ATR stop-loss and profit target plotted.
  • Exit conditions: Stop-loss or profit target hit, exit entry.
  • Update Frequency: Continuously, Bar Open, or Bar Open on entry then continuously.
  • ATR Overlap: no entry occurs if the ATR overlaps with price (stop-loss 'hit' already on entry bar)
  • Table: Displays input settings selected.
  • Show Only On Ticker: Ability to hide indicator on other tickers.

Long Limit

Long Stop-Limit

Short Limit

Short Stop-Limit

1. 'Check' alerts to use within indicator settings (entry, trailing stop hit, profit target hit, and failed entry).
2. Select 'Create Alert'
3. Set the condition to 'Limit Order + ATR Stop-Loss''
4. Select create.

Additional details can be added to the alert message using these words in between Curly (Brace) Brackets:
  • {{trail}} = ATR trailing stop-loss (price)
  • {{target}} = Price target (price)
  • {{type}} = Long or Short stop-loss (word)
  • {{traildistance}} = Trailing Distance (%)
  • {{targetdistance}} = Target Distance (%)
  • {{starttime}} = Start time of position (day:hr:min)
  • {{maxdrawdown}} = max loss
  • {{maxprofit}} = max profit
  • {{update}} = stoploss update frequency
  • {{entrysource}} = entry as 1st bar source (yes/no)
  • {{triggerentry}} = Wick/Close Trigger entry input
  • {{triggerexit}} = Wick/Close Trigger exit input
  • {{triggertarget}} = Wick/Close Trigger target input
  • {{atrlength}} = ATR length input
  • {{atrmultiplier}} = ATR multiplier input
  • {{atrtype}} = ATR type input
  • {{ticker}} = Ticker of chart (word)
  • {{exchange}} = Exchange of chart (word)
  • {{description}} = Description of ticker (words)
  • {{close}} = Bar close (price)
  • {{open}} = Bar open (price)
  • {{high}} = Bar high (price)
  • {{low}} = Bar low (price)
  • {{hl2}} = Bar HL2 (price)
  • {{volume}} = Bar volume (value)
  • {{time}} = Current time (day:hr:min)
  • {{interval}} = Chart timeframe
  • {{newline}} = New line for text
Fixed label issue during active entry.
Removed unnecessary moving average inputs.
Alerts now function as intended.

Update Stop-Loss Frequency:
  • Always = update continuously. (Trailing)
  • Bar Open = update bar from prior close. (Trailing)
  • Entry Bar Open, then Always = update bar from prior close for entry bar, then every bar after updates continuously. (Trailing)
  • Never = static, not updated after entry open. (Non-Trailing)


Scripts and content from TanHef are solely for information and education. Past performance does not guarantee of future results.

ด้วยจิตวิญญาณของ TradingView อย่างแท้จริง ผู้เขียนสคริปต์นี้ได้เผยแพร่เป็นโอเพนซอร์ส เพื่อให้ผู้ค้าสามารถเข้าใจและตรวจสอบได้ ไชโยให้กับผู้เขียน! คุณสามารถใช้ได้ฟรี แต่การใช้รหัสนี้ซ้ำในสิ่งพิมพ์อยู่ภายใต้กฎของบ้าน คุณสามารถตั้งเป็นรายการโปรดเพื่อใช้บนชาร์ตได้


ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ เงื่อนไขการใช้บริการ