I have attached the latest version of the code I've been working on for the ORB price patterns. I am removing the previous versions of this code posted in earlier pages of this post. I do this to prevent others from downloading an outdated version of the code. I appreciate all the feedback on this project and sincerely hope the updated code resolves many of the glitches users have experienced. The settings are easily modified using the parameters window. The code itself contains a section describing changes made during each release. I have included the most recent changes below:
VVVVVVVVVVVVVVVVVV 1.4 VVVVVVVVVVVVVVVVVVVVVVVVV
## Added user selectable stop amount. Stop amount is selected in the
parameters dialog and is used as a multiplier to position the stop loss
in between the breakout and the open. Lower values move the stop loss
closer to the brekout, higher values move the stop loss closer to the
open. Greater than 1 places the stop on the opposite side of the open.
## Fixed a bug in the FirstBOL and First BOL statements which prevented
an entry Signal from being recorded on the opening bar.
##Modified start and end time for market hours so the user can select whether
to adjust for daylight savings. User may chage the date ranges used for the
daylight savings adjustment in the Parameters as well. Your data may not
need to be adjusted for daylight savings so you should check your database
to determine if this parameter should be on or off.
## Cleaned up the code to reduce processor usage.
## Fixed some problems with the way the exploration was calculating the
various levels and recording entries/exits. Also added a third option
in the exploration filter, "OHLC" which can be used to output the daily
O,H,L and C of the current ticker. Very handy for exporting into a spread
sheet, use it to calculate your own price patterns manually.
## Modified various price patterns so they can adjust for shortened
holiday trading days, (mostly used for futures and forex). User can select
whether to filter out holidays or not. Your data may not contain data from
shortened holiday market hours. This is mainly found in Futures and Forex data.
You should examine your data to determine the best seeting to use.
## Added parameter to allow adjustment of the profit target line
## IMPORTANT NOTICE: I used a section of VBScript in order to calculate some
of the time values related to the market open and close times. VBScript host
is required in order to run this AFL, and it is included in Windows 2000 and XP.
I don't know if this is compatible with Windows Vista. More information is
available in the AB help files. Search "AFL Scripting Host" to locate the
Amibroker support information.
Also I have identified the most important setup information:
//required settings:
// Tools --> Preferences | go to Intraday tab and select "START time of interval"
// View --> Intraday --> "Show 24 Hours Trading"
// View --> Intraday --> "Filter Weekends"
Ok, all of these things should explain the changes made and help you understand how to make any adjustments needed to fit your particular market. Please note that many time frames are supported here except for the 7 minute chart.
I would very much like to see this discussion branch off into the many different methods of applying this knowledge. The core setup in the code is to enter on a breakout and exit at some target point. While completing this project and observing daily price action I have noticed another setup which may be very profitable. After an expansion day, WS4 or WS7, it appears to be very likely that breakouts will fail. This may provide an opportunity for a fade at the breakout, as mentioned in Toby Crabel's book. You may experiment with the profit target level, as a potential entry point for fading a breakout after a widespread day. After the fade it appears a very profitable exit point may be as the price returns to the market open, or perhaps for the more advanced, at the opposite breakout level.
If this thread doesn't go in that direction perhaps I will start a new thread specifically for this purpose. One of the things I have planned is to incorporate the swing pivots into a weekly ORB strategy. The goal being to develop a longer time frame trading method with reduced commission expense.
Ok that's all for now. Good Trading everyone.
Dry