{'fraction_non_alphanumeric': 0.018629407850964737, 'fraction_numerical': 0.0006653359946773121, 'mean_word_length': 5.4, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Devising Technical Trading Rules for Pakistan Stock Exchange using Genetic Programming

The efficient market hypothesis (EMH) suggests that a stock market behaves like a random walk which means that developing profitable trading rules and forecasting the trends would be impossible. However, quantitative traders examine the short-term behavior of the market using technical analysis to build the rules. Such rules control the buying and selling decisions of stocks and thus increase profit margin. Due to progress in computational intelligence, hybrid approaches based on machine learning, and technical analysis, the profit margin has increased from the traditional buy and hold approach. Technical analysis combines different technical indicators( such as Relative Strength Index, etc) and determines the timings of the investment. Combining different indicators and tweaking their parameters can change the trading rules and thus the profitability of the strategy. However, it is computationally expensive to try all the possible permutation of these indications. In this paper, we use genetic programming (GP) for this purpose to explore the search space and evolve trading rules capable of generating profits over unseen data. A walk forward validation is used instead of a traditional train-test split. The proposed method is tested on 8 different stocks listed on Pakistan Stock Exchange (PSX). Our results show that trading rules generated by our approach outperform than buy and hold approach.