DayTrade Engine · Guide

← Back to the engine

How the replay works, and how not to fool yourself.

1. The bar loop

The engine walks through the bars one at a time, in order. On every bar it does three things:

  1. Fill pending orders at the open. A signal seen on the previous bar's close becomes a market order here, and slippage is added against you.
  2. Check protective orders inside the bar. Stop, target and trailing stop are compared with the bar's high and low. If the bar opens beyond a level (a gap), the fill is the open price. If a single bar touches both the stop and the target, there's no way to know which came first, so the engine assumes the stop.
  3. Decide on the close. A position can be flattened at the session close, at a forced exit time, after a maximum number of bars, or because a signal exit fired (that last one fills at the next open). When flat, the entry rules are checked, subject to your entry window, trades-per-day cap and daily loss limit.

Every indicator only uses bars up to and including the current one, so a rule can never see the future. The opening range is blank until its window has fully closed.

2. Writing rules

A condition is left · comparison · right. Each side is a price field, an indicator or a plain number, and the right side can be multiplied (e.g. Volume > 2 × Volume SMA(20)). Price points are in the symbol's own price units: dollars for stocks, for example 0.0010 for EURUSD. crosses above is true only on the bar where the left side moves from at-or-below to above. Within a block, choose whether ALL conditions must hold or ANY one is enough.

IndicatorWhat it is
VWAPVolume-weighted average price, reset every session. For symbols without volume it falls back to the session's average typical price.
Opening-range high / lowHigh / low of the session's first N minutes, known once that window closes.
Session open / high / low so farRunning values within today's session.
Previous close / high / lowYesterday's session values.
Gap %Today's open against yesterday's close.
Relative volumeThis bar's volume divided by the average of the previous N bars.
Bar # in session1 for the first bar of the day, 2 for the next, and so on. Useful for "only in the first hour" rules.

3. Sizing

% of equity buys that fraction of current equity. % equity risked sizes so that hitting the stop loses exactly that fraction, which is the usual day-trader approach, and it needs a stop. Fixed $ and fixed shares do what they say. Every size is capped at equity × max leverage.

4. Reading the results

5. Markets

Choose Stocks, Crypto, Forex or Futures in the Market dropdown. Bars are cached on the server, so the first load of a symbol takes a few seconds and later runs are quick. The status bar under the controls shows how much history is available for the symbol and bar size you picked.

MarketSymbolsSession
StocksUS stocks and ETFs, e.g. SPY, AAPL, BRK.B09:30 to 16:00 New York time
CryptoPairs like BTCUSDT, ETHUSDT (BTC-USD also works)24/7. Each session is one UTC calendar day, so set entry windows in UTC.
ForexCurrency pairs like EURUSD, GBPUSD, USDJPY (EUR/USD also works)24 hours, Monday to Friday. Each session is one London trading day, so set entry windows in London time (London open 08:00, New York overlap 13:00 to 17:00). There is no volume data.
FuturesContract roots like ES, NQ, CL, GC (continuous front month)US day session only, 09:30 to 16:00 New York time. The overnight session is left out.

Very long histories are capped at about 60,000 bars per symbol and bar size, because every bar is sent to the replay chart. For stocks, volume may cover only part of the market. The app warns you when a strategy's VWAP or volume rules depend on it. Daily prices are split and dividend adjusted, so very old prices can be pennies per share.

6. Not fooling yourself