Closed bkunsberg closed 2 years ago
Yep you are absolutely right. We haven't implemented the shorting for alpaca in the backtesting framework - this is the most significant feature that we're missing in a full alpaca integration.
We are working on this, I will attach this issue to a pull.
Thanks for the quick reply! Looking forward to the full integration.
@EmersonDove glad you're working on this! Do you plan to do the same for Crypto (e.g. binance API)?
@sjhermanek This is a really good question. I suppose I'm not sure of the answer because I'm not really a binance user.
As I understand it, the margin API calls are through different endpoints which would make that integration significantly more complex but I'm not super sure. I think because of this we are going to wait for that more advanced stuff.
This feature is now active on the dev branch.
@bkunsberg , this is now live! Let us know what you think ðŸ’
Thank you for adding this feature so fast! I think it will be really useful for me (and others). Looking forward to trying it out.
On Sun, Jan 16, 2022 at 9:05 AM Brandon Fan @.***> wrote:
@bkunsberg https://github.com/bkunsberg , this is now live! Let us know what you think ðŸ’
— Reply to this email directly, view it on GitHub https://github.com/Blankly-Finance/Blankly/issues/73#issuecomment-1013913517, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKB4TQDFVYQ22NI33JWTOOLUWL3F3ANCNFSM5HTGU3TQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you were mentioned.Message ID: @.***>
Shorting on Binance
and with KeylessExchange
seems to also be impossible. Any idea if it will be possible in a next release ?
The blankly.Binance()
exchange is spot, so shorting is disabled. KeylessExchange
is also made to mimic spot so I didn't add an option for shorting but I could see an argument for adding it.
Supporting Binance cross margin will be great also.
Hi,
Thank you for the very useful package! I'm trying to backtest a strategy that involves shorting a stock/crypto. This means I make a call like: interface.market_order('MSFT', 'sell', 1) in a price_event function.
This results in an error message such as: *** blankly.utils.exceptions.InvalidOrder: Not enough base currency. Available: 0.0. hold: 0. requested: 1.
I'd expect to be able to short on Alpaca, as doing a 'sell' market order (e.g. through their web console) with 0 position is successful.
Note: I've gotten the same results with
and coinbase = CoinbasePro() crypto = Strategy(coinbase)
Is this intentional? Thanks so much!