MMTMMT Docs
Diagnostics

S022

trigger argument count does not match the alert's payload

S022

A payload-bearing alert is triggered with exactly one value of its declared payload record type; an empty-payload alert is triggered with no argument. Match the declaration.

Failing example

script "conf"

type Move { price: float }

alert moved = alert(payload: Move, title: "Moved")
alert simple = alert(title: "Simple")

data chart = subscribe(data.ohlcv)

on chart.update {
  moved.trigger()
  simple.trigger(1.0)
}

Corrected example

script "fixed"
type Move { price: float }
alert moved = alert(payload: Move, title: "Moved")
data chart = subscribe(data.ohlcv)
on chart.update {
  moved.trigger(Move { price: chart.close ?? 0.0 })
}

On this page