The 'binance-stepper-bot' is a trading automation program for Binance Exchange written in Python.
It is designed to be robust and reliable, so it only utilizes usual SELL and BUY limit orders, each following trade is placed based on the pre-generated array of prices and has only two orders out on the market at the same time.
Program is capable of sending you daily/weekly/monthly CSV reports with the number of completed trades and estimated profit. It also saves each and every order it places on the market in a CSV file, thus creating monthly trading history.
git clone https://github.com/aleksgaisov/binance-stepper-bot
pip3 install -r requirements.txt
List:
python-binance
requests
autobahn
certifi
chardet
cryptography
dateparser
pyOpenSSL
service-identity
Twisted
[*] Read Only [*] Enable Trading [] Enable Withdrawals
Optional: Consider restricting API access to trusted IPs only
This bot can email you reports based on its activity on the market. It uses Gmail as SMTP provider, meaning that you have to have at least one Gmail account in order to unitize it for emailing. Follow the steps to allow it to send you reports.
The program uses config.json file for basic configuration settings. It is divided in two entries: Binance_bot and Email_sender.
Setting | Description |
---|---|
api_key | Binance API key |
api_secret | Binance API secret key |
asset | cryptocurrency listed on Binance you want to buy your coin with (ex. BTC) |
coin | cryptocurrency listed on Binance you want to sell for you asset (ex. ETH) |
spread | number of step values between your BUY and SELL order >= 0 (ex. 2) |
step | distance between prices >= 0 (ex. 0.00002) |
conins_per_order | amount of coin for each trade (ex. 5) |
sender_address | email address to reports emails from |
sedner_pass | password from sender email |
receiver_adderss | email address to send reports to (could be the same as sender address) |
Some unimplemented configuration, like: toggle emailing, using different SMTP provider, frequency of report generation, frequency of market review should be done by commenting out appropriate source code section. For now.
Simplified version of the general algorithm can be viewed on the flowchart below:
In order to set the optimal values inside config file you should first get a brief idea of how do the orders are being generated and how do the values of step and spread affect them.
It is easy to demonstrate on an example with arbitrary values:
Imagine trading BTC against ETH (thus, ETH/BTC pair). Therefore, the values for asset and coin inside config file would be:
asset: "BTC"
coin: "ETH"
Then you decide that a reasonable values for step and spread are:
step: 0.00002
spread: 2
To visualize, on a chart it would look like that: