bad knock?

hey wondering if bad knock sensor? … ka24e it runs like shit. i mean when cold it wont go part 3000 rpm. when warm (only a cm up on the heat gauge) and the car wont rise over 3500 rpm also well on highway i wil be cruising and alll of a sudden loss or power and the engine is shaking bad like a misfire. anyhelp?