This is the last lesson of the course on automated trading and AI. By the end of it, you'll have the course in one picture, and a step-by-step way to practise automation without real money at stake. You'll also know where to go next to write code yourself.
1 of 9
What you'll learn
- Recap what a bot knows. It follows exact rules and knows nothing else.
- Expect things to break. Connections, code and records can all break.
- Keep breaks small. Use caps, a kill switch and daily checks.
- Automate in small steps. Start each step on practice only when the last ran cleanly.
- Carry the questions forward. Ask what it can't know, where stops sit and what stops it.
Exercise
- Write your own four-step practice plan for automating one set of exact rules on a An account with pretend money, where a simulation decides your fills instead of the real market. Also called a simulated account.More in the glossary, with what “ran cleanly” must mean before each next step.
- One optional next step: Wildflower's Bot is one place to run rules you've written yourself, and other platforms exist.
Quick check
1. In a signals-only step, what does the program send?
2. Why break things on purpose on a practice account?
3. The test gives 22 signals and the log has 20. What comes next?
0 of 3 answered.
Finished this lesson?
Tick it off and keep your place
Read the full notes
The course in short: a bot follows exact rules and knows nothing else; connections, code and records break; caps, a kill switch and daily checks keep breaks small; and AI finds patterns in the past, which is how overfitting happens. Practise automation in small steps on a practice account, and learn the code in the Pine Script and Python courses.
- The course in four lines: a Software that places trades by following rules written in advance: it reads prices, checks the rules and sends orders to a broker when they’re met.More in the glossary follows exact rules and knows nothing else; connections, code and records break, and mistakes repeat at computer speed; caps, a One control that stops automated trading at once: it blocks new orders, cancels working ones and can close open positions.More in the glossary and daily checks keep breaks small; A broad name for computer programs that do tasks people link with thinking, such as spotting patterns or writing text.More in the glossary finds patterns in the past, which is how Tuning a strategy’s rules so closely to one stretch of past prices that they describe that stretch’s quirks more than anything that carries on.More in the glossary happens.
- Small steps on a An account with pretend money, where a simulation decides your fills instead of the real market. Also called a simulated account.More in the glossary, each starting only when the last ran cleanly, because each step tests one kind of problem and a problem found on practice costs nothing: 1. signals only, sending nothing; 2. practice orders with caps and a kill switch (pressed once on purpose); 3. break things on purpose (disconnect, restart); 4. compare every fill with the test (Checking live trades against the test).
- To write code: What Pine Script is and Why use Python for testing. For the live side: Delay and speed and What forward testing is.
- Questions to carry: what doesn't it know? Where is the An order that closes a trade if price reaches a level you set against it. It aims to limit the loss, but in a fast market it can fill at a worse price.More in the glossary if everything goes dark? What stops it if it goes wrong? Was it tested on data it never saw (History kept back while a strategy’s rules are built, then used once to test the finished rules unchanged. The part used to build them is in-sample.More in the glossary), with real costs?
- Made-up signals-only check: test 22 signals, log 20; 2 missing (a restart and a Prices that have stopped updating, often because a data connection has frozen, so the last price shown is out of date.More in the glossary), both fixed, then step one runs again. Answer to the drill: 1.
Worked example
Made-up numbersA signals-only check
Made-up numbers · four weeks · no orders sent
- Test: 22 signals. Program log: 20.
- 2 missing: one during a restart, one on a stale price.
- Both fixed, then the four weeks run again.
Clean means every gap between the log and the test has an explanation.
Your turn
DrillMade-up numbers · the test gives 30 signals · the program logged 26 · 3 of the gaps are explained
Trading is risky. You can lose money, and automated trading can lose like any other trading. This lesson explains how things work. It isn’t advice.