Welcome to the Traders Laboratory Forums.
The Candlestick Corner All about candlesticks. Moderated by brownsfan019.

Reply
Old 06-02-2009, 11:56 AM   #25

brownsfan019's Avatar

Join Date: Jan 2007
Location: USA
Posts: 4,256
Ignore this user

Thanks: 1,912
Thanked 1,775 Times in 892 Posts



Re: Building a GAP Trading Strategy

Quote:
Originally Posted by BlowFish »
The book didn't arrive in time for my weekend away, however the free info (linked in the other thread) has a wealth of information. I don't know why but I thought you had ordered the book too?

He pretty much does what you have mentioned and that is look for strength or weakness in the first couple of bars/candles after the gap. He doesn't make any assumption on direction (fill or further move in the gap direction) but his observation is that gaps often lead to strong trends so he gets ready for that eventuality.
BF - I got it, but haven't opened it yet. Was planning to until I got hit w/ some bug that just shut me down for a good part of the week.
brownsfan019 is offline  
Reply With Quote
Old 06-03-2009, 02:01 AM   #26

Join Date: Apr 2008
Location: Stoney Creek
Posts: 10
Ignore this user

Thanks: 1
Thanked 3 Times in 2 Posts



Re: Building a GAP Trading Strategy

I wrote some code awhile back for TradeStation as a starting point to a gap strategy, I'll post it here. If you run backtesting on it you'll soon realize that it doesn't make sense to risk real money trading it. However -- I haven't given up on it yet. I'm thinking about ways to filter out the entries so that you enter the trade under ideal conditions.

Those conditions could include using some type of trend determination filter such as Heikin Ashi, Momentum, Buying/Selling pressure etc.

If / when I come up with a decent solution I'll be happy to post the conclusion. In the meantime, feel free to play with the code if it helps.

DaveDM

----- Place the following in two separate Strategy documents in EasyLanguage, one for Gap Up and one for Gap Down...


// Gap Up Strategy

inputs:
Percent_Fill(.75), // 1 = 100%
Min_Gap_Size_Points(20), // 1 = 1 YM point
Max_Gap_Size_Points(101), // 1 = 1 YM point
Total_Contracts(1),
Take_Position_Start(935),
Exit_Positions_Time(1550) ,
Risk_Reward_Ratio(1.00);

variables:

mp(0),
Trade_Count(0),
Min_Gap_Per_Short(0),
Max_Gap_Per_Short(0),
Min_Short_Entry(0),
Max_Short_Entry(0),
Target_Short(0),
P_Close(0),
P_Open(0),
Gap_Size(0),
Stop_Price(0);

mp = marketposition;


// Gap Open, Direction Short

If time = Take_Position_Start then begin
if Trade_Count < 1 then begin
P_Close = CloseD(1);
// find bar number to reference for opening price of today
Value1 = FindBar(Date, Take_Position_Start);
P_Open = Open[Value1]; // Open price after Take_Position_Start time
Min_Short_Entry = P_Close + Min_Gap_Size_Points;
Max_Short_Entry = P_Close + Max_Gap_Size_Points;
Target_Short = P_Open - ((P_Open - P_Close) * Percent_Fill);
Stop_Price = P_Open + ((P_Open - P_Close) * Risk_Reward_Ratio);

if P_Open > P_Close then begin // Close[2]
if P_Open >= Min_Short_Entry then begin
if P_Open <= Max_Short_Entry then begin
sellshort ("SHORT") Total_Contracts contracts this bar;
Trade_Count = 1;
end;
end;
end;
end;
end;

// Short Exit
if mp = -1 then begin
if low <= Target_Short then begin // low
buytocover ("Target_Short_GU") next bar at market; // * or use limit order
// resets
Trade_Count = 0;
P_Open = 0;
P_Close = 0;
Min_Gap_Per_Short = 0;
Min_Short_Entry = 0;
Target_Short = 0;
mp = 0;
Value1 = 0;
Value2 = 0;
Value3 = 0;
Max_Gap_Per_Short = 0;
Max_Short_Entry = 0;
Target_Short = 0;
Stop_Price = 0;
end;
end;

// Stop Loss
if mp = -1 then begin
if high >= Stop_Price then begin
buytocover ("Stop_Loss_Ouch!_GU") next bar Stop_Price stop;
// resets
Trade_Count = 0;
P_Open = 0;
P_Close = 0;
Min_Gap_Per_Short = 0;
Min_Short_Entry = 0;
Target_Short = 0;
mp = 0;
Value1 = 0;
Value2 = 0;
Value3 = 0;
Max_Gap_Per_Short = 0;
Max_Short_Entry = 0;
Target_Short = 0;
Stop_Price = 0;
end;
end;

