Ekliptor / WolfBot

Crypto currency trading bot written in TypeScript for NodeJS
https://wolfbot.org
GNU Affero General Public License v3.0
710 stars 215 forks source link

Bitmex fees #55

Closed SpiritOfLogic closed 4 years ago

SpiritOfLogic commented 4 years ago

https://github.com/Ekliptor/WolfBot/blob/7ac5f7e10ddd2d8220ab6af2cc181b2e86c0baa0/src/Exchanges/BitMEX.ts#L202

Seems as if fees for Bitmex are incorrect - https://www.bitmex.com/app/fees

Ekliptor commented 4 years ago

fixed with latest commit. thx

SpiritOfLogic commented 4 years ago

Not sure whether I understand your calculation of fees correctly but it should be 0.0075 per side as taker and -0.0025 (i.e. bonus not fee) per side as maker.

Ekliptor commented 4 years ago

WolfBot only has 1 fee per exchange (that value is only used for trade statistics, not for strategies). You can change it if you are always using maker/taker orders.

SpiritOfLogic commented 4 years ago

Ok I see - this might be an area for future improvements then - correct profit calculation especially for backtesting and also statistics similar to how the TradingView Strategy Tester does it - including draw down - would be very convenient.

Ekliptor commented 4 years ago

Agreed. Feel free to submit a pull request and compute fees for trading history depending on maker/taker ;) The complicated part is finding out what amount of your orders paid which fee. For example: You submit a limit order to buy x BTC and the order gets filled 50% immediately (taker fee). The other half gets filled later (maker fee). WolfBot queries open orders to check if they are filled (and move them), but doesn't query order history to check for paid fees. So the best way to do this is adding another API call "query my order history"