Trade Lifecycle
The bot should treat every trade as a lifecycle, not a one-off buy/sell guess.
flowchart TD
A[Observe market and portfolio] --> B{Setup exists?}
B -- no --> C[Wait with reason]
B -- yes --> D{Portfolio has room?}
D -- no --> E[Reduce, close, or wait]
D -- yes --> F[Create thesis]
F --> G[Define invalidation]
G --> H[Define profit plan]
H --> I[Place entry if reward beats risk]
I --> J[Monitor position]
J --> K{Thesis still valid?}
K -- no --> L[Reduce or close]
K -- yes --> M{Profit target or trail hit?}
M -- yes --> N[Take partial profit or trail]
M -- no --> O{Timeout expired?}
O -- yes --> P[Reassess or exit]
O -- no --> J
Entry
Entry is not “price is down.” Entry means the bot has a setup where reward is worth the risk.
Minimum entry packet:
{
"symbol": "BTCUSDT",
"setup": "support mean reversion",
"thesis": "price is near support and 1h trend is stable",
"invalidation": "breaks support for two cycles",
"profit_plan": "partial profit near resistance, trail rest",
"timeout_cycles": 6
}
Hold
Holding is an active decision. The bot should explain why it is still holding.
Good hold reason:
Hold BTCUSDT because thesis remains valid, price is above support, and upside target has not been reached.
Bad hold reason:
Hold because it is currently red.
Sell Or Reduce
Selling is not failure. Selling is risk control.
Good sell reasons:
- Thesis invalidated.
- Profit target reached and momentum faded.
- Trailing stop hit.
- Exposure too high.
- Better setup needs cash.
- Risk state worsened.
Wait
Waiting should also have a reason.
Useful wait categories:
| Wait reason | Meaning |
|---|---|
| Weak signal | Setup exists but evidence is not strong enough |
| Bad reward/risk | Upside is too small compared to invalidation distance |
| High exposure | Portfolio is already too invested |
| Conflicting regime | 5m signal disagrees with 1h trend |
| Poor execution | Spread, liquidity, or order filters make trade unattractive |
Gotcha: A bot that cannot explain why it is waiting will eventually overtrade or freeze. Wait reasons need structure.