bitcoin automated trading

[Bitcoin Automated Trading] Binance Futures Trading Martingale Betting Method - 1

tradingbot 2024. 2. 28. 00:53

------------------------------------------------------------------------------------------------------------------

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

Referral Code : 21391362

------------------------------------------------------------------------------------------------------------------

 

Let's apply the martingale betting method we learned previously to Binance futures trading and apply it to the automatic trading algorithm. Martingale betting is a really good betting method if you have capital and time. Time can be adjusted through automatic trading. I will start by betting as little capital as possible. Since there is a commission, we will take it as the minimum excluding the buying/selling commission.

 

 

1. Find out the price and quantity of cattle

To calculate the minimum size bet and commission, you need to know the ticksize, lotsize, and stepsize of the coin. You can get information about coins by calling the exchange_info method.

 

Each size was learned in kind.

PRICE_FILTER
tickSize
size between prices
LOT_SIZE
stepSize
size between quantities
NOTIONAL
notional
Minimum purchase price
(This refers to the minimum quantity of USDT when buying or selling BTCUSDT.)

If you check the Ethereum information, the ticksize is 0.01. Ethereum displays to two decimal places.

 

stepsize is 0.001. When purchasing in quantity, indicate to three decimal places. (Based on picture price 2300.00)

 

The notional value is 20, but the USDT required at the actual trading window is 22.62. This is because the minimum purchase quantity is rounded up to four decimal places. (Based on picture price 2300.00)

[가격 2300.00 기준]

 

Let’s find the minimum purchase quantity and minimum purchase USDT when the current price is 2300. The formula is notional / current price.
- 20 / 2300 = 0.0086956521...

Since stepsize is 0.001, it rounds up to the fourth digit. Then the minimum purchase quantity is 0.009. The way to get the minimum USDT is current price * minimum purchase quantity.
- 2300 * 0.009 = 20.70

It exactly matches the values required in the pictures above.

 

 

2. Fee calculation

Once the minimum USDT purchase is determined, the fee is calculated. There are two types of fees: MAKER and TAKER. We learned the difference between the two last time. TAKER has a low fee, but there is a possibility that the transaction will not be concluded. So, fine-tune the alpha value and set it so that it can be fastened well.
USDT * Fee = Fee incurred

 

 

3. ind a selling position

To find the selling position, use usdt / purchase quantity.

Since commissions are also incurred at the selling location, the commission for the selling location is calculated, and then the initially purchased USDT, buying commission, and selling commission are added together.

And an important technique in Martingale is to bet an additional amount equal to the amount you previously lost. Therefore, an additional amount equal to the amount lost up to this point is added.

If you bet and win, you will make a small profit excluding the initial commission, and if you lose, you will open a position by betting a larger amount in the next round. In other words, because the target position becomes longer, it may happen that the position exit becomes longer.

You can set long/short positions by calling the new_order method. Determine long/short through positionSide and open/close through side.

 

4. TP/SL

If TP is a win, SL can be considered a loss. Hang TP and SL in the same size. Each time a loss occurs, the cumulative loss is added.

Because it relies solely on long/short probability games, positions are set randomly. Since the long position is advantageous, I gave the long position probability 60%.

 

 

------------------------------------------------------------------------------------------------------------------

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

Referral Code : 21391362

------------------------------------------------------------------------------------------------------------------