// Timed Exit since IntraDay trade only, exit all trades before market close
if mp = -1 and time >= Exit_Positions_Time then begin;
buytocover ("CLOSE_TIME") this bar;
// resets
Trade_Count = 0;
P_Open = 0;
P_Close = 0;
Min_Gap_Per_Short = 0;
Min_Short_Entry = 0;
Target_Short = 0;
mp = 0;
Value1 = 0;
Value2 = 0;
Value3 = 0;
Max_Gap_Per_Short = 0;
Max_Short_Entry = 0;
Target_Short = 0;
Stop_Price = 0;
end;

---- ^ that was the end of the gap up strategy. Place the following in a separate EasyLanguage strategy file for Gap Down.


// Gap Down Strategy

inputs:
Percent_Fill(.75), // 1 = 100%
Min_Gap_Size_Points(20), // 1 = 1 YM point
Max_Gap_Size_Points(101), // 1 = 1 YM point
Total_Contracts(1),
Take_Position_Start(935),
Exit_Positions_Time(1550) ,
Risk_Reward_Ratio(1.00);

variables:

mp(0),
Trade_Count(0),
Min_Gap_Per_Long(0),
Max_Gap_Per_Long(0),
Min_Long_Entry(0),
Max_Long_Entry(0),
Target_Long(0),
P_Close(0),
P_Open(0),
Gap_Size(0),
Stop_Price(0);

mp = marketposition;


// Gap Down, Direction Long

If time = Take_Position_Start then begin
if Trade_Count < 1 then begin
P_Close = CloseD(1);
// find bar number to reference for opening price of today
Value1 = FindBar(Date, Take_Position_Start);
P_Open = Open[Value1]; // Open price after Take_Position_Start time
Min_Long_Entry = P_Close - Min_Gap_Size_Points;
Max_Long_Entry = P_Close - Max_Gap_Size_Points;
Target_Long = P_Open + ((P_Close - P_Open) * Percent_Fill);
Stop_Price = P_Open - ((P_Close - P_Open) * Risk_Reward_Ratio);

if P_Open < P_Close then begin
if P_Open <= Min_Long_Entry then begin
if P_Open >= Max_Long_Entry then begin
buy ("LONG_ON_GD") Total_Contracts contracts this bar;
Trade_Count = 1;
end;
end;
end;
end;
end;

// Long Exit
if mp = 1 then begin
if high >= Target_Long then begin // high
sell ("Target_Long_GD") next bar at market; // * or use limit order
// resets
Trade_Count = 0;
P_Open = 0;
P_Close = 0;
Min_Gap_Per_Long = 0;
Min_Long_Entry = 0;
Target_Long = 0;
mp = 0;
Value1 = 0;
Value2 = 0;
Value3 = 0;
Max_Gap_Per_Long = 0;
Max_Long_Entry = 0;
Target_Long = 0;
Stop_Price = 0;
end;
end;

// Stop Loss
if mp = 1 then begin
if low <= Stop_Price then begin
sell ("Stop_Loss_Ouch!_GD") next bar Stop_Price stop;
// resets
Trade_Count = 0;
P_Open = 0;
P_Close = 0;
Min_Gap_Per_Long = 0;
Min_Long_Entry = 0;
Target_Long = 0;
mp = 0;
Value1 = 0;
Value2 = 0;
Value3 = 0;
Max_Gap_Per_Long = 0;
Max_Long_Entry = 0;
Target_Long = 0;
Stop_Price = 0;
end;
end;

// Timed Exit since IntraDay trade only, exit all trades before market close
if mp = 1 and time >= Exit_Positions_Time then begin;
sell ("CLOSE_TIME_GAP_DOWN" ) this bar;
// resets
Trade_Count = 0;
P_Open = 0;
P_Close = 0;
Min_Gap_Per_Long = 0;
Min_Long_Entry = 0;
Target_Long = 0;
mp = 0;
Value1 = 0;
Value2 = 0;
Value3 = 0;
Max_Gap_Per_Long = 0;
Max_Long_Entry = 0;
Target_Long = 0;
Stop_Price = 0;
end;
DaveDM is offline  
Reply With Quote
The Following 2 Users Say Thank You to DaveDM For This Useful Post:
Tams (06-03-2009), windsurfer (06-03-2009)
Old 06-03-2009, 02:56 AM   #27

Join Date: Mar 2009
Location: Melbourne
Posts: 1
Ignore this user

Thanks: 0
Thanked 0 Times in 0 Posts



Re: Building a GAP Trading Strategy

We have done extensive gap trading testing over the SPI200 index futures. Please feel free to contact me for a copy of the test results.

regards
kevin

