-
Notifications
You must be signed in to change notification settings - Fork 829
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bitmex: TBP Logic #986
Comments
Are you referring to #976 ? If not TBP is calculated with the ewma ! |
I don’t think it’s what was discussed there. Say I’m using manual mode with 1 btc in margin. I want the bot to stop buying when I’ve spent 50% of my margin on buys and stop selling when I’ve used 50% of my margin on sells. The problem is that since the margin is in bitcoin, the bot only sees that Bitcoin held has gone down, regardless if I’ve used that bitcoin margin to accumulate long or short positions in bitcoin. If I’m long eos/xbt it’s fine, because I’m net short bitcoin, having used 50% of my margin buying eos and selling xbt, so it will set the bid to tbp held. But if I’m net short eos/btc, having used 50% of my margin buying btc and selling eos, it will still see that I have 50% of the bitcoin in my margin account, and it will set the bid to tbp held. So no matter if you have too many Buys or too many Sells, the bot will only stop buying, and never stop selling. It’s not that tbp is wrong, it’s that no matter what side of the trade you are on it always thinks that you are short the margin currency. |
Running into a possibly related issue where the bot, upon running out of margin, won't recognize that and proceeds to spam orders (which get "insufficient margin" error) until IP banned. |
Yeah, it’s related. I haven’t really had time to play with it since I’m in the middle of a big project at work.
My only solution has been to come up with a new bitmex specific strategy that trades less and with bigger sizing. Though this obviously isn’t and ideal strategy with such high rebates available.
…Sent from my iPhone
On Aug 22, 2019, at 12:41 PM, MiningInMySleep ***@***.***> wrote:
Running into a possibly related issue where the bot, upon running out of margin it won't recognize that and proceeds to spam orders (which get "insufficient margin" error) until IP banned.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
lemme reread all comments slowly again to see if i can understand it |
I can’t get tbp to work as it should. Now that I’ve got things working in terms of trading it’s now time to work on risk management.
As of now it looks like the bot doesn’t understand if tbp held should be applied to the bid side or the ask side. I imagine this could be fixed by having the bot query the bitmex api and see if the net position is long or short, then hold that side.
Coding this seems a bit over my head but I’ll give it a shot, @ctubio can you point me in the right direction and I’ll poke at it after work tonight.
The text was updated successfully, but these errors were encountered: