This is a full-fledged implementation of a system presented in an unique research paper 'Profitability of Candlestick Charting Patterns in the Stock Exchange of Thailand' (2017) on candlestick charting, candlestick patterns, trend identification methods, and testing. You can easily find this paper in the Web. For example, visit: researchgate.net/publication/320642444_Profitability_of_Candlestick_Charting_Patterns_in_the_Stock_Exchange_of_Thailand This script is best suited for middle-to-higher time frames. Possible future developments: trend identification and factor calculation techniques.