# Day 1. Mindset and Preparation

> Today's goal is to get your head straight and prepare your work environment. By the end of the evening, you will have a working Python environment, an API key for a Binance test account, and an honest understanding of what you're getting into. Without this, everything else is a waste of time.

---

## Why Read Something Today Instead of Immediately Writing Code

Algorithmic trading is the most deceptive niche in programming. The barrier to entry seems low (you know Python, the API is simple, GitHub is full of examples), but the statistics are harsh: **more than 90% of retail algo traders lose money or give up in their first year**. Not because they are bad programmers. Because they are good programmers who have run into a problem where programming skills **are not enough**.

A trap I'm familiar with looks like this: a programmer sees a YouTube video titled "How I made $5,000 in a month with a trading bot," downloads a project with 200 stars from GitHub, runs it on a live account, loses $1,500 in two weeks, deletes everything, and says, "This whole algo trading thing is a scam." In reality, the niche itself isn't the scam. The "download someone else's code and press Run" format is the scam.

We'll spend this first day making sure you don't fall into that trap. We'll cover three things:

1. Why 90% lose (three very specific reasons)
2. What an honest path from "have nothing" to "bot works stably" looks like
3. Preparing your tools — Python, IDE, test account key

You won't see a single piece of my working code today. Today, we're only working with our heads.

---

## Three Reasons Why Programmers Lose Money in Algorithmic Trading

### Reason 1. Backtest Overfitting

This is the number one killer. You write a strategy, run it on historical data, see a beautiful equity curve, launch it with real money—and it **immediately** starts losing. Why?

Because you've fitted the parameters to the historical data. If a 27-bar moving average on BTC for 2023 gives a better result than 26 or 28, it doesn't mean 27 works better. It means 27 happened to coincide with the specific market movements of 2023. In 2024 or in live trading, that 27 trick won't work anymore.

A sign of overfitting is a strategy with a 75% win-rate and a Sharpe ratio of 3 on a backtest. Real crypto strategies have a win-rate of 40-55% and a Sharpe of 0.8-1.5. If you see something better, it's almost always overfitting.

### Reason 2. Lack of Risk Management

A programmer writes a strategy that generates signals. And that's it. They go "all-in" (or risk a large portion of their capital) on every signal. The very first losing streak of 4-5 trades (which happens even with good strategies—it's math, not bad luck) wipes out half the deposit.

The right way is to define, in advance, **before** launching the bot:

- what percentage of capital you can lose on a single trade (typically 0.5-2%)
- what percentage of capital you can lose in a day before the bot shuts down until tomorrow
- the maximum number of simultaneously open trades
- what the bot does after a series of N consecutive losses (typically, pause for 24 hours)

Without these four limits, you're not trading—you're gambling.

### Reason 3. Lack of Iteration Discipline

The bot loses for three days straight → the programmer panics and changes 5 parameters at once → the bot makes money for a day → the programmer, in a state of euphoria, adds 3 new indicators → the next week is worse than before → the programmer breaks everything and starts over.

This is death by a thousand edits. Any good strategy goes through losing streaks. If you change the logic after every such streak, you don't have a strategy at all; you have a random behavior generator.

The right way is **one hypothesis, one test, one log, one decision**. And between changes, a minimum of 50-100 trades are needed to statistically separate the signal from the noise.

---

## What the Honest Path Looks Like

If you do it right, the journey from "I know nothing" to "a bot is consistently making money on a live account" normally takes **6-12 months**. Not a week, not a month, not three. Half a year to a year.

Here's a rough breakdown:

| Stage | What Happens | Timeframe |
|---|---|---|
| Preparation | Setup, understanding, choosing a strategy archetype | 1-2 weeks |
| First Bot on Paper | A simple strategy from basic building blocks, test account | 2-4 weeks |
| Quality Check | Backtest with walk-forward, identifying weaknesses | 2-4 weeks |
| Iterations | Dozens of small improvements, infrastructure development | 2-4 months |
| Small Real Money | Launch with a deposit you're not afraid to lose (e.g., $200) | 1-2 months |
| Gradual Scaling | If statistics are stable — increase position size | 3-6 months |

