Bar close or every tick

One header line changes when the script runs.

By default a script runs after each bar closes. With evaluate: tick it runs at every point of the price path, and market orders fill at the price that triggered them.

AlgoBarsX
strategy "Tick Scalper"
market: XAUUSD
bars: 1m
evaluate: tick
max_open: 1
input max_stretch = 2.0
when crosses_above(close, vwap()) once per bar cooldown 2 bars:
buy risk: 0.5%, stop: 30 points, target: 1.5R, ghost: true
on tick:
if not bar.confirmed and close < vwap() - atr(14) * max_stretch:
close_all side: long
  • Inside a forming bar, prices are live and indicators are not. close, high and low move with the tick, while indicator values stay as they were at the last bar close. Nothing repaints.
  • bar.confirmed is false during a tick and true at the close.
  • In a backtest, the 1-minute bars inside each bar supply the price path. When a bar has no finer data stored, its own path is used and the run is labelled “approximate intrabar”, listing the bars affected.

Rules: E2 and E6.

Try this in the Terminal. AlgoBars is free: $0 a month, no card needed.

Create my free account