September 1, 2011
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; SetTradeDelays( 0, 0, 0, 0 ); SetOption( "AllowSameBarExit", True ); SetOption( "maxopenpositions", Qty ); GapAmount = Param( "Gap (%)", 1.5, 0, 3, 0.01 ); BuyPrice = ( 1 - GapAmount / 100 ) * Ref( L, -1 ); BuyPrice = Min( O, BuyPrice ); // Enter immediately at Open if below BuyPrice Buy = L < BuyPrice AND Ref( MA( V, 10 ), -1 ) > 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", 0 ) ) { Optimize( "Dummy", 1, 1, 100, 1 ); PositionScore = mtRandom(); } PositionSize = -100 / Qty; Plot( C, "", 1, 128 ); if ( ParamToggle( "Arrows", "HIDE|SHOW", 0 ) ) { Equity( 1 ); PlotShapes( IIf( Buy, shapeUpArrow, shapeNone ), colorGreen, 0, BuyPrice ); PlotShapes( IIf( Sell, shapeDownArrow, shapeNone ), colorRed, 0, SellPrice ); PlotShapes( IIf( Buy, shapeSmallCircle, shapeNone ), colorGreen, 0, BuyPrice, 0 ); PlotShapes( IIf( Sell, shapeSmallCircle, shapeNone ), colorRed, 0, SellPrice, 0 ); }
Filed by Herman at 6:53 pm under Ideas (Experimental)
Comments Off on A Long-only EOD Gap trading idea