I know Binance already has something like this, but I wanted to build my own.
I’ve been working on this on and off while juggling other things—programming doesn’t pay the bills (at least not yet). A pattern I kept running into: I’d make progress, then try to bolt on “cool” features before the project even worked end-to-end. Or I’d have it ~75% working and start polishing the frontend, only to create a mess in the backend because I was adding things that would’ve been much easier if I’d planned for them from the beginning.
I feel there are two ways to approach a project like this:
The “programmer” way: define the exact bullet points that get you to the goal, then hit them strategically in a sensible priority order.
The “human” way: ask “if I were doing this manually, how would I do it?” That can work, but it’s slower and much longer in code.
It’s not that the first way is a shortcut—it’s just more efficient. But even then, you need to be specific about how you want things done. Telling someone “walk east until you see the Eiffel Tower” is technically true, but you also need to know where you’re starting and what’s in the way (oceans, mountains, etc.). People absorb context automatically; a program has to be told everything. That’s why this post is part programming, part the obstacles I kept hitting, and how I had to decide exactly what I wanted up front so I could set clear bullet points.
The idea
My plan: build a simple trading bot. I’m relatively new to programming, and emotions are hard to control when trading—you want profit and to avoid losses. I wanted a “simple” bot that buys low and sells high. But “low” and “high” are relative. I could use an average price so the bot “knows” what’s high vs. low, but in crypto that’s tricky—BTC can jump $40k and drag other coins with it, so an average can be misleading. If it were predictable.....
First step: connect the bot to my Binance account via APIs, read balances, buy round numbers like 10 USDT of a few coins, track them, and react—sell the excess when they rise, buy a bit when they drop. Obviously, if I have 10 USDT in RandomCoin and it drops to 9, then I buy 1 more to top back up to 10, and later it bounces and I sell 1, that doesn’t produce profit on its own.
I had that working, but then I added a “% profit sell.” When the bot buys 1 USDT more of a coin, it tracks that specific amount and only sells if it hits the profit % I set at the start. For example, if I bought 1 USDT, it sells at 20% profit—so 1.20 USDT. Is that profit? Yes. Is it a lot? No. But if It’d bought 10, selling 2 USDT is more meaningful. Then again, how often do coins swing 20%? I talked about this in earlier posts.
Next challenge: I wanted to test on mainnet (real money) and realized I’d have to remove my testnet API files and sign in fresh with the real APIs. That’s clunky—I should have planned separate configs/environments from day one.
Right now it runs…
My main plan is a bot that lets me choose a few crypto coins, hold about $10–$20 in each, and set a small take-profit like 5–10%. If price rises 10%, it sells that excess. If it drops, it buys more and tracks how much it added so it can sell that same amount later at a 10% profit—placing those sells automatically.
What we need is for the bot to pull all USDT pairs and put them in a list—ideally updating that list on every restart in case a symbol gets delisted. Then we set how much to buy and the profit percentage, and let it go.
By “let it go,” I mean: have it buy the selected coins and remember the entry price so it can calculate whether we’re in profit or not. It should refresh prices on an interval and check whether orders have filled. We can have it place buys and sells automatically so there’s no manual order entry.
Example: say we select HIVE and BTC. We buy $10 of each and wait. In this simple case, the bot automatically places a take-profit at exactly +10% (not more, not less). Whenever it detects a new buy, it places another +10% take-profit for that specific lot.