LuxAlgo

Market Structure Trailing Stop [LuxAlgo]

This script returns trailing stops on the occurrence of market structure (CHoCH/BOS labeling). Trailing stops are adjusted based on trailing maximums/minimums with the option for users to be able to control how quickly a trailing stop can converge toward the price.

🔶 SETTINGS

  • Pivot Lookback: Pivot length used for the detection of swing points.
  • Increment Factor %: Controls how fast trailing stops converge toward the price, with lower values returning slower converging trailing stops.
  • Reset Stop On: Determines if trailing stops are reset on CHoCH structure or all (CHoCH + BOS).
  • Show Structure: Determines if market structure is displayed.

🔶 USAGE


Trailing stops allow traders to protect them against downside risk while also guaranteeing a potential profit in case the market goes in the expected direction of the trade.


Users making use of market structure as a primary entry condition can benefit from having trailing stops based on these to either provide an additional exit condition or to provide points of support/resistance with the price.


Trailing stops can avoid being hit more frequently by using a lower Increment Factor % setting.


Finally, users can reset the trailing stop when any market structure is detected (or only on CHoCHs). Allowing trailing stops to reset on the detection of any market structure allows the indicator to return trailing stops closer to the price. CHoCH labels are highlighted as dashed lines while BOS labels are highlighted as dotted lines.

🔶 DETAILS


When a new structure (or only CHoCH if specified by the user) is detected, trailing stops will initially be set based on the maximum/minimum made on the previous trend. This will also set the trailing maximum/minimum to the current price value.

If an uptrend is detected (most recent market structure is bullish) then the trailing stop will increase if the trailing maximum increase, the increment is calculated as:

trailing stop = trailing stop + Increment Factor % of (trailing maximum - previous trailing maximum)

If a downtrend is detected (most recent market structure is bearish) then the trailing stop will decrease if the trailing minimum decrease, the decrement is calculated as:

trailing stop = trailing stop + Increment Factor % of (trailing minimum - previous trailing minimum)

Get access to our exclusive tools: luxalgo.com

Join our 150k+ community: discord.gg/lux

All content provided by LuxAlgo is for informational & educational purposes only. Past performance does not guarantee future results.
Mã nguồn mở

Với tinh thần TradingView, tác giả của tập lệnh này đã xuất bản nó dưới dạng mã nguồn mở, vì vậy các nhà giao dịch có thể hiểu và xác minh nó. Chúc mừng tác giả! Bạn có thể sử dụng mã này miễn phí, nhưng việc sử dụng lại mã này trong một ấn phẩm chịu sự điều chỉnh của Nội quy nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?