torrent and IDM speed manage

i want to fix speed for torrent for for example

max upload 5kb
max download 20kb

how can i do this and i also want to set speed limit for internet download manager(IDM) software

Both are working on Dynamic port so limiting bandwidth for both this is difficult & not available in mikrotik but you can try with adding some firewall rule but that will block it but not allowed to limit it

can u tell me how to block IDM and Torrent ?