# Day 2. Choosing a Strategy Style and Analyzing Others' Examples

> Today's goal is to choose the exact type of bot you're going to build, from four well-known approaches. And to learn how to **analyze** other people's implementations on GitHub, not just copy them. By the end of the evening, you will have one archetype, a written justification for why you chose it, and two analyzed public examples of this archetype.

---

## Why Choose a Type Today

The main mistake from yesterday's preparation stage is when a programmer immediately sits down to write a "universal bot that can do everything." Such bots don't exist. Every working strategy belongs to one of a small number of archetypes, and each archetype solves **completely different problems**, requires **different capital**, and suits a **different trader personality**.

If you choose the wrong archetype for yourself, even perfectly written code won't work. Not because the code is bad, but because you, as a person, won't be able to stick to the logic of that approach. You'll panic when the logic says "be patient," or exit impatiently when the logic says "wait for confirmation."

Today:

1.  Four archetypes—a brief and to-the-point look at what each one does, the capital it requires, and the personality it demands.
2.  How to match an archetype to yourself—three questions.
3.  The enemy—who we are outplaying (this will help you position your bot, even just for yourself).
4.  How to analyze others' code on GitHub—not to copy, but to **understand**.

---

## Four Strategy Archetypes

This is a **well-known** classification. No secrets here. Any professional course on algorithmic trading starts with this.

### Archetype 1. Trend-following strategy

**Idea:** "The price is going up—buy. The price is going down—sell. No guessing where it will go next—we follow what's already happening."

**Signal indicators:** Moving average crossover (e.g., a fast MA crossing a slow one from below = buy signal), price channel breakout, resistance level breakout.

**What you need:** Capital from $500 (for crypto), a long timeframe (4-hour, 1-day), and a calm personality. Most trades will be **small losses** (60-70%), but the **30-40% of winning trades** will be large enough to cover all losses and turn a profit.

**Main pain point:** Long periods of drawdown when there's no trend in the market. The bot will sit there and rack up a series of small losses from stop-outs. If your personality can't handle 2-3 months of quietly "bleeding" capital, this style isn't for you.

**Who it's for:** Engineers with a long-term perspective, accustomed to long projects. Programmers with a day job and 1-2 hours to spare in the evening.

### Archetype 2. Mean-reversion strategy

**Idea:** "The price has moved too far in one direction—it will come back. We buy when everyone is panic selling and sell when everyone is euphoric."

**Signal indicators:** RSI extremes (above 70 = short, below 30 = long), deviation from the mean by more than N standard deviations (Bollinger Bands), bounce off a support level.

**What you need:** Less capital (can start with $200 due to frequent trades), short timeframes (15-minute, 1-hour), and strong nerves. The win-rate is high (often 55-65%), but the average win is equal to or smaller than the average loss. Profit comes from frequency.

**Main pain point:** Periods of **strong trends** will kill this strategy. You'll repeatedly try to catch a "bottom" that keeps falling another 30%. One such period can wipe out six months of profit.

**Who it's for:** Active individuals who are prepared to monitor daily and understand that **they need to manually turn it off in a strong trending market**. Not for those who want to "set it and forget it."

### Archetype 3. Momentum strategy

**Idea:** "If the price moves sharply on high volume, it will continue to move due to inertia. We buy right after the first jump and sell a short time later."

**Signal indicators:** Rate-of-change over the last N candles is above a threshold, volume is M times higher than average, a news trigger.

**What you need:** Capital from $300, minute/second timeframes, **very fast reaction time** (which is why this only works for a bot, not manually), and low exchange fees. Trades last for minutes or hours, not days.

**Main pain point:** The bot must execute **very quickly**; the problem of **slippage** and commissions eats into profits. With a typical network latency of 100-300 ms, you're already late to the momentum. Plus, on crypto, momentum spikes are often **false**—the price quickly reverts after a news-driven pump.

**Who it's for:** Programmers who already understand the infrastructure side (low latency, execution, monitoring). **Not for a first bot.** This is a second or third one.

### Archetype 4. Pairs or arbitrage strategy

**Idea:** "Two related assets (like BTC and ETH, or the same token on two different exchanges) usually move together. When they diverge, we bet that they will return to the mean. We buy the lagging asset and sell the leading one."

**Signal indicators:** The spread between the pair goes outside its historical range, the correlation between the assets is consistently high (>0.85).

**What you need:** Capital from $1,000 (you need to hold two positions simultaneously), a good understanding of statistics, and two open accounts (for crypto, this is usually one exchange, two instruments). The win-rate is high (60-70%), and the trades are calm.

**Main pain point:** Commissions for two trades at once (one entry means two positions), and the requirement to hold capital in both assets. Plus, the **regime can break**—the correlation between pairs isn't permanent, and during a crisis, everything can crash in one direction regardless of historical relationships.

