I built a small indicator for something I check every morning anyway: what did the first couple of bars do.
This is an enabler for research in trading the open – and with this tech and AI you can run a lot of cool ideas.
The code is open-source so you can put it into AI program and then use it on any trading platform.
Click here to find it on TRADINGVIEW

Here’s what it does. From the first bar of the session, it counts consecutive same-colour bars. Set your check window — I run 2 — and once the count hits it, you get a label and the bars colour in. Simple enough on its own. But the part I actually wanted was underneath it: the spike size.
Two spike measurements, both automatic:
- Consecutive Spike — the combined high/low range of the first two bars of the session. Every day, whether or not a CSC actually fires. That’s your baseline.
- Total Spike — the full range of however long the run goes — three bars, five bars, whatever — printed once the streak finally breaks. Not capped at the check window. If the market opens and just keeps going in one direction for six bars, Total Spike captures all six.
Both numbers, plus the CSC bar type, are in the Data Window. So if you want to log them, export them, run your own study on spike size versus what happens for the rest of the day — the numbers are sitting there for you to pull.
How to Use?
- Try it on 5 min spikes to see how it impacts the day
- Try it on 15 min spikes as well
- I like to use it on 60 min spikes, post coming soon.






Leave a comment