Cryptorobot.ai

Math Operators

Index of Highest Value (Bars Since High) (MAXINDEX)

Index of highest value over a specified period

Deep Dive

Everything You Need to Know

Under the Hood

How It Works

MAXINDEX returns the number of bars ago (index) where the highest value occurred within the lookback period (default 30). Instead of returning the maximum value like MAX, it returns how long ago that maximum was reached. Output of 0 means the current bar is the high; output of 15 means the high was 15 bars ago. This quantifies recency of highs.

In Practice

How Traders Use It

Traders use MAXINDEX to measure time since recent high, useful for detecting momentum fading or consolidation periods. When MAXINDEX increases, price is moving further from recent highs (potential weakening). When MAXINDEX = 0, price just reached a new period high (potential breakout). MAXINDEX is valuable for regime detection and timing entry after pullbacks from highs.

Highlights

MAXINDEX at a Glance

  • Returns bars since highest value
  • 0 = current bar is period high
  • Higher values = time since high
  • Default 30-period lookback
  • Measures recency of peak prices
  • Useful for momentum and consolidation detection

Related

More Math Operators

Get Started

Automate MAXINDEX with Cryptorobot.ai

Build automated strategies using Index of Highest Value (Bars Since High) and hundreds of other indicators. Connect to your favourite exchange and let the bot execute trades 24/7 — no code required.

FAQ

Frequently Asked Questions

What is the Index of Highest Value (Bars Since High) (MAXINDEX) indicator?

Index of highest value over a specified period

How does MAXINDEX work?

MAXINDEX returns the number of bars ago (index) where the highest value occurred within the lookback period (default 30). Instead of returning the maximum value like MAX, it returns how long ago that maximum was reached. Output of 0 means the current bar is the high; output of 15 means the high was 15 bars ago. This quantifies recency of highs.

How do traders use MAXINDEX in their strategies?

Traders use MAXINDEX to measure time since recent high, useful for detecting momentum fading or consolidation periods. When MAXINDEX increases, price is moving further from recent highs (potential weakening). When MAXINDEX = 0, price just reached a new period high (potential breakout). MAXINDEX is valuable for regime detection and timing entry after pullbacks from highs.

What are the key points to know about MAXINDEX?

Returns bars since highest value 0 = current bar is period high Higher values = time since high Default 30-period lookback Measures recency of peak prices Useful for momentum and consolidation detection

Can I use MAXINDEX with Cryptorobot.ai?

Yes. Index of Highest Value (Bars Since High) (MAXINDEX) is available as a built-in indicator in Cryptorobot.ai. You can add it to any automated strategy using the no-code strategy builder, backtest it against historical data, and deploy it live on supported exchanges.