Swing trading strategy: rules that hold for days

By Oalgo · Last reviewed

A swing trading strategy holds each trade for several days, so its rules usually read longer candles, often daily ones. Fewer trades mean each one carries more weight, and a short test can look very different from a long one.

What does a swing rule usually read?

#
  • A longer candle, such as a daily or 4-hour candle, which the builder offers.
  • Slower averages, or a level set over many candles.
  • An exit that can take days, so the drawdown during the hold matters as well as the final value.
Ten daily candles in a row. A bracket spans six of them, labelled 'Held for six days'. The first candle is marked 'Entry' and the sixth of the span 'Exit'.20-day averageEntryExitHeld for six days
Made-up candles drawn for this page, to show the holding span only.

What does a worked example look like?

#

A rule reads daily candles and enters long when a candle closes above its 20-day average. It exits when a candle closes below that average, or at a stop 4 percent under the entry. On the chart the entry is on day 3 and the exit on day 8, a holding span of six days. The record lists the entry day, the exit day and the holding time, so the span can be checked against the candles.

Why a few trades weigh so much

#

Eight trades a year give a short test only eight trades to judge. Read the trade count before any average, because a single unusual trade can move the whole picture. Overfitting makes this worse when the settings were fitted to the same few trades. Two or three years of daily candles give roughly 250 candles a year, which is a longer stretch than the trade count suggests.

Two rules, one label

#

Two rules with one entry condition can still differ in the record once their candle sizes differ. A daily-candle rule that enters on a close above a 20-day average may hold for six days, while the same condition on hourly candles might close within a day. The test should state its candle size, so the two are never compared as if they were one rule.

What can a swing test not show?

#

A multi-day hold gives the real-world factors more time to add up. Oalgo's terms list slippage and venue fees among the factors a simulation leaves out, so a clean swing record still leaves those costs open. A forward test adds new days, one at a time, and cannot shorten the wait for them.

On Oalgo the order is set. Your own words for the idea come first, then rules the AI builds and you check, then a backtest on past candles and a forward test on live prices with simulated funds. Go Live is the last step and is optional, on your own Live Strategy and your own Venue Account at a Supported Venue.

Read next