# Day 3. Formulating Your Bot on Paper — Before You Write Any Code

> Today's goal is to describe your bot **in a single sentence** and write down **four rules** on paper. No code. This is the most underrated day of the five. Most programmers skip it and then spend two months redoing what they wrote on impulse.

---

## Why Pause Before Hitting the Keyboard

This is the most powerful habit you will need to develop. And it's the one most invisible to an outside observer.

A programmer sees an interesting problem and starts writing code. That's how our minds work. Code is **activity**, and activity creates the feeling of progress. Paper is **sitting and thinking**, and thinking feels like downtime.

The trap is that **paper is cheap, and code is expensive**. Changing one sentence in a text file takes 10 seconds. Changing the logic when you already have 800 lines of code, tests, a config, and a backtest takes days. And most mistakes only become visible when you try to explain the idea in **simple terms**. If you can't explain it, you haven't formulated the idea yet; you're just rushing to the code.

This day is a **test of clear thinking**. If, by the end of the evening, you can't explain your bot to anyone in two minutes, it means you don't fully understand what you're building yourself. Go back to the paper.

Today:

1. A one-sentence template that describes any decent bot
2. Four rules that must be written down before coding
3. A simple flowchart of the bot's loop—on paper, not in Visio
4. Common pitfalls specific to the formulation stage

---

## The One-Sentence Template

This is a formula from the world of product marketing, adapted for systems development. It sounds trivial—until you try to apply it to your bot. Then it turns out you haven't defined **half the things** yourself.

The template:

```
My bot will [specific, measurable result]
using [archetype + specific signal on a specific timeframe]
without [the main risk I am avoiding]
so that I can [real goal: time / peace of mind / capital growth]
within [a realistic time horizon + acceptable drawdown].
```

Five blocks. Each has a strict role. Let's break them down one by one.

### Block 1. Specific, Measurable Result

This is **not** "make money." "Make money" is not a result; it's a hope. A specific, measurable result sounds like this:

- "close 3-5 trades per week"
- "maintain a win-rate above 50% over a horizon of 100 trades"
- "grow by 8-12% per month with a drawdown of no more than 15%"
- "generate 40-60 signals per month on a test account"

See the difference? There's a **measurable number** you can look at and say "yes or no, the goal has been met."

If the number is hard to assign, choose a **process**, not a **profit**. For example, "close 3-5 trades per week" is about the process. Profit is secondary during the learning phase.

### Block 2. Archetype + Specific Signal on a Specific Timeframe

Here, you pull out what you chose on Day 2. Not "a trend-following strategy," but **specifically**:

- "trend-following on the 4-hour timeframe, signal is a crossover of fast and slow moving averages"
- "counter-trend on the 1-hour timeframe, signal is a bounce from the two-standard-deviation level of the Bollinger Bands"
- "pairs trading on the daily timeframe, signal is the spread between BTC and ETH moving outside its historical corridor"

Notice—no **specific numbers** (how many bars for the period, how many deviations). The numbers are chosen later, deliberately. On paper, the **type of signal** is enough.

### Block 3. The Main Risk I Am Avoiding

This block is the most important, and the most overlooked. It defines **what the bot does differently than most of its counterparts**.

Examples:

- "without holding positions through major news releases" — the bot closes positions before FOMC, before CPI, before major news
- "without operating on holidays" — Christmas, New Year's, Chinese New Year — the bot is off
- "without opening more than one position at a time" — there are never two open trades
- "without operating when volume is below the 24-hour average" — the bot sleeps in a thin market
- "without re-optimizing parameters more than once a quarter" — once every three months, no more often

A good bot **refuses** certain opportunities. This is a **sign** of a good system. A bot that tries to "trade always and everywhere" is hopeless.

### Block 4. The Real Goal

This is **why** you're doing this at all. And here, be honest with yourself.

Common honest answers:

- "to sleep soundly knowing I didn't miss a move while I was at my main job"
- "to spend 30 minutes a day checking logs instead of 4 hours reading chats"
- "to gradually grow my capital 10x in two years and prove to myself that this works"
- "to go through the honest journey of algorithmic trading and understand if this field is for me at all"

Common **dishonest** answers (where failure begins):

- "quit my job in six months"
- "buy a car by summer"
- "beat the market"
- "become a millionaire"

It's easy to tell an honest answer from a dishonest one: **can the bot actually deliver on this goal?** It can help you sleep soundly. It cannot buy you a car by summer; that's a matter of statistics and luck on a short horizon.

### Block 5. Time Horizon and Drawdown

Here, you pre-program your tolerance for pain into the system.

Example: "within a 6-month testing period with a drawdown of no more than 20% of the starting capital." This means you have **given yourself permission** in advance to go down 20% and not panic. And you have **set a timeline** for yourself to make a decision in 6 months, not before.

Without this block, any bad day will feel like a catastrophe. With this block, you can honestly say, "this is within the limits I allowed, we continue."

### Full Example

Let's put it all together. A learning example (not ours, not our strategy):

