For Business

Trading Strategies

What Is Algorithmic Trading

Algorithmic trading is a written rule carried out by a program: the program reads each bar, checks the rule, acts on the answer and waits for the next bar, for as long as it runs. This paper shows you that loop, the idea as a music box whose pins play the same tune every time, one rule's answers across all 258 daily bars of gold in 2025 on the chart, the list of what a program does and does not do, and the rule written as five lines of code in your platform's editor.

Difficulty
Beginner
Reading time
5 min
Pages
8
Reviewed by
Saman Rahbar

This paper is locked

Read it in the browser and keep the PDF with Premium, or buy this one paper.

The loop

Algorithmic trading is a written rule carried out by a program instead of a person. The program runs a loop. A new bar closes; it reads the close and the average; it asks the rule, here whether the close is above the twenty-day average; it acts on the answer, yes or no; it waits for the next bar. Then the same five steps again, for as long as it runs. On gold in 2025 that was 258 bars on the daily chart — one bar for each day — or 5,915 on the hourly chart, or 11,400 on the five-minute one, each checked in exactly the same way, at whatever hour it closed.

A music box

Picture a music box. The pins on the cylinder are set once, and as the cylinder turns each pin plucks its note at its moment, the same tune every time, with nobody deciding anything while it plays. An algorithm plays a trading rule the same way: the rule is written once, and then it is carried out exactly and tirelessly on every bar, with no idea what it is playing and no ability to play anything else. What was written is what plays, and if the tune is wrong, it is wrong on every bar.

This paper is locked