Intrabar spike

Intrabar spike is an alert that checks every 1 hour and fires at most once per bar.

inside the bar

intrabar-spike.abx
1alert "Intrabar spike"
2check: every 1h
3repeat: once per bar close
4
5inner = intrabar(bars: 1m)
6spike = inner.high.max() - inner.low.min()
7
8when inner.len > 0 and spike > atr(14) * 1.5:
9notify "Minute-level spike of {spike:0.00} inside the hour on {market.symbol}"
What this script says

Intrabar spike is an alert that checks every 1 hour and fires at most once per bar.

It calculates inner as the bars inside this bar (bars 1 minute) and spike as inner.high.max() minus inner.low.min().

When the number of inner is above 0 and spike is above 1.5 × the 14-bar ATR, it sends the notification "Minute-level spike of {spike:0.00} inside the hour on {market.symbol}".

Try this in the Terminal. AlgoBars is free: $0 a month, no card needed.

Create my free account