§ 00 / produits / apigtbot

apigtbot. Un bot de trading qui montre son travail.

Two strategies — a buy-low-sell-high grid and a breakout trend follower — running as always-on daemons against live market data, with every fill, refit and kill written to a journal you can read. One shared wallet funds them all, capital moves to wherever the opportunity is, and every decision is scored against what actually happened. Paper mode by default: real prices, simulated fills, no exchange keys. Risk caps are enforced on the server, not in the strategy, and an AI agent can tune the grid every hour — but never touch the caps.

c'est quoi
plateforme auto-hébergée de bot de trading crypto
état
paper trading · real money behind a go-live gate
licence
MIT · open source
platform
self-hosted PHP 8.4 · Binance
built with
GoatCheese
stratégies
grid · trend · optional core, per symbol
mode par défaut
papier — prix réels, sans clés
IA
serveur MCP · routine d'agent horaire
§ 01 / stratégies

Two engines, one run, one switch.

Les marchés oscillent et les marchés tendent ; un bot qui ne connaît qu'un des deux a tort la moitié du temps. Les deux moteurs partagent la même interface : une exécution peut changer d'avis sans changer de portefeuille.

01/grille

Grille — retour à la moyenne

A ladder of buy and sell levels across a price range: geometric or arithmetic spacing, configurable levels and per-level allocation. Buys the dips, sells the bounces, re-anchors itself when the geometry changes and never abandons inventory on a refit. Geometry is set by the agent or runs in mechanical mode: a fixed ±% band, re-centred on a timer.

02/tendance

Tendance — suiveur de cassure

Long-only entries when price closes above the recent high with the fast average over the slow one; exits on a ratcheting trailing stop sized by volatility with a hard floor. Regime activation is machine-scaled from 4h and 1d ADX and efficiency ratio, with hysteresis so it doesn't flap: the arm deploys its whole slice when the regime turns up and exits cleanly when it fades.

03/core

Core — optional inventory

A 1d EMA-cross core position built in staggered tranches, bought on a pullback or after a time limit — the long book beside the trade book, so a grid never sells the last of what you meant to keep.

04/bascule

Une bascule par exécution

Basculez une exécution en cours entre grille et tendance depuis le tableau de bord. Le démon redémarre et passe le relais proprement : entrées ouvertes annulées avec les exécutions partielles comptabilisées, sorties en cours conservées comme ordres hérités, positions non protégées reprises au coût.

§ 02 / capital follows opportunity

One wallet. Capital goes where the move is.

A budget pinned to a symbol sits idle while the move happens somewhere else. Here every run draws from one shared wallet, and an allocator moves the slices — inside limits it enforces on itself.

01/arms

Arms per symbol

No fixed budget splits. Each symbol declares its grid and trend arms; a trend arm is funded when its regime turns up and released when it fades.

02/allocator

An allocator every 15 minutes

Rebalances the pool toward wherever the opportunity is, and keeps a reserve it refuses to spend — gtbot_pool_reserve_pct is headroom the allocators cannot touch.

03/invariant

Never overcommit

The shared-budget invariant is enforced in three layers — when you save, in the allocator, and in the daemon — so a slip in one is caught by the next.

04/lifecycle

Run lifecycle

Retire and purge finished runs, seal a wallet, or let the cap follow account value in "use all funds" mode. One wallet, multi-asset seeded, funds everything.

05/why

It tells you why

An arm sitting idle names its cause. A silent grid raises an alert. An arm with nothing running has to explain itself to the watchdog, or it pages you.

06/hold

Never panic-sell

By default a position is never sold below cost unless the ladder has nothing left to trade with. Liquidating is a decision, not a reflex.

§ 03 / trading modes

Le papier d'abord. L'argent réel s'active volontairement, deux fois.

01/papier

Papier — par défaut

Données de marché en direct, exécutions simulées localement, soldes dans un portefeuille simulé. Aucun compte de bourse, aucune clé. Chaque stratégie, graphique, alerte et garde-fou se comporte exactement comme avec de l'argent en jeu.

  • sans clés
  • prix réels
02/testnet

Réel — testnet

Les ordres partent vers le bac à sable de la bourse avec des clés testnet. Même chemin de code que le réel : ce que vous voyez ici est ce que vous obtiendrez là.

  • clés bac à sable
03/en ligne

Réel — en direct

Mainnet orders with your own keys. Gated on purpose: the run's own switch and the server's environment flags must all agree; a mismatch is refused at boot, and the daemon fast-fails without credentials. The go-live gate (gtbot-golive) reads the ledgers and passes only when every check does; the account audit (gtbot-audit) checks that the real exchange account backs them, and a finding pages you only if it survives two consecutive audits.

  • vos clés
  • verrouillé
§ 04 / risk rails

La stratégie propose. Les garde-fous décident.

Un bot n'est jamais plus sûr que ce qui peut lui dire non. Chaque garde-fou ci-dessous s'applique à l'identique en mode papier, testnet et réel.

