Here is a panel where you enter the desired stop-loss price, the amount you would like to risk and it spits out what you should trade to only lose that amount if the stop-loss is hit.
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publications is governed by House rules. 您可以收藏它以在圖表上使用。