Skip to content

AFL example downloads

Every complete formula in this course is a real .afl file that you can download and open in AmiBroker’s Formula Editor.

The lessons do not contain their own copy of the code. Each lesson reads the file from disk when the site is built, which means the code you read in a lesson and the file you download here are the same bytes. They cannot drift apart, and if a file were ever missing the site would fail to build rather than quietly show you something that does not exist.

  1. Download the .afl file, or use the copy button on the code block in the lesson.
  2. In AmiBroker, open the Formula Editor.
  3. Paste or open the file, then apply it — as an indicator on a chart, or by sending it to the Analysis window, depending on what the lesson is doing.
  4. Read the header comment first. Every example states what it assumes: the bar interval, whether prices need to be adjusted, which Analysis settings it expects, and anything about it that is a teaching device rather than something to trade.

These formulas are written to be read and understood, not to be traded. Several of them deliberately do things you must never do in a live rule — the reality-check studies read future bars on purpose in order to measure what already happened, and they say so at the top of the file in capital letters. Read the header before you reuse anything.

Nothing here is financial advice, and nothing here is a strategy that has been shown to work. See the disclaimer.

199 AFL examples are available to download. Each one is the exact file shown in its lesson — the lesson embeds the file rather than containing its own copy, so the two cannot disagree.

Part 2 Understanding Market Data

Part 3 Getting Started with AmiBroker

Part 4 Reading Price Charts

Part 5 Support, Resistance and Price Structure

Part 6 Indicators

Part 7 Candlesticks and Chart Patterns

Part 8 AFL Programming Fundamentals

Part 9 Working with Arrays and Historical Bars

Part 10 Building Custom AFL Indicators

Part 11 Reusable AFL Programming

Part 12 Scanning and Exploration

Part 13 Ranking and Relative Strength

Part 14 Multi-Timeframe AFL

Part 15 Multi-Symbol Analysis

Part 16 Market Breadth

Part 17 Introduction to Real-Time Markets

Part 18 Real-Time Data Providers

Part 19 Creating an Intraday AmiBroker Database

Part 20 Trading Sessions, Exchanges and Time Zones

Part 21 Real-Time Charts

Part 22 Real-Time Quotes and Time & Sales

Part 23 Real-Time AFL

Part 24 Real-Time Scanning

Part 25 AFL Alerts

Part 26 Bar Replay and Simulated Practice

Part 27 From Trading Idea to Trading System

Part 28 AmiBroker Backtesting

Part 29 Understanding Backtest Results

Part 30 Backtesting Mistakes

Part 31 Optimization

Part 32 Out-of-Sample and Walk-Forward Testing

Part 33 Monte Carlo and Robustness

Part 34 Risk Management

Part 35 Developing a Complete Trading Research Process

Part 36 Advanced AFL

Capstone Capstone: Build Your Own AmiBroker Trading Research Workstation