A Long-only EOD Gap trading idea

This idea was posted ( #161332 ) on the main AmiBroker list on July 3, 2011. There were numerous excellent comments on the list and if you are interested in working on this system you do well to read them all before starting. After posting I found a number of posts on the web discussing this trading idea, some claimed to be trading a similar system with good success.

I referred to this system a “Gap Trading” system but this may be a bit of a misnomer, “Mean reversion” might be a better classification. Googling for it will get you many more hits to similar systems. Here are a few links:

NDX100: Trading intraday mean reversion using limit orders
Trading intraday mean reversion using limit orders – does it work?

It appears to be a fairly widely discussed trading idea and I suggest you’ll do some Googling on your own to learn the latest. As an Amibroker user you have better tools than most traders and you have a better chance than most to come up with a variation that works. Perhaps with a little less profits, and with a significant amount of additional code — it won’t be a “quicky” project :-)

Some people commented that this system will not work in real trading, while they may be right others say schemes like this work. I didn’t finish the system and can’t claim to know whether it is tradable or not.

The system Buys at a certain percentage below yesterday’s Low, on a LMT order, and exits in the same day at the Close.

Short Cover 0;
Qty 6;
SetTradeDelays000);
SetOption"AllowSameBarExit"True );
SetOption"maxopenpositions"Qty );

GapAmount Param"Gap (%)"1.5030.01 );
BuyPrice = ( GapAmount 100 ) * RefL, -);
BuyPrice MinOBuyPrice ); // Enter immediately at Open if below BuyPrice
Buy BuyPrice AND RefMAV10 ), -) > 1000000;
SellPrice C;
Sell Buy;

// To test for ticker-sensitivity turn on Random Ticker Selection
// and run this code in the Optimizer to see how performance varies
// Because it is unknown which ticker will trigger first actual
// performance will be somewhere between the min/max profits shown

if ( ParamToggle"Random Ticker Selection""OFF|ON") )
{
    Optimize"Dummy"11100);
    PositionScore mtRandom();
}

PositionSize = -100 Qty;

PlotC""1128 );

if ( ParamToggle"Arrows""HIDE|SHOW") )
{
    Equity);
    PlotShapesIIfBuyshapeUpArrowshapeNone ), colorGreen0BuyPrice );
    PlotShapesIIfSellshapeDownArrowshapeNone ), colorRed0SellPrice );
    PlotShapesIIfBuyshapeSmallCircleshapeNone ), colorGreen0BuyPrice);
    PlotShapesIIfSellshapeSmallCircleshapeNone ), colorRed0SellPrice);
}