SutraLipi docs grammar v1

Events

Your logic lives inside event blocks. Most strategies use onTick.

onStart { }   // once, before the first tick
onTick  { }   // on every price update — most logic lives here
onStop  { }   // once, when the strategy stops
onTimer { }   // on a timer tick
onTrade { }   // when a trade event fires

Ready to run this? Build and backtest strategies in the SutraLipi algo trading platform — no-code builder, tick-level backtesting and one-click live execution. Browse all documentation topics.

Code copied — paste it into the editor with Ctrl+V.