DEVTOME.COM HOSTING COSTS HAVE BEGUN TO EXCEED 115$ MONTHLY. THE ADMINISTRATION IS NO LONGER ABLE TO HANDLE THE COST WITHOUT ASSISTANCE DUE TO THE RISING COST. THIS HAS BEEN OCCURRING FOR ALMOST A YEAR, BUT WE HAVE BEEN HANDLING IT FROM OUR OWN POCKETS. HOWEVER, WITH LITERALLY NO DONATIONS FOR THE PAST 2+ YEARS IT HAS DEPLETED THE BUDGET IN SHORT ORDER WITH THE INCREASE IN ACTIVITY ON THE SITE IN THE PAST 6 MONTHS. OUR CPU USAGE HAS BECOME TOO HIGH TO REMAIN ON A REASONABLE COSTING PLAN THAT WE COULD MAINTAIN. IF YOU WOULD LIKE TO SUPPORT THE DEVTOME PROJECT AND KEEP THE SITE UP/ALIVE PLEASE DONATE (EVEN IF ITS A SATOSHI) TO OUR DEVCOIN 1M4PCuMXvpWX6LHPkBEf3LJ2z1boZv4EQa OR OUR BTC WALLET 16eqEcqfw4zHUh2znvMcmRzGVwCn7CJLxR TO ALLOW US TO AFFORD THE HOSTING.

THE DEVCOIN AND DEVTOME PROJECTS ARE BOTH VERY IMPORTANT TO THE COMMUNITY. PLEASE CONTRIBUTE TO ITS FURTHER SUCCESS FOR ANOTHER 5 OR MORE YEARS!

Applying Technical Analysis Rule Generation to Bitcoin

Introduction

This assessment will apply the three-part rule generation methodology, introduced in a previous article, to Bitcoin (BTC). There’s likely debate over the application of technical analysis rule methodology to an immature, often illiquid asset, one subject to difficulties with exchange and price volatilities arguably resulting from some technological infrastructure implementation and management issues. It is also debatable how much value a long-term appraisal can add when the price trend has generally been so positive from the onset and from a very low base, when compared with the current price.

This price history also raises questions over the choice of sample dataset, so as to eliminate such bias. In the case of BTC this is not possible without making the selection arbitrary and perhaps chosen to fit a desired or at best subjective outcome. For this reason the sample data is the complete available dataset from 17th July 2010 to 4th May 2013. Such selection does however have its own obvious implications. Observed positive price trend moves over the period will necessarily favour longer-term trending patterns such as simple Moving Averages, MACD, Oscillators; somewhat nullifying any real value of a broad comparison of tools.

Thus the general aim for now is to formulate more optimised rules within the likely subset of best performing indicators, rather than attempting to draw any conclusions from self-evident observations that, for example, in a positive market methods that implement frequent trades and/or better capture short-selling opportunities aren’t successful. As a result this analysis may be periodically updated as the Bitcoin price evolves, when there may be more analytical variation in data.

Refresher

Theoretical rules have been applied to the movements in the BTC price, in US dollars. The profitability of each rule across the data set is assessed by comparing them to each other, a buy-and-hold on BTC and Gold returns over the same period. The evaluation involves a three-tiered assessment procedure, ensuring a more objective analysis. Observing technical analysis as a tool, the data is segmented in order to formulate trading rules, test their reliability and finally use one rule to indicate profitable trades.

Methodology

To test technical trading rules, the dataset is that of BTC from 17th July 2010 to 4th May 2013.

The data is split into three components: a training set; a test set; and a prediction set:

  • Training Set: 17th July 2010 – 3rd July 2012 (70% of Data):
    • In this set the data is examined, looking for any patterns and formulating any rules that appear profitable
  • Test Set: 4th July 2012 – 22nd January 2013 (20% of Data):
    • Once the rules have been developed in the training set, they are tested on the test set
  • Prediction Set: 23rd January 2013- 4th May 2013 (10% of Data):
    • If rules are vindicated by the test set, they may then be used on the final 10% of data to predict profitable trades. If any rules are profitable across the prediction set, it may then be justifiable to use them for future trades

btc_chart.jpg

A buy-and-hold strategy and returns on Gold over the same period have been used as a benchmark against which the returns of the trading strategies may be compared. The choice of Gold is somewhat arbitrary; Bitcoin has little to do with Gold, but both are nominally priced in US dollars so may provide a means of drawing inferences that do not too heavily factor the currency element, although this analysis will not dwell on any and only serves as an observation in this instance.

