Open Martin-Molinero opened 1 year ago
Nice!
I take it this would be some crude generic margin fee model, to replace the null model for the brokerages / security types that do not have a specific model.
Hey @lucasbrynte!
I take it this would be some crude generic margin fee model, to replace the null model for the brokerages / security types that do not have a specific model.
Thank you! Exactly 💯, if AccountType
is AccountType.Margin
Is it also on the roadmap at the moment to implement realistic margin fee models for other brokerages than Binance, e.g. Bitfinex?
Not at the moment but we do accept contributions 👍
May I also ask how LEAN manages historical margin interest data in practice? E.g. in the case of Binance futures, can the historical margin interests be downloaded from QuantConnect via lean-CLI, to be stored in a CSV file or similar?
Can see details on the implementation of binance futures at https://github.com/QuantConnect/Lean/pull/6807, it's file driven generated by https://github.com/QuantConnect/Lean.DataSource.BinanceFundingRate. We have now added support for downloading it with the lean-CLI 👍
Regarding the DefaultMarginInterestRateModel
I think applying a fix rate cost (which can be an argument) would be enough given it would be generic, defaulting to a low reasonable value
Regarding the DefaultMarginInterestRateModel I think applying a fix rate cost (which can be an argument) would be enough given it would be generic, defaulting to a low reasonable value
After chatting with @jaredbroad we agreed on DefaultMarginInterestRateModel
reusing InterestRateProvider
internally to calculated the interest rate model based on the us treasury rate + 1%
Expected Behavior
IMarginInterestRateModel
accounting for costs associated with margin tradingActual Behavior
Potential Solution
DefaultMarginInterestRateModel
accounting for costs associated with margin tradingDefaultBrokerageModel.GetMarginInterestRateModel(Security security)
would return itReproducing the Problem
N/A
System Information
N/A
Checklist
master
branch