Use trading portfolio in trade order flow
When to use trading portfolio in your trade order flow
If you manage all trades on behalf of your client - the client's book-entry account is not linked to any trades but you manage them through your own account - then you should use trading portfolio in your trade order flow.
How to get it working
Add your trading portfolio details to the system.
How to handle trade order flow with Trading portfolio
Exception to the normal trade order flow is, when you do the execution:
Execute trades via trading portfolio
Use transaction types "Sell to customer", "Buy from customer"
Add also the market transaction to trading portfolio