OPEN-SOURCE SCRIPT

Anchor Buy Sell Levels

89
Daily Validity:
The indicator generates a single horizontal line (either a Buy Level or a Sell Level) that remains valid throughout the entire trading day.

Source of the Signal:
The level (buy or sell) is determined using candles that were generated before the day in question.

Selection Logic:
When determining the level, the indicator checks past candles in descending order (from the most recent backward).

The very first candle encountered that meets the respective logic (either the buy or sell condition) sets the level.
Buy and Sell Logic:

Buy Signal: Generated when a candle’s close is lower than both the previous candle’s close and the next candle’s close (i.e., a local minimum). The Buy Level is drawn at the low of that qualifying candle.
Sell Signal: Generated when a candle’s close is higher than both the previous candle’s close and the next candle’s close (i.e., a local maximum). The Sell Level is drawn at the high of that qualifying candle.
One Signal per Day:
For any given day, the indicator will display either a Buy Level or a Sell Level—not both. The decision is based on which qualifying candle (and its corresponding condition) is found first when scanning the historical data in descending order.

Pernyataan Penyangkalan

Informasi dan publikasi tidak dimaksudkan untuk menjadi, dan bukan merupakan saran keuangan, investasi, perdagangan, atau rekomendasi lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Persyaratan Penggunaan.