OPEN-SOURCE SCRIPT
已更新 Previous Candle High/Low (Clean)

✅ Creates one horizontal line for the previous candle’s high (green).
✅ Creates one horizontal line for the previous candle’s low (red).
✅ The lines update on each new candle, always following the most recent previous high/low.
✅ The lines are extended to the right — they don’t stack or clutter the chart.
✅ Works on all timeframes.
✅ Creates one horizontal line for the previous candle’s low (red).
✅ The lines update on each new candle, always following the most recent previous high/low.
✅ The lines are extended to the right — they don’t stack or clutter the chart.
✅ Works on all timeframes.
版本注释
This indicator draws two horizontal black lines on your chart representing the high and low of the previous candle. These lines help you quickly identify key recent price levels for use in your trading decisions.How It Works:
Previous Candle Levels:
The script takes the high and low values of the candle immediately before the current one (i.e., high[1] and low[1]).
Line Drawing:
It draws one horizontal line at the previous candle's high.
It draws another horizontal line at the previous candle's low.
Line Length Control:
The length of these lines on the chart is controlled by an input parameter called Line Length (Bars).
This input lets you specify how many bars forward the lines should extend on the chart.
For example, if you set it to 5, the lines will stretch from the current bar to 5 bars ahead.
This gives you flexibility to keep the lines visible for as long as you want without cluttering the chart.
Dynamic Update:
As new candles form, the lines update to always represent the most recent previous candle’s high and low.
This means the lines "move forward" with the price action, maintaining relevance.
Visual Style:
Both lines are drawn in black with a width of 2 for clear visibility.
The lines do not extend infinitely — they only cover the number of bars you specify.
Use Case:
This indicator is useful for traders who want to:
Quickly see key levels from the previous candle to help with breakout or reversal decisions.
Monitor support and resistance levels based on recent price action.
Keep their chart clean by controlling how long these levels remain visible.
版本注释
What this script does:📌 Draws two horizontal lines on your chart:
One at the high of the “before previous” candle (2 bars back).
One at the low of the “before previous” candle.
🕒 The lines start exactly on the candle where that high/low happened
(they begin at the open time of the “before previous” candle).
➡️ The lines extend to the right for a user-defined number of bars
(you control this using the “Line Length After Candle (Bars)” setting).
🎨 You can choose the color of each line in the settings.
🔄 The lines update automatically on each new bar, always tracking the correct candle.
Use Case:
🔹 Helps you mark key price levels from the before previous candle,
which can be useful for identifying breakout or reaction zones.
🔹 Keeps your chart clean — lines don’t extend indefinitely.
🔹 Works on all timeframes.
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。