[Bitcoin Automated Trading] Developing automatic trading using order book information (2)
------------------------------------------------------------------------------------------------------------------
https://accounts.binance.com/register?ref=21391362 <- Get Discount on Binance Futures Fees With Referral Code
Referral Code : 21391362
------------------------------------------------------------------------------------------------------------------
Now that you know how to find the buy RBI in the previous post, let's develop it in earnest. Create a bapi.py file and remove the getClient(), closeClient(), and server_time_sync() functions separately.
Since the Binance API has a call limit per hour, it is recommended to include the API usage code.

Check that it does not exceed 1200 sizes per minute.

There is a minimum trade amount when buying and selling coins. Trading is possible only when the minimum transaction amount is exceeded.

It is Bitcoin, and you can buy it by putting in at least 10 USDT.

Check the amount of USDT in your wallet through the get_asset_balance function and check if it is 10 or more.

You need to calculate the number of runs. In the previous poster, we created a method for calculating buy points using the order book information. Import the order book information to the maximum and extract the price with the highest volume.

Let's place an order by calling the order_limit_buy method. The data type of the price argument is string type. Usually, the price is entered as a real number or an integer, so let's convert it to a string here.

Calling the method results in a reserve buy order. There is a point to consider here, but if you run a loop for automatic trading, you may have a problem where the order quantity continues to increase as the buy order enters again. You need to check the status of the current order form and wait until it is concluded or wait for the program.


You can get the current order information through the get_order method. When calling the method, an order number is received as an argument value, and the order number can be obtained when order information is returned when ordering the first purchase. You can check the status of the current order form through status, and there are four status values: Cancellation, Period Expiration, New Receipt, and Contract Complete.


After placing a new order, it waits until the purchase is concluded or cancelled.

------------------------------------------------------------------------------------------------------------------
https://accounts.binance.com/register?ref=21391362 <- Get Discount on Binance Futures Fees With Referral Code
Referral Code : 21391362
------------------------------------------------------------------------------------------------------------------