DEVELOPING A MODULAR PORTFOLIO SELECTION MODEL FOR SHORT-TERM AND LONG-TERM MARKET TRENDS AND MASS PSYCHOLOGY

In an effort to model stock markets, many researchers have developed portfolio selection models to maximise investor satisfaction. However, this field still needs more accurate and comprehensive models. Development of these models is difficult because of unpredictable economic, social, and political variables that affect stock market behaviour. In this paper, a new model with three modules for portfolio optimisation is presented. The first module derives the efficient frontier through a new approach; the second presents an intelligent mechanism for emitting trading signals; while the third module integrates the outputs of the first two modules. Some important features of the model in comparison with others are: 1) consideration of investors’ emotions – the psychology of the market – that arises from the three above-mentioned factors; 2) significant loosening of simplifying assumptions about markets and stocks; and 3) greater sensitivity to new data.


INTRODUCTION
Modern portfolio theory, based on the pioneering work of Markowitz [1,2] and Sharpe [3], is an effort to build on the traditional principles of portfolio selection.Portfolio theory has been organised to overcome the challenge of assigning one's wealth between different assets [4].In mathematical programming, an asset is a random variable with a stochastic distribution for future returns, and a portfolio is a linear combination of these variables [5]; so any way of diversifying money between several assets can be called a portfolio [6].Recognising the best portfolio of assets is one of the major challenges in the financial world [7], and is called 'portfolio selection'.In fact, portfolio selection is the process of building a portfolio that maximises investor satisfaction [6,8,9,10].
The Markowitz model, despite its theoretical importance, has never been extensively used to make large-scale portfolios [11].Because of the computational difficulties that a largescale quadratic programming problem with a dense covariance matrix has [12], there are some restricting assumptions, such as symmetric distribution of the returns.So the model has experienced much development in two directions: 'alternative portfolio selection models', and 'equilibrium models'.Some of the alternative models, with minor changes, are Mean-Semivariance, Mean-absolute deviation, Mean-Variance-Skewness, or Mean-Variance with logical constraints; and, if more fundamental changes are considered, we can include Robust Optimisation, Markov chain, Multi-objective decision-making, Possibility and Fuzzy theory, or Minimax modelling of portfolio optimisation.For the equilibrium models, the Capital Asset Pricing Models (CAPM) developed by Sharpe [13,14], Lintner [15] and Mossin [16], or the Arbitrage Pricing Theory formulated by Ross [17] and developed by Huberman [18] and Connor [19] can be named.But in spite of many improvements made by the above-mentioned contributions to portfolio theory, there is a long way to go to the ideal use of these models, and further contributions are still needed.In this paper, a portfolio selection model with three modules is presented.The first two modules are discussed in detail, but the third is only introduced.The improvements that this model makes to the theory are as follows: • Loosening the restricting assumptions on the distribution of data • Considering the stock market's psychology • Making the model sensitive to both short-and long-term trends • Decreasing reliance on raw past data, and moving towards processing them for particular purposes such as forecasting.
Sections 2 and 3 focus on the first and second modules respectively; section 4 describes and gives examples of the third module; and section 5 presents the conclusions of the study.

