This is a trading item or a component that was created using QuantShare by one of our members.
This item can be downloaded and used by QuantShare Trading Software.
Trading items are of different types. There are data downloaders, trading indicators, trading systems, watchlists, composites/indices...
You can use this item and hundreds of others for free by downloading QuantShare.
Top Reasons Why You Should Use QuantShare:
Works with US and international markets (stock, forex, options, futures, ETF...)
Offers you the tools that will help you become a profitable trader
Allows you to implement any trading ideas
Exchange items and ideas with other QuantShare users
Our support team is very responsive and will answer any of your questions
We will implement any features you suggest
Very low price and much more features than the majority of other trading software
A Gap occurs when the price of a stock or any other security moves up or down with few trading in between. Gap Up is defined as a stock price with a today's low that is higher than yesterday's high and the opposite for the Gap Down; stock price with a today's high that is lower than yesterday's low.
There are many reasons that could lead to gaps in a financial asset. Both technical and fundamental factors could make the stock or the financial asset jump leaving gaps behind it. For example, earnings almost always force a stock to gap up or gap down if the company's earnings are much higher or much lower than what traders, investors and analysts expected.
After a gap, the stock price may continue its rally or decline or it may move back to the pre-gap price level. When this happens, we say that the gap has been filled. Most of the time gaps are filled.
This trading indicator signals bars where a gap up has been filled. It also returns the number of days since the last gap up, that is, the number of days that took the stock or security to fill its gap up.
Here is an example of a trading rule that returns a signal if a gap filling occur and if it took the security between 10 and 30 trading bars to fill the gap up:
GapUpFilled() >= 10 and GapUpFilled() <=30
Last Gap Up/Gap Down Price Size is another trading indicator I have shared. It returns the gap up or gap down size, that is, the difference between the high and the low of the gap.
You can use both functions to retrieve the gap size on the bar where the gap has been filled:
iff(GapUpFilled() > 0, ref(GapSize(0), GapUpFilled()), 0)
In order for the above line to work properly, you must make a small change to the GapSize function so it doesn't return a value when a gap down occurs.