Year: 2006
Type: article
Abstract: From in-the-sample test, we found that by increasing flexibility of the parameter settings for standard MACDR2 trading strategy, we can create a very powerhl tool that outperforms, or at least equal to, the performance of standard long or short MACD trading strategy.Out-of-sample tests enable us to measure the effectiveness of momentum trading strategy in a setting more close to real world.We confirmed that MACD trading can outperform buy-and-hold on NASDAQ, TSX, HSI, KOSPI, and TWSE if trading cost has been ignored.When we scrutinize MACD trading returns over ten indices and DJIA stocks with paired comparison test, we found no evidence that MACD trading can outperform buy-and-hold with the presence of trading cost. Relative strennth index fRTI)The construction of RSI,,, at time t of period p uses closing prices to calculate the ratio of upward change U , , to dowanward change D l , over the selected time period p , expressed as an oscillator that has a range of 0 to 100.Given an index set I,,, = {i : t -p 5 i 5 t ] , for anyi E I,,, we have C , -C , -, i f c , > c , -, = i0 otherwise c,-,-c, i f C , -, > C i otherwise where C , is the closing price at time i , the next step is to calculate exponential moving average of U , and Dl such that -U t , = Exponential -Moving -Average of U, over I,, -D t , = Exponential -Moving -Average of D, over It,, the ratio of those two averages is the Relative Strength (RS) -Ut,, RS,,, = -- DL,Finally, we can have RSI by plugging RS into the following formula:For practitioners, a reading above 70 indicates an overbought market, while a reading below 30 indicates an oversold market.Declaration Option Explicit Option Base 1 Const MaxDays = 10000 Const MaxTrades = 7000 Public Price(MaxDays) As Double Public PDate(MaxDays) As Date Public MACD(MaxDays) As Single Public EMA(MaxDays, 2) As Single 'EMAl and EMA2 Public Signal(MaxDays) As Single Public Trading(MaxDays) As Integer 'record buylsell trading signal according to MACD rule Public TotalDay As Integer Public AllMACD As Integer 'total number of MACD value Public AllSigl As Integer 'total number of Signal value Public CopyPriceOK As Boolean Public LearningMode As Boolean 'TRUE: we are in Learning mode, a signal for optimizer Public LearnDay 1 As Integer 'for Learning() to tell optimizer which time period to learn (or to apply) Public LearnDay2 As Integer Public Optimized(6) As Single '1:EMAl 2:EMA2 3:Signal4:DayDelay 5:Trigger 6:Target Public OptimizedRtn As Single 'Max return found by optimizer Public Performance(4) '1:AllDealNo 2:DealAvgProfit% 3:CompoundedReturn 4: FarDay(for internal check)
Source: Summit (Simon Fraser University)
Authors: Bill X. Huang, Yong Soo Kim
Language: English
Subfield: Finance
Domain: Social Sciences
Open Access status: green
OpenAlex ID: W2136640958