FIRST MODULE: ON DERIVING THE EFFICIENT FRONTIER
Deriving an efficient frontier (EF) on the basis of historical information is an essential initial step to removing inefficient portfolios; otherwise the complexity of the decision-making increases considerably [7].The collection of portfolios that have maximum return at a specified level of risk, or have minimum risk at a specified level of return, is called the efficient frontier (EF) [1], and Ballestero and Romero [20] recommend maximising investors' expected utility on EF.Our proposed model also considers EF as one of its basesbut with some changes to improve the results.
The model to derive EF that is generally well-known in the literature is as follows.
( ) ( ) http://sajie.journals.ac.za a y (5) a : Pre-determined number of stocks in the portfolio d R : Indicator of the portfolio past performance i l : Lower admissible limit for investment in stock i i u : Upper admissible limit for investment in stock i In the model, constraints 1, 2 and 6 are necessary, but constraints 3, 4 and 5 (added to the Markowitz model by Perold [21]) are optional.The model also lets decision-makers choose any risk measure or any definition for i r .
The literature has introduced the arithmetic average of past returns of stock i as a definition for i r , but it does not encompass many situations, and may not be a basis for some investors' decisions.Investors may use any other statistic as a measure for the asset's past performance.For instance, a person who invests in lottery tickets considers the maximum potential return as an indicator of asset return, because the expected return of a lottery ticket is lower than many other investment opportunities with even smaller risks.The main reason for applying an arithmetic average in almost all the portfolio models is the mutual dependency of risk and return measures in this family of models.In fact, EF is the result of equilibrium between return and risk.For example, if you apply the risk measure of variance, for rational results the statistic of arithmetic average has to be used, as proposed by Markowitz.
The main contribution of our EF model is the risk measure of 'lower partial moment (LPM) of the first order' that replaces 'variance'.There is a considerable literature on the efficacy of the proposed measure.For example, Jasemi et al. [22] develop a new set of axioms for assessing risk measures to show the significance of the measure better.Unser [23] believes that LPM is of special importance for applications in financial decision-making; and symmetrical risk measures can clearly be dismissed in favor of shortfall measures [23].Bawa [24,25], Harlow & Rao [26] and Unser [23] firmly recommend using it for the development of asset pricing models rather than earlier formulations.And it is to be noted that in the category of shortfall measures, LPM is more consistent with how individuals actually perceive risk [26].
In addition to the above literature in support of LPM, poor performance of the variance in some cases, compared with LPM, convinces us of the need to make the change.That is, if the computational difficulties associated with the variance-based models are overlooked, and if the applied data also satisfy the characteristic of being symmetric, the results still do not make sense.Let's consider the situation in which there are only two stocks with returns of 1 r and 2 r so that 2 1 r r > .If an investor wants to put together the best portfolio of 1 r and 2 r , which combination of them should be chosen?Naturally and obviously, a 100% http://sajie.journals.ac.za investment in 1 r is recommended, and the associated EF would be only one point.To see the performance of variance-based EF models under the above conditions, a 301-day financial period with 300 positive returns of 1 r and 2 r is considered while 2 1 2 r r = .
According to the generated data and the arithmetic average as representative of past performance, the following model is achieved: After solving the model for 20 amounts of d R , Table 1 with 20 points is achieved, in which each point represents a portfolio.The results of Table 1 are also shown in a chart in Fig. 1.As can be seen, the model offers more than one point, while, surprisingly, a 100% investment in 2 r , which in practice cannot be justified at all, is also recommended.It should be noted that the columns of 1 x and 2 x in Table 1  After analysing the problem with additional stocks, again the same results were achieved.So it can be firmly stated that the model is not reliable, even if all of its theoretical problems are overlooked or resolved.
On the basis of what has been discussed, the new EF model that makes up the first module is as follows.
where st LPM 1 : LPM of the first order To check the performance of the new EF model against the case discussed above, the new model is run with three amounts of 20%, 30% and 40% for τ .Again, for each τ 20 amounts of d R that completely cover the inputs range are assigned.Fig. 2 shows the results, while - as usual -the x and y axes represent risk and return respectively.which recommends a 100% investment in 1 r , can be accepted as EF; i.e., instead of an efficient frontier we have an efficient point, because the point offers maximum return and minimum risk, and is superior to all the others.So the Mean-LPM model generates acceptable results.It should be noted that the robustness of the new mechanism has also been confirmed by analysing cases with a greater number of assets (up to 10).

