OPEN-SOURCE SCRIPT

Buy Point % Levels

646
Buy Point % Levels

Overview

Buy Point % Levels is a visual planning tool for position management. Once you've bought (or plan to buy) a stock at a given price, it draws a horizontal "Buy" line at that price plus a set of dashed stop-loss and take-profit lines, each expressed as a percentage above or below your buy point. Every line is labeled on the right with its percentage and the exact price it corresponds to, so you can see your risk/reward levels laid out on the chart at a glance.

It does not generate buy/sell signals, plot historical markers, or fire alerts — it's a reference overlay for a position you already have in mind, redrawn fresh on the most recent bar each time the chart updates.

How the buy price is determined

The script figures out your buy price in this order of priority:

1. Positions list match — if the current chart's ticker appears in the "Positions" input (see below), that price is used automatically, regardless of any other setting.
2. Manual override — if the ticker isn't in the Positions list and "Manual Override" is checked, the script uses the Buy Price input/line. The first time you use it, that line starts at the last close — drag it on the chart or type an exact value to set your real entry.
3. Default (tracking mode) — if neither of the above applies, the buy point defaults to the current/last close and moves with the price on every bar. This is the out-of-the-box behavior for any ticker you haven't entered a fixed price for — ideal for watchlist tickers you're just observing, so you can see what your levels would look like if you bought at today's price.

How to use it

  1. Add the indicator to a chart. With no other settings changed, the buy point simply tracks the current/last close — this default behavior is what you want for a ticker you're just watching, not yet holding: as the price moves, the buy line and every level move with it, so you can see at a glance what the stop-loss and target prices would be if you bought right now.
  2. Once you actually own a position (or have a specific entry price in mind), lock the buy point in place with either:
    - Positions list — type "SYMBOL:PRICE" into the Positions field for every ticker you hold (e.g. "FLNC:19.86, TSLA:245, AAPL:227.5"), so the right fixed buy price loads automatically no matter which of those charts you open, or
    - Manual Override — check Manual Override and drag the buy-price line to your entry price on a single chart.
  3. In the Levels section, turn on the stop-loss and target percentages you want to see, and adjust each percentage to match your own risk/reward plan.
  4. The buy line (blue) and your selected levels (red for stop, green for targets) will appear at the right edge of the chart, each labeled with its percentage and price.


Inputs

Buy Point

  • Positions (SYMBOL:PRICE, comma separated) — optional — A running list of ticker/price pairs, e.g. "FLNC:19.86, TSLA:245". When the chart's symbol matches one in this list (case-insensitive), that price is used as the buy point automatically — useful for keeping one master list that works across all your charts.
  • Manual Override (use Buy Price field / dragged line below) — When checked, and the current symbol isn't in the Positions list, the buy point comes from the Buy Price field instead of defaulting to the last close.
  • Buy Price (drag the line on the chart, or type here) — The manual entry price. This appears as a draggable line on the chart when the indicator is added; you can drag it into place or type a value directly in Settings. Only used when Manual Override is on and the symbol isn't matched in Positions.
  • Extend Lines Right (bars) — How many bars past the current price the lines and labels extend to the right. Default 10.
  • Levels — eight independent percentage levels, each with its own on/off checkbox and editable percentage, applied relative to the buy price: Each level draws a dashed horizontal line (red for the stop, green for targets) and a label showing its percentage and the resulting price. Any level can be renamed in effect by simply changing its percentage — the label always reflects the live value.


Notes

  • Lines and labels are only drawn on the most recent bar, so they always reflect your current settings rather than showing historical levels.
  • This is a manual planning aid, not a signal generator — it does not predict price movement, issue alerts, or represent a recommendation to buy or sell any security. Always do your own research and manage risk according to your own plan.

면책사항

해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.