Back

Possible to model tax lot methods?

I'm considering going live with an algorithm but it does a lot of portfolio rebalancing across a small subset of ETFs essentially doing correlation style trading. While it has an impressive compounded annual return one concern is Quantconnect is reporting a very low unrealized gain. What sort of tax lot method is Quantconnect using to estimate unrealized losses? FIFO? 

I have a strong feeling this algorithm could possibly be a lot better in practice if I can model tax lots better. I'd like to see how it works out with LIFO, Highest Cost, and other Lot-Matching Methods Interactive Brokers uses - 

https://www.interactivebrokers.com/en/software/ibto/ibto/lotmatchingmethods.htm

Also, it'd be really useful if we had a way to see what percentage is long term vs short term gains. It'd be great to see how much tax drag it has in the dashboard too. My algorithm is intended to possibly run for a decade or more (backtesting has held up since 1960 at least through all markets), and so ideally I'd like to accumulate a lot of long term capital gains tax lots, while selling off any losses and minimizing short term capital gains. I.E. I want to mimize tax drag as much as possible.

Does IB expose nominating specific lots in their API? If so, it'd be awesome to manage these tax lots algorithmically too! TD Ameritrade has a great Tax Efficient Loss Harvester method - 

https://www.tdameritrade.com/education/taxes/what-is-a-tax-lot.page

 

 

Update Backtest







0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Hi Ritaeyln,

Currently, Lean does not model taxes or interest on your capital, and it also does not take into account tax lots when executing orders. When new shares are purchased for an existing position, Lean does not distinguish between the positions, instead it treats it as one average positon. The unrealized gains reported on Lean are the total gains on positions which have not been closed yet.

You could model tax lots on your own by keeping track of each position you enter and then implementing a tax lot ID method.

2

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


I guess papertrading with various brokerages would allow one to see the 'live' effects of these lot models as they are required to manage trades for their own jusrisdictions? 

 

Perhaps I am falsely assuming they manage paper accounts the same way as live accounts

1

Hey Josh,

I looked into the paper trading accounts offered by some brokerages, they don't seem to provide any information about tax lots in paper trading. Interactive brokers has a guide on how to manually match lots for trades through TWS. Maybe it's possible to do that through a IB paper trading account as well.

0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Update Backtest





0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Loading...

This discussion is closed