Comparing the new and old EF models in general cases
In this part, five sets of experiments with real data from the New York Stock Exchange (NYSE) are run, as shown in Table 2.The first five experiment sets cover respectively the periods of 1/2000-7/2009, 1/1990-12/1995, 1/1981-1/1986, 1/1971-12/1976, and 1/2006-8/2009; and they are referred to here respectively as 1 st , 2 nd , 3 rd , 4 th and 5 th .In addition to the data periods, the experiments also differentiate on the basis of the stocks selected for each experiment.
Other than the above-mentioned differences, the experiments are identical, and make the following assumptions.
1.A typical EF is derived only for the next month by using the stock prices of the 13 latest months.For example, the EF for 8/1991 needs stocks prices from 1990/8 to 1991/8.2. The input data are the closing prices of stocks at the beginning of each month.
In each experiment set, the EFs for each dataset are derived on the basis of new and old approaches.The performance of each portfolio is measured according to its return for the following month.Naturally the EFs -whether achieved by the old model or the new -are composed of several points, in which each represents an efficient portfolio; and each EF has to be totalised.In this paper, the three popular statistics of Max, Min and Mean are used.Table 3 summarises the final results of the experiments, while each grid determines the percentage of times that the model performs better than the other, according to the associated statistic.Obviously the first, second and third variance-based columns can only be compared with the first, second and third LPM-based columns respectively.After Table 3, in which the relative performances of Max, Min and Mean of the points on the EFs by both of the models are compared; Table 4 determines what would happen to the initial capital if an investor invests for the associated period in the Max, Min or Mean of variancebased or LPM-based portfolios.For example, Table 4 shows that, if for the 4 th experiment set for each month only the average of efficient portfolios of the LPM-based model is used for investment during 1/1971 to 12/1976, the initial asset becomes 1.867 times bigger.

No
The stocks

No
The stocks  As can be seen in Tables 3 and 4, the new LPM-based model is decidedly better than the other according to the measures of Max and Mean, while its performance is slightly worse according to the measure of Min.That is nevertheless a satisfactory result.

SECOND MODULE: WHAT ABOUT THE NEAR FUTURE?
Unlike the past performance assessment of stocks done in the first module, evaluating stocks according to their probable future performance is not a routine task, mainly because of the many difficulties that come with forecasting.In the models based on past performance, it is assumed that the future state of stock markets will fully reflect past trends or behaviours -an assumption that cannot be easily accepted when stock markets experience continuous variations [27].It is true that there are many works in the field of predicting stock return; but the lack has always been felt of an integrated portfolio selection model that may be capable of considering the future performance of stocks.
This module adds to our model the forecasting mechanism of technical analysis (TA) that contributes to the final results (of the portfolio optimisation model) that are not only on the basis of the stocks' past performance, but also their probable future state.
Technical analysis (TA, also known as charting technique) has been part of financial dealings for many years, and many people believe that it is the main tool for investment analysis [28].Although there has been much academic opposition to TA, it has been proved that TA for stock prices is powerful, and has considerable popularity among economists and practitioners -because of the balance that TA maintains among human, political, and economic events [28] by considering market psychology.TA can provide a good mechanism to measure the irrational or emotional components that are present in all markets [29], while fundamental analysis only provides a gauge of the supply/demand situations, price/earnings ratios, economic statistics, and so forth; and there is no psychological component involved in such analysis [29].In a nutshell, this module makes the model more sensitive to market psychology and to short-term data (such as daily movements).After feeding the necessary data into this module, for each stock there will be a signal to buy, sell, or hold that stock -that is, the outputs of this phase are various signals.

The selected technique
Among the many technical analyses, 'Japanese candlestick' (the oldest [30], going back to 1730) is chosen for use in this module.Since its introduction to the Western world it has become almost universally available in software and online charting packages [31].But although the supporting literature on candlestick charting and its antiquity are important factors, the main reasons for using Candlestick charting in our model are these:

