OPEN-SOURCE SCRIPT
Updated Advanced Position Tool by yegeinal

This indicator is a risk-management tool that displays an on-screen panel calculating position size in real time, based on your total portfolio value and the risk percentage you're willing to accept (the "riskometer"). It automatically pulls two stop levels — the current day's low/high (STOP 1) and the previous day's low/high (STOP 2) — and calculates how many shares you can buy (or sell, for short positions) using the formula "Risk Amount ÷ Distance to Stop" for each one. You can switch between Long and Short position types; when Short is selected, the reference stops automatically flip to the day's high points instead of the lows. It also includes a hard cap mechanism: even if the stop distance is extremely tight, position size can never exceed a maximum percentage of your portfolio that you define (e.g., 15%), and any position hitting that cap is flagged with a "[MAX]" tag in the table. Overall, the indicator combines risk-based position sizing with a capital-protection limit in a single visual panel.
Release Notes
Changed the name of it.Added MaxLookBack for lower days possible before the previous day.
Added Smallest view edition.
Release Notes
%ADR has been added to the calculation.If the ADR is bigger than the current price to stop loss range its okay to take trade.
On the contrary indicator will show it to you.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.