The tests make several assumptions for simplicity:

  • There is no bid-ask spread
  • There are no transaction costs
  • The market is continually liquid and there will be no slippage on any of the trades
  • There is no short-selling. Although a few providers have begun to offer this facility for BTC, the tests will assess only buy or sell back to US Dollars
  • There is a 0% return for holding US Dollars

Formulating Trading Rules

The Training Set:

The training period data was run through a Metastock system testing procedure to find the most profitable trading rules. With a notional initial equity of USD 100, the following graph displays the overall profitability of a range of trading rules. The chart broadly details the five best performing rules.

Some systems such as the ‘Moving Average Crossovers’ incorporate an optimization function, whereby all combinations of shorter MA from 1-50 and longer MA from 51-100, for example, may be tested on the data set; so the Net Profits of all tests within a particular system are averaged across the rules. This gives a useful indication of the rules’ performance, but does not yet give an optimal rule for the specific data set. The significance of this lies, for example, in the inability to utilize any long-period moving average process on a very small data set.

meta1.jpg

meta3.jpg

The next stage therefore is to analyse the three best performing general systems, in order to obtain the optimal parameters that will prove testable on the testing and prediction sets. This supplies three specific top performing rules:

Rule One: Directional Movement Indicator (20):

The directional movement index system is utilised to establish if a market has a strong trend and then to provide indication on how to trade that tendency. It was originated in 1978 by the creator of the Relative Strength Index (RSI) J. Welles Wilder. The indicator is generally plotted with three progressive indicators, +DI, –DI and ADX, on a scale of 0-100. It’s a fairly complex procedure established by comparing the difference between successive lows with the difference between highs. If a market is trending strongly, it will hit a new high or low, and the relative directional index (DI) will take a new value;

+DI upward or positive Directional Movement: If (current high – previous high) > (previous low – current low) then = (current high – previous high) if positive. A negative value = 0.

-DI downward or negative Directional Movement: If (previous low – current low) > (current high – previous high) then = (previous low – current low) if positive. A negative value = 0.

If the DI has been high, but is falling, it suggests the market is no longer trending. The +DI crossing over the –DI is considered a buy signal, and crossing below is considered a sell signal. So the directional movement index is a tool to use in addition to others, rather than solely, as it will identify and trade a trend, but in a range-bound market the +DI and –DI values will whipsaw.

‘’’ADX’’’ Average Directional Movement Index: As an average of the spread between the two indicators, +DI and –DI, it provides an indication of whether the market is trending or not. So it’s effectively a moving average of the price range. Using the ADX as well as the upward or downward directional indicators therefore helps to ascertain whether a trend is still in place. If the ADX falls below both this suggests a range bound market rather than a trending market. When the ADX rise above both this suggests the trend is becoming extended.

Testing the Directional Movement results optimised for a 20 day averaging period for the technique. However it’s worth noting that many optimisation variables tested (including a 26 and 38 averaging period) resulted in returns above those of any other indicators. Using the Directional Movement Indicator (20) gives 14 trades over the training period, trade profit/loss of 9/5 and an average profit/average loss of 6.67.

Rule Two: Moving Average Crossovers (10/20):

Moving averages are one of the oldest and simplest technical indicators, yet remain extremely popular with market practitioners. In order to calculate a moving average, one simply specifies a time frame, (e.g. 10 days), with ample historical price data to hand (e.g. 50 days). The calculation can then be done for every ten day period over the course of the past 50 days. For example, the second point on such a chart would be the sum of the prices of days 2-11 divided by 10, and so forth.

Connecting all the points on the chart leaves a smooth price trend. A buy signal is observed once the price crosses above the moving average and the moving average is directed upwards. A sell signal is denoted by the price crossing below a downward trending moving average. The rationale for this is that if the asset price is above the moving average it shows that current market/investor expectations are more bullish on this asset than the average expectations over the past 10 days, and vice versa for a sell signal.

In the case of the Moving Average Crossover rule, two moving averages (for example, 10 and 20 day moving averages) can be used in conjunction with each other in order to generate buy and sell signals. In its simplest form, it is sufficient to say a buy signal is given by the short dated average (10 day in this example) penetrating above the longer dated average (20 day in this example) when both are moving in an upward direction, and the reverse scenario for a sell signal. Investors should always be on the ‘right’ side of the market when employing a moving average indicator, since prices cannot rise significantly without exceeding their average price. However, such an approach will always buy and sell late, since the trend is simply being followed once it has been set.

Here, the Moving Average Crossovers optimization parameters are set to between 1 and 50. Testing all permutations of the rule, the optimal result is obtained by utilising 10/20 day MA’s. This results in 10 trades over the period, trade profit/loss of 7/3 and an average profit/average loss of 3.11.

