blackbird icon indicating copy to clipboard operation
blackbird copied to clipboard

Alter Code To Short Using Different Exchange

Open taiez opened this issue 6 years ago • 29 comments

Hi Everybody,

I found this arbitrage bot a few weeks ago and was messing around with installing and running (in demo mode) it on an Amazon EC2 instance. I was successful, and the demo mode was showing several arbitrage opportunities. When I went to create a Bitfinex account to start trading with real money I was unable to. Apparently, they aren't taking new members until Jan 15th, if you believe that. This leads me to my question:

Is there an easy way to alter the code to use a different trading exchange as the shorting exchange?

I'll admit that I haven't looked at the code yet. It has been a while since I've seen a C++ code. However, I would like to get to know the guts of the code, and would enjoy altering it a bit. If it is not an easy endeavour though, I might just try to wait out Bitfinex...

Thanks in advance everyone! This is an amazing bot with what seems like a passionate community. Hopefully, I can get in the game too!

taiez avatar Dec 21 '17 16:12 taiez

Hi,

CEX.IO seems to be a good candidate: They are based in the UK and here is their REST API documentation. Short selling is possible.

butor avatar Dec 21 '17 16:12 butor

Hello,

This is some great work! Would Poloniex margin trading be able to be supported? CEX.IO margin trading doesn't seem to be working for U.S customers.

Mgla96 avatar Dec 22 '17 09:12 Mgla96

@butor I'm willing to work on adding CEX.IO to Blackbird (currently I'm ~25% complete), however, I need an API key / secret to finish and fully test the private API functions. CEX.IO has temporarily disabled new sign-ups to their exchange so I can't get the key / secret.

Does anyone know a way around this?

cricc78 avatar Dec 23 '17 18:12 cricc78

I don't see any possible workaround, and I don't have any account on CEX.IO that you could temporary use.

Hopefully they will reopen their new user registration soon (more info here).

butor avatar Dec 23 '17 20:12 butor

Yep, I'll just create an account once they're back up.

cricc78 avatar Dec 23 '17 22:12 cricc78

BTW - it appears as if CEX.IO BTC/USD is generally priced much higher than on the other exchanges - at least that was my observation over the past couple of days. Not sure if this will last or if it will normalize over time, but this exchange does appear to be a good one considering it allows short positions.

Whether or not they will allow us US-based folks to trade on margin is another question...

cricc78 avatar Dec 23 '17 22:12 cricc78

related to #341

blundell avatar Dec 24 '17 00:12 blundell

related to #324

blundell avatar Dec 24 '17 00:12 blundell

related to #307

blundell avatar Dec 24 '17 00:12 blundell

related to #302

blundell avatar Dec 24 '17 00:12 blundell

Hi, is short selling on okcoin already implemented?

gweit avatar Dec 25 '17 19:12 gweit

No. But don't get your hopes up too high as okcoin lacks liquidity.

andygoossens avatar Dec 25 '17 19:12 andygoossens

Hey Gang, I have had an active CEX.io account for a while(use to be GHash.io), I would love to have it implemented in this bot, how may we do that?

mattsicotte avatar Jan 08 '18 08:01 mattsicotte

Any update on progress of adding CEX.io ?

JinjaNinja22 avatar Jan 14 '18 15:01 JinjaNinja22

I’ve got a good chunk of the code done; however, I still need an API key to test everything out. I’m sure code refinement will be necessary once I can test.

Last I checked, CEX.IO is still not accepting new accounts so I haven’t been able to get my own API key.

cricc78 avatar Jan 14 '18 15:01 cricc78

oh right i see. I do have a CEX.io account that i dont have any money on currently.

JinjaNinja22 avatar Jan 16 '18 16:01 JinjaNinja22

@JinjaNinja22 OK, let me know the best way to contact you and we can discuss.

cricc78 avatar Jan 17 '18 16:01 cricc78

@cricc78 sorry for the delay, fibre was down. Sucks that there aren't DMs on here anymore, do you have twitter? Can DM there to discuss.

JinjaNinja22 avatar Jan 19 '18 18:01 JinjaNinja22

Yep, it's a pain. Sure, you can DM here: https://twitter.com/chrisct

cricc78 avatar Jan 19 '18 18:01 cricc78

@cricc78 sorry for the delay, i followed you on twitter [https://twitter.com/merrick_bengis]. Follow back when you get a chance so we can DM.

JinjaNinja22 avatar Jan 22 '18 11:01 JinjaNinja22

Any luck here?

taiez avatar Feb 02 '18 02:02 taiez

Making progress. Probably another couple of weeks, assuming I don’t get stuck anywhere. But then I’ll ask you guys for help!

Currently testing / optimizing the buy / sell orders.

cricc78 avatar Feb 02 '18 03:02 cricc78

Hi Chris, I am just wondering how is going with your setting up Blackbird? Have you done any trade? Is it worth it? Thanks

flocoder avatar Feb 11 '18 01:02 flocoder

@flocoder No, I have not executed any real money trades beyond what I did while testing the Cex.io API. The main problem is that as a US resident, not many exchanges allow me to sell short. The ones that do allow shorts for US residents tend to price bitcoin lower than other exchanges, based on my recent observations. Blackbird works in part by initiating a short on an exchange that prices bitcoin higher than another...but if I can't initiate shorts on those exchanges, it leaves me with no way to exploit the opportunity.

I'm still working on finding an opportunity here, but if you're not from the US, I would give it a go and see what results you can obtain. You may be better positioned than I because you can probably initiate shorts on the exchanges that tend to price bitcoin higher than others.

cricc78 avatar Feb 11 '18 17:02 cricc78

@cricc78 First thanks for the prompt reply. I am trying to set the Blackbird from Australia. I hope as you have mentioned there is better opportunity outside of US. I will update it how it goes. Currently I am setting up accounts in the various exchanges and depositing funds. Blackbird is running smoothly in demo mode. Not sure how it does with real money. Thanks

flocoder avatar Feb 13 '18 07:02 flocoder

Any closer to being able to test with short selling with CEX.io ? any help needed with testing or known bugs ?

brettham70 avatar Mar 11 '18 21:03 brettham70

As was noted in #392, the minimum to short on CEX is 0.05 BTC. I haven't heard of anyone who has tested with that amount yet. Testing with any smaller amount will cause the CEX API to return an error and Blackbird to crash.

fdoumet avatar Mar 12 '18 15:03 fdoumet

@fdoumet - I tested it yesterday with 0.05 or larger amount in account (USD1000). Order still received the same error. Suggest it's not calling the correct API and assume if i had put BTC in account it would have maybe sold it.Problem i see with CEX is that the ARB % is always there between 1.5% and 3% currently meaning positions will never close. Anyone else with a good ARB idea let me know :).

brettham70 avatar Mar 12 '18 18:03 brettham70

I think CEX.IO short must use this interface below not this (/place_order/BTC/USD/)

Open position POST https://cex.io/api/open_position/{symbol1}/{symbol2}

redpanda321 avatar Mar 13 '18 14:03 redpanda321