Intraday trading strategy: rules that close within the day

By Oalgo · Last reviewed

An intraday trading strategy is a rule set whose trades open and close on the same day. Intraday means within the day, the same idea as day trading. This page covers one question: how a rule ends a trade after a set number of candles, and how to turn a time of day into that number.

What does an intraday rule need that other rules do not?

#
  • An exit that ends the trade after a set number of candles, using the builder's Time Exit, alongside a target or a stop.
  • A candle size chosen so that the count gives the holding time you want.
  • A check that the count runs out before the day ends, since a count does not know the clock.

How do you turn a time into a candle count?

#

The builder's Time Exit closes a trade after a number of candles, and its default is 20. It does not read the clock. To set a time, divide the minutes by the candle length. On 5-minute candles, 12 candles is one hour, so a one-hour limit is 12. On 15-minute candles, the same hour is 4 candles. One hour is the same length of time on every candle size, but the count changes with the candle size.

A strip of 12 five-minute candles, each labelled with its close time from 15:00 to 15:55. The first is marked 'Entry', the twelfth 'Time Exit after 12 candles'.15:0015:0515:1015:1515:2015:2515:3015:3515:4015:4515:5015:55EntryTime Exit after12 candles
Made-up times, drawn for this page. Check how the builder counts from the entry candle before you rely on the count.

What does a worked example look like?

#

A made-up session. A rule enters long on a 5-minute candle close above 100. It exits at a target of 101.0, at a stop of 99.5, or after 12 candles, whichever comes first. A trade still open after its 12th candle is closed at a made-up price of 100.6, and the record shows it closed by the Time Exit. The reader can match that candle to the chart. Without the Time Exit, the same trade could stay open into the evening, and its outcome would depend on a price the rule never planned for.

A second example: the same rule over two days

#

The same rule, with the 12-candle limit, run over two made-up days. The count of trades that reach the limit is the figure to read first, because it shows how much of the rule depends on the Time Exit.

DayTrades openedClosed by the Time Exit
Monday62
Tuesday31

What does a count not know?

#

A count does not know the clock. A trade entered at 14:50 on 5-minute candles, with a 12-candle limit, runs past 15:00 and into the next hour. If a rule must end by a set time of day, the count has to be short enough to end before it, or the entry rule has to stop earlier. The test shows whether the chosen count does that.

A common mistake

#

Setting the candle count after seeing which trades were still open, so the rule fits the day that was tested. Write the count down before the test and keep it fixed. Then read each Time Exit in the record against the chart, to confirm it closed after the set number of candles.

What can an intraday test not show?

#

A test on past candles shows how the Time Exit behaved on those days. It cannot show how a session will open next week. A forward test adds new days as it runs, but only as many as it has run. Real closing fills, and their costs, sit outside what a backtest measures.

Here the first step is your own wording of the idea. Oalgo's AI then builds the rules, and you check the candle count and the exits before any test runs. The backtest and forward test use simulated funds, and only after them, if you choose, do you Go Live with your own Live Strategy on your own Venue Account at a Supported Venue.

Read next