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}"
Watch it run · EURUSD · 1h bars
alert sent

Sample data. Not a result. The real AlgoBarsX engine ran this exact script on made-up bars, and this replays what it drew and did. It shows no profit or loss, and it says nothing about how the script would do in a real market.

Replay of this script on 150 sample bars: 10 alerts sent.

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