OPEN-SOURCE SCRIPT
Realtime Position Calculator

Risk management is the single most important factor in trading success. This indicator automates the process of position sizing in real-time based on your account risk and a dynamic technical Stop Loss. It eliminates the need for manual calculations and helps you execute trades faster while adhering to strict risk management rules.
How it Works
The indicator visually places a Stop Loss line based on recent market structure (Highs/Lows) and instantly calculates the required position size (Contracts/Lots) to match your defined monetary risk.
1. Dynamic Stop Loss: It identifies the highest high (for Shorts) or lowest low (for Longs) over a user-defined lookback period.
2. Position Calculation: It calculates the distance between the current price and the Stop Loss level.
3. Formula: Contract Size = Risk Amount / (Distance * Point Value)
4. Actual vs. Target Risk: Because of the rounding, the script calculates and displays the Actual Risk (e.g., $95) alongside your Target Risk (e.g., $100), so you know exactly what is at stake.
Key Features
Real-time Calculation: Updates instantly as price moves.
Copy Trading Support: Includes an "Account Multiplier" setting. If you trade 10 accounts via a copy trader, set the multiplier to 10. The indicator will show the total contract size needed across all accounts.
Point Value Support: Works for Stocks/Crypto (Point Value = 1) and Futures (e.g., ES = 50, NQ = 20).
Customizable UI: Toggle specific data on/off in the label (e.g., hide price, show only contracts). Adjustable label offset to keep the chart clean.
Settings Guide
Trade Direction: Toggle between Long and Short setups. Add the indicator two times and set another for Longs and another for Shorts so you can see both direction at the same time.
Risk Amount: Your max risk in currency (e.g., $100).
Lookback: How many bars back to look for the SL pivot (e.g., 10 bars).
Point Value: Crucial for Futures. Use 1.0 for Crypto/Stocks. Use tick value/point value for futures (e.g., 50 for ES).
Account Multiplier: Multiply the position size for multiple accounts.
Label Offset: Move the information label to the right to avoid overlapping with price action.
Disclaimer
This tool is for informational and educational purposes only. Always verify calculations manually before executing trades. Past performance is not indicative of future results.
How it Works
The indicator visually places a Stop Loss line based on recent market structure (Highs/Lows) and instantly calculates the required position size (Contracts/Lots) to match your defined monetary risk.
1. Dynamic Stop Loss: It identifies the highest high (for Shorts) or lowest low (for Longs) over a user-defined lookback period.
2. Position Calculation: It calculates the distance between the current price and the Stop Loss level.
3. Formula: Contract Size = Risk Amount / (Distance * Point Value)
4. Actual vs. Target Risk: Because of the rounding, the script calculates and displays the Actual Risk (e.g., $95) alongside your Target Risk (e.g., $100), so you know exactly what is at stake.
Key Features
Real-time Calculation: Updates instantly as price moves.
Copy Trading Support: Includes an "Account Multiplier" setting. If you trade 10 accounts via a copy trader, set the multiplier to 10. The indicator will show the total contract size needed across all accounts.
Point Value Support: Works for Stocks/Crypto (Point Value = 1) and Futures (e.g., ES = 50, NQ = 20).
Customizable UI: Toggle specific data on/off in the label (e.g., hide price, show only contracts). Adjustable label offset to keep the chart clean.
Settings Guide
Trade Direction: Toggle between Long and Short setups. Add the indicator two times and set another for Longs and another for Shorts so you can see both direction at the same time.
Risk Amount: Your max risk in currency (e.g., $100).
Lookback: How many bars back to look for the SL pivot (e.g., 10 bars).
Point Value: Crucial for Futures. Use 1.0 for Crypto/Stocks. Use tick value/point value for futures (e.g., 50 for ES).
Account Multiplier: Multiply the position size for multiple accounts.
Label Offset: Move the information label to the right to avoid overlapping with price action.
Disclaimer
This tool is for informational and educational purposes only. Always verify calculations manually before executing trades. Past performance is not indicative of future results.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
- Viltsu / x.com/ViltsuFIN
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
- Viltsu / x.com/ViltsuFIN
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.