> "My bot will close 3-5 trades per week using a trend-following strategy on the 4-hour timeframe with a moving average crossover, without holding positions through major news releases, so that I can spend 30 minutes a day reviewing logs instead of 4 hours reading chats, within a 6-month testing period with a drawdown of no more than 20% of the starting capital."

Read it out loud. If it's understandable even to someone who knows nothing about trading, the formulation is good. If it sounds awkward or unclear, rewrite it.

---

## Four Rules on Paper

After the single sentence, we go one level deeper. These four rules are a contract between you and the bot.

### Rule 1. Entry Conditions

What must be **true** for the bot to open a trade. A complete list of conditions, without exceptions.

Template:

```
ENTRY:
- Signal X has occurred
- AND Signal Y has confirmed it
- AND Filter Z permits it
- AND capital is free (no open position)
- AND it's not a restricted time (see Rule 4)
```

For example:

```
ENTRY:
- The fast moving average has crossed the slow one from below
- AND the volume of the last candle is above the 24-hour average
- AND ATR (volatility) is above the minimum threshold—otherwise it's noise
- AND there is no open position
- AND the time is between 9:00 and 22:00 UTC, not a weekend
```

Notice: **no specific numbers**. This is a rule on paper. The numbers are selected during the backtesting phase, not now.

### Rule 2. Exit Conditions

When the bot **closes** a trade. Also a complete list—because the exit is **half the battle**, yet most people only think about the entry.

Template:

```
EXIT:
- Profit target is reached (take-profit)
- OR loss has reached its limit (stop-loss)
- OR a reverse signal has appeared (reversal)
- OR time in position has exceeded the maximum
- OR a major news release is approaching
```

Good bots often have **3-5 exit conditions**. If any one of them triggers, the position is closed. If the bot thinks "I'll wait a bit longer," it's a sign that the exit conditions are not clearly defined.

### Rule 3. Risk Management

This is **how much** the bot risks. The most important piece. Without it, any smart signal will drain your capital.

Template:

```
RISK:
- Size of one position = X% of current capital (typically 0.5-2%)
- Stop-loss = Y% from the entry price (typically 1-3%)
- Maximum drawdown for the day = Z% (typically 5-10%)—after which the bot sleeps until tomorrow
- Maximum number of simultaneously open positions = N (for a first bot, this is 1)
- A series of K consecutive losses = pause for M hours (typically 5 losses → 24-hour pause)
```

And again—**on paper, without numbers**. The numbers are chosen deliberately during testing.

### Rule 4. Emergency Stop

What shuts the bot down **completely**, not just skips a trade.

Template:

```
EMERGENCY STOP:
- Drawdown from peak > 20%—bot shuts down, requires manual restart
- A series of K consecutive technical API errors—bot shuts down
- No data from the exchange for > N minutes—bot shuts down
- A command from me (Telegram bot / manual flag)—bot shuts down
```

This is the final safety fuse. When something goes very wrong, the bot must **know how to give up**, not "heroically continue trading through a storm."

---

## A Simple Flowchart on Paper

Take a sheet of paper and draw the bot's cycle by hand. Not in Visio, not in draw.io. **By hand**, on paper, with a ballpoint pen. This is important—your hand thinks differently than a mouse.

The minimal cycle:

```
[ Start every N minutes ]
        ↓
[ Get fresh candles + current price ]
        ↓
[ Check: Is there an open position? ]
        ↓                   ↓
       YES                  NO
        ↓                   ↓
[ Check EXIT conditions ]    [ Check ENTRY conditions ]
        ↓                   ↓
[ All conditions met?]        [ All conditions met?]
        ↓                   ↓
[ Close position ]            [ Open position ]
        ↓                   ↓
[ Write to log ]     [ Write to log ]
        ↓                   ↓
[ Sleep until next tick ]
```

Seven blocks. No more. No less. If your flowchart has **fewer**, you've missed something. If it has **more**, you're overcomplicating things too early.

And be sure to draw a **separate** flowchart for the **emergency stop**—what happens when something breaks. Most bots don't have this diagram and behave unpredictably in real-life situations.

---

## Common Mistakes on This Specific Day

1.  **Skipping Day 3 and jumping straight to code.** This is the most common mistake. Someone reads "formulation on paper," thinks "that's not for me, I already know what I want to do," and starts coding. Two weeks later, they come back and redo it. Don't skip this. An hour and a half on paper today saves two or three days of coding tomorrow.

2.  **Writing one sentence and one rule, then stopping.** Completeness is important. All four rules must be on paper, even if the last one (emergency stop) feels "paranoid." Especially the last one.

3.  **Setting specific numbers today.** Don't. On paper, you define signal types and logic. Numbers come in the next stage (Day 4 and beyond), and they must be **justified by testing**, not intuition.

4.  **Describing it too complexly.** If your one sentence ends up being 40 words long with three subordinate clauses, you haven't formulated it yet; you're just overcomplicating. A 25-word summary of the same example: "The bot closes 3-5 trades per week on the 4-hour BTC trend, avoids trading through major news, aims to save me 4 hours a day, with a 6-month horizon and up to 20% drawdown." This is exactly the same as the detailed example above, but simpler.

