There are certain limitations on retrieving historical data. You can refer to the discussion here for more details and plan your data retrieval accordingly.
If you are holding a long position, the TRANSACTION_TYPE for placing a stop-loss order should be set to the opposite side of your position — i.e., it should be "sell".
You may retrieve the order details and check the filled_quantity/pending_quantity details. Check out the pykiteconnect documentation here.
You may also check out the API documentation here.