Skip to content

Manage your Bitmex account using the private Telegram bot. Give it a star ๐ŸŒŸ if you find it useful.

License

Notifications You must be signed in to change notification settings

learn2grid/Bitmex-to-Telegram

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

10 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Bitmex-to-Telegram

Manage your Bitmex account using the Private Telegram bot

Configuration

Create Telegram bot

  • Contact @BotFather in your Telegram messenger
  • Create a new bot by sending /newbot command and choose new name for your bot. Then, you will receive a link to your bot and an access token.
  • Head over to the bot_manager.py file and set your access token to TELEGRAM_BOT_TOKEN variable

Set up Bitmex API keys

  • Setup BITMEX_API_KEY and BITMEX_API_SECRET environment variables to your bitmex account api key and secret.

Month Codes

  • Quote symobol for future contracts at bitmex changes after settlement. Currently active future contracts ends with "U20". You need to change this value yourself based on active contracts and set it to CONTRACTS_CODE variable in bot_manager.py file

Make Telegram Bot Private

You need to make sure that no one will use this bot except yourself. That's why, we make the bot private so it will respond only to messages from your telegram account.

  • Run main.py file, now your telegram bot is running
  • Start a conversation with your telegram bot with the link provided by @BotFather and send /help command
  • Check the logs in the console. You get:
2020-07-24 20:17:03,612 - bot_manager - INFO - Admin Chat ID: 432156789
2020-07-24 20:17:03,612 - bot_manager - INFO - First Name: Spiral
2020-07-24 20:17:03,612 - bot_manager - INFO - Last Name: Dev

Now, head over to the telegram_helper.py file and set ADMIN_CHAT_ID, ADMIN_FIRST_NAME and ADMIN_LAST_NAME variables to what you got from the console.

Rerun the script. Done!

Commands

Bot has the following commands:

/help - List of all commands 
/long - Create buy market order. ::Symbol, Quantity 
/short - Create sell market order. ::Symbol, Quantity 
/margin_status - Get margin status 
/positions - Get open positions 
/orders - Get orders ::Last N 
/cancel - Cancel order with ID ::OrderID 
/cancel_all - Cancel all orders 
/leverage - Set leverage ::Symbol, Leverage 
/history - Get wallet history. ::Last N 
/instrument - Get instrument(s). ::Symbol 
/indices - Get price indices. ::Root Symbol

Contributions

Contributions and feature requests are always welcome!

Support

Your Support and Donations are welcomed and appreciated!

  • BTC: 1PUGs6mxcW2W3SJi95aG8GvRQRJsoFHWWQ

  • ETH: 0x66615e09f7f46429e7620ffbf78479879bbab41d

  • LTC: LRxYMgEXMumwxYdimZo9EJ5CfBcipD5c3n

LICENSE

MIT LICENSE

About

Manage your Bitmex account using the private Telegram bot. Give it a star ๐ŸŒŸ if you find it useful.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%