The structure
Generally the approach of artificial intelligence (AI) can be used to equip the model with TA, as shown in Fig. 3. Performing TA in financial markets with AI is not new: it has been surveyed by many researchers, with promising results.For example, Lee and Jo [32] develop an expert system of candlestick charting analysis to forecast the best timing of the stock market.Fernandez et al. [33] study the applicability of a simple technical rule on the basis of neural networks.Yao and Tan [34] present some evidence for the applicability of neural network (NN) models in predicting currency exchange rates, where time series data and technical analyses -like the moving average to discover the principles of currency exchange rate movement -are fed to a NN.Leigh et al. [35] show the prospects for applicating the modern approach of hybrid methods to assess buying opportunities in the stock market by TA and NN.Lam [36] studies the applicability of NNs -especially the back propagation algorithm -to integrating fundamental and technical analyses for the forecasting of financial performance.Chavarnakul and Enke [28] use an NN to perform an equivolume charting technique.It should be noted that, although in our study the concept of NN will be applied, any other kind of AI -including expert system, genetic algorithm, and fuzzy theory -can be also used.To discover patterns representing the input and output variables, a supervised feed-forward NN with back propagation learning will be applied.Unlike the input and output layer, there are no standard rules available for determining the appropriate number of hidden layers and neurons per layer.But since the model is a multiple regression one, the number of input and output nodes for the network configuration is determined according to dependent and independent variables.The output of an NN is always the solution to the problem.In this study, based on what has been discussed, the network is intended to inform us about changes in market trends.So the output layer consists of only one node, which determines the stock price trend in the near future using three states: ascending, descending, and neutral.For the input layer, the problem is not as easy, particularly because so many approaches can be taken to devise this layer.In this regard we focus on the raw input data of the Japanese candlestick, including Open, High, Low and Close prices of the stock over the last three days; while to cover the stock price trend, the close prices of the stock over the last seven days are also included.

Input Data
Overall this approach produces 15 normalised indices of denote respectively open, high, low and close prices on i th day while 7 th day is today (last day), 6 th day is yesterday, and so on.Based on the literature, feeding a particular NN with raw data is common because NNs are able to recognise high-level features such as serial correlations; and the NN is known as an appropriate classification and forecasting tool in business applications [37].So there will be fifteen input nodes and one output node.

Empirical results
Here, the efficiency of this module is tested on the basis of the 5 th experiment set.In total we have ten NNs that are trained by the daily data of the corresponding stocks during 2004 and 2005.These training data are used to determine the specifications of the models and the parameters of the forecasting technique, while the testing data of 2006-9 are used for out-of sample evaluation of the forecasting model.
The empirical results are divided into two parts.In the first, the correctness ratio of the emitted signals is evaluated; in the second, the amount of variation in the initial investment if the stocks are traded according to the emitted signals is surveyed.It should be noted that, to calculate the stocks returns, it is assumed that traders enter and exit at the close price of the signal day.Other researchers may make other assumptions; for example, Marshall et al. [30] assume that traders enter at the open price on the day following a signal.

Correctness ratio
To determine the ratio of correct signals, the trend horizon and definition should be decided on.The Japanese candlestick is designed to get short-term price movements, and is most helpful over periods of about ten days [29,38]; so any period less than ten days seems wise.In this study, like Lee and Jo [32], a six-day stock market movement is selected as the unit of evaluation time.That is, each time a bull signal is followed by an actual upturn or a bear signal is followed by an actual downturn within six days, the signal is considered to be a success.In this regard Horton [39] uses a three-day period, and Marshall et al. [30] apply a ten-day period.
In this study, not all the positive and negative returns are considered as actual upturns or downturns.However, for the positive returns there is a lower bound of ; where mp and mn are averages of positive and negative daily returns of the stock during the testing years respectively.
Table 5 shows the results of applying the trained networks to the 5 th set of experiments for five different testing periods, in which column 1 shows the percentages of correct signals during a six-day period, and column 2 presents the total number of buy and sell signals emitted by the network.is above 51%, the model can be regarded as useful and feasible.The total hit ratio of our new model is 74.2%; and even if the evaluation time unit is set at one day, a surprisingly high hit ratio of 43% is achieved.In fact, the model performs brilliantly well in some cases.For example, for Dow Chemical for the period of 12/30/2005 to 12/29/2006, the one-day period achieves a hit ratio of 55.5%; and Choice Hotel INT New for the period 12/31/2007 to 12/31/2008 achieves the excellent hit ratio of 79.6% using the six-day period.

