QuantConnect / Lean

Lean Algorithmic Trading Engine by QuantConnect (Python, C#)
https://lean.io
Apache License 2.0
9.92k stars 3.28k forks source link

Model Short Interest Fee on Short Holdings #4563

Open jaredbroad opened 4 years ago

jaredbroad commented 4 years ago

Expected Behavior

Fees paid for a hard to borrow stock

Actual Behavior

No fees paid for shorts.

Potential Solution

Obtain hard to borrow list; model fees.

Reproducing the Problem

Short hard to borrow stocks

Checklist

pberto commented 2 years ago

Would be great to get some attention to this. The web app even has an "Exposure> Equity Long/Short Ratio" chart for when the algo sells a security one does not possess.

For interactive brokers the cost modeling would be 0.25% annualized:

https://www.interactivebrokers.com/en/pricing/short-sale-cost.php#:~:text=The%20Short%20Sale%20Proceeds%20Interest,computed%20on%20the%20calculator%20here.

Then IIUC there are additional costs for interest that depend on the cash in your account. Would be nice to model this too but seems harder.

cheukhin1024 commented 1 month ago

The short fee rate can be retrieved via FTP automatically. Link: https://www.interactivebrokers.com/campus/ibkr-api-page/twsapi-doc/#shortable image

Here is its documentation and tutorial link: https://ibkr.info/it/article/2024

AlexCatarino commented 1 month ago

@cheukhin1024, LEAN has this information: Short Availability > Supported Providers > Interactive Brokers Provider. This issue is open because it has not been modeled yet, meaning that LEAN doesn't use the information of the InteractiveBrokersShortableProvider and apply the cost to the cashbook.