5.  **Describing it too abstractly.** "The bot will react to market conditions and make optimal decisions" is empty rhetoric. You can't test it, you can't turn it into code, you can't evaluate it. Specificity wins.

6.  **Not showing the formulation to anyone.** The best test is to read it **out loud to another person** who doesn't understand trading. If they ask "what does this block mean?"—rewrite it. If they nod along, the formulation works.

---

## Today's Assignment

In writing, in your workbook:

- [ ] **One sentence** for your bot—filled out according to the five-block template, no more than 50 words
- [ ] **Entry rule**—a list of 3-5 conditions
- [ ] **Exit rule**—a list of 3-5 conditions
- [ ] **Risk rule**—five parameters (types on paper, no numbers)
- [ ] **Emergency stop rule**—what shuts the bot down completely
- [ ] **Flowchart** of the main loop, drawn by hand on paper
- [ ] **Flowchart** of the emergency stop, separately
- [ ] **Read out loud** the one sentence and four rules to another person (partner, friend, parent—anyone). Wrote down what they asked about.

Send a short message to the Telegram channel:

```
Day 3 — done.

My bot's one-sentence description:
[insert your sentence here]

The hardest part to formulate was: [block 1 / 2 / 3 / 4 / 5]
```

---

## What's Next

Tomorrow, we write code. **Only now**, with one sentence, four rules, and two flowcharts on paper, are you ready to write code that will be **useful**, not thrown away in two weeks.

By the end of Day 4, you will have a working bot on a Testnet account. Not a perfect one. Not a "money-making" one. Just one that **launches and executes trades** according to your rules. This is a huge difference from where you were at the beginning of the week.

See you tomorrow.

---


# Homework — Day 3

> The main task for today is **not to write a single line of code**. Just paper and your brain.

## Checklist

In writing, in your workbook:

- [ ] **A one-sentence description** of my bot, filled out using the five-block template (≤ 50 words)
- [ ] **Entry rule** — 3-5 conditions in a list
- [ ] **Exit rule** — 3-5 conditions in a list
- [ ] **Risk rule** — five parameters (on paper without numbers, just the types)
- [ ] **Emergency stop rule** — what shuts down the bot completely
- [ ] **A flowchart** of the bot's main loop, drawn by hand on paper
- [ ] **A flowchart** of the emergency stop, separately
- [ ] **Read aloud** the one-sentence description and the four rules to another person, and wrote down the questions they asked

---

## One-Sentence Template to Copy into Your Notebook

```
My bot will ___________________ (a specific, measurable result)

using ___________________ (archetype + specific signal on a specific timeframe)

without ___________________ (the main risk I am avoiding)

so that I can ___________________ (the real goal)

within ___________________ (time horizon + acceptable drawdown).
```

---

## Four-Rule Template

```
RULE 1. ENTRY CONDITIONS
the bot opens a position when:
1. ________________________________
2. ________________________________
3. ________________________________
4. (optional) __________________
5. (optional) __________________

RULE 2. EXIT CONDITIONS
the bot closes a position when (OR):
1. ________________________________
2. ________________________________
3. ________________________________
4. (optional) __________________
5. (optional) __________________

RULE 3. RISK MANAGEMENT
- Position size: ___% of capital
- Stop-loss: ___% from entry price
- Daily drawdown limit: ___%
- Maximum concurrent positions: ___
- Losing streak → pause for: ___ hours

RULE 4. EMERGENCY STOP
the bot shuts down completely when:
1. ________________________________
2. ________________________________
3. ________________________________
4. ________________________________
```

---

## Self-Check Before Bed

Close your notebook, step away from the computer, and try to answer three questions **from memory**:

1.  **What exactly does my bot do?** (You should be able to answer in one sentence within 30 seconds.)
2.  **When does my bot *not* trade?** (Exit conditions + emergency stop.)
3.  **How much am I willing to lose before I shut down the experiment?** (Daily limit + total limit.)

If you get "stuck" on any of these questions, open your notebook and **add more detail**. Your brain should know the answers automatically. This is what it means to be ready to code.

---

## What to Send to the Group Chat

```
Day 3 — done.

My bot's one-sentence description:
[paste your full sentence here]

The hardest part was formulating:
[block 1 / 2 / 3 / 4 / 5 — choose one and explain why]
```

---

## If You're Stuck

**Can't come up with the one-sentence description?** That's normal for the first time. Try this: write **three sentences** about the bot, then condense them into one. If you can't condense them, it means you have several different ideas mixed up, and you should **choose just one** for your first bot.

**Can't list five entry conditions?** This means your signal is too general. Ask yourself: "Under what **market** conditions do I NOT want the bot to trade, even if the main signal is present?" These answers are your additional filters.

**Can't determine the position size?** Start with a safe choice for your first bot: 1% of capital per trade, a 2% stop-loss, and a maximum of 1 open position. This isn't optimal, but it **won't kill** your account. Optimization comes later.

**Can't draw the flowchart?** Use the seven blocks from the day's cycle (see the lesson). Copy the structure and replace the labels with your own.

---

See you tomorrow.