Change in the initial investment
As discussed before, the output of this module is trading signals of 1, -1 and 0 whose correctness ratio was surveyed.In this part the returns of investing in stocks are investigated when the investor fully obeys the emitted signals to buy or sell the associated stocks.The following three strategies will be applied in converting the raw signals (of 1, -1 and 0) to trading commands (of 1 and -1).

1.
Getting buy, sell and neutral signals and normalising them according to the following 2-day, 3-day, 4-day, and 5-day or 6-day trends.

2.
Getting buy, sell and neutral signals without normalising them.

3.
Getting only buy or sell signals without any neutral signal.
In the first strategy, at the first step the neutral trading signals of 0 are converted so that a typical zero is equal to the last non-zero signal.Then a kind of normalisation is performed on the logic that a buy or sell signal is credible for the next six days -i.e., if a buy signal does not become true for the next four days, there is a probability that it will become true on the fifth or sixth day.In this study the signals are normalised independently for 2, 3, 4, 5 and 6 days.For example, for a 3-day normalisation consider a buy signal on day t .A buy signal on day t means that the investor should buy the stock at the closing price of day t , because the next day the price will rise.But if what happens does not match what has been predicted, the buy signal will be applied on the next day as well, even if the predicted signal for day 1 + t is a sell one.This is repeated for the following day too.For a six-day normalisation, an unmet buy signal may overrule all the sell signals of the model on five days following the first.So this strategy is divided into five sub-strategies of S1.2, S1.3, S1.4,S1.5 and S1.6.Moreover, each of these sub-strategies is run with eight different parameters that affect the acceptance of a change in the stock price as a positive or negative trend.
In the second strategy, as in the first, the neutral trading signals are first converted to nonzero elements, and the resulting signals are used for trading without extra normalisation.And, finally, in the third strategy there is no neutral signal to be converted and no normalisation.Since in these two strategies there is no need for the recognition of trends, we shall have no parameters.So in total we end up with 42 strategies and sub-strategies.
In evaluating the efficacy of the new EF model presented in part 2, Markowitz's famous EF model was used as a benchmark; but in this part the investment strategy of Buy and Hold (B&H) will be applied as a benchmark.For example, for the BHP Billiton Ltd stock between 12/29/2006 and 12/31/2007, a return of 76% is achieved on the basis of B&H because the price changes from 39.75 to 70.04.It is worth noting that the best performance from among the 42 strategies will be compared with the benchmark of B&H.In other words, all three strategies are considered as a whole, and for each stock the best performance among them represents the module.Table 6 shows the results: the columns of 'ns' and 'bh' represent the amount of investment at the end of the associated period for the new and B&H strategies respectively, if the amount of investment at the beginning of the period is taken as 1.For example, for the Honda Motor stock, the new strategy performs much better than the B&H strategy for all periods; while for all stocks over the longest period, the new strategy is superior to B&H.
As mentioned earlier, this module is composed of 42 strategies and sub-strategies; or, to be more precise, it consists of S1.2, S1.3, S1.4,S1.5, S1.6, S2 and S3.So it seems wise to check which of these seven strategies and sub-strategies offer the best performance; and this is shown in Table 7.On the basis of In most cases, portfolio optimisation is limited to editing the current portfolio -that is, buying, selling, or holding stocks.This is called 'portfolio management'.The application of simple portfolio selection models to portfolio management has several inadequacies, such as a significant amount of repetitive work, or the low sensitivity of the results to new data.For instance, in the case of daily editing, the model should be solved every day and its results compared with those of the day before.If a particular stock is present in yesterday's portfolio but is absent from today's, the stock should be sold completely; while if the reverse is the case, the stock should be bought up to the amount specified by the new portfolio.And finally, if a stock is present in both of the portfolios, its investment share will be set on the basis of the new results.However, in the proposed new modular model, since the input data of TA processors cover intervals of up to seven days, the sensitivity of the model to new data will be much greater than that of the portfolio selection models, with their input data over several months.On the other hand, for exactly the same reason, data is fed into the model less often, and so the amount of repetitive work is considerably reduced.In the concept of portfolio management, there should be an initial portfolio for editing.Here the first module delivers that initial portfolio.Naturally, if the stocks' data of T time units are fed to module 1, this module should be applied every According to Fig. 5, at the first step the data should be fed into the model.For past performance filtering, the last T data for each stock -usually the closing price -are used and fed into the model.According to these data, the model yields the efficient frontier.For future performance filtering, the necessary data are fed in n (number of available stocks) times to get the signals for each stock.According to outputs and the pre-defined rule, an optimal portfolio results, and at this time the first run of the model is finished.The next run of the model will be after a specified time unit.For example, if a day is used as the time unit, the next run of the model will be the next day.After a time unit, new data are added to the data base and the new package of data are fed only into the second module, just as in the previous step, to get the new score vector of future performance.At this stage the old score vector of past performance is replaced with the new optimal portfolio score vector.In the next runs of the model, this vector will be replaced by the score vector of the new optimal portfolios.This procedure continues for 1 T times, each time beginning like the first run, but with new data.

