OPEN-SOURCE SCRIPT

Gaps Trend [ChartPrime]

The Gaps Trend - ChartPrime indicator is designed to detect Fair Value Gaps (FVGs) in the market and apply a trailing stop mechanism based on those gaps. It identifies both bullish and bearish gaps and provides traders with a way to manage trades dynamically as gaps appear. The indicator visually highlights gaps and uses the detected momentum to assess trend direction, helping traders identify price imbalances caused by strong buy or sell pressure.


⯁ KEY FEATURES & HOW TO USE

⯌ Fair Value Gap (FVG) Detection:
The indicator automatically detects both bullish and bearish FVGs, identifying gaps between candle highs and lows. Bullish gaps are shown in green, and bearish gaps in purple. These gaps indicate price imbalances driven by strong momentum, such as when there is significant buying or selling pressure.
Use: Traders can use FVG detection to identify periods of high price momentum, offering insight into potential continuation or exhaustion of trends.
ảnh chụp nhanh

⯌ Trailing Stop Feature Based on FVGs:
A core feature of this indicator is the trailing stop mechanism, which adjusts dynamically based on the identified FVGs. When a bullish gap is detected, the trailing stop is placed below the price to capture upward momentum, while bearish gaps result in a trailing stop placed above the price. This feature helps traders stay in trends while protecting profits as the price moves.
Use: The trailing stop follows the momentum of the price, ensuring that traders can stay in profitable trades during strong trends and exit when the momentum shifts.

bullish set up
ảnh chụp nhanh
ảnh chụp nhanh

bearish set up
ảnh chụp nhanh
ảnh chụp nhanh

⯌ Trend Direction Indication:
The indicator colors the chart according to the current trend direction based on the position of the price relative to the trailing stop. Green indicates an uptrend (bullish gap), while purple shows a downtrend (bearish gap). This provides traders with a quick visual assessment of trend direction based on the presence of gaps.
Use: Traders can monitor the chart's color to stay aligned with the market’s trend, staying long during green phases and short during purple ones.
ảnh chụp nhanh

⯌ Gap Size Filtering:
Each detected gap is assigned a numerical ranking based on its size, with larger gaps having higher rankings. The gap size filter allows traders to only display gaps that meet a minimum size threshold, focusing on the most impactful gaps in terms of price movement.
Use: Traders can use the filter to focus on gaps of a certain size, filtering out smaller, less significant gaps. The numerical ranking helps identify the largest and most influential gaps for decision-making.
ảnh chụp nhanh

⯌ FVG Level Visualization:
The indicator can display dashed lines marking the levels of previously filled FVGs. These levels represent areas where price once experienced a gap and later filled it. Monitoring these levels can provide traders with key reference points for potential reactions in price.
Use: Traders can use these gap levels to track where price has filled gaps and potentially use these levels as zones for entry, exit, or assessing market behavior.
ảnh chụp nhanh

⯁ USER INPUTS
  • Filter Gaps: Adjust the size threshold to filter gaps by their size ranking.
  • Show Gap Levels: Toggle the display of dashed lines at filled FVG levels.
  • Enable Trailing Stop: Activate or deactivate the trailing stop feature based on FVGs.
  • Trailing Stop Length: Set the number of bars used to calculate the trailing stop.
  • Bullish/Bearish Colors: Customize the colors representing bullish and bearish gaps.


⯁ CONCLUSION
The Gaps Trend [ChartPrime] indicator combines Fair Value Gap detection with a dynamic trailing stop feature to help traders manage trades during periods of high price momentum. By detecting gaps caused by strong buy or sell pressure and applying adaptive stops, the indicator provides a powerful tool for riding trends and managing risk. The additional ability to filter gaps by size and visualize previously filled gaps enhances its utility for both trend-following and risk management strategies.
fairvaluegapfvgstoplossTrend AnalysistrendsVolatility

Mã nguồn mở

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

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


Ngoài ra, trên:

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