You are on page 1of 9

An Automated Trading Strategy using PsychSignal Bullish/Bearish indicators

By: The Deltix Quantitative Research Team

Introduction This paper describes the implementation of an automated equity trading strategy based on social media derived bullishness and bearishness sentiment indicators and the results from back-testing this strategy. The sentiment factors were provided by PsychSignal who have developed natural language processing software with the purpose of calculating bullishness and bearishness indices from StockTwits, Twitter and chat rooms. The PsychSignal data and market data used in this research, together with the QuantOffice implementation of this strategy, are available from Deltix Cloud Services (DCS).

Trading logic description We developed the trading strategy based on intraday PsychSignal bullish/bearish indices using two approaches. In both cases, we were operating on the hypothesis that past bullish/bearish indicators for a specific security provide predictive power on the future price of that security and that we can profitably trade using this insight.

1.

Regression based model

We took as predictors the two most recent days of daily bullish and bearish indicators data. These daily predictors were smoothed using an EMA (Exponential Moving Average) indicator and acted as the regressors (independent variables) in our model. As the regressand (dependent variable), we calculated the close-to-next-day-open price change for each security in the S&P500 over a period of 50 days (the training period). We applied linear regression to the resultant matrix of regressor values and the vector of the regressand values. The regression parameters were set as weights in the indicator formula and the following signal logic was applied: If indicator is positive and current price is lower than the 50 day EMA-smoothed day close price, then open a long position at market close and close that position at next market open. If indicator is negative and current price is higher than 50 day EMA-smoothed day close price with then open a short position at market close and close that position at next market open. The order size for opening order is calculated by the following formula:

( where: retON = list of overnight returns collected for the last 50 days.

The following variations of this model are available via input parameters of the strategy: Using the return calculated as 15 min before close price, as an extra parameter in the regression model. Instead of comparing the indicator to 0, we can compare it to some enhanced boundaries. As an example of such boundaries, +/- absolute value of the 30 day SMA (Simple Moving Average) of the indicator was used: if indicator is greater than the absolute value of the SMA, then open long position, if it is less then open a short position.

2.

RSI based model

In this model, daily predictors are smoothed by collecting data for each predictor into an EMA indicator. The day close EMA values are smoothed with EMA daily indicators and the RSI (Relative Strength Index) is calculated as:

If RSI<15 and current price is lower than 50 day EMA-smoothed day close price then open long position at market close and close that position at next open. If RSI>85 and current price is higher than 50 day EMA-smoothed day close price then open short position at market close and close that position at next open. 1. Order size for opening order is calculated by the following formula: ( where: retON means list of overnight returns collected for the last 30 days. )

Results The strategy was run on securities in the S&P100. Consolidated results Parameter Net Profit/Loss Total Profit Total Loss Cumulated Profit % Max Drawdown Max Drawdown % Max Drawdown Date Return/Drawdown Ratio Drawdown Days % Max Drawdown Duration CAGR Sharpe Ratio Annualized Volatility Sortino Ratio UPI Information Ratio Optimal f All Trades # Profitable Trades Ratio Winning Trades # Losing Trades # Average Trade Average Winning Trade Average Losing Trade Avg. Win/ Avg. Loss Ratio Average Profit per Share Max Conseq. Winners Max Conseq. Losers Regression based 390,804.54 2,176,093.57 -1,785,289.03 390.80% -106,957.11 -18.80% 7/24/2013 3.65 46.07% 21 771.97% 2.88 184.48 5.55 5.18 2.88 2.27 5657 0.51 2897 2760 69.08 751.15 -646.84 1.16 0.02 13 15 SMA boundaries 404,459.44 1,734,422.43 -1,329,962.99 404.46% -95,237.32 -16.77% 7/23/2013 4.25 41.88% 21 805.16% 3.13 175.93 5.61 6.79 3.13 2.6 4341 0.54 2338 2003 93.17 741.84 -663.99 1.12 0.03 26 16 Return in regression, SMA boundaries 325,423.34 1,614,855.21 -1,289,431.87 325.42% -62,589.54 -13.00% 7/25/2013 5.2 50.26% 21 617.77% 3.1 143.03 5.75 4.13 3.1 3.02 4226 0.51 2172 2054 77.01 743.49 -627.77 1.18 0.03 19 14 RSI 137,914.56 326,873.83 -188,959.27 137.91% -20,407.60 -19.80% 12/31/2012 6.76 54.97% 29 225.39% 2.7 69.47 5.76 4.14 2.7 4.67 739 0.58 427 312 186.62 765.51 -605.64 1.26 0.05 47 13

Detailed results 1. Regression based algorithm Parameter Net Profit/Loss Total Profit Total Loss Cumulated Profit % Max Drawdown Max Drawdown % Max Drawdown Date Return/Drawdown Ratio Drawdown Days % Max Drawdown Duration CAGR Sharpe Ratio Annualized Volatility Sortino Ratio UPI Information Ratio Optimal f All Trades # Profitable Trades Ratio Winning Trades # Losing Trades # Average Trade Average Winning Trade Average Losing Trade Avg. Win/ Avg. Loss Ratio Average Profit per Share Max Conseq. Winners Max Conseq. Losers All Trades 390,804.54 2,176,093.57 -1,785,289.03 390.80% -106,957.11 -18.80% 7/24/2013 3.65 46.07% 21 771.97% 2.88 184.48 5.55 5.18 2.88 2.27 5657 0.51 2897 2760 69.08 751.15 -646.84 1.16 0.02 13 15 Long Trades 378,866.62 845,980.89 -467,114.27 378.87% -53,779.96 -15.74% 6/24/2013 7.04 45.03% 16 743.23% 3.08 167.3 5.57 10.02 3.08 2.66 1859 0.61 1125 734 203.8 751.98 -636.4 1.18 0.07 55 23 Short Trades 11,937.92 1,330,112.68 -1,318,174.76 11.94% -158,289.04 -60.24% 7/24/2013 0.08 64.40% 27 16.59% 0.07 242.09 0.11 0.05 0.07 0.03 3798 0.47 1772 2026 3.14 750.63 -650.63 1.15 0 34 44

2.

+/- SMA value as boundaries Parameter Net Profit/Loss Total Profit Total Loss Cumulated Profit % Max Drawdown Max Drawdown % Max Drawdown Date Return/Drawdown Ratio Drawdown Days % Max Drawdown Duration CAGR Sharpe Ratio Annualized Volatility Sortino Ratio UPI Information Ratio Optimal f All Trades # All Trades 404,459.44 1,734,422.43 -1,329,962.99 404.46% -95,237.32 -16.77% 7/23/2013 4.25 41.88% 21 805.16% 3.13 175.93 5.61 6.79 3.13 2.6 4341 Long Trades 377,455.08 1,047,071.96 -669,616.88 377.46% -70,438.24 -16.54% 6/24/2013 5.36 45.55% 16 739.85% 2.54 202.45 4.3 7.18 2.54 1.81 2218 Short Trades 27,004.36 687,350.47 -660,346.11 27.00% -99,399.48 -43.90% 8/1/2013 0.27 60.73% 28 38.46% 0.28 131.01 0.43 0.18 0.28 0.22 2123

Profitable Trades Ratio Winning Trades # Losing Trades # Average Trade Average Winning Trade Average Losing Trade Avg. Win/ Avg. Loss Ratio Average Profit per Share Max Conseq. Winners Max Conseq. Losers

0.54 2338 2003 93.17 741.84 -663.99 1.12 0.03 26 16

0.6 1325 893 170.18 790.24 -749.85 1.05 0.06 34 40

0.48 1013 1110 12.72 678.53 -594.91 1.14 0 23 34

3.

Return in regression, SMA boundaries Parameter Net Profit/Loss Total Profit Total Loss Cumulated Profit % Max Drawdown Max Drawdown % All Trades 325,423.34 1,614,855.21 -1,289,431.87 325.42% -62,589.54 -13.00% Long Trades 304,738.15 603,891.16 -299,153.02 304.74% -26,493.13 -8.72% Short Trades 20,685.20 1,010,964.04 -990,278.85 20.69% -113,048.33 -48.37%

Max Drawdown Date Return/Drawdown Ratio Drawdown Days % Max Drawdown Duration CAGR Sharpe Ratio Annualized Volatility Sortino Ratio UPI Information Ratio Optimal f All Trades # Profitable Trades Ratio Winning Trades # Losing Trades # Average Trade Average Winning Trade Average Losing Trade Avg. Win/ Avg. Loss Ratio Average Profit per Share Max Conseq. Winners Max Conseq. Losers

7/25/2013 5.2 50.26% 21 617.77% 3.1 143.03 5.75 4.13 3.1 3.02 4226 0.51 2172 2054 77.01 743.49 -627.77 1.18 0.03 19 14

6/24/2013 11.5 43.98% 10 570.69% 3.58 115.91 6.89 9.86 3.58 4.25 1301 0.62 804 497 234.23 751.11 -601.92 1.25 0.08 35 17

8/1/2013 0.18 63.35% 37 29.17% 0.15 184.57 0.24 0.09 0.15 0.09 2925 0.47 1368 1557 7.07 739.01 -636.02 1.16 0 26 46

4.

RSI Parameter Net Profit/Loss Total Profit Total Loss Cumulated Profit % Max Drawdown Max Drawdown % Max Drawdown Date Return/Drawdown Ratio Drawdown Days % Max Drawdown Duration CAGR Sharpe Ratio Annualized Volatility Sortino Ratio UPI Information Ratio Optimal f All Trades 137,914.56 326,873.83 -188,959.27 137.91% -20,407.60 -19.80% 12/31/2012 6.76 54.97% 29 225.39% 2.7 69.47 5.76 4.14 2.7 4.67 Long Trades 129,891.35 299,538.25 -169,646.89 129.89% -22,074.81 -21.08% 12/31/2012 5.88 56.54% 32 210.55% 2.52 70.28 5.28 3.56 2.52 4.26 Short Trades 8,023.21 27,335.59 -19,312.38 8.02% -4,073.91 -3.63% 7/18/2013 1.97 73.30% 40 11.08% 0.93 11.76 2.27 0.4 0.93 8

All Trades # Profitable Trades Ratio Winning Trades # Losing Trades # Average Trade Average Winning Trade Average Losing Trade Avg. Win/ Avg. Loss Ratio Average Profit per Share Max Conseq. Winners Max Conseq. Losers

739 0.58 427 312 186.62 765.51 -605.64 1.26 0.05 47 13

662 0.59 389 273 196.21 770.02 -621.42 1.24 0.05 47 13

77 0.49 38 39 104.2 719.36 -495.19 1.45 0.04 5 6

You might also like