-
Notifications
You must be signed in to change notification settings - Fork 704
Description
Is your feature request related to a problem? Please describe.
Portfolio Performance currently lacks native support for leveraged positions. This makes it impossible to accurately track the performance and risk of investments that use leverage (e.g., trading on margin, using leveraged ETFs, or trading derivatives like CFDs or futures). The core issue is that the classic model of a "Cash Account" and a "Securities Account" cannot represent borrowed funds or the amplified exposure and risk that leverage creates. This forces users to employ cumbersome workarounds that do not integrate properly with the portfolio's performance calculations.
Describe the solution you'd like
I envision a new, dedicated account type, such as a "Leveraged Account" or "Margin Account". The key features of this account should be:
- Position-Based Management: Instead of just tracking a negative cash balance, this account would allow users to open and close leveraged positions. Each position would be defined by:
- An underlying security (e.g., SP500).
- A leverage multiplier (e.g., 5x, 10x, -2x for short) set by the user at the time of opening the position.
- The initial capital invested (the equity/margin requirement).
- Automated Exposure Calculation: The system would automatically calculate and track the total notional value of the position (
Initial Capital * Leverage
). The profit and loss of the position would be calculated based on the price movements of the underlying asset, multiplied by the leverage factor. - Integrated Performance Reporting: The performance of these leveraged positions must be fully integrated into the portfolio's reports. Most importantly, the Time-Weighted Return (TWR) and Money-Weighted Return (IRR) should be calculated based on the actual equity invested in the leveraged position, reflecting the true amplified gain or loss.
- Risk Metrics: The system should provide clear visibility into the total exposure and leverage ratio at the portfolio level.
This approach is more intuitive and powerful than simply managing a loan account because it directly models the economic reality of a leveraged trade.
Describe alternatives you've considered
I am currently using a script-based workaround:
- I create a custom, virtual security named like "10x Long SP500".
- I manually calculate and import the price data for this virtual security by applying the 10x multiplier to the daily returns of the actual SP500.
- I then "invest" in this virtual security within a standard securities account.
Limitations of this workaround:
- High Maintenance: It requires continuous manual data creation and management outside of Portfolio Performance.
- Fragile and Error-Prone: The entire process is manual and susceptible to errors.
- Inaccurate Cost Basis: The transaction history does not reflect the actual capital at risk correctly; it shows the notional value.
- No Distinction from Real Assets: The portfolio reports treat it as a normal long position, which can be misleading.