This 5-day course covers only the **very beginning**—the preparation and first paper bot stages. The goal of these five days is for you to have your own working first bot and to understand where to go next. These five days alone won't make you a professional algo trader. This is the **first step on the right path, instead of random floundering**.

---

## Installing the Tools

Now for the practical part. Half an hour of work, and your environment will be ready.

### What You'll Need

1. Python 3.10 or newer
2. Any IDE (I recommend VSCode—it's free and convenient)
3. A virtual environment for the project
4. The `python-binance`, `pandas`, and `numpy` libraries
5. An API key for the Binance Spot Testnet account

### Step 1. Python and Virtual Environment

Check that the correct version of Python is installed:

```bash
python3 --version
# Should be Python 3.10.x or newer
```

If not, install it. On Linux/Mac, it's usually done through the system package manager. On Windows, get it from python.org.

Create a project folder and a virtual environment:

```bash
mkdir my-first-bot
cd my-first-bot
python3 -m venv venv
source venv/bin/activate  # Linux/Mac
# venv\Scripts\activate  # Windows
```

### Step 2. Libraries

Inside the activated environment:

```bash
pip install python-binance pandas numpy python-dotenv
```

### Step 3. Binance Testnet Account Key

This is a **test account**, not a real one. The money isn't real. No passport, no KYC, nothing. It's just a development tool.

1. Go to https://testnet.binance.vision/
2. Log in with your GitHub account (if you don't have one, create a free one)
3. Click "Generate HMAC_SHA256 Key"
4. Save the two values: API Key and Secret Key

Create a `.env` file in the project folder:

```
BINANCE_API_KEY=your_key_here
BINANCE_API_SECRET=your_secret_here
```

Create a `.gitignore` file to avoid accidentally committing your keys to a public repository:

```
venv/
.env
__pycache__/
*.log
```

### Step 4. Verifying Everything Works

Create `check_setup.py`:

```python
import os
from dotenv import load_dotenv
from binance.client import Client

load_dotenv()
client = Client(
    os.getenv("BINANCE_API_KEY"),
    os.getenv("BINANCE_API_SECRET"),
    testnet=True,
)

# Check connection
status = client.get_system_status()
print(f"Testnet account status: {status}")

# Check balance (Testnet provides a starting deposit automatically)
account = client.get_account()
balances = [b for b in account["balances"] if float(b["free"]) > 0]
print(f"Balances: {balances}")

# Check candlestick data retrieval
klines = client.get_klines(symbol="BTCUSDT", interval="1h", limit=5)
print(f"Retrieved {len(klines)} 1-hour candlesticks for BTC/USDT")
```

Run it:

```bash
python check_setup.py
```

It should output something like this:

```
Testnet account status: {'status': 0, 'msg': 'normal'}
Balances: [{'asset': 'USDT', 'free': '10000.00000000', 'locked': '0.00000000'}, ...]
Retrieved 5 1-hour candlesticks for BTC/USDT
```

If it did, everything is working, and you can call it a night.

If it didn't, here are some common problems:

| Error | Cause | Solution |
|---|---|---|
| `Invalid API-key` | Key is not from Testnet | Double-check that the key is from testnet.binance.vision, not binance.com |
| `Invalid signature` | Secret key was not copied completely | Copy it again, check for extra spaces |
| `Module not found: dotenv` | Libraries are not installed | Activate the venv (`source venv/bin/activate`) and run `pip install` again |
| Timeout / no connection | Firewall / VPN is blocking Binance | Try from a different network or with a VPN |

---

## Common Mistakes Specific to Today

1. **Getting the key from the regular binance.com instead of testnet.binance.vision.** Any attempt to trade will then use real money. Double-check the domain you got the key from.

2. **Not activating the virtual environment before running `pip install`.** The libraries will be installed system-wide and may conflict with other projects.

3. **Putting keys directly into the code.** Today you put them in your `bot.py`, tomorrow you upload the project to GitHub forgetting to remove them—and 10 minutes later, your account will be cleaned out. Always use `.env` + `.gitignore`.

4. **Immediately installing many libraries "for the future"—ta-lib, ccxt, backtrader, vectorbt, etc.** Don't. At each stage, install only what you need right now. Otherwise, you'll drown in dependencies that will later conflict.

5. **Deciding that Testnet is "not real" and trying it with real money "just to see".** Never. Any code that you haven't run for at least 2 weeks on a test account is not code; it's a lottery ticket.

---

## Today's Assignment

Simple. By the end of the evening, you should have all of this done:

- [ ] Python 3.10+ is working (`python3 --version` shows the version)
- [ ] The `my-first-bot` folder has been created with a virtual environment
- [ ] `python-binance`, `pandas`, `numpy`, and `python-dotenv` are installed
- [ ] An API key from Binance Spot Testnet has been obtained
- [ ] The `.env` and `.gitignore` files have been created
- [ ] The `check_setup.py` script runs and shows a successful result

And answer these three questions for yourself (in writing, in your notebook, not just in your head):

1. What capital am I **truly willing to lose** in this experiment? (Not "none"—that's self-deception. Any algorithm can lose. Be honest with yourself.)
2. How many hours per week can I **realistically** dedicate to this? (Not "10" if it's actually 3.)
3. What will I **do** in 6 months if the bot isn't working? (Quit? Keep learning? Hire help? Think seriously about this in advance.)

These three answers will define your discipline for the coming months. Without them, everything else is just playing with code.

---

## What's Next for Tomorrow

Tomorrow, we'll figure out **what kind of strategy you're actually going to build**. Not our secret one (it's a secret). Instead, we'll choose one of four well-known approaches that suits your personality and capital. We'll learn to find public implementation examples and **analyze them**, not just copy them. By the end of Day 2, you will have chosen an archetype and studied two public examples of it.

See you tomorrow.

---


# Homework — Day 1

## Environment Readiness Checklist

Check off when done:

- [ ] **Python 3.10+** is installed and available from the terminal
- [ ] **Project folder** `my-first-bot` is created
- [ ] **Virtual environment** is activated
- [ ] **Libraries** are installed: `python-binance`, `pandas`, `numpy`, `python-dotenv`
- [ ] **Binance Testnet key** is obtained (from testnet.binance.vision, not the main binance.com)
- [ ] **`.env` file** is created with the keys
- [ ] **`.gitignore` file** is created and contains `.env`
- [ ] **Script `check_setup.py`** is run, has output the status and balance

If everything is checked off, your work environment is ready for Day 2.

---

## Written Exercise: "Three Honest Questions"

> Open a notebook (paper, a text file, notes on your phone—it doesn't matter). Write down detailed answers. They aren't for me—they're for you. You will come back to them in three months.

**Question 1.** How much capital am I truly willing to lose in this experiment?

A hint for honesty: "None" is self-deception. Any algorithm can go into a 30-50% drawdown in a month. If you have $5,000 and say "I can lose $5,000," that's a lie; you'll panic later and ruin everything. If you have $5,000 and say "I can lose $300," that's the truth, and it's the right starting point.

Write it down: ___________

---

**Question 2.** How many hours per week will I **realistically** dedicate to this?

A hint for honesty: 5 evenings at 1.5-2 hours each = 7-10 hours per week. If you plan to spend 20 hours a week on a trading bot on top of your main job and family, it's almost always a lie. Algorithmic trading won't make you a millionaire in a month, and a 20-hour-a-week commitment will quickly turn into 0 hours after a month.

Write it down: ___________

---

**Question 3.** What will I do in 6 months if the bot isn't working?

Options to consider:
- Quit and try a different programming niche
- Continue learning because I find the process itself interesting
- Switch from my own bot to a subscription for ready-made signals
- Take a paid course and get mentorship
- Hire an assistant / partner

Knowing the answer in advance means you won't panic in 4 months when something goes wrong.

Write it down: ___________

---

## What to Post in the General Chat

In our Telegram channel (link on the course page), post a short message:

```
Day 1 — done.

Environment set up: [Python ✓ / venv ✓ / Testnet ✓]
My biggest fear: [one sentence]
```

This serves two purposes:

1. You publicly confirm that you've completed Day 1—this helps with discipline.
2. You see that you're not alone—there are dozens of people just like you in the chat.

---

See you tomorrow.