In order to compare patterns over time at different stock prices the pattern matrix must be relative and calculated wrt some reference point. The method can be used in any time frame.
It is actually fun because when you have this type of pattern software you can click anywhere on the chart and display the pattern ID for n-bars preceding the selected bar. It will also highlight any part on your historical chart that matches this pattern. Of course you can calculate and display stats for the pattern, for example profits for the next bar following the patterns. The procedure for five bars:
Select 5 bars to set the width of the pattern area.
Use the HHV(H,5) and LLV(L,5) to set the upper/lower limits of the pattern space.
Draw 3 horizontal lines (at 20% levels) inside the square.
You now have a 5x5 matrix overlaying your pattern space.
Each small square within the checker board has a one bar interval width and a relative 20% price change height.
OHLC prices within the chart segment will all fall inside one of the small squares.
You encode the positions of the OHLC prices to create a PatternID
You now have a relative pattern ID. You can display this at your cursor and then have your code look for and display matching patterns on your chart.
It easier to explain this with some code. When i have time i will write an example and post it on the UKB.
Best regards,
herman
For tips on developing Real-Time Auto-Trading systems visit:
http://www.amibroker.org/userkb/
Thursday, February 28, 2008, 10:06:24 PM, you wrote:
>
> Hi Herman
> I am having trouble understanding your second paragraph
> particularly the terms "relative time" - I presume it is bar No from the beginning of the day
> "matrix can be referenced....." - not a clue about this one.
> "if a quote falls in one of cells" - What is the criteria of a
> quote falling in one of the cells. What does each cell represent?
> can you explain a little more perhaps with a little example,
> Ta
> Paul
> From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Herman
> Sent: Friday, 29 February 2008 1:20 AM
> To: brian_z111
> Cc: amibroker@xxxxxxxxxxxxxxx
> Subject: Re: [amibroker] Re: Pattern Searching within AB
> Pattern searching using candles may be significant with EOD data
> but EOD results are very unlikely to apply to Intraday patterns.
> candles lack important information (like HL precedence). Intraday
> patterns are arbitrary and are subject to timing, timing shifts,
> data delays, time frames, etc. An Intraday pattern will not retain
> its shape when any of these non-price variables change. I have
> another demo somewhere that explores that...may look it up when i
> find the time. Intraday patterns should really be run in the smallest timeframe possible.
> My preferred approach was to overlay a relative time vs price
> matrix on the chart. Matrix dimensions can be referenced to the
> initial open price of the first bar in the matrix, and can be
> expressed in percent change. If a quote falls in one of the cells it
> is set (binary). This way you end up with a binary image consisting
> of many small binary squares (like a checker board). This image can
> be expressed with a unique string or number. You determine pattern
> profitability by sliding this matrix over your data and looking for
> profit. This is very computational intensive...
> However.... this can lead to a very unique and interesting trading
> systems. Such a system would capture the current n-bar pattern. You
> then take this pattern and slide it over you historical data,
> calculating the profits of this pattern as you go along. This way
> you will get a Profitability rating for your CURRENT price pattern.
> This pattern is totally random and not related to any traditional
> patterns - however if the system finds that this pattern was
> historically profitable the system would make the trade. Thus this
> system will trade heretofore unknown patterns that are defined in
> real time as data arrives. The advantage is that this system doesn't
> require a pattern library. There is much more to it... actually very
> interesting. Because you can collect profitable/unprofitable
> patterns in a file and gradually build an empirical pattern library,
> completely automated. Gradually this system would become more
> efficient (computationally) as the library grows, and winning
> patterns are traded and losing patterns are rejected.
> Instead of sampling raw price you can of course sample indicators,
> or combinations of indicators, in the same way. Indicators tend to
> compress price data and reduce the computational overhead.
> Nevertheless, It can get quite complex. Many years ago I spend a
> significant amount of time on this however the computing overhead
> was just too much - perhaps with faster computers this idea can be revived.
> best regards,
> herman
> For tips on developing Real-Time Auto-Trading systems visit:
> http://www.amibroker.org/userkb/
> Thursday, February 28, 2008, 8:42:28 AM, you wrote:
>> Thanks Herman,
>> Just when I was going to go to bed too!
>> brian_z
>> Please note that this group is for discussion between users only.
>> To get support from AmiBroker please send an e-mail directly to
>> SUPPORT {at} amibroker.com
>> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
>> http://www.amibroker.com/devlog/
>> For other support material please check also:
>> http://www.amibroker.com/support.html
>>
>> Yahoo! Groups Links
>> <*> To visit your group on the web, go to:
>> http://groups.yahoo.com/group/amibroker/
>> <*> Your email settings:
>> Individual Email | Traditional
>> <*> To change settings online go to:
>> http://groups.yahoo.com/group/amibroker/join
>> (Yahoo! ID required)
>> <*> To change settings via email:
>> mailto:amibroker-digest@xxxxxxxxxxxxxxx
>> mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx
>> <*> To unsubscribe from this group, send an email to:
>> amibroker-unsubscribe@xxxxxxxxxxxxxxx
>> <*> Your use of Yahoo! Groups is subject to:
>> http://docs.yahoo.com/info/terms/
>>
>
__._,_.___
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
For other support material please check also:
http://www.amibroker.com/support.html
__,_._,___
|