A cBot lifecycle method called once for each new bar/candle on the attached chart. According to the docs, “OnBar()… is triggered only when a new bar is drawn on the chart…”. Use OnBar()
to run logic at bar close (one bar per timeframe). This contrasts with OnTick()
, which fires on every tick.