hi Pete,
the code I posted does not require you to set the
trading hours. I just use the setting 24 hours trading (no filtering). Still by
using the code I posted you can filter out the High, Low and Close out
yourself.
Below I post a little additional code where I plot
the Daily Close (prior day close price) and the Daily MA,
regards, Ed
SetBarsRequired(-2,-2);
starttime = 093000; //
true exchange opening time endtime = 160000; //
true exchange closing time
timecond = TimeNum() >= starttime AND TimeNum() <= endtime;
firstBarOfDay =
TimeNum() >= starttime ;
firstBarOfDay = firstBarOfDay - Ref(firstBarOfDay,-1); lastBarOfDay = TimeNum() >= endtime; lastBarOfDay = lastBarOfDay -
Ref(lastBarOfDay,-1);
// or use deDateTime.dll
plugin, slight different results //firstBarOfDay = deFlagFirstBarOfDay( starttime
); //lastBarOfDay =
deFlagLastBarOfDay( endtime);
myHigh = ValueWhen( timecond, HighestSince( firstBarOfDay,
High) ); myLow =
ValueWhen( timecond,
LowestSince(
firstBarOfDay, Low) ); myClose =
ValueWhen(lastBarOfDay,C);
DH = TimeFrameCompress(myHigh, inDaily, compressLast); DL = TimeFrameCompress(myLow, inDaily, compressLast); DC = TimeFrameCompress(myClose, inDaily, compressLast);
DH = Ref(DH,-1); DL = Ref(DL,-1); DC = Ref(DC,-1); MA_DAILY = MA(DC,10);
YHigh =
TimeFrameExpand( DH,
inDaily,
expandFirst ); YLow = TimeFrameExpand( DL, inDaily, expandFirst ); YClose =
TimeFrameExpand( DC,
inDaily,
expandFirst ); MA_DAILY =
TimeFrameExpand( MA_DAILY,
inDaily,
expandFirst );
GraphXSpace = 5; SetChartOptions(0,
chartShowDates); Plot(C,"\nC",colorWhite,64);
Plot(YClose,"\nYClose",colorGreen,styleLine); Plot(MA_DAILY,"\nMA_DAILY",colorWhite,styleLine);
Plot(timecond, "", colorDarkGrey, styleArea|styleOwnScale,0,1);
----- Original Message -----
Sent: Wednesday, July 22, 2009 4:20
AM
Subject: [amibroker] Re: Intra-Day
Database Setup
Ed, Brian, Thank you so much for the very detailed suggestions. I look
forward to exploring them in detail over the weekend. My day job sucks the
life out of me every day so the only time I have any brain mojo for studying
code is on the weekends. I'll let you all know how it goes. As for now I am
working on a version of the code which uses very basic timeframeset() and
only a few timeframeexpand() statements. When database is set to show
only day session everything so far seems to calculate
perfectly.
FYI, The project I'm working on is to code Toby Crabel's
price patterns and Opening Range Breakout as discussed in his 1989 book. It
requires some tweaking to ensure it's able to adjust to changing markets but
so far it seems very likely to provide a robust trading system.
So far
I have a complete system built using this technique but the original code is
too cumbersome and takes forever to do back tests and optimizations. The new
streamlined version is coming along. I have the price patterns coded, as well
as the break out levels and target levels. All I need to add is some
optimizeable parameters and I should be ready to start analyzing for optimum
parameter values.
Good Trading everyone.
Pete
:-)
__._,_.___
**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.
TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com
TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
__,_._,___
|