๐Ÿš€ v1.1.0 Released โ€” Performance, Metrics & Strategy API Improvements

Hi everyone :waving_hand:
Iโ€™ve just released v1.1.0, and this update focuses on performance improvements, better reporting, and a cleaner, more powerful strategy API.

Below is a summary of whatโ€™s new and why these changes were made.
I also recommend you to check docs for Strategy API


:high_voltage: Performance improvements

  • Internal execution and reporting have been optimized
  • Backtests with large datasets are faster and more consistent
  • Metrics are now calculated incrementally instead of post-processed

:bar_chart: Metrics are now available inside strategies

Strategy scripts can now directly access performance metrics via the metrics object:

metrics.roi
metrics.pnl
metrics.equity
metrics.maxDrawdownPercentage

This makes it possible to:

  • react to performance during execution
  • implement risk limits (e.g. stop after drawdown)
  • build adaptive strategies based on results

:package: Positions & trades model finalized

The trading state is now clearly separated:

  • Positions โ†’ bought base waiting to be sold (unrealized PnL)
  • Trades โ†’ closed positions with realized PnL

You can access them via:

trader.positions
trader.trades.last(10)

This makes strategy logic and reporting much easier to reason about.


:bell: New orderStatus hook

A new hook has been added:

trader.addHook("orderStatus", (order) => {
  // fires on every order update
});

This hook runs on:

  • partial fills
  • full fills
  • cancellations
  • any order status change

Itโ€™s the recommended place to track fills, manage positions, and react to order lifecycle events.


:sparkles: Cleaner helper naming (crossUp, crossDown, crossAny)

Cross helpers are now camelCase for readability and consistency:

ta.crossUp(a, b)
ta.crossDown(a, b)
ta.crossAny(a, b)

This matches the rest of the Strategy API naming


:compass: ind.ref() โ€” explicit indicator output references

Multi-output indicators (like BBANDS or MACD) now use an explicit reference system:

ind.ref('bbands', 'lower')
ind.ref('macd', 'signal')

This is especially useful with helpers like crossUp:

if (ta.crossUp(
  ind.ref('macd', 'macd'),
  ind.ref('macd', 'signal')
)) {
  await order.buy();
}

Why we dropped bbands.lower dot notation

Previously, dot notation was used to select indicator outputs (bbands.lower).
This worked, but it caused ambiguity and made it harder to:

  • distinguish values vs references
  • support helpers like crossUp reliably
  • extend the API safely in the future
  • keep visual scripting and code-based strategies consistent

ind.ref(name, output) makes intent explicit, avoids hidden parsing rules, and provides a much more robust foundation going forward.

Note: Visual scripting still shows user-friendly selectors (e.g. BBANDS > Lower) and compiles them automatically โ€” no extra work needed.


:folded_hands: Thanks

If you have questions or spot anything unexpected, feel free to reply here.

Happy trading :rocket: