I am working on an application in Python that will allow a user to select a group of candlesticks and match them with similar patterns found within an entire database of candlesticks.
I followed the 2nd tutorial in this link and was actually able to do something akin to what I want to do with Template Matching.
After matching different patterns to the template, I would like to show the candles that appeared after those matched patterns occurred. The point is to see what happened in the past with similar patterns to help determine what could happen now that a similar pattern is present.
Obviously it would be extremely inefficient to write a script that will iterate through candlestick databases and produce a bunch of chart images for Image Template Matching.
Is there something similar to Image Template Matching I can use to find candlestick patterns similar to a specified subset?
Eg. "Look at the latest 5 candles in the database, then look at the entire database and find similar patterns along with a similarity %"
I read databases into dictionaries like so:
candle_dictionary = {
"opens": [123, 121, 122, 103],
"highs": [126, 131, 122, 133],
"lows": [143, 71, 92, 100],
"closes": [173, 124, 128, 123]
}
So the close value of the newest candle in the database would be candle_dictionary["closes"][0]
, which would be 173.