How to Build a Trading Bot: Do the Fee Math on 20 Trades a Day First

2026-10-08

How to Build a Trading Bot: Do the Fee Math on 20 Trades a Day First

Three numbers before any code

  • Upbit charges 0.05% per order in its KRW market, so a buy and a sell together cost about 0.1%
  • At 20 round trips a day and a flat price, 1,000,000 won is about 549,000 won after 30 days (assumed)
  • A bot with a 1% take-profit and a 1% stop-loss needs to win 55% of trades to break even

If you are working out how to build a trading bot, most guides start with an API key and a strategy. This one starts one step earlier, with what every filled order costs. The balance, trade counts and 30-day month below are assumptions; only the fee rates come from the exchanges' own tables.

1.What the top results cover

Type "how to build a trading" into Google and "how to build a trading bot" is the first suggestion. On YouTube it is second, behind a Minecraft trading hall (checked on 7 October 2026).

The top written guides walk through the build in numbered steps: strategy, programming language, exchange API, testing and deployment. In the three top guides checked on 7 October, the cost of each order is not a step of its own.

That cost scales with the trade count. A program can trade far more often than a person, and every round trip pays the fee twice.

2.Fees by trade count over one month

Two official fee tables set the numbers. Upbit's KRW market charges 0.05% for regular orders, maker or taker, with VAT included (Upbit fee table).

Binance spot charges regular users 0.1% maker and taker. Paying in BNB takes 25% off, which makes it 0.075% (Binance fee schedule).

Round trip: buying and then selling the same position. The fee is charged on both orders.

So one round trip costs about 0.1% on Upbit and about 0.2% on Binance.

Set the strategy's skill to zero. Assume the price never moves, so the only thing changing the balance is fees.

On Upbit, 20 round trips a day with 1,000,000 won means 20,000,000 won of buys and 20,000,000 won of sells, 40,000,000 won a day. Over 30 days that is 1.2 billion won traded, and 0.05% of it is 600,000 won.

The balance does not stay put, though. Each fee shrinks the money used on the next trade, so the real figure after a month is 548,812 won left.

The price never moved, and about 45% of the balance went to fees.

Here is the balance after 30 days at other trade counts, as a share of the starting 1,000,000 won.

  • 5 a day: Upbit 86.1% left · Binance 74.1% left
  • 20 a day: Upbit 54.9% left · Binance 30.1% left
  • 50 a day: Upbit 22.3% left · Binance 5.0% left
Assumed: full balance traded every time, flat price, 30 days. Fee rates from the two official tables.
▲ Assumed: full balance traded every time, flat price, 30 days. Fee rates from the two official tables.

Fifty round trips a day is a lot for a person. A bot that checks the market every 5 minutes makes 288 decisions a day.

If one in six of those becomes an order (assumed), that is 48 orders, or 24 round trips, already past the 20 in the list.

On the same Upbit table, reserved orders cost 0.139%, about 2.8 times the regular rate. Upbit is also waiving fees on API maker orders in its BTC and USDT markets until 20 November, but the KRW market is not part of that event (Upbit notice).

Fees are paid on every filled order, whether the strategy was right or wrong. That is why the daily trade count is a number to fix before the code.

3.Break-even win rate with fees included

Now look at a single trade. Take the simplest rule, a take-profit and a stop-loss at the same distance, and add the round-trip fee.

Break-even win rate: where money kept on winners equals money lost on losers. Below it, the bot shrinks over time.

On Upbit with a 1% take-profit and 1% stop-loss, a winning trade keeps about 0.9% and a losing trade gives up about 1.1%. 1.1 ÷ (0.9 + 1.1) puts break-even at 55%.

  • 0.5% range: Upbit 60.0% · Binance 70.0%
  • 1% range: Upbit 55.0% · Binance 60.0%
  • 2% range: Upbit 52.5% · Binance 55.0%

A tighter range closes trades sooner, so there are more of them, and break-even rises with it. Both push in the same direction as the monthly fee in section 2.

A 54% backtest win rate on a 1% range is still below break-even on Upbit. Slippage, the gap between the price you asked for and the fill, is set to zero here, so the real break-even sits a little higher.

4.Four steps to settle before the code

Once the fee math is done, set the build order. Write the four steps below in plain words first, then code them in that order.

Writing the order in a notebook first makes the missing step easy to spot.
▲ Writing the order in a notebook first makes the missing step easy to spot.
  • Rules: when to buy, when to sell and the daily cap on round trips, all as numbers
  • Run: send orders through the exchange API, with a very small amount at first
  • Stop: a daily loss limit and a condition that switches the bot off
  • Log: fill price and fee for every trade
Each of the four steps has a place where fees belong.
▲ Each of the four steps has a place where fees belong.

The log is what lets you check section 2 against real numbers. A backtest without fees gives a win rate you cannot compare with the break-even rates in section 3.

5.Write these down before you build

If any line below is still blank, work out that number before opening an editor.

Before writing code

  • Fee rate: checked the exchange, market and order type in the official table
  • Round trip: wrote down what one buy and sell together cost
  • Trade count: set the daily round trips and worked out the balance after a month
  • Break-even: calculated it from the take-profit and stop-loss range
  • Log: put fees into both the backtest and the live record

Hiddenpick is a Windows program that keeps on its server the betting rules that pick owners do not make public, and runs them as they are on the PC of the person who received them through a referral code. It currently runs on Evolution live baccarat at Stake (stake.com). Whether rules picked on past data hold up on new data is tested with 1,630 baccarat rules in the truth about baccarat prediction software.

HIDDENPICK
Built on data we collect ourselves, run by a program that never tires
  • 25,000+ real shoes collected and analysed since September 2026
  • 90+ baccarat tables from the lobby on one screen · refreshed every 0.35s · seated 2 to 4 seconds after a click
  • Stops by itself at your take-profit and stop-loss · tie several PCs into one team and stop on the total
  • No browser extension · your money stays in your own Stake account · 12 languages
Go to www.hiddenpick.my →
← Reading