My requirement is actually very simple. I want to track the performance of my strategies over a period of time. I tag all my orders placed programmatically with {strategy}-{instrument}
I want to calculate the pnl of each strategy over a user-given time period (week, month, quarter, etc.). Looking at the existing APIs, I see no straightforward way to achieve this. The only feasible way from my understanding is to fetch all the orders, segregate by tags and then go through each order to calculate pnl and finally, get the live positions and do some more circus to match the live positions to the orders that created them to get the final pnl figure. Any easier way to do this?
I'm ok with a solution that isn't available during live market hours too. After all, the idea is to track performance over a longish period. In a way, what I'm asking is for an API that gives you the Console P&L functionality but which also has a 'filter by tag' option.
Thanks for your response, Sujith. Can this be accommodated as a request to enhance the existing API? I imagine this will be useful to a lot of algo traders out there.
@kauphylover I don't think that it will be added to the API logic. The core reason is that Kite Connect is purely an execution platform, and it doesn't provide strategy or any logic that is related to the client's strategy.
Your logic is easy to do at your end. As I understand from your thread above, you just need to know the P&L of each strategy; this can be done easily if you have coding/DBM skills.
1. Store each tag in the database alongside each P&L value, with the correct sorting based on strategy. 2. Retrieve all data based on each strategy and then calculate it and then compare it.
By doing this approach, you can do this computation at any time.
Thank you, @ANL. Yes, the end user can store the orders and calculate pnl. My thinking was that this could be a simple feature addition to the already present P&L calculation on console (if providing an API to provide real-time pnl is really out of scope of KiteConnect). Can this functionality (of filtering by tag) be added to Console instead? If this is not the right forum for that, can someone point me to where I can make that feature request instead?
console is our backoffice platform. Kite Connect only provides trading APIs, it doesn't contain backoffice APIs. Until recently, we were supporting trade based tagging on console. We had to stop it because of very low adoption rate. You will have to do this at your end.
That is exactly what was removed. You can only add one tag for an instrument on console. You will have to maintain tagging your strategies at your end.
Your logic is easy to do at your end. As I understand from your thread above, you just need to know the P&L of each strategy; this can be done easily if you have coding/DBM skills.
1. Store each tag in the database alongside each P&L value, with the correct sorting based on strategy.
2. Retrieve all data based on each strategy and then calculate it and then compare it.
By doing this approach, you can do this computation at any time.
Thanks in advance!
Until recently, we were supporting trade based tagging on console. We had to stop it because of very low adoption rate. You will have to do this at your end.
I can download the order history from https://console.zerodha.com/reports/tradebook but the order tags don't show up in the report.
Is it possible to add the order tag to the report?