profils de risque
Un seul menu — NoLoss, Cautious, Balanced, Aggressive, Max — pilote chaque plafond comme un ratio vivant du budget de l'exécution : limite de perte journalière, arrêt sur perte latente, plafonds de position et d'ordres, politique de cassure, multiplicateurs de stop suiveur. NoLoss refuse structurellement tout chemin qui réalise une perte.
portefeuille partagé
All runs draw slices from one budget pool. Over-commitment is refused when you save, and halts entries at the daemon if it slips through. A wallet-level drawdown floor kills every run when equity falls below it and stays there for three ticks.
vendre à perte
A per-run switch, off by default. Until you turn it on, the bot will hold inventory rather than realise a loss — a deliberate choice, not a forgotten one. sell_when_starved sells below cost only when the ladder has nothing left to trade with, and Flatten takes the bids and chases the price until the position is flat.
côté serveur
Les plafonds vivent hors de la stratégie et hors de l'agent. Un bogue de stratégie ou une proposition d'IA trop zélée ne peut ni relever une limite, ni effacer un arrêt d'urgence, ni liquider une position.
preuves
Walk-forward sweeps over collected candle history — spacing, width, deployment policy, trend parameters — validate a setting before it is trusted with a live run. Sixteen sections of refit evidence and counting; ideas the data refuted stay refuted and are written up as such. Guardrails derived from them are computed into every refit proposal.
alertes
Kills, breakout halts, drawdown stops and stranded inventory go to your phone immediately; closed cycles the moment they book, with realised P/L; routine fills batched into digests so a burst is one message, not ten. A stop alert is never held back by the throttle.
§ 05 / an agent in the loop

Réglé par une IA. Borné par le serveur.

La géométrie d'une grille est fastidieuse à régler à la main, et les marchés bougent. Alors un assistant comme Claude s'en charge à heure fixe — dans des limites qu'il ne peut pas changer, avec un tableau de scores auquel il ne peut pas échapper.

01/mcp

Serveur MCP

The whole system is drivable by an AI agent over the Model Context Protocol, as a logged-in user: status, the hourly routine brief, grid preview and set, refit proposals, market and backtest, P/L report, decisions and events, budget and allocation mode, create, start, stop, kill, retire and purge a run.

  • gtbot_routine_brief
  • gtbot_refit_proposal
  • gtbot_alloc_mode
  • +15
02/routine

Routine horaire de réajustement

Une fois par heure, un agent prend un seul résumé compact de chaque exécution — digest du signal, régime et seuils, grille candidate, historique, un bit « changement significatif » — et réajuste plage, niveaux et déploiement des exécutions signalées, en réallouant des tranches de budget là où c'est utile.

  • gtbot_routine_brief
  • 1 lecture / heure
03/noté

Des décisions qui sont notées

Every agent decision is journaled with its reasoning, then scored by the server against what the market actually did: each decision records its clamps and candidate delta and gets a counterfactual verdict computed from intra-bar OHLC. The agent reads its own track record in the next brief and learns from it.

  • gtbot_decisions
  • noté
04/garde-fous

Consultatif, avec garde-fous

L'agent peut réajuster la géométrie et déplacer des tranches. Il ne peut ni relever un plafond de risque, ni effacer un arrêt d'urgence, ni liquider l'inventaire — cela reste humain. Une tâche « homme mort » prend le relais avec des réajustements par quantiles si la routine se tait deux heures.

  • plafonds intouchables
  • homme mort
§ 06 / in the box

Conçu pour être exploité, pas seulement lancé.

01

Dashboard

Per-run charts — trades, price history, trend line, grid band, lifecycle markers — holdings, the shared-wallet tile with an inline budget editor, hold / release funds, start / pause / reload per run. A wallet NAV ledger and a P&L report benchmarked against HODL and USDT.

02

Démons permanents

Un processus par exécution active, maintenu par un chien de garde ; données de marché collectées toutes les dix minutes ; une sauvegarde nocturne. Ni root ni gestionnaire de services requis.

03

Journal de décisions

Every fill, refit, switch, halt and kill is an event with an id. Alerts carry the id, so a genuine repeat is distinguishable from a double-send. Regime episodes and engagement tracking show how long each arm was eligible and how much of that time it was actually working. Fills are booked at the price they traded at.

04

Market outlook

A long-horizon 1d / 1w regime detector with hysteresis and scored 7-day and 30-day outcomes, with an optional daily Telegram digest. A detector, not a predictor: the predictor version was tested and refuted.

05

Backtests et balayages

Testez une grille ou un réglage de tendance candidat depuis le tableau de bord ou l'agent ; scripts de balayage walk-forward pour les paramètres qui comptent.

06

API REST

Exécutions, ordres, événements, données de marché et portefeuille comme points d'accès documentés avec contrôle des rôles et journal d'audit — la même surface qu'utilisent le tableau de bord et le serveur MCP.

07

Go-live & audit

gtbot-golive reads the ledgers and exits 0 only when every check passes; gtbot-audit checks that the real exchange account backs them. The BNB fee float is handled, and exchange switches belong to the host, so a deploy never pushes them.

08

Manuel d'exploitation

Passage en réel, reprise après incident, alertes, le prompt et la conception de la routine d'agent, les preuves derrière les garde-fous — écrits, dans le dépôt.

Construit sur GoatCheese : l'administration, l'API et le serveur MCP sont générés à partir du modèle de données ; les moteurs de stratégie et les démons sont la partie sur mesure.

§ 07 / next step

Faites-le tourner vous-même, ou faites-en construire un.

Clonez-le, lancez l'installateur, créez une exécution papier et regardez-le travailler. Vous voulez votre propre stratégie, une autre bourse, ou une routine d'agent réglée sur vos règles ? Envoyez un brief.

Logiciel expérimental pour la recherche et le trading papier. Rien ici n'est un conseil financier ; si vous connectez des fonds réels, vous le faites à vos risques.