OPEN-SOURCE SCRIPT
Actualizado ATR Risk Sizer

📘 ATR Risk Sizer (Daily ATR, RMA)
English
What it does
Plots ATR(10) (daily, Wilder/RMA) and computes position size from your risk using a volatility stop.
To avoid undersizing volatility intraday, the tool uses a conservative ATR used:
Pre-open (before first trade): previous day’s ATR
Intraday (bar not confirmed): ATR used = max( today’s ATR, yesterday’s ATR )
After close (daily bar confirmed): today’s ATR
Key terms
ATR(10): 10-day Average True Range (RMA/Wilder) on the daily timeframe.
ATR used: the ATR value actually used for risk/size, following the rules above.
Formulas
TrueRange = max( high-low, |high-close[1]|, |low-close[1]| )
ATR(10) = RMA(TrueRange, 10)
Per-unit risk = ATR used × Multiplier × PointValue
Position size = floor( RiskAmount ÷ Per-unit risk ÷ LotSize ) × LotSize
Inputs
ATR Length: period for daily ATR (default 10)
ATR Multiplier (m): stop distance factor (e.g., 1.0–1.5)
Risk Amount: capital you’re willing to risk on the trade
Point Value: money value per point (equities/ETFs = 1; futures = contract point value)
Lot Size: minimum tradable unit (equities=1; futures=contract lot)
Max Position Cap: optional cap on position size
Show summary table: toggles the top-right table
Outputs
Panel plot: thin pink ATR(10) line (daily, RMA)
Summary table (optional): ATR(10), ATR used, Per-unit, Risk, Size
Notes
ATR is always computed on daily bars via request.security(..., "D", ...), so results are stable across intraday charts.
This indicator sizes positions; it does not place orders or stops.
For futures/indices, set PointValue/LotSize to the instrument’s specs.
한국어
무엇을 하나요?
일봉 ATR(10)(RMA/윌더) 라인을 표시하고, 변동성 스탑을 가정해 포지션 사이즈를 계산합니다.
장중 변동성 과소평가를 막기 위해 ATR used를 보수적으로 선택합니다.
장 오픈 전(첫 체결 전): 전일 ATR
장중(일봉 미확정): ATR used = max( 오늘 ATR, 전일 ATR )
장 마감 후(일봉 확정): 당일 ATR
용어
ATR(10): 최근 10일의 평균 진짜 변동폭(일봉, RMA).
ATR used: 위 규칙대로 리스크/사이징에 실제로 쓰는 ATR 값.
계산식
TrueRange = max( 고-저, |고-전일종가|, |저-전일종가| )
ATR(10) = RMA(TrueRange, 10)
단위당 위험 = ATR used × 배수(m) × PointValue
포지션 사이즈 = floor( RiskAmount ÷ 단위당 위험 ÷ LotSize ) × LotSize
입력값
ATR Length(기본 10), ATR Multiplier(m), Risk Amount,
Point Value(주식=1, 선물=계약 포인트가치), Lot Size, Max Position Cap,
Show summary table(요약 테이블 표시)
출력
패널 플롯: 얇은 핑크 ATR(10) 라인(일봉, RMA)
요약 테이블(선택): ATR(10), ATR used, Per-unit, Risk, Size
비고
ATR은 항상 일봉 기준으로 계산되어, 분/시간봉 차트에서도 일관된 값을 제공합니다.
이 도구는 사이징 계산용이며, 주문/스탑을 직접 제출하지 않습니다.
선물/지수는 종목 규격에 맞게 PointValue/LotSize를 설정하세요.
English
What it does
Plots ATR(10) (daily, Wilder/RMA) and computes position size from your risk using a volatility stop.
To avoid undersizing volatility intraday, the tool uses a conservative ATR used:
Pre-open (before first trade): previous day’s ATR
Intraday (bar not confirmed): ATR used = max( today’s ATR, yesterday’s ATR )
After close (daily bar confirmed): today’s ATR
Key terms
ATR(10): 10-day Average True Range (RMA/Wilder) on the daily timeframe.
ATR used: the ATR value actually used for risk/size, following the rules above.
Formulas
TrueRange = max( high-low, |high-close[1]|, |low-close[1]| )
ATR(10) = RMA(TrueRange, 10)
Per-unit risk = ATR used × Multiplier × PointValue
Position size = floor( RiskAmount ÷ Per-unit risk ÷ LotSize ) × LotSize
Inputs
ATR Length: period for daily ATR (default 10)
ATR Multiplier (m): stop distance factor (e.g., 1.0–1.5)
Risk Amount: capital you’re willing to risk on the trade
Point Value: money value per point (equities/ETFs = 1; futures = contract point value)
Lot Size: minimum tradable unit (equities=1; futures=contract lot)
Max Position Cap: optional cap on position size
Show summary table: toggles the top-right table
Outputs
Panel plot: thin pink ATR(10) line (daily, RMA)
Summary table (optional): ATR(10), ATR used, Per-unit, Risk, Size
Notes
ATR is always computed on daily bars via request.security(..., "D", ...), so results are stable across intraday charts.
This indicator sizes positions; it does not place orders or stops.
For futures/indices, set PointValue/LotSize to the instrument’s specs.
한국어
무엇을 하나요?
일봉 ATR(10)(RMA/윌더) 라인을 표시하고, 변동성 스탑을 가정해 포지션 사이즈를 계산합니다.
장중 변동성 과소평가를 막기 위해 ATR used를 보수적으로 선택합니다.
장 오픈 전(첫 체결 전): 전일 ATR
장중(일봉 미확정): ATR used = max( 오늘 ATR, 전일 ATR )
장 마감 후(일봉 확정): 당일 ATR
용어
ATR(10): 최근 10일의 평균 진짜 변동폭(일봉, RMA).
ATR used: 위 규칙대로 리스크/사이징에 실제로 쓰는 ATR 값.
계산식
TrueRange = max( 고-저, |고-전일종가|, |저-전일종가| )
ATR(10) = RMA(TrueRange, 10)
단위당 위험 = ATR used × 배수(m) × PointValue
포지션 사이즈 = floor( RiskAmount ÷ 단위당 위험 ÷ LotSize ) × LotSize
입력값
ATR Length(기본 10), ATR Multiplier(m), Risk Amount,
Point Value(주식=1, 선물=계약 포인트가치), Lot Size, Max Position Cap,
Show summary table(요약 테이블 표시)
출력
패널 플롯: 얇은 핑크 ATR(10) 라인(일봉, RMA)
요약 테이블(선택): ATR(10), ATR used, Per-unit, Risk, Size
비고
ATR은 항상 일봉 기준으로 계산되어, 분/시간봉 차트에서도 일관된 값을 제공합니다.
이 도구는 사이징 계산용이며, 주문/스탑을 직접 제출하지 않습니다.
선물/지수는 종목 규격에 맞게 PointValue/LotSize를 설정하세요.
Notas de prensa
📘 ATR Risk Sizer (Daily ATR, RMA)English
What it does
Plots ATR(10) (daily, Wilder/RMA) and computes position size from your risk using a volatility stop.
To avoid undersizing volatility intraday, the tool uses a conservative ATR used:
Pre-open (before first trade): previous day’s ATR
Intraday (bar not confirmed): ATR used = max( today’s ATR, yesterday’s ATR )
After close (daily bar confirmed): today’s ATR
Key terms
ATR(10): 10-day Average True Range (RMA/Wilder) on the daily timeframe.
ATR used: the ATR value actually used for risk/size, following the rules above.
Formulas
TrueRange = max( high-low, |high-close[1]|, |low-close[1]| )
ATR(10) = RMA(TrueRange, 10)
Per-unit risk = ATR used × Multiplier × PointValue
Position size = floor( RiskAmount ÷ Per-unit risk ÷ LotSize ) × LotSize
Inputs
ATR Length: period for daily ATR (default 10)
ATR Multiplier (m): stop distance factor (e.g., 1.0–1.5)
Risk Amount: capital you’re willing to risk on the trade
Point Value: money value per point (equities/ETFs = 1; futures = contract point value)
Lot Size: minimum tradable unit (equities=1; futures=contract lot)
Max Position Cap: optional cap on position size
Show summary table: toggles the top-right table
Outputs
Panel plot: thin pink ATR(10) line (daily, RMA)
Summary table (optional): ATR(10), ATR used, Per-unit, Risk, Size
Notes
ATR is always computed on daily bars via request.security(..., "D", ...), so results are stable across intraday charts.
This indicator sizes positions; it does not place orders or stops.
For futures/indices, set PointValue/LotSize to the instrument’s specs.
한국어
무엇을 하나요?
일봉 ATR(10)(RMA/윌더) 라인을 표시하고, 변동성 스탑을 가정해 포지션 사이즈를 계산합니다.
장중 변동성 과소평가를 막기 위해 ATR used를 보수적으로 선택합니다.
장 오픈 전(첫 체결 전): 전일 ATR
장중(일봉 미확정): ATR used = max( 오늘 ATR, 전일 ATR )
장 마감 후(일봉 확정): 당일 ATR
용어
ATR(10): 최근 10일의 평균 진짜 변동폭(일봉, RMA).
ATR used: 위 규칙대로 리스크/사이징에 실제로 쓰는 ATR 값.
계산식
TrueRange = max( 고-저, |고-전일종가|, |저-전일종가| )
ATR(10) = RMA(TrueRange, 10)
단위당 위험 = ATR used × 배수(m) × PointValue
포지션 사이즈 = floor( RiskAmount ÷ 단위당 위험 ÷ LotSize ) × LotSize
입력값
ATR Length(기본 10), ATR Multiplier(m), Risk Amount,
Point Value(주식=1, 선물=계약 포인트가치), Lot Size, Max Position Cap,
Show summary table(요약 테이블 표시)
출력
패널 플롯: 얇은 핑크 ATR(10) 라인(일봉, RMA)
요약 테이블(선택): ATR(10), ATR used, Per-unit, Risk, Size
비고
ATR은 항상 일봉 기준으로 계산되어, 분/시간봉 차트에서도 일관된 값을 제공합니다.
이 도구는 사이징 계산용이며, 주문/스탑을 직접 제출하지 않습니다.
선물/지수는 종목 규격에 맞게 PointValue/LotSize를 설정하세요.
Notas de prensa
📘 ATR Risk Sizer (Daily ATR, RMA)English
What it does
Calculates position size from your risk using a daily ATR(10, RMA) stop model and shows a clean summary table.
ATR(10) is computed on daily bars (RMA/Wilder).
ATR used (intraday-safe):
Pre-open (before first trade): yesterday’s daily ATR
Intraday (daily bar not confirmed): max(today’s ATR, yesterday’s ATR)
After close (daily bar confirmed): today’s daily ATR
Stop (long): Stop = Today’s Daily Low − m × ATR_used
Per-unit risk (actual): Per-unit = max(0, Entry − Stop) × PointValue (Entry = current price)
Position size: Size = floor( Risk ÷ Per-unit ÷ LotSize ) × LotSize (capped by MaxSize if set)
Bet (exposure): Bet = Entry × Size × PointValue
Inputs
ATR Length (Daily RMA): default 10
ATR Multiplier (m): stop distance factor (e.g., 1.00)
Risk Amount: money you’re willing to risk on the trade
Point Value: cash value per point (equities/ETFs = 1; futures = contract point value)
Lot Size: minimum tradable unit (equities = 1; futures = contract lot)
Max Position Cap: optional hard cap (0 = none)
Show summary table: toggle the top-right table
Outputs
Panel plot: thin pink ATR(10) (daily, RMA)
Summary table: ATR(10), ATR used, Stop, Per-unit, Risk, Size, Bet
Notes
Daily ATR is fetched via request.security(..., "D", ...), so values stay consistent on intraday charts.
Sizing only—this indicator does not place orders or stops.
For futures/indices, set PointValue/LotSize to contract specs.
한국어
무엇을 하나요?
일봉 ATR(10, RMA) 기반 스탑 모델로 리스크 대비 포지션 사이즈를 계산하고 요약 테이블을 보여줍니다.
ATR(10) 은 일봉 기준(RMA/윌더) 으로 계산됩니다.
ATR used(장중 안전 보정):
장 시작 전(첫 체결 전): 전일 일봉 ATR
장중(일봉 미확정): max( 오늘 ATR, 전일 ATR )
마감 후(일봉 확정): 당일 일봉 ATR
스탑(롱): 스탑 = 오늘 일봉 저가 − m × ATR_used
단위당 위험(실제): Per-unit = max(0, 진입가 − 스탑) × PointValue (진입가 = 현재가)
포지션 사이즈: Size = floor( Risk ÷ Per-unit ÷ LotSize ) × LotSize (설정 시 MaxSize로 상한)
베팅 금액(익스포저): Bet = 현재가 × Size × PointValue
입력값
ATR Length (Daily RMA): 기본 10
ATR Multiplier (m): 스탑 거리 배수(예: 1.00)
Risk Amount: 이번 트레이드에서 감당할 리스크 금액
Point Value: 포인트당 화폐가치(주식/ETF=1, 선물=계약 포인트가치)
Lot Size: 최소 거래 단위(주식=1, 선물=계약 롯)
Max Position Cap: 최대 수량 상한(0=무제한)
Show summary table: 우상단 요약 테이블 표시
출력
패널 플롯: 얇은 핑크 ATR(10)(일봉, RMA)
요약 테이블: ATR(10), ATR used, Stop, Per-unit, Risk, Size, Bet
비고
일봉 ATR은 request.security(..., "D", ...)로 가져오므로 분/시간봉 차트에서도 값이 일관됩니다.
이 인디케이터는 사이징 계산용이며 주문/스탑을 직접 제출하지 않습니다.
선물/지수는 PointValue/LotSize를 상품 규격에 맞게 설정하세요.
Script de código abierto
Siguiendo fielmente el espíritu de TradingView, el creador de este script lo ha publicado en código abierto, permitiendo que otros traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Puede utilizarlo de forma gratuita, pero tenga en cuenta que la publicación de este código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.
Script de código abierto
Siguiendo fielmente el espíritu de TradingView, el creador de este script lo ha publicado en código abierto, permitiendo que otros traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Puede utilizarlo de forma gratuita, pero tenga en cuenta que la publicación de este código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.