BKN Hickory Smoked now allows you to pre-set a risk amount and pass on that risk amount to determine position size. If you input a risk of $100 per trade, the script will calculate where the stop loss will be as a decimal (10% would be 0.1) and then divide your pre-determined R of 100 by that decimal. In this situation, 100/0.1 yields a position size of $1000. Now, you can pass that position size to a bot of your choice by using the below syntax in your alert to output position size:
{{plot("PositionSize")}}
Note that because this value needs to be turned into a plot for the purpose of adding it to the TradingView alert, it will distort your charts if you have "auto" on. The plot has been made transparent and un-editable, but it will still distort the chart itself.