Mind the Gap – and watch your profits soar
Gaps are said to be filled when price quickly runs out of steam and retraces back to fill the prices that were skipped by the gap.
- Breakaway: usually occur at the start of a trend
- Runaway / Measuring: occur in the middle of a strong trend, allowing for price projection
- Exhaustion: occur at the end of a trend
- Opening: when the open of a bar is outside the range of the previous bar
Before, the way to show gaps was by using a simple script in a watchlist or chart using a simple formula:
Gap Up: LOW() > HIGH()[1];
Gap Down: HIGH() < LOW()[1]
In this example, two green breakaway gaps last November identified the start of a new trend in CSCO, which filled three previous gaps down (in red), the first of which occurred back in July 2019:
Using the Gap Finder in Scripting
The GAP() function in scripting has four output values, allowing you to search for any conditions:
GapAbove – Price of the beginning of the next gap zone above.
GapBelow – Price of the beginning of the next gap below.
GapAboveSize – the width of the zone above (in $).
GapBelowSize – the width of the zone below (in $).
For example, to show how far in percent the current price action is above a gap below – based on a 0.5% gap – you would use this:
1 2 3 4 |
G1=GAP(MINSIZE=0.50); (CLOSE() - G1.GapBelow) / G1.GapBelow *100 |
Microsoft is currently 4.1% above the partially-filled recent gap, and moving away:
Share Link

Darren Hawkins, MSTA
Senior Software Specialist at Optuma
0 Comments