Events reference

All 8 events in AlgoBarsX, each with its parameters, defaults, ranges and an example: start, bar close, tick, fill, exit, session open, day change, render.

start bar close tick fill exit session open day change render

on start:#

Runs once before the first evaluated bar.

Example
on start:
log "Deployed"
strategyindicatoralertsince 1.0

on bar close:#

Runs on every confirmed bar.

Example
on bar close:
log "Bar {bar.index}"
strategyindicatoralertsince 1.0

on tick:#

Runs on every price update (evaluate: tick).

Example
on tick:
log "{close}"
strategyalertsince 1.0

on fill(order):#

Runs when an order fills.

Example
on fill(order):
log "Filled {order.size}"
strategysince 1.0

on exit(trade):#

Runs when a trade closes, with trade.pnl, trade.r and trade.reason.

Example
on exit(trade):
log "Closed at {trade.r:0.00}R"
strategysince 1.0

on session open "<name>":#

Runs when a session opens.

Example
on session open "london":
log "London open"
strategyindicatoralertsince 1.0

on day change:#

Runs at each calendar day boundary.

Example
on day change:
log "New day"
strategyindicatoralertsince 1.0

on render(canvas):#

Custom vector drawing for the visible range.

Example
on render(canvas):
canvas.text("Hello", at: (canvas.last_bar, close))
strategyindicatorsince 1.0

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

Create my free account