CONCLUSION
After a short review of the field of portfolio selection and its major models, some of the shortcomings that seem to reduce their usefulness to stock traders in real markets are The proposed model is to some extent sensitive to market psychology; it is free of the usual simplistic assumptions (for example, on the distribution of stock returns, the state of the market, and the varied direction of parameters); and its sensitivity to new market changes is good.On the other hand, the experiments show that the first and second modules perform well, and hold promise.
In the proposed model, the first module is a mechanism for deriving EF and covering longterm changes, while the second module emits trading signals and covers short-term changes in the market.The benchmark for the EF module was the Markowitz model, while for the trading signals module the benchmark was B&H.
To prove the efficiency of the model in a more practical manner, the third module should be devised more precisely, running a comprehensive set of experiments for a more solid assessment of its performance.Trying to fit the model into a given market to get better results than previous models would be a good area for research.
of stock i past performance

1 :
Probability density function for return of ( ) average of the past returns that are greater than τ

Figure 2 :
Figure 2: Results of solving the new model for three amounts of τ and 20 amounts of d R On the basis of the EF definition and Fig.2, for each τ only the point on the furthest left,

Figure 3 :
Figure 3: The future performance filtering module of the model

mp 5 1
and for the negative returns there is an upper bound of mn 5 1

A
model for filtering of stocks, based on past performance A model for filtering of stocks, based on future performance Combination of the qualified stocks and signals /sajie.journals.ac.za

1 T≤ 1 .
time units where T T Fig.5shows the flowchart of this typical portfolio management model.

Start
Get last version of stocks' dataDeriving efficient frontier Future filtering of stocks Integration of A and B for development of optimal portfolio A = Score vector of optimal portfolio Deriving the vector of stocks' scores for their past performa nce Deriving the vector of stocks' scores for their potential future performance A=Vector of past performance scores B=Vector of future performance scores Get stocks' data for new time unit N Y Optimal portfolio http://sajie.journals.ac.za introduced as the focal point of this study.To solve the problem, a modular model is presented.The first two modules are discussed in detail, including their development and validation; while for the third module the study is restricted to describing its concept.

Table 1 :
The 20 portfolios that make up the EF

Table 2 :
List of the stocks and their periods in the experiments http://sajie.journals.ac.za

Table 3 :
The final results of the experiments

Table 4 :
The amount of change in the initial capital during the associated period [30]ts use of open, high, low, and close prices, where other technical trading studies have used close price data only.2.It is more resistant to the criticism of 'data snooping' than are other tests of technicaltrading rules, as it was developed for an entirely different purpose: forecasting rice markets.[30]

Table 5 :
[32]percentages of correct forecastings for one-and six-day periods with total number of buy and sell signals Lee and Jo[32]believe that if the hit ratio defined by

Table 6 :
The proportional amount of the investment at the end of the period for the new and B&H strategies