Self managing multiple portfolio on Dhan


I am wondering if I can manage multiple portfolios in a single dhan account where in

  • each portfolio has group name or group tag and there by can be looked in with an expanded view of holdings or contracted view on the group holdings.
  • with or WITHOUT smallcase, I would like to make sure when I am touching the holdings in a particular holding group, they should not have any relation or impact to other holding groups
    scenario: portfolioA might have few common scrips to other portfolioB or portfolioC
  • I looked at the API (Portfolio - DhanHQ Ver 1.0 / API Document)
    – it looks like all the holdings are grouped together into a single portfolio — this could have bad ramifications, as I intend to manage seperate portfolio cases in programmatic means for some of the portfolio atleast.

(unfortunately, smallcase is not offering programmatic means to curate and manage the portfolios through programmatic means for personal portfolio/cases, so I intend to rely on Dhan API as much as possible and at the same time making sure the holdings of one group are not affected by the actions in one group – lot of calculations could changed such as %allocation overall)

@PravinJ please comment and help

Thinking out loud and co-relating with smallcases here, if smallcases have smallcase Id then, why not portfolio have portfolio id which can help group the allocations?

And if yes, this will lead to some necessary required changes to portfolio API (in next v1.1 or v2.0).
Build better! :slight_smile:

I think we will need engineering and product to think of this together though – portfolio grouping tags will help with multiple problems related to allocations and will improve allocation efficiency

Smallcase as a use-case a very different from our use-case of Portfolio. Your’s is a very advanced use-case, mostly more like a mutual fund - every every basket or portfolio has a different use-case.

Any API we provide to solve for this, will also not serve this purpose - reason being stocks (like cash) when in demat format is fungible. So your stocks can be labelled only when you buy all of them and sell all of them at the same time, otherwise they come and go as fifo method with every transaction.

We introduced this small feature that many users like, I personally do is marking my long term portfolio separately, more on that here: Now mark your Long-Term Portfolio separately on Dhan

thanks for checking on this @PravinJ appreciate your response.

yes, I do see your point that at the end of day, shares are held in Demat account and not with the broker (that is probably the reason brokerage will not have much say about the groupings and allocations) however, that being said – I think portfolio holdings (dhan brokerage api) is a simple representation of all the (open) holdings in demat account today.

A brokerage here can still be a store of the portfolio/basking groupings from the end user point of view, while the demat continues to be the store for the stocks from regulation standpoint.

So, this is where I think dhan brokerage can lead the path of change, to accommodate and cater to multiple views/needs.
As in, perhaps to summarize but not really trivialize the efforts involved here, brokerage can merely provide logical constructs enough to see the stocks in grouped views where in multiple groups can have the same stock scrip but with different quantities this is where I think dhan as a brokerage could step in and help lead the way.
(btw, if I am not wrong thinkorswim trading platform in US already provides this feature, may need to verify this though)

For example, I can have some quantities of ITC as a stock for long term holdings in a different basket and at the same time, can do swing trading, BTST and/or even intraday trading in different holdings group without having to worry about overlaps or touching the long term holdings.

Stocks as a symbol are not a useful reference versus compared to the quantities, even from the taxation point of view. The taxation is also from the number of days held for each bought transaction initiated for the stock and not the stock itself. This, I think is a convincing way to look at the need.

If this is not going to help, I am afraid I have to develop a smallcase like solution at my own having to do it at my own big inconvenience :frowning: but I rather would have a leading brokerage here trail blaze the path and efforts for Indian retail trading community.

Please let me know what you think. I am sure you do would like this solution too :slight_smile:

I think this is something not just the tagging related concept, as in tagging is a breadth wise or row-wise activity concept … and I am looking at this as top-down approach instead.

The reason I am saying is this:

I have lets say 3 individual separate portfolio, each catered for different objectives and different holding periods – which may have some common scrips too.

Understandably, all the stock holdings are necessarily stored in the demat account – which means there cannot be a way to store this into demat account. If tagging is done at the brokerage end, then think of this instead as having to create/maintain multiple portfolio id (similar to smallcase id) at the brokerage level. So, this provides a logical view to the holdings in the demat account filtered by the portfolio id instead of having a blanket representation to all the holdings.

An example:

Portfolio A (Long Term) Portfolio B Portfolio C
ITC 1None 5 None
HAL 3 2 3
BHEL 30 None None

There are 2 stocks in portfolio A that are common to other portfolio in single account. ITC and HAL with varied quantity holdings.

What I do (qty:- add, reduce, sell) with ITC or HAL in Portfolio A allocations should not have any bearing impact to the holdings in Portfolio B or Portfolio C or other portfolios. ITC as a stock could be held in different tranches across different portfolios too. A Portfolio can have its own weightage/allocation policies.

(What I am self debating is whether stocks can move across the portfolio constructs and whether this would be mutually beneficial with brokerage and that is something to ponder on but I would like the possibility, after all portfolio are only virtual construct buckets with lot of benefits)

That being said, tagging is free text(may lead to tag explosion) and will not help here as it is not the stock representation but the stock’s quantity representation in each portfolio across tranches of their own.

Even from the taxation point of view, as we understand, the individual transactions are taxed based on the number of days held after a buy transaction instead of at the stock level.

I am planning to use this at the earliest as soon as Dhan API (v2.1?) makes the constructs available as this will greatly help my automation and improve my trading allocation/risk management efficiency.

@PravinJ I will be happy to chime in any and all the technical discussions around this with the team over video whenever your team is ready to go over this. This is something that must have already happened in the brokerage scene and I feel dhan has the necessary resources to make that trailblazing efforts to get to the cutting edge.

Thinking more on this in terms of technical scenario:

Operating System Platform → Virtual Machine/Container → Application allocation/isolation efficiency

Apply this to

Brokerage platform → Virtual Portfolio Id construct → Portfolio isolation/allocation efficiency

With, ofcourse API and Data First!

think of this is something like a virtual machine/container on the brokerage platform…

On the win for brokerage, In the long run, it gets a lot easier to manage whatever that is done today with tools outside brokerage to get that inside the brokerage and perhaps also implies to get lot of business that is managed outside the brokerage also simplified.

@PravinJ what would it take to prioritize this from your end even for enabling a good thought process development into the flow here (not necessarily the availability of features yet – I know and understand that it is very much important to get the thoughts around this right first before embarking on the development works – development is probably a cakewalk for engineering smarts at Dhan once the solid specs are in place.

Our prioritisation for 2023 is here: 2023: What next to expect from Dhan

Lots to build from this list, and much more.

I saw that and it is a pretty good list of stuff to look forward to, and I can see the excitement there and at the same time a mixed feeling of “lot of stuff already on the plate!” – hence, also, asked what would it take to get this into the mix. how can I help and contribute for this feature? believe me when I say this, this will significantly unblock my resources (both capital and streamlining the efforts) and I am eagerly looking forward to have this happen at Dhan first :slight_smile:

@PravinJ I am making sure this thread still stays afloat and alive – I would really prefer to talk to you offline if that helps you convinced about this idea to get prepped up. I am more than inclined to spend hours and get this going if that helps the team.

I would like to throw my weight behind this with full understanding that feature requested is not trivial. I currently have three accounts to run separate strategies and would have loved to consolidate with Dhan given the features available.

1 Like