OPEN-SOURCE SCRIPT
Updated Position Size Tool

Manual Stop Line: You are now prompted to enter an initial value to make the line visible, which can be re-opened from the indicator settings (simply select reset points). This can be helpful when switching between charts and the line falls outside of vision due to the price difference.
Limit Line :
Limit Line :
Release Notes
Thanks for the original script from StockLeave !This is a quick position sizing tool that automatically calculates the position size for long or short trades based on the selected price and stop-loss method. The tool supports the following five types of stop-loss:
1.Current bar's high
2.Current bar's low
3.Previous bar's high
4.Previous bar's low
5.Manually entered stop-loss price
Additionally, you can set a target price (Limit) at the bottom. When using the Manual Stop, the system will automatically calculate the optimal position size based on the manual stop-loss and the target price.
All calculations are performed automatically, making it easy to quickly evaluate the optimal position size under different stop-loss strategies.
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.
For quick access on a chart, add this script to your favorites — learn more here.
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.
For quick access on a chart, add this script to your favorites — learn more here.
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.