I have a position and its TransactionType is 'TRANSACTION_TYPE_BUY'. If i need to place stop loss order, what should be the TransactionType either TRANSACTION_TYPE_BUY / TRANSACTION_TYPE_SELL ?
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".
If you want to exit at two different points then you will need to place target and stop-loss orders.