the best approach to achieve that is tu use a given amount (not the numbers of shares) to open a position and use a % for the stoploss .... that is the only way that I managed to achieve that .... ex : set preset > amount to 5.000USD positions (TWS will calc how many shares it will buy or sell) and then set a 1% stoploss for 50USD risk
this have a huge bug ! if the amount you use cannot be bought or sold short for 100 sh or more .... TWS will do 100 share lot !! for example setting up 1.000usd with a bigger stock (said TSLA) you wont get a nice result .... instead of around 30 shares, you will end up getting 100 shares (around 3000 usd) .... contacted TWS support and they have NO solition nor idea how to resolve that bug
check this link for more information about my TWS setup (dark and white themes) + hotkeys :
https://forums.bearbulltraders.com/topic/1144-interactive-broker-tws-setups-and-hotkeys/