| The Candlestick Corner All about candlesticks. Moderated by brownsfan019. |
![]() | | Tweet | |
| | #25 | ||
![]() | Re: Building a GAP Trading Strategy Quote:
| ||
| |
|
| | #26 | ||
![]() | Re: Building a GAP Trading Strategy 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; | ||
| |
|
| The Following 2 Users Say Thank You to DaveDM For This Useful Post: | ||
Tams (06-03-2009), windsurfer (06-03-2009) | ||
| | #27 | ||
![]() | Re: Building a GAP Trading Strategy regards kevin Last edited by Soultrader; 06-03-2009 at 05:57 AM. Reason: email postings not allowed | ||
| |
|
| | #28 | ||
![]() | Re: Building a GAP Trading Strategy Quote:
thanks | ||
| |
|
| | #29 | ||
![]() | Re: Building a GAP Trading Strategy Quote:
Webcasts Details I know nothing about him or his services, just passing on the info. | ||
| |
|
| | #30 | ||
![]() | Re: Building a GAP Trading Strategy | ||
| |
|
| | #31 | ||
![]() Join Date: Mar 2008 Location: USA Posts: 401 Thanks: 112
Thanked 343 Times in 120 Posts
Blog Entries: 2 | Re: Building a GAP Trading Strategy Quote:
| ||
| |
|
| The Following User Says Thank You to atto For This Useful Post: | ||
jmiranda (07-02-2009) | ||
| | #32 | ||
![]() | Re: Building a GAP Trading Strategy Quote:
| ||
| |
|
![]() |
| Thread Tools | Search this Thread |
| 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 |