Last edited by Soultrader; 06-03-2009 at 05:57 AM. Reason: email postings not allowed
ksaunders71 is offline  
Reply With Quote
Old 06-03-2009, 12:37 PM   #28

brownsfan019's Avatar

Join Date: Jan 2007
Location: USA
Posts: 4,256
Ignore this user

Thanks: 1,912
Thanked 1,775 Times in 892 Posts



Re: Building a GAP Trading Strategy

Quote:
Originally Posted by ksaunders71 »
We have done extensive gap trading testing over the SPI200 index futures. Please feel free to contact me for a copy of the test results.

regards
kevin
Go ahead and post here Kevin - you can upload a wide variety of attachments to the forum. No need for personal emails to be sent.

thanks
brownsfan019 is offline  
Reply With Quote
Old 06-03-2009, 03:26 PM   #29

Join Date: Mar 2008
Location: UK
Posts: 25
Ignore this user

Thanks: 5
Thanked 0 Times in 0 Posts



Re: Building a GAP Trading Strategy

Quote:
Originally Posted by simterann22 »
Check out masterthegap.com

I subscribed to Scott Andrews' service for a couple of months. He uses statistical data to trade the opening gap everyday in the eminis.....plus pivot points etc. He does a pretty good job of it. I stopped subscribing because I wasn't trading futures at the time....now I am...so I'll probably subscribe again.
He put out a book called "Understanding Gaps" which is useful
FWIW, I just got an email advertising a free webinar he is doing tomorrow.

Webcasts Details

I know nothing about him or his services, just passing on the info.
NoSquigglyLines is offline  
Reply With Quote
Old 06-03-2009, 05:04 PM   #30

Join Date: May 2009
Location: Little Rock
Posts: 3
Ignore this user

Thanks: 0
Thanked 2 Times in 1 Post



Re: Building a GAP Trading Strategy

I just started subscribing to the auto-trading program here thegapfill.com. He has back-tested results posted, and daily video of trades for the last month or so. Just started with it, so we will see how it goes.
dancorcal is offline  
Reply With Quote
Old 06-03-2009, 05:34 PM   #31

atto's Avatar

Join Date: Mar 2008
Location: USA
Posts: 401
Ignore this user

Thanks: 112
Thanked 343 Times in 120 Posts
Blog Entries: 2



Re: Building a GAP Trading Strategy

Quote:
Originally Posted by dancorcal »
I found this somewhere, and thought it could be useful. It states the half gap fill is 80% winner. Of course you will still need correct money management (i.e. position size, stop loss) to make it profitable.
If anyone's going to take a statistical approach to this, make sure you use ample data. The xls attached on the quoted post uses a fairly small sample size. You may come to incorrect or statistically insignificant conclusions with not enough data. Also, the stats analyzed on the xls deal with specific day biases, which from my testing, are not as reliable or exploitable than biases rooted in market conditions (such as technical analysis, etc). It's a good start, but don't fool yourself with faulty statistics.
atto is offline  
Reply With Quote
The Following User Says Thank You to atto For This Useful Post:
jmiranda (07-02-2009)
Old 06-03-2009, 05:48 PM   #32

Join Date: May 2009
Location: Little Rock
Posts: 3
Ignore this user

Thanks: 0
Thanked 2 Times in 1 Post



Re: Building a GAP Trading Strategy

Quote:
Originally Posted by atto »
If anyone's going to take a statistical approach to this, make sure you use ample data. The xls attached on the quoted post uses a fairly small sample size. You may come to incorrect or statistically insignificant conclusions with not enough data. Also, the stats analyzed on the xls deal with specific day biases, which from my testing, are not as reliable or exploitable than biases rooted in market conditions (such as technical analysis, etc). It's a good start, but don't fool yourself with faulty statistics.
I totally agree with what you are saying. I didn't put together the data, it could be totally bogus. I'm just wondering how you were able to determine the sample size? I also agree with you that technical analysis should be more valuable than specific day biases, though the fact that Monday has the lowest probability for a gap fill makes logical sense to me, and I think is valuable to know, and should be included in the overall analysis of the trade. The "special days" again should be included as statistically they do appear to have an effect.
dancorcal is offline  
Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Looking for Position Trading Strategy chris Forex Trading Laboratory 8 10-27-2011 09:12 AM
Trading Strategy cowboy_town Beginners Forum 2 11-22-2008 10:55 AM
Building Your E-mini Trading Strategy CME Group Knowledge Trading Center 1 08-07-2008 11:12 PM
ER2 Trading Strategy Question Soultrader E-mini Futures Trading Laboratory 24 02-25-2007 09:33 PM

All times are GMT -4. The time now is 01:43 AM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.