Rule Three: Stochastics (10/50-70):

The stochastic oscillator compares where a security's price has closed relative to its price range over a specifically identified period of time. The theory behind this indicator is that in an upwardly trending market, prices tend to close near their high; and during a downward trending market, prices tend to close near their low. Further, as an upward trend matures, price tends to close further away from its high; and as a downward trend matures, price tends to close away from its low.

The stochastic indicator is plotted as two lines. This system incorporates two optimization parameters, namely the %D line (set between 1 and 50 days) and the %K line (set between 51 and 100). Testing these parameters against the training set results in optimal values for the %D and %K line of 10% and between 50-70% respectively. Results above 50-70% suggest that the asset is closing near its high and as such should be sold, whereas results below 10% suggest that the asset is closing near its low and should be bought.

Using the Stochastic 10/50-70 gives identical results of 3 trades over the training period, trade profit/loss of 2/1 and an average profit/average loss of 0.96. The reference to '50-70' indicates no distinction at this stage between values for the %K line of 50 to 70. Referring to this isn't technically correct as a rule, but it makes a point about the rule assessment generation for the dataset.

Overall Trading Rule Performance in the Training Set:

The following results compare the returns of these initial three trading rules, across the training set:

Trading Strategy & Returns:

  • Directional Movement 31,763%
  • Moving Average Crossovers 26,840%
  • Stochastics 14,050%
  • Gold 36%
  • Buy-&-Hold 12,922%

Gold and BTC rose over the period, BTC very significantly. During this bullish period, all three of these trading rules emerge as strongly performing strategies:

The Test Set:

Each of these trading strategies is then analysed for performance across the testing period:

Rule One: Directional Movement (20):

test1.jpg

The top panel in the above graph shows the profit/loss profile across the test set for this trading rule. The middle panel shows movements in the BTC price and buy/sell points. Finally, the bottom panel shows the trading volumes across the data set.

Summary Performance

  • Profit 24.6%
  • Buy & Hold Profit 162%

Trade Summary

  • Total Trades 6
  • Profitable Trades 3
  • Highest Profit USD 24.63
  • Unprofitable Trades 3
  • Highest Loss USD -6.60

Account Variation

  • Highest Account Balance: USD 124.63
  • Lowest Account Balance: USD 3.80
  • Highest Portfolio Value: USD 169.40

The Direction Movement indicator returns a profit of 24.6%. It made 6 trades and underperformed a buy-and-hold strategy of 162%

Rule Two: Moving Average Crossovers (10/20):

test2.jpg

This profit profile shows that the rule performed better than the Directional Movement Indicator across the period.

Summary Performance

  • Profit 63.8%
  • Buy & Hold Profit 162%

Trade Summary

  • Total Trades 4
  • Profitable Trades 3
  • Highest Profit USD 49.25
  • Unprofitable Trades 1
  • Highest Loss USD -7.80

Account Variation

  • Highest Account Balance: USD 163.80
  • Lowest Account Balance: USD 5.57
  • Highest Portfolio Value: USD 169.40

This rule was the most profitable of the 3 indicators in the test set, with 4 trades and a profit of 63.8% but underperformed the buy-and-hold.

Rule Three: Stochastics (10/50-70) optimised:

Using the predetermined optimisation settings, the stochastic oscillator did not enter a trade in the period, returning 0%. To attain other results, the overbought and oversold parameters would have to be adjusted to fit, but it is not the objective of this analysis to test-to-fit at this stage.

Summary Performance

  • Profit 0%
  • Buy & Hold Profit 162%

Trade Summary

  • Total Trades 0
  • Profitable Trades 0

Overall Performance of Individual Trading Strategies - Trading Strategy & Returns From Test Set Data:

  • Directional Movement 24.6%
  • Moving Average Crossovers 63.8%
  • Stochastics 0%
  • Gold 4.5%
  • Buy-&-Hold 162%

Rule Combinations:

As part of the analysis across the test set, a combination of the Directional Movement and Moving Average Crossover rules was run.

Combination Trading Rule One: Directional Movement (20) AND Moving Average Crossovers 10/20:

Summary Performance

  • Profit 62.1%
  • Buy & Hold Profit 162%

Trade Summary

  • Total Trades 4
  • Profitable Trades 3
  • Highest Profit USD 49.25
  • Unprofitable Trades 1
  • Highest Loss USD -7.80

Account Variation

  • Highest Account Balance: USD 162.10
  • Lowest Account Balance: USD 3.87
  • Highest Portfolio Value: USD 169.40

