{"id":1016,"date":"2007-08-19T13:49:24","date_gmt":"2007-08-19T13:49:24","guid":{"rendered":"http:\/\/www.amibroker.org\/userkb\/2007\/08\/19\/kiss-001-gap-trading\/"},"modified":"2011-06-21T12:38:12","modified_gmt":"2011-06-21T12:38:12","slug":"kiss-001-gap-trading","status":"publish","type":"post","link":"http:\/\/www.amibroker.org\/editable_userkb\/2007\/08\/19\/kiss-001-gap-trading\/","title":{"rendered":"KISS-001: Intraday Gap Trading"},"content":{"rendered":"
This is the first in a series off KISS (keep it simple, stupid) trading ideas for you to play with. All system ideas presented here are unproven, unfinished, and may contain errors. They are intended to show possible patterns for further exploration. As always, you are invited to make comments and\/or add your own ideas to this series.<\/p>\n
I prefer real-time systems that trade fast, are automated, and are devoid of traditional indicators. Preferably, they should have no optimizable parameters; however, I may not always be able to meet this objective. Not all systems will be \u2018that\u2019 simple; there will be some that use simple averaging or HHV\/LLV type functions. The first system shown below is a copy of the demo system<\/a> I use to develop Trade-Automation routines elsewhere on this site.<\/p>\n Real-Time Gap-Trading<\/strong>. Backtesting this on the NASDAQ-100 watchlist (individual backtests, 15 min. Periodicity) gives the profits shown below for the period of 1 MAR 2007 to 17 AUG 2007. Ticker names are omitted to keep the chart compact; the chart simply shows a net profit bar for each ticker tested. Average exposure for this system is about 15%; hence, you may be able to trade portfolios to increase profits and smooth the equity curves. Be cautioned that in its raw form the drawdowns are unacceptable and that there may be volume restrictions for many tickers.<\/p>\n
\nTo see how this works, you should Backtest it on 1-minute data with a periodicity in the range of 5-60 minutes. Your first impression may be that these profits are simply due to an up market, however, the fact that Long and Short profits are about equal suggests there is more to it. Because 98% of all trades fall between 9:30 AM and 10:30 AM, this type of system is nice if you just want to trade a short time each day. This reduces risk with respect to market exposure and gives you more time to enjoy other activities.<\/p>\nSetOption<\/span>(<\/span>"CommissionMode"<\/span>,<\/span>3<\/span>);\r<\/span>SetOption<\/span>(<\/span>"CommissionAmount"<\/span>, <\/span>0.005<\/span>);\r<\/span>SetTradeDelays<\/span>(<\/span>0<\/span>,<\/span>0<\/span>,<\/span>0<\/span>,<\/span>0<\/span>);\r<\/span>Buy <\/span>= <\/span>O <\/span>< <\/span>Ref<\/span>(<\/span>L<\/span>,-<\/span>1<\/span>);\r<\/span>BuyPrice <\/span>= <\/span>O<\/span>;\r<\/span>Sell <\/span>= <\/span>L <\/span>< <\/span>Ref<\/span>(<\/span>L<\/span>,-<\/span>1<\/span>);\r<\/span>SellPrice <\/span>= <\/span>C<\/span>;\r<\/span>Short <\/span>= <\/span>O <\/span>> <\/span>Ref<\/span>(<\/span>H<\/span>,-<\/span>1<\/span>);\r<\/span>ShortPrice <\/span>= <\/span>O<\/span>;\r<\/span>Cover <\/span>= <\/span>H <\/span>> <\/span>Ref<\/span>(<\/span>H<\/span>,-<\/span>1<\/span>);\r<\/span>CoverPrice <\/span>= <\/span>C<\/span>;\r<\/span>E<\/span>=<\/span>Equity<\/span>(<\/span>1<\/span>);\r<\/span>Plot<\/span>(<\/span>C<\/span>,<\/span>""<\/span>,<\/span>1<\/span>,<\/span>128<\/span>);\rif( <\/span>PlotTriangles <\/span>= <\/span>ParamToggle<\/span>(<\/span>"Triangles"<\/span>,<\/span>"HIDE|SHOW"<\/span>,<\/span>1<\/span>) )\r{\r<\/span>PlotShapes<\/span>(<\/span>IIf<\/span>(<\/span>Buy<\/span>, <\/span>shapeSmallUpTriangle<\/span>, <\/span>shapeNone<\/span>),<\/span>5<\/span>,<\/span>0<\/span>,<\/span>BuyPrice<\/span>,<\/span>0<\/span>);\r<\/span>PlotShapes<\/span>(<\/span>IIf<\/span>(<\/span>Sell<\/span>, <\/span>shapeHollowDownTriangle<\/span>, <\/span>shapeNone<\/span>),<\/span>4<\/span>,<\/span>0<\/span>,<\/span>SellPrice<\/span>,<\/span>0<\/span>);\r<\/span>PlotShapes<\/span>(<\/span>IIf<\/span>(<\/span>Cover<\/span>, <\/span>shapeHollowUpTriangle<\/span>, <\/span>shapeNone<\/span>),<\/span>5<\/span>,<\/span>0<\/span>,<\/span>CoverPrice<\/span>,<\/span>0<\/span>);\r<\/span>PlotShapes<\/span>(<\/span>IIf<\/span>(<\/span>Short<\/span>, <\/span>shapeSmallDownTriangle<\/span>, <\/span>shapeNone<\/span>),<\/span>4<\/span>,<\/span>0<\/span>,<\/span>ShortPrice<\/span>,<\/span>0<\/span>);\r}<\/span><\/pre>\n