The strategy's rules in detail
What the strategy does in every situation.
1. The cycle
PriceAveraging levelsTP with fees
The price falls
the strategy buys more, the average price goes down
The price rises to the TP
sells the whole amount — the cycle closes with a profit
A new cycle
starts at once unless "Stop after this cycle" was pressed
A real cycle of a practice strategy: ETH/USDT, the Binance test network, 17 November 2026, 4 parts, a 1 % step, a 0.5 % TP — three averagings and the exit within 8 hours. This is the "buy first" mode; "sell first" and the short are the mirror.
A cycle is one trade from the entry to the TP. The strategy always knows which of its orders should be on the exchange right now, compares this with the exchange and delivers the difference. So a restart, a missing order or a manual cancel are all handled the same way: the strategy brings the exchange back to the plan.
Modes:
| Mode | Entry | Averaging | TP | Profit |
|---|---|---|---|---|
| Buy first, profit in the quote currency | buy | lower | sell the whole amount | USDT |
| Buy first, profit in the asset | buy | lower | sell a part to get the USDT back | BTC |
| Sell first, profit in the quote currency | sell your own asset | higher | buy back the same quantity | USDT |
| Sell first, profit in the asset | sell your own asset | higher | buy with all the proceeds | BTC |
The budget is the amount of the trades themselves: in USDT for "buy first", in the asset for "sell first". Fees are on top of the budget.
"Sell first" sells only your own asset: before a sale the strategy checks the free balance on the account and does not sell more.
2. The entry
- At market: one market order for the first part's share of the budget. The quantity is calculated at the current price. If the market filled at a higher price (slippage), the entry costs more than calculated by that much — this is how a market order works. On Binance, BingX and Coinbase spot a market buy is sent for a sum: the planned quantity × the best ask, to 0.01 in a dollar-like currency (USDT, USDC, EUR and the like) and to 8 decimals in a coin quote (BTC, ETH, BNB); if more than planned was bought, the extra is counted, if less, the strategy buys the rest. A market sale goes by quantity. Without a current price the sum cannot be counted — the order is not sent and the strategy tries on the next step.
- Limit with an offset: an order below the price (for "sell first" — above). Every 15 minutes the strategy cancels the unfilled part and places a new limit order for the remaining money at the current price with the same offset. If the price has not changed, the order just stays.
- Partial entry: the part bought is counted at once; the entry price is the average over all parts. If the remainder is smaller than the exchange's minimum order, the entry counts as complete. While the entry is incomplete there is no TP and no averaging; if the entry stays incomplete for 15 minutes, "The entry is only partly filled, no TP is set" comes once a cycle — the strategy still waits for the whole entry and only then places the TP.
- The condition "do not enter above X" is only a filter: whether to start a new cycle. If the price is above X, no new cycle starts; the strategy waits with the reason "entry condition". Once the cycle has started, the price is no longer compared with X: the entry is re-placed at the current price, as usual. In the app this field exists only with a limit entry.
- The averaging orders and the TP appear only after the full entry.
3. Averaging (DCA)
- The levels are counted from the actual average entry price: 2 %, 4.4 %, 7.28 %… with a step of 2 % and steps wider by 20 %. The volume of each part grows by the percent set.
- One at a time: there is never more than one DCA on the exchange. The next one appears only after the previous one has filled completely.
- A partly filled DCA stays on the exchange for the remaining volume.
- A level below the exchange's minimum. Before a cycle starts the strategy checks every part of the grid at the planned entry price. If the entry filled worse than planned (higher for a buy, lower for a sell; for example, slippage of a market entry) and a level counted from the actual price came out below the exchange's minimum, the strategy skips this level and places the next one at once. "Events" shows "DCA level skipped" with the level's size and the exchange's rule; Telegram gets "⚠️ DCA level skipped", once per level and cycle. A skipped level bought nothing: it is not counted in "DCA filled", it does not hold the cycle, and the TP works as usual. It is not placed again until the cycle ends, even if the exchange lowers its minimum later: the grid goes on with the next levels. A new cycle counts its levels afresh. A level's order already on the exchange is not cancelled, even if the exchange raises its minimum later: it stays as it is. Only a level not placed yet can be skipped.
4. Take-profit (TP)
- One TP for the whole amount. Its price is the lower bound of net profit after all fees: the actual fees of the trades already made plus the future exit fee at the full rate. The BNB discount is a bonus.
- The future fee rate is the larger of the one in the settings and the exchange's current maker rate for your account (a TP is a limit order). On Binance the strategy asks the exchange for the rate once a day — one rate per pair for all the account's strategies. If it cannot refresh it, the last rate holds for 6 more hours (the strategy asks again every 5 minutes); after that it makes no new decisions — the strategy waits (this is a technical fault, not an emergency). On T-Invest no tariff is typed: until the strategy knows the real rate it plans the TP with the broker's maximum rate, 0.3 %; once the strategy's fully paid trades reach a turnover of 1,000 ₽ or more, it plans with the real rate if it is below 0.3 % (it never rises above 0.3 %), and a TP already standing is replaced once at it. Strategies made before version 2.0.21 move to this scheme from their next cycle. Binance strategies made before 2.0.21 planned the TP with 0.1 % even when the account's rate is lower (about 0.05 % on futures), so the TP stood above what was set. Since version 2.0.22.2 such a strategy plans with its account's rate from its next cycle, as a new one does; the open cycle finishes with its TP.
- An answer of the exchange with a rate of 10 % or more (or not a number) is not taken as the rate: it is a failed read — the last rate holds and the strategy asks again. If such a rate still reaches the strategy, it changes nothing and waits: "the exchange's fee is 10 % or more — the strategy waits".
- When the TP is moved:
- a DCA filled completely — at once;
- a DCA fills in parts — at most once every 5 minutes;
- nothing new was bought — never (a partly filled TP keeps working);
- the TP turned out below the target (for example, the fee went up) — at once.
- A replacement always takes two steps: first a cancel with confirmation, then a new TP for what is left — after all the trades of the cancelled TP are counted, even if the exchange reported them late. There are never two TPs at once.
- After the TP's first fill, the strategy cancels the DCA and averages no more — it only waits for the TP to fill to the end.
- If the volume is below the exchange's minimum for the TP, the averaging orders keep working; the TP appears when the volume is enough ("TP below the exchange minimum").
- Your own TP, set on the "TP" screen, holds until the cycle ends: in percent from the average — it is counted again from the new average after every purchase; at a price — it stays at that price. A new cycle — the settings' TP again. If the TP became a loss (the fee rose, a DCA moved the break-even) and there was no consent to a loss for this position, the strategy puts the strategy's TP back (Manual control).
5. End of the cycle
- The cycle is closed by the TP's fill; the remaining orders are cancelled. The cycle counts as closed when none of its orders is left on the exchange.
- The remainder (dust, an incomplete lot) is carried to the next cycle with its cost. With profit in the asset (BTC, shares), the remainder after the TP is the profit itself: it stays on your account, is not sold and is not carried to the next cycle.
- If the last cycle's dust is no longer on the account before a new cycle (for example, you converted it), the strategy stops counting it, with the event "the coin's small remainder is no longer on the account — the strategy no longer counts it". There is no emergency. A remainder that can be sold is not let go like this. Dust in an open position is written off the same way (more).
- "Sell first" and short: if the debt is below the exchange's minimum order and cannot be bought back, it is carried with its proceeds to the next cycle — that cycle's TP buys this debt back too. On futures this way no part of the position is left without an owner. A partly filled TP stays at its price as long as the strategy has sold nothing more.
- Futures, long and short: when the TP is partly filled and what is left of the position is below the exchange's minimum order, the rest of the TP order stays on the exchange and closes the position — the cycle ends when the strategy holds nothing. "Stop after this cycle" stops the strategy with no position left. The remainder goes to the next cycle only in the rare case when the order has to be placed anew (for example, you moved the TP) and the exchange does not take one that small.
- "Sell first" with profit in the asset (BTC, shares): a debt that is carried over is not a loss of the cycle that handed it on, and it is not subtracted twice. A cycle's profit in the asset is only what it earned beyond the debt (the next cycle pays the carried debt with its own asset); the sum over the cycles - in the strategies list, in the messages and in the reports - equals the asset the account gained, except for the last cycle's debt, which is not bought back yet and does not count as a loss.
- A new cycle starts at once unless "Stop after this cycle" was clicked.
- The cycle's profit is the realized profit of the sold part; the value of the carried remainder is not part of it.
- A Binance strategy on a pair with the coin BNB itself, with fees paid in BNB: the exchange takes the sale's fee from BNB on top of the quantity sold. If the strategy's own BNB does not cover it, the exchange takes the missing part from the account's spare BNB. For the strategy it is an expense of the cycle: the cycle's result is smaller by its cost, and there is no emergency. With the profit kept in BNB, this part lowers the cycle's profit in BNB (it may show a small minus in BNB).
6. Control
Start: if the cycle is not finished (the strategy is stopped or in an emergency) — the choice of "Continue the cycle" or "Start a new cycle". With a new cycle, the old one is closed as "interrupted", and its remainder is explicitly handed to you. "Start" at once resets the wait after refusals and checks again.
Pause: there is no "Pause" button — urgently "Stop", to finish the cycle — "Stop after this cycle". A strategy paused before (orders stay, no new ones, fills counted) can be started or stopped.
A copy (Copying trades): no pause of its own; start, stop, "Stop after this cycle" and the balance — as above; the rules and manual commands are the lead strategy's.
Stop: the strategy's own orders are cancelled, the asset is not sold. If the outcome of some order is not known yet, the other orders are cancelled at once, and this one as soon as the exchange shows it.
After an update of the program, a rollback or its fault a vault that was open opens by itself, and the strategies that were working or paused go on without you.
After a reboot of the server the vault must be opened with the password, and each strategy, except stopped ones, started with the "Start" button. The group "Start" under the list starts all the strategies shown that are not running, including stopped ones; it passes strategies in an emergency by — they are started one by one.
Stop after this cycle: the current cycle is finished, no new one starts.
New settings can be set at any time: they are kept separately and apply from the next cycle. The current cycle lives out its own grid. If there is no cycle (for example, the old settings do not meet the exchange's minimum), the new ones apply at once.
7. Faults and emergencies
In an emergency the strategy names the reason in words and says what to do: in the "🔴 Emergency" message — in the last line "What to do: …", on the strategy's screen — under the "Emergency reason". The words are the same; more — Emergencies and faults.
| Situation | What the strategy does | Who resumes |
|---|---|---|
| No answer from the exchange to a new order | Changes nothing about this order, finds out from the exchange what happened to it. Never sends it again blindly. On Binance it trusts the answer "no such order" only after 30 seconds. On T-Invest it sends the same order again under the same key — the broker will not create a second one; if the outcome is unknown for 28 days — an emergency | By itself |
| The exchange does not answer requests (server errors, timeouts, an error page or an empty answer instead of an answer) | Skips the step, does not touch the orders on the exchange, keeps the pair's rules as they were, the next try after 1, 2, 4… up to 20 seconds. Such an answer is never taken as "the pair is gone" (an empty list of pairs included), "no coins or money", "no position" or "the order is cancelled": an order is cancelled only when the exchange confirmed it | By itself |
| The price has not been updated for more than a minute | Places nothing new, leaves what is already placed | By itself |
| Many strategies and requests to Binance | The requests of all the server's strategies to Binance go through a shared budget below the exchange's limit, and each key's orders also through its own. TPs, cancels and fills go first; new entries and DCA wait. If the exchange still asks for a pause or bans the address — all the server's keys wait, and even a restart remembers this. The limit of the server's address is split equally between the users whose Binance strategies are running — separately for spot and for futures (the exchange has separate limits for them) | By itself |
| The Binance event stream is not working (dropped, silent) | Normally the strategy takes fills from the stream and checks them against the exchange: the orders every 5 minutes, the trade history every 5 minutes on futures and every 10 on spot. After a drop — a check at once, then asking the exchange every step: a TP may come a few seconds later. The stream fell silent without dropping: the fill is seen at the check of the orders (on futures also of the position) — within 5 minutes. A fill the stream missed is found in the exchange's trade history — none is lost or counted twice. The stream connects again by itself; 10 minutes without it — one message, when it works again — one more | By itself |
| An error in the strategy's program | An emergency of this strategy only: its orders are cancelled, the asset is not sold; the other strategies work | You |
| A cancel is not confirmed | Waits, repeats the cancel; 5 minutes — a warning, 15 minutes — an emergency | After the emergency — you |
| The exchange shows an order as filled, but there are no trades yet | Does not treat it as filled, does not place the next one; 5 minutes — a warning | By itself |
| Not enough funds | A message, retries after 5, 15, 30, 60 minutes, then once an hour; one "funds are enough" when it works | By itself |
| The exchange refused the entry or a DCA for another reason | The same retry schedule | By itself |
| The exchange refused the TP | An emergency: the strategy's own orders are cancelled, the asset is not sold, the other strategies work | You |
| You cancelled a strategy's order by hand | Checks its fills and places it again | By itself |
| A DCA filled after the cycle had closed | An emergency, the decision is yours | You |
| T-Invest: no trading by schedule (night, weekend) | Waits quietly, without messages | By itself |
| Binance halted trading of the pair | Waits and tries again; after 15 minutes — a message, and one more when trading is back. The strategy sees the halt at once if the exchange refused an order, otherwise within 5 minutes; that trading is back — within 5 minutes too | By itself |
| The database does not answer | Sends no new orders, the placed ones stay; one warning; when the database answers — goes on as after a restart. "Stop" works meanwhile too: the stop is recorded as soon as the database answers — see Emergencies and faults | By itself |
| The strategy's records do not agree with the exchange or with each other: less asset than counted; an order on the exchange with the strategy's number that it has no record of; an order stands but the strategy thinks it is finished; a sale larger than the strategy holds; a trade missing in the history; a fee that cannot be estimated | An emergency: the strategy's own orders are cancelled, the asset is not sold, the position is not closed; the unknown order stays on the exchange to be looked into | You |
8. T-Invest shares and funds
- Lots. Each grid part is rounded down to a whole number of lots; an incomplete lot is carried over, like dust on Binance. If even one part is smaller than one lot, the cycle does not start — the reason is "a grid part is below the exchange minimum". A larger budget or fewer parts helps.
- Trading hours. The strategy trades all the time the exchange accepts limit orders: the morning, main and evening sessions, weekends, auctions. When there is no trading, it waits quietly, without messages.
- Day orders. The exchange cancels orders at the end of the trading day. This is not a manual cancel: there is no "order removed by someone else" message. When trading opens, the DCA and the TP are placed again; what filled yesterday is counted.
- Price band. The exchange refuses an order outside the band. This is an ordinary refusal: a message and retries after 5, 15, 30, 60 minutes, then once an hour. The TP stays.
- No short selling. The broker accepts a sale of securities that are not on the account (a short position). Before each opening sale the strategy checks how many securities are free and sells no more than that.
- A market entry — only in continuous trading. During the opening or closing auction the strategy waits; the limit DCA and TP orders stay and are placed meanwhile.
- Sessions per security. If the security trades in the evening or at the weekend, the strategy works; if not, it waits for the morning. The schedule is taken from the exchange for each security separately.
- The fee. Until the strategy knows the real rate, the TP is planned by the broker's maximum rate (0.3 %, the "Investor" plan); once the strategy's fully paid trades reach a turnover of 1,000 ₽ or more — by the real rate if it is below 0.3 % (from one small order the rate is only the noise of rounding to kopecks, so it is not taken earlier). A strategy made before version 2.0.21 — from its next cycle (the open cycle is finished with its TP as it was). The fees of the cycle's past trades are the actual ones charged. The broker may send the actual fee later than the trade: the strategy counts it once, when it comes. If the cycle closed earlier, its result is marked "needs clarification" until the fee comes; the late fee is shown in the history.
- Dividends are not part of the strategy's profit. A split, a change of lot or ticker, delisting — an emergency, like any mismatch: the strategy's own orders are cancelled, the securities are not sold. The strategy rereads the security's rules once a day; a failure or an unreadable answer of the broker is not delisting.
- The strategy sees a manual change of its order in the T-Invest app as a cancel: it counts the fills and places the order again by its plan.
More — T-Invest shares and funds.
9. USD-M futures
A strategy on Binance perpetual futures works with the same grid. The differences: the side is long or short (real positions, Hedge Mode); the budget is the position size in USDT, the grid is sized from it, the margin = size ÷ leverage (up to 10); profit only in USDT; funding is part of the cycle's accounting and shifts the TP; the strategy's share of the pair's shared position is counted by its own fills, your manual trades are yours; a position smaller than the shares of the strategies on the same contract and side — an emergency of every working strategy of the side with a share (one rule of the account check, see item 10); 10 % before liquidation — a warning; there is no stop-loss.
More — USD-M futures.
9a. COIN-M futures
A strategy on Binance COIN-M futures (the perpetual inverse contract BTCUSD_PERP) follows the USD-M rules (Hedge Mode, Cross, leverage up to 10, its own share of the position, a warning 10 % before liquidation, no stop-loss). The differences:
- Everything in BTC. The budget is the position size in BTC, the grid is sized from it; the margin = size ÷ leverage; fees, funding and profit are in BTC too. USDT takes no part; USD is for reference only, at the cycle's closing price.
- Whole contracts of 100 USD. A level's contracts = its share of the size in BTC × price ÷ 100, rounded down; the remainder is not carried to the next level, so not all of the size is used. Every level is at least 2 contracts, otherwise the strategy is not created (“at least … BTC is needed”).
- The average price is by BTC: the whole notional in USD ÷ the whole value in BTC.
- The TP is the lowest price at which the net profit in BTC after the entry and exit fees is at least TP % of the position's value at entry; it is rounded up to the price step. Funding in BTC is part of the cycle's accounting and shifts the TP. If there is no such price (fees and funding ate the profit), the TP is not placed, one message per cycle; the DCA levels stay.
- Money is checked by the strategy itself before every opening order: free BTC in the COIN-M wallet (margin + fee); not enough — “Not enough funds” and a retry on schedule.
- Two liquidation prices: the exchange's (cross margin — the whole COIN-M wallet) and the strategy's estimate (where its own margin is gone). The warning, the risk bar and the distance go by the more cautious one, for a long the higher; until the exchange's price is updated after an averaging — by the strategy's estimate.
- Long only for now, BTCUSD_PERP only; a short on COIN-M is not created, trades are not copied from or to COIN-M.
More — Binance COIN-M and the path I want to trade COIN-M futures.
10. Restart and storage
- Everything the strategy has learned and decided is written to the database as one "all or nothing" record. An order goes to the exchange only after its record is saved.
- The process can be cut off at any moment — by an update, a reboot, a failure. After the start the strategy first checks with the exchange: it fetches all the trades made while it was down, even if there are hundreds; finds out what happened to the orders sent just before the break; compares the account with the sum of the records of every strategy of each asset (a coin, the currency of "sell first" strategies, a contract and side) — one rule: enough — they work; the dust on the records covers all that is missing — the dust is written off; otherwise an emergency of every working strategy of the asset with a share, a strategy without one waits with "the account does not agree". The verdict comes once every strategy of the asset has read its trades and the outcomes of orders are known (up to 2 minutes, on BingX, Bybit and Coinbase up to 12); not then — an emergency too. A liquidation while it was down is called a liquidation; and only then does it decide anything.
- The cycle's accounting (volume, cost, fees) is not stored separately but recalculated each time from the saved trades. If a trade does not fit into the accounting or the history is incomplete — an emergency that says what exactly is wrong.
- These survive a restart: the strategy's mode, "stop after this cycle", the retry schedule when funds are short, the emergency reason, the next cycle's settings.
- The history — trades, orders, events, cycles — is never deleted.
- Any mismatch between the records and the exchange is an emergency that says what exactly did not match. After you look into it — "Start": continue (the strategy checks with the exchange again) or start a new cycle. An unknown order with the strategy's number must be removed from the exchange first, otherwise the strategy stops again.
All strategies work in one service. One service per database: a second copy of the strategies does not touch the first while the first is alive. Everything the strategies do is written to a log on the server — it can be used to restore the history of any order; keys and passwords never get into the log.
These rules were tested on a practice exchange with a real database: 100 process cut-offs at random moments over 33 cycles — not a single extra order, missed or doubled trade; the accounting matches the balance. When the connection to the database breaks, no order leaves without a record; eight strategies write to the database at the same time without errors.