**Who it's for:** Those with more capital, a good feel for statistics, and who enjoy the **"machine-like"** feel of the strategy's operation (it's all purely mathematical).

---

## How to Choose Your Archetype

Three questions. Answer them honestly.

**Question 1. How much time can you realistically spend on this per day?**

| Time per day | Best Archetype |
|---|---|
| 30 minutes in the evening | Trend-following (4-hour or daily timeframe) |
| 1-2 hours actively | Mean-reversion (15-min or 1-hour timeframe) |
| Full workday | Pairs / Arbitrage (requires monitoring) |
| Minutes or nothing | Momentum (bot must decide, but this is **not a first bot**) |

**Question 2. How much capital are you willing to risk?**

| Capital | Best Archetype |
|---|---|
| $200-500 | Mean-reversion (frequent, small trades) |
| $500-2,000 | Trend-following (requires tolerance for long drawdowns) |
| $1,000+ | Pairs (requires double collateral) |
| Any | Momentum is **technically possible**, but not for a first bot |

**Question 3. What's your personality like?**

- Patient, used to long projects? → **Trend-following**
- Can't stand long drawdowns, like to see results every day? → **Mean-reversion**
- Calm, love pure math, dislike emotions? → **Pairs**
- Already built your first bot and want more speed? → **Momentum**

After these three answers, one obvious archetype should emerge. If it's still unclear, choose **trend-following**. It's the simplest first bot, the one most people learn on, and the one with the fewest pitfalls.

---

## Who We Are Outplaying

This is an important part—defining the **enemy**. Not out of malice, but for clarity of positioning (even to yourself).

All people trading crypto fall into four groups:

1.  **Traders from signal chats.** They pay $50-300 a month for groups that send out "Buy BTC at 70K, sell at 71K." Most of these signals are garbage. A few are good, but you'll never know which ones.
2.  **Emotional traders.** They open their exchange app 15 times a day, trade on intuition, sometimes win, but usually lose. They don't even know why they bought today.
3.  **Traders using others' bots from GitHub.** They downloaded an open-source project, ran it without understanding it, and are surprised when they lose money.
4.  **Traders using their own bots with their own rules.** This is the smallest group. **This is you—after this course.**

Your bot wins against the first three not because it's smarter, but because **you understand what it does and why**. When something goes wrong, you can fix it. They can't.

This isn't a slogan for a landing page. It's the truth. And when your bot starts to infuriate you (and it will—everyone gets infuriated by week three), remember that you have an advantage that 95% of retail traders don't: **you understand your system**.

---

## How to Analyze Others' Code on GitHub

Now for the practical part. To avoid reinventing the wheel, we **study public examples**, but we don't copy them. Here's the correct process:

### Step 1. Find 3-5 examples of your archetype

Search on GitHub:

- For trend-following: "crypto trend following bot python"
- For mean-reversion: "mean reversion bot binance python"
- For momentum: "momentum trading bot python"
- For pairs: "pairs trading crypto python"

Sort by stars. Pick 3-5 projects with at least 100 stars and updates within the last year.

### Step 2. Read the README to understand, not to copy

What to look for in the README:

1.  **What are the exact entry and exit rules** described? A bot without clear rules in the README is garbage; move on.
2.  **What backtest results** does the author show? If it shows "win-rate 95%, Sharpe 5," it's overfitted; move on.
3.  **Which exchange / which pairs** does it work on? If it's only for one exotic pair, it's a narrow case and not very useful.
4.  **What limitations** does the author mention? Good projects honestly state "doesn't work in a sideways market" or "requires low fees."

### Step 3. Read the main bot file (don't run it!)

Open the main file (usually `main.py`, `bot.py`, or `strategy.py`). Read it carefully.

What to note:

1.  **Where does it get data?** Real-time via WebSocket or periodic polling? What's the latency?
2.  **Where does it make decisions?** Which function returns a signal? What are the thresholds?
3.  **Where does it manage risk?** Are there position limits, stop-losses, or drawdown limits?
4.  **Where does it log trades?** The log structure is important for later analysis.

### Step 4. Find the **weak spots**

This is a key skill. Every public codebase has weaknesses. Learn to find them.

Typical weaknesses:

- **Hardcoded parameters** — RSI threshold = 30, EMA period = 20. Where did these numbers come from? If the author doesn't explain, they were likely curve-fitted to the backtest.
- **Lack of error checking** — What if the exchange returns an empty array of candles? What if an order fails to execute? Bad bots lack these checks and will crash in a live environment.
- **No protection against duplicate trades** — What if the previous trade is still in progress when a new signal arrives? A bad bot will open both simultaneously.
- **No logging** or logging only to the console — you won't be able to figure out what happened a month ago.

### Step 5. Document your understanding

In your workbook, for **each** example you analyze:

```
Project: [name on GitHub]
Archetype: [trend / mean-reversion / momentum / pairs]
Entry logic: [one sentence]
Exit logic: [one sentence]
Risk management: [what it has, what it's missing]
Strength: [one thing]
Weakness: [one thing]
What I will take from this for my bot: [something specific, in my own way]
```

After two such analyses, you will have an understanding of **what is generally done** in your chosen archetype. Not code. Understanding.

---

## Common Mistakes for Today

1.  **Choosing an archetype because it "sounds cool."** A momentum strategy sounds cool (fast, aggressive, high-tech). In reality, it's the most difficult first bot. Choose based on the match with your personality and time, not on aesthetics.

2.  **Copying someone else's code entirely.** In two weeks on the live market, it will break, and you won't understand why. Because you didn't write it. Analyzing is good. Copying is not.

3.  **Opening 10 projects at once.** Three to five, analyzed thoroughly, is enough. It's better to deeply understand three than to skim through twenty.

4.  **Ignoring `Issues` on GitHub.** Open the Issues section for every project you consider. That's where people who have **already** run into problems post. It's free education from others' mistakes.

5.  **Thinking that 5,000 stars = a good project.** Stars on GitHub don't mean the code works. They mean the code became popular. These are often two different things. Look at the date of the last commit, the author's replies in Issues, and the honesty of the README.

---

## Today's Assignment

In writing, in your workbook:

- [ ] Wrote down your archetype (one of the four) and a one-sentence reason why.
- [ ] Found at least **three** projects on GitHub in this archetype with 100+ stars.
- [ ] Read the full README for each.
- [ ] Read the main bot file for at least two of them.
- [ ] Filled out the analysis card (using the template above) for two projects.
- [ ] Opened the `Issues` for each—found at least **one** real problem that users are reporting.

Send a short message to the Telegram channel:

```
Day 2 — done.

My archetype: [...]
Why: [one sentence]
The most surprising thing I learned from others' projects: [one sentence]
```

---

## What's Next for Tomorrow

Tomorrow is the most important day of all five. You will formulate **your** bot's purpose in a single sentence—before you write a single line of code. Most people do it the other way around: they write the code and then can't explain what the bot does. That's a dead end. We do things differently.

By the end of Day 3, you will have:
- A single sentence that fully describes what your bot does.
- Four rules (entry, exit, risk, stop) on paper.
- A simple flowchart of the entire cycle on paper.

And only after that, on Day 4, will we write code. All professionals do it this way. All amateurs do the opposite.

See you tomorrow.

---


# Homework — Day 2

## Checklist

In writing, in your workbook:

- [ ] **My archetype is written down** (trend / counter-trend / momentum / pair)
- [ ] **In one sentence**, why this archetype suits me (linking it to my time, capital, or personality)
- [ ] **Found 3 GitHub projects** in my archetype with at least 100 stars and updates in the last year
- [ ] **Read the README for each** (not the code — just the README for now)
- [ ] **Read the main bot file** for at least two projects
- [ ] **Filled out a breakdown card** for two projects
- [ ] **Opened the `Issues`** for each project — found at least one real user problem

---

## Breakdown Card Template

> Fill out **one card for each of the two projects**.

```
Project: ___________________________________________
GitHub URL: ___________________________________
Archetype: __________________________________________

Entry logic (1 sentence):
__________________________________________________
__________________________________________________

Exit logic (1 sentence):
__________________________________________________
__________________________________________________

Risk management:
- What it has: ______________________________________
- What it's MISSING: ______________________________________

Strong point (one):
__________________________________________________

Weak point (one):
__________________________________________________

What I will take from this for my bot (be specific, not "everything"):
__________________________________________________
```

---

## Memo on Analyzing `Issues`

What to look for in open and closed tickets:

1.  **“Bot doesn't work on X”** — on which pair or exchange does it not work? This points to code inflexibility.
2.  **“Why is it losing money?”** — specific user complaints. Often, you can see that the author doesn't know the answer themselves.
3.  **“How to add stop-loss?”** — if this question exists and the author replies “we don't have that, add it yourself” — this is a **weak point** of the project.
4.  **“Crashed after running for X days”** — stability. Programmers often write code that works on the first day but doesn't survive a week.

---

## What to Send to the Group Chat

```
Day 2 — done.

My archetype: ___________
Why: [one sentence]

The most unexpected thing I learned from other people's projects:
[one sentence]
```

---

## If You're Stuck

Can't choose an archetype? Go with **trend-following**. It's a safe choice for a first bot, it's what most people learn on, and there are fewer mistakes.

Can't find good projects on GitHub? Search for `crypto trading bot python`, sort by stars, and pick from the first page. Don't look for perfect projects — look for **diverse** ones to see different approaches.

Opened the code and don't understand anything? That's normal. **Today's goal is not to understand all the code**, but to see the **overall structure**: where the data is, where the signal is, where the execution is, where the risk is. Five blocks — that's enough.

---

See you tomorrow.