This is a Simple Binance Trader as a Telegram Bot.
With TakeProfit and Stoploss Trades using OCO type of trades.
For TakeProfit and Stoploss you can either use the exact value or you can use percentage.
You can also get your balance and use the bot for simple market and limit buy and sell orders.
-
To begin, you'll need an Access Token for your telgram bot that you can make using BotFather. then you need your API keys frm binance. be sure to turn withdrawal option off.
-
First install some dependencies: Best way is use Virtualenv:
virtualenv -p python3 .env
source .env/bin/activate
pip install -r requirements.txt
-
After create your bot and get your Token from botFather, send some text(more than two message) to your bot and use this command to find your chat_id: use @userinfobot bot to get your chat_id by sending /start to bot. Put your chat_id and Token and Binance's API keys in config.
-
Run code:
python telegramBot.py
- Send you command via Telegram's Bot
/start : to start using the bot
/ping8 : to send ping and check your connection
/help : to get list of all the possible commands
the rest of the commands:
Buy_market --market market --quantity quantity
Sell_market --market market --quantity quantity
Buy_limit --market market'] --quantity quantity --rate rate
Sell_limit --market market'] --quantity quantity --rate rate
Get_open_trades --market market
Cancel_order --market market --orderID orderID
Get_balance --symbol symbol
Get_market_price --market market
Sell_OCO_order --market market --quantity quantity --takeProfitPrice takeProfitPrice --stopLimit stopLimit --stopLossPrice stopLossPrice
Trade --market market --quantity quantity --takeProfitPrice takeProfitPrice --stopLossPrice stopLossPrice
Trade_pct --market market --quantity quantity --takeProfitPct takeProfitPct --stopLossPct stopLossPct
Transfer_dust --symbol symbol
*you can also use amount of BTC instead of quantity (--amount amount)
*for get_balance market argument is optional. default value is BTC
*if you dont use amount or quantity minimum quantity will be used
*for Trade you can add multiple targets separating them with comma
example:
Get_balance --market BTC
Trade --market ETHBTC --quantity 0.005 --takeProfitPrice 0.038 --stopLossPrice 0.036
Trade_pct --market ETHBTC --quantity 0.005 --takeProfitPct 1.2 --stopLossPct 2