OPEN-SOURCE SCRIPT

ATR Position Sizer

314
ATR Position Sizer

A simple position sizing tool for futures traders. Calculates how many contracts to trade based on your risk tolerance and the current ATR-based stop distance.

How it works

The indicator uses the standard formula:
Contracts = Risk $ ÷ (ATR × Stop Multiplier × Dollar per Point)
It pulls the contract's dollar-per-point value directly from the symbol info, so you don't need to enter it manually. At the close of each bar, the calculation updates and displays in the bottom right of your chart.

Inputs
  • ATR Lookback (bars): How many bars to use for the ATR calculation. Default is 14.
  • Risk Tolerance ($): Maximum dollar amount you're willing to lose on the trade. Default is $250.
  • Stop Multiplier (xATR): How wide your stop is relative to ATR. Default is 1.5x.


How to use it

  1. Add the indicator to your chart.
  2. Set your ATR lookback, risk tolerance, and stop multiplier in the settings.
  3. At the close of your entry candle, look at the contracts value in the bottom right.
  4. Size your trade accordingly.


The output is a decimal so you can see exactly where you stand. Round down if you want to stay within your risk, round up if you're comfortable taking slightly more.

Supported instruments

This indicator was designed and tested on the following futures contracts:

S&P 500: ES, MES
Nasdaq 100: NQ, MNQ
Russell 2000: RTY, M2K
Dow: YM, MYM
Nikkei 225: NKD, NIY
Gold: GC, MGC
Crude Oil: CL, QM, MCL

It may work on other futures contracts that have a defined point value in TradingView, but results outside the listed instruments are not guaranteed.
Disclaimers
This indicator is for educational and informational purposes only. It is not financial advice, investment advice, or a trading recommendation.
The calculations assume your actual stop loss will be placed at the ATR-based distance. If you use a different stop placement method, your real risk will differ from what this indicator shows. Always verify your stop placement and position size before entering a trade.
ATR is a backward-looking measure of volatility. It does not predict future price movement, slippage, gaps, or news-driven volatility expansion. Your actual loss on a trade can exceed the calculated risk amount, especially on thinly traded instruments, around economic releases, or during overnight sessions.
This tool does not account for commissions, exchange fees, margin requirements, account size, or overall portfolio exposure. You are responsible for ensuring any position size is appropriate for your account and risk profile.
Futures trading involves substantial risk of loss and is not suitable for every investor. Past performance is not indicative of future results. Trade at your own risk.

Wyłączenie odpowiedzialności

Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.