Combination Trading Rule Two: Directional Movement (20) OR Moving Average Crossovers 10/20:

Summary Performance

  • Profit 28.6%
  • Buy & Hold Profit 162%

Trade Summary

  • Total Trades 17
  • Profitable Trades 8
  • Highest Profit USD 25.72
  • Unprofitable Trades 9
  • Highest Loss USD -6.60

Account Variation

  • Highest Account Balance: USD 128.59
  • Lowest Account Balance: USD 4.16
  • Highest Portfolio Value: USD 169.40

The combination rules over the test set add no value to the result obtained with the Moving Average Crossover rule alone, in terms of profit and/or the ratio of profitable trades.

Prediction Set:

With the results of the test set, the next step is assessment over the prediction period. Although the Directional Movement indicator performed most strongly in the training set, by at least 18%, it underperformed the Moving Average Crossover and a buy-and-hold in the test set. The method has value as a supplement to other rules, but its complicated methodological nature does not lend itself to being a sole approach.

The Moving Average Crossover performed strongly in the training set, beating a buy-and-hold, and outperformed other indicators by 100% in the test set. The indicator is far simpler and more intuitive; it is applied to the prediction set. It is worth noting here that due to the shorter time period under test, the data required for 10/20 moving averages is not really sufficient for a complete assessment; the final sale into the closing period is due only to the lack of further data and a requirement for all rules that any open positions are closed out with the final period (day) in the data set.

Trading Strategy & Returns:

  • Moving Average Crossovers 117.8%
  • Gold -13%
  • Buy-&-hold 425%

prediction1.jpg

Having conducted a largely objective analysis of the BTC data set across the three periods, the Moving Average Crossovers trading rule demonstrates the most profitable conclusion of those tested. It did not outperform a buy-and-hold under all scenarios but proved consistently financially rewarding over a large dataset. Although on first assessment it may be difficult to asses the reasons behind any success or failure, the earlier outlined underlying nature of how this rule works goes some way to explain its benefits. Incorporating 10/20 moving averages into an assessment with fairly sustained trends provides a representation of the broad price moves. This method is indicative of overall market buying/selling pressures and also gives an idea of the levels of disparity, with underperformance demonstrated due to the delayed nature of the indicator.

Moving Average Crossover Optimisation:

Although not the initial intent of the study, there appears to be merit in a more granular optimization of the Moving Average Crossover rule for BTC prices, as a separate formulation to the three-step rule filtering development. This is for interest only but demonstrates some utility of moving average methodology to data of varying time periods, extents of price trends and volatility. As would be expected, the optimal short and long term moving average periods relate to the time period under examination and data trends (generally shorter averages for shorter time-frames and lesser price trends). Moving averages appear to offer a reasonable and simple monitor and technical analysis method for BTC, however the choice of time-frame and selection of optimisation parameters will be left with the reader. There are common sense observations to be made about BTC price examination and trends using moving averages, but little wisdom in application of selective data-fitting, bias or voodoo.

All data: Moving Average Crossover (12/27)

Summary Performance

  • Profit 340,175%
  • Buy & Hold Profit 206,323%

Trade Summary

  • Total Trades 9
  • Profitable Trades 7
  • Highest Profit USD 301,074
  • Unprofitable Trades 2
  • Highest Loss USD -1,766

Also of note with all-data were the (18/21) and (17/21) moving average crossovers, both with a profit of 334,134% and 9 trades, of which 8 profitable)

Training set: Moving Average Crossover (10/19)

Summary Performance

  • Profit 28,512%
  • Buy & Hold Profit 12,922%

Trade Summary

  • Total Trades 9
  • Profitable Trades 6
  • Highest Profit USD 13,790
  • Unprofitable Trades 3
  • Highest Loss USD -2,527

Test set: Moving Average Crossover (15/26)

Summary Performance

  • Profit 97.2%
  • Buy & Hold Profit 162%

Trade Summary

  • Total Trades 2
  • Profitable Trades 2
  • Highest Profit USD 48.62
  • Unprofitable Trades 0
  • Highest Loss USD 0.00

Prediction Set: Moving Average Crossover (4/11)

Summary Performance

  • Profit 381%
  • Buy & Hold Profit 425%

Trade Summary

  • Total Trades 2
  • Profitable Trades 1
  • Highest Profit USD 389.48
  • Unprofitable Trades 1
  • Highest Loss USD -8.46

References


QR Code
QR Code applying_technical_trading_rules_to_bitcoin (generated for current page)
 

Advertise with Anonymous Ads