Skip to content

DSL Events

Events define robot lifecycle blocks.

onBar

Runs after historical candles are loaded and for bar-based execution.

onBar {
  if close > close[1] {
    signal = 1
  }
}

onTick

Runs on each live quote event.

onTick {
  if ask > 0 {
    signal = 1
  }
}

Reserved Events

The following events are reserved for lifecycle support:

  • onInit
  • onStop