# Portfolios / Sub-accounts

**URL:** <https://forum.alpaca.markets/t/portfolios-sub-accounts/678>\
**Category:** Feature Requests\
**Created:** [January 21, 2020, 9:39am UTC](https://forum.alpaca.markets/t/portfolios-sub-accounts/678 "2020-01-21T09:39:16Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![Xavier\_Robitaille](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/xavier_robitaille/32/2364_2.png) [@Xavier\_Robitaille](https://forum.alpaca.markets/u/Xavier_Robitaille)\
**Post date:** [August 30, 2021, 7:03pm UTC](https://forum.alpaca.markets/t/portfolios-sub-accounts/678/21 "2021-08-30T19:03:27Z")

</div>

Yes, positions are aggregated: e.g. if you buy 100 shares of ABC and a week later buy another 200 shares of ABC, Alpaca shows that your account is long 300 shares.

If these two purchases belong to two different trading strategies, you could tag each order with labels representing their respective trading strategy, and use a portfolio management app to analyze the evolution of the PL of each strategy by filtering by label (see above post).

---

<div class="post-metadata">

**Author:** ![whitej125](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/whitej125/32/3027_2.png) [@whitej125](https://forum.alpaca.markets/u/whitej125)\
**Post date:** [August 30, 2021, 7:16pm UTC](https://forum.alpaca.markets/t/portfolios-sub-accounts/678/22 "2021-08-30T19:16:11Z")

</div>

+1 to this… $25k per account no problem.

---

<div class="post-metadata">

**Author:** ![JeremyWhittaker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/jeremywhittaker/32/3239_2.png) [@JeremyWhittaker](https://forum.alpaca.markets/u/JeremyWhittaker)\
**Post date:** [November 2, 2021, 12:19am UTC](https://forum.alpaca.markets/t/portfolios-sub-accounts/678/23 "2021-11-02T00:19:03Z")

</div>

I was wondering if there was any update on this?

I’m able to push orders with unique identifiers with “client\_order\_id=”

However, once it is converted into a position I’m not sure how to retrieve the order ID. How are people keeping their different strategy trades separated once they become a position?

---

<div class="post-metadata">

**Author:** ![inkheist](https://avatars.discourse-cdn.com/v4/letter/i/7993a0/32.png) [@inkheist](https://forum.alpaca.markets/u/inkheist)\
**Post date:** [December 6, 2021, 10:33pm UTC](https://forum.alpaca.markets/t/portfolios-sub-accounts/678/24 "2021-12-06T22:33:15Z")

</div>

+1

I’m using Alpaca to backtest strategies on a paper account using the same ETFs and this would save a bunch of coding!

---

<div class="post-metadata">

**Author:** ![nthorwir](https://avatars.discourse-cdn.com/v4/letter/n/8491ac/32.png) [@nthorwir](https://forum.alpaca.markets/u/nthorwir)\
**Post date:** [January 18, 2022, 5:15pm UTC](https://forum.alpaca.markets/t/portfolios-sub-accounts/678/25 "2022-01-18T17:15:24Z")

</div>

Thanks [Xavier](https://forum.alpaca.markets/u/Xavier_Robitaille) , I think this is a good idea in theory and would allow me to separate the different strategies, but also here, the devil is in the details: I have seen some corporate actions that result in transactions that I didn’t initiate. The assigned user ID is random and I would not know which portfolio / strategy these belongs to. While these are few, it would still result in a lot of effort to sort them out, which is needed to have all transactions balanced for each strategy - for quality control.

---

<div class="post-metadata">

**Author:** ![Xavier\_Robitaille](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/xavier_robitaille/32/2364_2.png) [@Xavier\_Robitaille](https://forum.alpaca.markets/u/Xavier_Robitaille)\
**Post date:** [January 18, 2022, 8:12pm UTC](https://forum.alpaca.markets/t/portfolios-sub-accounts/678/26 "2022-01-18T20:12:26Z")

</div>

> [@nthorwir](#):
>
> I have seen some corporate actions that result in transactions that I didn’t initiate

Hi @nthorwir, thanks for bringing new points to the discussion. Would you mind elaborating bit more on the corporate action you have in mind? Since corporate actions occur on live positions that can themselves be attributed to each strategy, I don’t expect them to be that problematic.

For example:

1. If the corporate action occurs on a security that is held exclusively by `algo1`, it would be easy to tag the `algo1` label to the `activities` representing the corporate action. The effect of the corporate action would thereby only impact `algo1` in Feather Finance (we model each strategy’s portfolio based on all the `activities` tagged with that strategy).

2. If instead the position is shared by several algos, then corporate action `activities` would need to be duplicated and the amounts would pro-rated according the each algo’s position.

You are right to say that it would currently involve a manual process, but the mechanics should be pretty straightforward (couple minutes max). We do have a few Alpaca users who tag strategy labels. If more users start using the feature we could even consider automating the manual process.

Thanks,  
Xavier

---

<div class="post-metadata">

**Author:** ![nthorwir](https://avatars.discourse-cdn.com/v4/letter/n/8491ac/32.png) [@nthorwir](https://forum.alpaca.markets/u/nthorwir)\
**Post date:** [January 18, 2022, 9:27pm UTC](https://forum.alpaca.markets/t/portfolios-sub-accounts/678/27 "2022-01-18T21:27:50Z")

</div>

Xavier,  
thanks for a quick reply. I am thinking of e.g. splits, rights issue, symbol changes and mergers. I can believe that each of these can be attributable to the correct strategy as you point out and that it possible to reconstruct the holdings at a given point for each strategy. But it took me more than a couple of minutes each to identify the issue, find the details on what happened, correct the transactions, verify success and to make sure that the correction does not interfere with calculations such as profit per transaction etc.  
How do you apply these so quickly ? Is there a general recipe or semi automation?

---

<div class="post-metadata">

**Author:** ![Xavier\_Robitaille](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/xavier_robitaille/32/2364_2.png) [@Xavier\_Robitaille](https://forum.alpaca.markets/u/Xavier_Robitaille)\
**Post date:** [January 19, 2022, 2:46pm UTC](https://forum.alpaca.markets/t/portfolios-sub-accounts/678/28 "2022-01-19T14:46:39Z")

</div>

**TLDR**  
@nthorwir I see what you mean. I think it helps split the question/problem in two: (1) portfolio issues caused by corporate events in and of themselves (regardless of subportfolios/labeling techniques), and (2) their implications on labeling strategies. When I said “couple minutes max”, I was referring to the additional work involved to make sure strategies remain well labeled on a typical corporate action.

**Issues Caused by Corporate Events**  
I agree with you that it is often tricky to troubleshoot portfolio issues when there’s an ongoing corporate action on one of its holdings. The main problem is that complex corporate events (like spin-offs) don’t impact the portfolio all at once, as one “atomic” event. Instead the portfolio can transition through several (incomplete) states: corporate event’s ex-date, date at which symbol trades at post-event price, corporate event’s pay date, date(s) at which the broker (partially/fully) reflects the corporate event in the user’s portfolio… For the broker & the clearing house, the only real deadline by which everything needs to be in order in the user’s portfolio is several days later, when the corporate event settles (when hard money & cusips exchange hands at the clearing house…

If it makes you feel any better, I know for a fact that traders at top financial institutions face some of the same problems.

While there is no silver bullet to guard against such issues, portfolio management tools can help you troubleshoot these issues faster (e.g. trading desks at investment banks use such tools every day to reconcile their P/L):

- P/L Attribution Tool (see [thread](https://forum.alpaca.markets/t/does-anyone-track-their-portfolio-with-another-application/5038/20))
- Filtering by Symbol (see [thread](https://forum.alpaca.markets/t/simply-way-to-find-p-l-by-equity/5855))
  - e.g. if you’re analyzing the impact of LB splitting into BBWI & VSCO, you can filter on a set of symbols (LB / BBWI / VSCO) and look at the evolution of that subset of your portfolio.

- Temporarily Disabling Transactions / Inserting Temporary Transactions
  - If a corporate event has been partially processed it can be helpful to temporarily disable / temporarily add a transaction in your portfolio to put it in a more consistent state while waiting for other

**Implications for Labeling**  
You raise a good point that any portfolio `activity` that isn’t directly initiated by you won’t be labeled automatically. That’s true of corporate events activities, but also of e.g. TAF & REG fees.

The way I see it, tagging your strategies only gives you more info to troubleshoot your portfolio issues. E.g. your labels will point you to which strategy is affected by the issue. I am not saying that labeling will always be effortless. If your trading strategies involve holding positions on many different symbols, there will come a time when a particularly thorny corporate event makes you reconsider the fact that you not only have to troubleshoot the issues caused by the corporate event, but also keep your strategy labels updated throughout that mess. However, over the long run, I think the benefits will outweigh the additional work for many of us.

---

<div class="post-metadata">

**Author:** ![nthorwir](https://avatars.discourse-cdn.com/v4/letter/n/8491ac/32.png) [@nthorwir](https://forum.alpaca.markets/u/nthorwir)\
**Post date:** [January 19, 2022, 5:46pm UTC](https://forum.alpaca.markets/t/portfolios-sub-accounts/678/29 "2022-01-19T17:46:36Z")

</div>

Thanks Xavier for another helpful reply.  
The resolving of corporate actions and attribution are of course separate issues and I can see how the latter is easier - good point.

> If it makes you feel any better,  
> I know for a fact that traders at top financial institutions face some of the same problems.

It kinda does 🙂

Definitely agree that tagging is the a good idea to enable flexibility in the future.

---

<div class="post-metadata">

**Author:** ![AlwaysTraining](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/alwaystraining/32/3600_2.png) [@AlwaysTraining](https://forum.alpaca.markets/u/AlwaysTraining)\
**Post date:** [June 10, 2022, 12:16am UTC](https://forum.alpaca.markets/t/portfolios-sub-accounts/678/30 "2022-06-10T00:16:58Z")

</div>

Hi, Is there documentation about the “_FF_” label format specification? I think it is bold of you to take away my client order id prefix! j/k, I store metadata keys and values encoded in a yaml like syntax in the client\_order\_id. Is there a programmatic way I can apply labels to orders for past and future in feather?

---

<div class="post-metadata">

**Author:** ![Xavier\_Robitaille](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/xavier_robitaille/32/2364_2.png) [@Xavier\_Robitaille](https://forum.alpaca.markets/u/Xavier_Robitaille)\
**Post date:** [June 10, 2022, 8:11pm UTC](https://forum.alpaca.markets/t/portfolios-sub-accounts/678/31 "2022-06-10T20:11:16Z")

</div>

Hi @AlwaysTraining,

> [@AlwaysTraining](#):
>
> Is there documentation about the “_FF_ ” label format specification?

- On our documentation page, there is a section on **Labels** and a section on how to **Filter by Label**
  - [https://featherfinance.com/docs/](https://featherfinance.com/docs/)

- Here is the description of the FF label format specification:

> - Tag a custom label to an order by specifying a _client\_order\_id_ parameter in the following format:
> - custom\_order\_id = “MYCUSTOMLABEL” + “_FF_” + my\_custom\_id;
> - where _MYCUSTOMLABEL_ is the label that will feed to Feather Finance, _FF_ is a delimiter used by Feather Finance, and _my\_custom\_id_ is a unique identifier for the order.
> 
> - For the tech-savvy: here is the regular expression we use to extract the label from the _client\_order\_id_: `/(^.+)_FF_.*/.`

> [@AlwaysTraining](#):
>
> I think it is bold of you to take away my client order id prefix! j/k, I store metadata keys and values encoded in a yaml like syntax in the client\_order\_id.

- The above specification is hardcoded in Feather Finance at the moment, but it would be easy for us to let you choose your own label format specification if you can’t find a way to work with ours (i.e. in technical terms, we could let you specify your own regular expression in your Feather Finance User Settings).

> [@AlwaysTraining](#):
>
> Is there a programmatic way I can apply labels to orders for past and future in feather?

Currently there are two ways for you to apply labels yourself:

1. In the Feather Finance WebApp you can manually edit the label field of any portfolio activity.
2. By prefixing a label to the Alpaca’s _client\_order\_id_ parameter (discussed above).

If you have a one off request to back-populate the label field of historical activities based on a set of criteria, it would be easy for us to do it for you (we have internal tools that do just that).

Others have shown interest in programatically amending activities, so we may well implement such an endpoint for our public API.

Let us know how it goes! If you’re interested, I could put you in contact with other Alpaca users who have implemented this.

---

<div class="post-metadata">

**Author:** ![jam](https://avatars.discourse-cdn.com/v4/letter/j/f6c823/32.png) [@jam](https://forum.alpaca.markets/u/jam)\
**Post date:** [September 21, 2022, 11:58pm UTC](https://forum.alpaca.markets/t/portfolios-sub-accounts/678/32 "2022-09-21T23:58:42Z")

</div>

+1 for this feature. Ideally it’d work with the Rebalancing API as well. I assume that if it’s implemented it would be available for the Broker API.

---

<div class="post-metadata">

**Author:** ![jonnymaserati](https://avatars.discourse-cdn.com/v4/letter/j/f07891/32.png) [@jonnymaserati](https://forum.alpaca.markets/u/jonnymaserati)\
**Post date:** [October 30, 2022, 10:22am UTC](https://forum.alpaca.markets/t/portfolios-sub-accounts/678/34 "2022-10-30T10:22:49Z")

</div>

Any updates on this?

Easiest to implement would be to add a tag to orders that can be used to filter a `GetOrdersRequest` so that at least the capital allocated for a specific portfolio can be calculated? Nicer would be to add a dictionary attribute to an asset that keeps running subtotals for the quantity of orders based on the order tag from above?

---

<div class="post-metadata">

**Author:** ![backpack](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/backpack/32/4842_2.png) [@backpack](https://forum.alpaca.markets/u/backpack)\
**Post date:** [January 14, 2023, 1:35am UTC](https://forum.alpaca.markets/t/portfolios-sub-accounts/678/35 "2023-01-14T01:35:17Z")

</div>

+1 on this feature, this would be really great to have to keep all strategies separate

---

<div class="post-metadata">

**Author:** ![Veng34nc3Th3k1dd](https://avatars.discourse-cdn.com/v4/letter/v/ecc23a/32.png) [@Veng34nc3Th3k1dd](https://forum.alpaca.markets/u/Veng34nc3Th3k1dd)\
**Post date:** [March 12, 2023, 4:06am UTC](https://forum.alpaca.markets/t/portfolios-sub-accounts/678/36 "2023-03-12T04:06:58Z")

</div>

ABSOLUTELY!!! 1000%. I am even creating a new thread. Please listen! And shorting fractional sized orders!!!

---

<div class="post-metadata">

**Author:** ![Jure\_Smrekar](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/jure_smrekar/32/4804_2.png) [@Jure\_Smrekar](https://forum.alpaca.markets/u/Jure_Smrekar)\
**Post date:** [March 30, 2023, 7:56pm UTC](https://forum.alpaca.markets/t/portfolios-sub-accounts/678/37 "2023-03-30T19:56:34Z")

</div>

+1 for multiple sub-accounts or somehow separate the multiple strategies to be independent between each other.

---

<div class="post-metadata">

**Author:** ![Rok\_Petric](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/rok_petric/32/1072_2.png) [@Rok\_Petric](https://forum.alpaca.markets/u/Rok_Petric)\
**Post date:** [April 7, 2023, 12:46pm UTC](https://forum.alpaca.markets/t/portfolios-sub-accounts/678/38 "2023-04-07T12:46:54Z")

</div>

+1, much needed feature, hope to see it ASAP, the post is already old

---

<div class="post-metadata">

**Author:** ![tve686588](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/tve686588/32/5308_2.png) [@tve686588](https://forum.alpaca.markets/u/tve686588)\
**Post date:** [April 15, 2023, 1:42pm UTC](https://forum.alpaca.markets/t/portfolios-sub-accounts/678/39 "2023-04-15T13:42:14Z")

</div>

Yes +1. Really need sub accounts

---

<div class="post-metadata">

**Author:** ![FIRMCEO](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/firmceo/32/1924_2.png) [@FIRMCEO](https://forum.alpaca.markets/u/FIRMCEO)\
**Post date:** [July 29, 2023, 3:48pm UTC](https://forum.alpaca.markets/t/portfolios-sub-accounts/678/40 "2023-07-29T15:48:39Z")

</div>

+1 YES! We need this!

---

<div class="post-metadata">

**Author:** ![Sahil\_Mirchandani](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/sahil_mirchandani/32/6740_2.png) [@Sahil\_Mirchandani](https://forum.alpaca.markets/u/Sahil_Mirchandani)\
**Post date:** [December 31, 2024, 7:38am UTC](https://forum.alpaca.markets/t/portfolios-sub-accounts/678/41 "2024-12-31T07:38:31Z")

</div>

Alpaca, I know you are listening, it has been 4 years we need sub accounts.  
PLEASE

[Previous page](https://forum.alpaca.markets/t/portfolios-sub-accounts/678.md?page=1)

[Next page](https://forum.alpaca.markets/t/portfolios-sub-accounts/678.md?page=3)
