Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

N57H

Gaps Test

Recommended Posts

Hi,

 

I'm trying to create a log file that will check the number of filled gaps and non filed gaps. The gap as % from yesterday range.

 

If anyone can help me with the code, it will be great.

 

The rational of this method is from Dr. steenberger blog

 

" Do Opening Gaps Tend to Fill?

The difference between the market's opening price and its previous day's close forms a gap on a bar chart. Does this gap tend to fill in during the next day's price action? That is, when we open with a gap lower or higher, do prices subsequently move back to the prior day's close?

 

For this investigation, I measured gaps as a function of the previous day's high-low range. This measures the gap relative to the prior day's volatility. Thus, an opening gap of two points that follows a day with a range of six points is measured as a 33% gap. The same opening gap of two points that follows a day with a range of ten points is measured as a 20% gap.

 

Assessed in this manner, we find that the average opening gap is 27% of the previous day's range going back to May, 2003 (N = 897 trading days) in the S&P 500 Index (SPY). That provides us with a benchmark for defining relatively large and relatively small gaps.

 

When upside gaps exceed 40% of the prior day's range (N = 99), 46 of them fail to close during the day session. When downside gaps exceed 40% of the previous day's range (N = 81), 40 of them go unfilled. Bottom line: approximately half of all large opening gaps don't fill during that coming day's action."

 

 

 

// Gap Test

// version: beta 0.1

// author: noam

// Date: 20090721

// License: public use

//

// Description: This program screens the gap size as a % from yesterday range and check the % of filled gaps, non filled gaps as a function of the gap size.

 

 

input:

start.date(19620102);

 

var:

YesterdayRange (0),

gapsize (0);

 

YesterdayRange=high[1]-low[1]

GapSize= Topen-Yclose/YesterdayRange*100

 

 

 

 

if date > start.date - 19000000 then

begin

 

if then

print(numtostr(date+19000000,0) + " gap filled=" + NumToStr(r3,2));

 

 

 

end;

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.