If user doesn't put in their commission rate, then it will just take the stop loss amount as the total R.
The calculator will now provide a gross R:R calculator if there is no commission input (left at 0)
The calculator will provide a net R:R if commission is included, and net risk will be auto calculated based on the entry price.
Your commission amount is dependent on your entry price, it is a rough estimation and is only accurate if entry and exit price are identical. Outside of this the R:R calculator is a rough estimation.
Added in a breakeven line as well depending on users commission.
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 a publication is governed by House Rules. You can favorite it to use it on a chart.