OPEN-SOURCE SCRIPT

Position Size Tool

49
Position Size Tool

What it does:
Shows a small on-chart table that converts per-ticker dollar amounts into share counts (shares = amount ÷ current price) for up to 4 configurable tickers.


Inputs (indicator settings)
  • Ticker 1–4 — select the symbol (TradingView will show the exchange-qualified form like BATS:TQQQ in the settings).
  • Ticker N $ Amount — dollar amount to convert into shares for that ticker.
  • Show Ticker N — toggle each row on/off.
  • Table Text Color — color of the table text.
  • Table Position — screen location (Top/ Middle/ Bottom × Left/Center/Right).
  • Font Size — Small / Medium / Large.
  • Show Empty Top Row — optional spacer row.



What the table displays
  • Left column: the ticker symbol only (the script strips the exchange prefix for display, so BATS:TQQQ appears as TQQQ in the table).
  • Right column: the calculated share count, formatted to two decimal places (or "—" if price is not available or zero).
  • Table updates on the chart’s timeframe using live/last bar prices.



How to use
  • Add the indicator to a chart.
  • Open the indicator’s settings panel.
  • In Ticker 1–4, type/select the symbols you want (you may see the exchange prefix there; that’s TradingView’s UI).
  • Enter the dollar amounts for each ticker.
  • Use Show Ticker N to hide/show rows.
  • Adjust text color, font size, and table position as desired.



Notes
  • The settings field will always show the exchange-qualified symbol (TradingView behavior); the script strips the exchange only for the on-chart display.
  • If the selected symbol has no price data on the chart/timeframe, the table shows "—".
  • Shares are computed as amt ÷ current close from the requested symbol and timeframe.



Example of how to use this tool:

Monitor an index and execute trades on leveraged derivative products. This tool will determine the quantity of shares that can be purchased with a pre-determined dollar amount. Ex: Monitor SPX for entry/exit signals and execute trades on UPRO/SPXU/SPXL/SPXS.

Input a ticker and a dollar amount for position size, shares that can be purchased will be calculated based on the current asset price.

This tool can be helpful for those that use multiple platforms simultaneously to monitor and execute trades.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.