I was playing around this morning to try and test the "fade the gap" theory, which is supposed to be one of the easiest plays on the ES. A Strategy to test trading gaps +/- 2 points is attached. It prints results to the output window.
For 2010, I have 48 gap up days and 27 gap down days so far.
The rules in my code are pretty basic. Fade the gap with a stop equal to the gap, and the gap is the target. It is not 100% accurate as I'm using basic OHLC logic, but errs on the side of caution.
8 of the 48 gap up days were profitable.
27 of the 27 gap down days were profitable.
Have a look, have a play, and let's see if we can quantify and code one of the oldest, most widely published trades. If you spot any logic errors, please point them out.
Here is the guts:
protected override void OnBarUpdate()
{
gap = Open[0]-Close[1] ;
if (gap >= 2)
{
upCounter ++;
if ((Open[0]-gap) > Low[0] && (Open[0]+ gap