automated trading strategy

18
Executive Summary The strategy entailed in this report aims to maximize net profit by testing data of the defined portfolio over the years 2012 and 2013. A strategy using four relevant indicators was developed. Important characteristics of this strategy are summarized in the summary section below. A portfolio of six stocks covering a wide array of sectors such as manufacturing, services and automobiles has been constructed to test the strategy. Market capitalization and daily volume traded are the major characteristics taken into account while selecting each stock. Our filter to select highly liquid stocks was to select those with at least one million trades per day. Stocks that show a low degree of negative correlation to one another have been used and is a subtle constraint of the strategy. Optimization was done for data over the years 2012 and 2013 using a generic optimization analysis. We did not have the computing power to process this optimization on default mode. The parameters for this strategy are detailed in the Optimization Analysis section. These parameters are used while backtesting the strategy for data over the years 2014 and 2015. NinjaTrader has been used to create the automated trading strategy (Appendix I). A pseudocode has been provided with a detailed analysis of the trading strategy and the indicators used within it. Results of the backtext, optimization analysis and forwardtesting have been visualized for better representation. This report concludes with the enumeration of the strengths and weaknesses of the strategy that has been developed. Stocks in Portfolio Amazon (AMZN) Facebook (FB) Goldman Sachs (GS) 3M (MMM) Netflix (NFLX) Tesla (TSLA) Indicators Used EMA RSquared Rate of Change Line Regression Slope Summary Salient Features Cumulative Profit 161.61% Net Profit $4698.88 Max. Drawdown 7.56% No. of Trades 12 Profitable Trades 9 FB 6% NFLX 8% GS 9% MMM 11% TSLA 25% AMZN 41% Net Profit Per Company Total Net Profit $4698.88 Automated Trading Strategy Platform: NinjaTrader Developed by: Akhilesh Agarwal Mrunmayi Deshmukh AMZN, FB, GS, MMM, NFLX, TSLA

Upload: akhilesh-agarwal

Post on 20-Jan-2017

150 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Automated Trading Strategy

Executive Summary

The strategy entailed in this report aims to maximize net profit by testing data of the defined portfolio over the years 2012 and 2013. A strategy using four relevant indicators was developed. Important characteristics of this strategy are summarized in the summary section below. A portfolio of six stocks covering a wide array of sectors such as manufacturing, services and automobiles has been constructed to test the strategy. Market capitalization and daily volume traded are the major characteristics taken into account while selecting each stock. Our filter to select highly liquid stocks was to select those with at least one million trades per day. Stocks that show a low degree of negative correlation to one another have been used and is a subtle constraint of the strategy. Optimization was done for data over the years 2012 and 2013 using a generic optimization analysis. We did not have the computing power to process this optimization on default mode. The parameters for this strategy are detailed in the Optimization Analysis section. These parameters are used while back-­testing the strategy for data over the years 2014 and 2015. NinjaTrader has been used to create the automated trading strategy (Appendix I). A pseudocode has been provided with a detailed analysis of the trading strategy and the indicators used within it. Results of the back-­text, optimization analysis and forward-­testing have been visualized for better representation. This report concludes with the enumeration of the strengths and weaknesses of the strategy that has been developed.

Stocks in Portfolio

Amazon (AMZN) Facebook (FB) Goldman Sachs (GS) 3M (MMM) Netflix (NFLX) Tesla (TSLA) Indicators Used

EMA R-­Squared Rate of Change Line Regression Slope

Summary

Salient Features

Cumulative Profit 161.61% Net Profit $4698.88 Max. Drawdown -­7.56% No. of Trades 12 Profitable Trades 9

FB6%

NFLX8%

GS9%

MMM11%

TSLA25%

AMZN41%

Net Profit Per Company

Total Net Profit $4698.88

Automated Trading Strategy Platform: NinjaTrader

Developed by:

Akhilesh Agarwal Mrunmayi Deshmukh

AMZN, FB, GS, MMM, NFLX, TSLA

Page 2: Automated Trading Strategy

Selection of Portfolio

The portfolio used for the strategy includes stocks from the financial, automotive, manufacturing and services sectors. A total of 6 stocks has been used for this empirical analysis screened using finviz. 1. Amazon: Although Amazon has not turned profits in most quarters that it has been in business, the company boasts of approximately a $315 billion market capitalization. This stock accurately captures North America’s services sector.

2. Facebook: Since its IPO in May 2012, the stock has shown a strong uptrend due to its frequent inclusion of added functionality on its platform. The company has managed to retain users more effectively than any other social media platform and continues to dominate the social media ad space.

3. Goldman Sachs: The company captures approximately $67 billion in market capitalization. The stock was highly volatile during 2012 and 2013 which adds an internal check for the strategy’s integrity.

4. 3M Company: The stock has shown strong growth since the financial crisis of 2008. With a market capitalization of approximately $110 billion, the company’s stock is analogous to the strong growth of manufacturing in USA.

5. Netflix: Subject to high volatility in recent times, this stock is a direct competitor of Amazon’s streaming services. The global provider of TV series and movies has a market capitalization of approximately $40 billion.

6. Tesla Motors Inc: A detailed valuation of this company has proved it to be a strong manufacturing stock. Although it has undergone a turmoil over the last 6 months it almost reached the 6-­month target price of $270 during late April, 2016. At the forefront of automobile and manufacturing innovation, this stock has a market capitalization of approximately $27 billion.

Portfolio Characteristics

$0.00

$50.00

$100.00

$150.00

$200.00

$250.00

$300.00

$350.00

$400.00

AMZN FB GS MMM NFLX TSLA-­‐5

10 15 20 25 30 35 40 45 50

TSLA NFLX GS FB AMZN MMM

Market Capitalization (Billions)

Daily Average Volume Traded (Millions) 01/01/13 – 05/10/2016

Automated Trading Strategy Platform: NinjaTrader

Developed by:

Akhilesh Agarwal Mrunmayi Deshmukh

AMZN, FB, GS, MMM, NFLX, TSLA

Page 3: Automated Trading Strategy

Indicators Used

Four indicators have been used in this analysis to effectively capture essential features of every stock namely – the standard deviation, moving average and correlation. 1. Exponential Moving Average: The EMA is similar to the simple moving average (SMA), except that more weight is given to the latest data. This indicator is used to balance our strategy by weighting in recent stock movements. Formula: (Closing Price – EMA (Previous Day)) x Multiplier + EMA (Previous Day)

2. R-­Squared: It measures the variation between the linear regression and the underlying data that it tracks. A correlation-­check with the movement of the stock price was the motivation behind using this indicator. It is helpful in determining the trend and the direction of the stock price. R-­Squared has been used to calculate the correlation between the stock price and the linear regression. A large value of R-­Squared would mean that the stock price moves in accordance with the line of regression. Formula: (1 – (Residual sum of squares / Total sum of squares))

3. Line Regression Slope: It is a statistical measure that determines the best fit line for a price series. The Slope has essentially been used to measure price shifts. As some of the stocks in our portfolio exhibit high volatility in recent times, this indicator proves to be a good compliment to the EMA. Formula: (Y = MX + C;; M = ((Y1 – Y2) / (M1 – M2))

4. Rate of Change: This indicates the percentage change in stock price. We use this indicator in our strategy to indicate buy-­side and sell-­side pressure. Formula: ((Close – Close n periods ago) / (Close n periods ago)) x 100

Measurement of Objectives

Our desired profits are 40% or above which mandates that at least 40% of all our trades must be profitable. We have set this goal after considering the mindset of an investor. It so happens, at times, that one particular stock makes a huge profit, overshadowing the losses that are made in an asset which is not as expensive. Looking at just the total portfolio value and the net profits, we would be misled. Therefore, developing a strategy that has at least 40% and higher profitable trades makes sure that all stocks perform well. We intended to develop a fairly conservative strategy for a risk-­averse investor. To do so, we tried to control the loss to 10% or lesser. This was done by putting several constraints to be sure about our buy and sell signals. Data for 2012 and 2013 was used to test the strategy. We took 2 years into consideration to have a longer test period. It helps in generalizing the strategy and in reality people invest over a longer time horizon than just a few months or a year. A longer time frame gives us a better idea of the performance of the strategy.

Automated Trading Strategy Platform: NinjaTrader

Developed by:

Akhilesh Agarwal Mrunmayi Deshmukh

AMZN, FB, GS, MMM, NFLX, TSLA

Page 4: Automated Trading Strategy

Trading Strategy

While (RSquared (Period) > Correlation && LineRegSlope (Period) > Slope && ROC (Period) > BuyThreshold && EMA (Fast) Crosses Above EMA (Slow)) Enter Long (Quantity)

While (RSquared (Period) <= Correlation && LineRegSlope (Period) <= Slope && ROC (Period) < SellThreshold && EMA (Fast) Crosses Below EMA (Slow)) Exit Long (Quantity)

Strategy Pseudocode

Input Fast Input Slow Input Period Input Correlation Input BuyThreshold Input SellThreshold

Set Quantity to 100 Set Slope to Zero

As the value of R-­Squared exceeds the specified input value, a change in price trend is recognized – confirming the first condition. A high value of R-­Squared is not to be misinterpreted as a reflection of high prices, but only as an indication of a strong trend. A declining R-­Squared value is accompanied by a flattening of the regression line – meaning trend reversals or price retracements. The Line Regression Slope is used to determine the direction of the trend as a momentum oscillator. It tells us the direction of price movement. This indicator considers the regression line and not the stock price. The slope shows to what degree the price is expected to move. A positive value suggests an imminent uptrend and a negative value suggests a downtrend. Invaluable information regarding the price trend can be obtained by combining the R-­Squared and Line Regression Slope indicators. We enter a long position if the correlation is high and the slope is above zero. This indicates that stock prices are on an upward trend. The opposite happens if the correlation is high and the slope is below zero. This suggests a strong decline in stock prices and we exit the long position. A positive value of Rate of Change indicates buy-­side pressure and vice-­versa. It also helps us determine divergences. In our strategy, if the value of ROC surpasses a threshold value below zero, we take that as a buy signal and if the goes below a threshold above zero, we take it as a sell signal. This indicator helps the strategy confirm a particular trend. Finally, we used the EMA to help us predict future price movements. The behavior of EMA (Fast) and EMA (Slow) helps us make the prediction. If EMA (Slow) and EMA (Fast) approach each other, we can expect a buy or a sell signal depending on the direction approached from.

We chose EMA because it is quick to respond to price movements. This way we do not have a lag in our model and it catches a buy or sell signal quickly giving us a higher profit potential by reducing our Maximum Adverse Excursion (MAE). We wait for the EMA (Fast) to cross above EMA (Slow) from below. This indicates that the price is on an uptrend and sends out a buy signal in our strategy. When EMA (Fast) crosses below the EMA (Slow) from above, we take that as a sell signal.

Automated Trading Strategy Platform: NinjaTrader

Developed by:

Akhilesh Agarwal Mrunmayi Deshmukh

AMZN, FB, GS, MMM, NFLX, TSLA

Page 5: Automated Trading Strategy

Testing the Strategy

The trading strategy explained in the previous section has been tested in depth and in presented in this section.

AMZN Prices – 01/01/2012 – 12/31/2013

130135140145150155160165170175

8/1/13 9/1/13 10/1/13 11/1/13 12/1/13

GS Stock– 08/01/2013 – 12/31/2013

0

50

100

150

200

250

300 Buy Signal

Sell Signal

Buy Signal

Sell Signal

Back-­Testing

Using the alongside parameters we observe a net profit of $4698.88 and a cumulative profit of 161.68%. 75% profitable trades indicate that the strategy performed quite well. Only 3 trades made a loss of $164.6 in total out of 12 trades. The remaining 9 trades grossed $4863.48. The maximum drawdown is -­7.56%, showing that our portfolio dropped only 7.56% from its peak value before approaching a new peak. In the instruments table (Appendix II) we observe that Netflix has a drawdown of 30.35%.

Parameters

Fast 10 Slow 70 Period 11 Correlation 0.38 BuyThreshold -­2 SellThreshold 2 Quantity 10 Slope 0

After analyzing the trades table, we found that the drawdown results are so because Netflix made a huge loss in its first trade. This is reflected in the MAE value of that particular trade – 0.3042, which is larger than the rest. We observe that an average winning trade makes 127.68% profit in the summary table (Appendix II). The average losing trade makes loss of only 15.12% suggesting that the strategy worked well for the described time frame. An average MAE of 7.58% indicates the captures of sell signals accurately. The average MFE is 117.58% which suggests that the long position is exited before the stock price enters a downward trend. Hence, the strategy predicts imminent price movements efficiently. The average ETD is found to be 25.60%. A low ETD here suggests that the strategy captures the exit condition effectively based on price movements after entering a long position. Our exit condition is fairly optimized and captures most of the price movements accurately after entering the position. Let us consider Amazon trades to evaluate the trades table (Appendix II). We look at the second Amazon trade which enters the long position on 9th March, 2012 at $186.76 and exits on 24th October, 2012 at $235.88 – a total profit of 26.28%. We observe from the graph that the strategy predicts the upward

Automated Trading Strategy Platform: NinjaTrader

Developed by:

Akhilesh Agarwal Mrunmayi Deshmukh

AMZN, FB, GS, MMM, NFLX, TSLA

Page 6: Automated Trading Strategy

trend and enters the long position. The strategy detects a reversal in trend as the price starts to drop, aligning with our goals and exiting the position. As mentioned earlier we intend to capture the short term market fluctuations and predict futures prices to exit long positions. Let us now look at the second trade of Goldman Sachs and explain why it makes a loss. The strategy enters the long position at $164.84 and exits it at $155.17 thus giving a profit of -­5.87%. We observe from the graph that the strategy entered long position on an uptrend but failed to capture the beginning of the downtrend. The reason for this behavior is our choice of Fast and Slow parameters of the EMA indicator. The stock price entered a downtrend within a month of entering the long position – the Slow EMA was not able to capture that quick enough which led to the sell signal not being sent out.

Optimization Analysis

The parameters alongside yield us a net profit of $4922.78, $223.9 higher than the result we obtained from back-­testing (Appendix IV). The profitable trades increased from 75% to 83.33%. Out of a total of 12 trades, 10 give us a profit after optimization. The parameters obtained from the optimization are close to what we modeled in the back-­testing. The differences are in the following: 1. Slow – We used a 70-­day period prior to optimization. The optimized model suggests we take a longer time frame for the Slow EMA. We need a longer time period to capture price trends accurately. 2. Period – We used 11 days prior to optimization. The optimizer gives us a value of 4 days. This change in parameter helped the strategy estimate the latest price changes. If the stock is volatile, the strategy detects the volatility and considers a short-­term price change to signal an entry or exit. 3. Correlation – The optimizer suggests a higher value of correlation than what we used in the back-­test.

Selection of Parameter Values

We have chosen 10 days for the Fast parameter and 70 days for the Slow because both periods are not very long and the strategy responds quickly. Taking 10 days and 70 days helps us incorporate any recent trends in the stock price and the average movement in stock price. We observe that the strategy does not utilize the advantage of short term arbitrage if a long time frame is chosen. We have chosen 11 days to calculate the Rate of Change. It calculates the momentum of the stock price by measuring the percentage change. This value serves us well in capturing the momentum of the stock price and accordingly report buy or sell signals. The threshold values we consider are -­2 and 2. This way we do not get a wrong signal if the value is close to zero. Hence false signals are avoided. We do not vary the slope;; it has been fixed to 0. If the value of the slope is positive, the prices rise and vice-­versa. All the parameters in the strategy have been selected to satisfy the needs of a risk averse investor (Appendix VII). Parameter Range

Fast 10:150:10 Slow 50:200:10 Period 3:21:1 Correlation 0.1:0.6:0.01 BuyThreshold -­10:-­1:0.1 SellThreshold 1:10:0.1 Quantity 10 Slope 0 Post-­Optimization Parameters

Fast 10 Slow 110 Period 4 Correlation 0.44 BuyThreshold -­2 SellThreshold 2

Overall, we had a better idea of price trends and momentum of the underlying stocks after optimization. Our max drawdown reduced from -­7.56% to -­3.54%. The average MFE remained the same suggesting

Automated Trading Strategy Platform: NinjaTrader

Developed by:

Akhilesh Agarwal Mrunmayi Deshmukh

AMZN, FB, GS, MMM, NFLX, TSLA

Page 7: Automated Trading Strategy

Optimizer Settings

Optimizer – Generic Aggregated – True Time period – 01/01/2012 Time to – 12/31/2013 Optimize On – max net profit

that the exit conditions estimated were close to perfect. Another point worth mentioning is that the average ETD increased after optimization which misled us to believe that the price movement before the exit condition was not accounted for properly. This occurred because of just one trade of TSLA that had an ETD value of 2.42. Even though this value is very large, the profit from this trade is also very large (285.16%).

-­‐0.5 0 0.5 1 1.5 2

Cumulative Profit

Max. Drawdown

Percent Profitable

Optimization Back-­‐Test

-­‐200-­‐150-­‐100-­‐500

50100150

Back-­‐Test Optimization

4500

4600

4700

4800

4900

5000

Back-­‐Test Optimization

Total Net Profit Gross Profit

Profit Factor

Gross Profit

Comparison of results from Back-­Testing and Optimization (2012-­2013)

Walk-­Forward Analysis

A walk-­forward was conducted from 2010 to 2015 for a period of 2 years. This way, NinjaTrader optimizes the parameters for 2010-­2011 and uses the parameters for 2012-­2013 and so on and so forth. The parameter values obtained are shown alongside. The combined profit for the two years is $2248.9 (Appendix V). This is much smaller than the net profit that we made in the back-­test and in the optimization analysis. The optimized parameter values for 2010-­2011 are not the best input parameters for 2012-­2013. The stock price movements in 2010-­2011 are very different from price movements in 2012-­2013 leading to inaccurate estimation parameters. For 2014-­2015 the total net profit is $3092 which is quite close to the value we obtained after the back-­test.

Parameters for 2012-­2013

Fast 40 Slow 80 Period 6 Correlation 0.49 BuyThreshold -­2 SellThreshold 2 Parameters for 2014-­2015

Fast 20 Slow 50 Period 11 Correlation 0.47 BuyThreshold -­2 SellThreshold 2 Testing all historic data from 2010 and 2015, we obtain a net profit of $5341. 52.38% of the trades are

profitable and a loss of 19.19% is observed. This loss is greater than what we specified in our goals in Measurement of Objectives. Therefore, we do not accept this as optimal. Hence, the walk-­forward analysis did not give us the best results.

Automated Trading Strategy Platform: NinjaTrader

Developed by:

Akhilesh Agarwal Mrunmayi Deshmukh

AMZN, FB, GS, MMM, NFLX, TSLA

Page 8: Automated Trading Strategy

Automated Trading Strategy Platform: NinjaTrader

Developed by:

Akhilesh Agarwal Mrunmayi Deshmukh

AMZN, FB, GS, MMM, NFLX, TSLA Monte Carlo Simulation

We run a back-­test based on the results of the optimization on the portfolio over the years 2010-­2013. Stocks according to the total net profits are chosen from this back-­test (Appendix VI).

Best Performing Stock – AMZN (3 trades per simulation)

90% of the trades give 432% cumulative profit and above. Only the bottom 3% of the trades give us a negative profit.

The drawdown is not linear. Top 80% of the trades have 0% drawdown and the bottom 50% of the trades have -­6% drawdown.

Our MAE is capped at 19.66%. The bottom 50% of the trades have an MAE of 11.58% or less.

Our MFE goes as high as 98% for top 5% of the trades. The least is 19.89% -­ a positive number that suggests an effective strategy.

Page 9: Automated Trading Strategy

Automated Trading Strategy Platform: NinjaTrader

Developed by:

Akhilesh Agarwal Mrunmayi Deshmukh

AMZN, FB, GS, MMM, NFLX, TSLA Average Performing Stock – MMM (7 trades per simulation)

The graph is not linear, top 90% and more trades yield 135% cumulative profits. 0 – 36% of trades and below yields a negative profit.

The bottom 80% of the trades have a negative drawdown and only the top 2% have 0% drawdown.

The MAE is a linearly growing function for this stock. Our MAE is caped at 4.6% and the least MAE is 1%.

Our MFE goes up to 33.4% for the top 2% of trades. The least is 5.4% which is positive, suggesting an effective strategy.

Page 10: Automated Trading Strategy

Automated Trading Strategy Platform: NinjaTrader

Developed by:

Akhilesh Agarwal Mrunmayi Deshmukh

AMZN, FB, GS, MMM, NFLX, TSLA Worst Performing Stock – GS (3 trades per simulation)

The top 3% of trades give 42.62% and above cumulative profits. The bottom 83% of trades yield a negative cumulative profit.

The bottom 95% of trades have a negative drawdown and the last 5% have a 0% drawdown.

The MAE is capped at 44.83% and the least MAE is 1.4%. Considering the exit positions for the worst performing stock, the result is good.

The MFE goes up to 14.9% for the top 1% of the trades. The is least is 6.5% which indicates that the strategy performs well.

Page 11: Automated Trading Strategy

Strengths of the Strategy • The inclusion of the Line Regression Slope as an indicator makes the strategy efficient. It tells

us the direction in which the price is expected to move. • We have chosen the EMA over the SMA because the EMA responds quicker to price

movements, helping us reduce MAE and maximize profits. • We use R-­Squared to compare the line of linear regression and the underlying stock price. Since

the line of linear regression is the best fit line, it helps the strategy predict future price movements in turn helping make an informed decision “today”.

Testing for 2014-­2015 Data

To check if our strategy can be implemented across years, we back-­tested it on our portfolio over the years 2014 and 2015. We observe a net profit of $3703.6 and a cumulative profit of 27.92% (Appendix III). 50% of our trades are profitable suggesting satisfactory performance. 9 trades made a loss of $697.70 in total out of 18 trades. The gross profits amount to $4401.6. Compared to the back-­testing results of 2012 and 2013 data, the total difference in net profits is $995.28.

-­‐0.35

-­‐0.3

-­‐0.25

-­‐0.2

-­‐0.15

-­‐0.1

-­‐0.05

0

2012-­‐2013 2014-­‐2015

Comparison of Max. Drawdown (Percentage)

The maximum drawdown is -­6.07%, better than the maximum drawdown observed in 2012 and 2013, showing that our portfolio fell only 6.07% from its peak position before approaching a new peak. Netflix, again, is the one that has the greatest drawdown. Its individual drawdown is only -­11.11% compared to -­30.35% during 2012-­13, indicating that the strategy is good at detecting exit conditions. A high MAE does not allow the strategy to detect the downtrend within the timeframe of the Netflix’s trade (1year, 4 months). We observe that an average winning trade makes 24.14% profit in the summary table (Appendix III). The average losing trade makes loss of only 4.22% suggesting that the strategy worked well during 2014 and 2015. Although the values of average MAE and ETD are satisfactory for this time period, the value of average MFE is only 22.88%. We observed an average MFE of 117.58% during 2012 and 2013, showing a substantial decrease in value. The strategy is less sensitive in detecting exit positions because the graphs of of stock prices are more rounded. Since we focused our strategy more during the years 2012 and 2013, parameter values based on the behavior of stock prices during that time frame was chosen. We would have to adjust the value of the parameters for the years 2014 and 2015 to obtain better results.

Developed by:

Akhilesh Agarwal Mrunmayi Deshmukh

AMZN, FB, GS, MMM, NFLX, TSLA

FB NFLX GS MMM TSLA AMZN COMBINED

Automated Trading Strategy Platform: NinjaTrader

Page 12: Automated Trading Strategy

Automated Trading Strategy Platform: NinjaTrader

Developed by:

Akhilesh Agarwal Mrunmayi Deshmukh

AMZN, FB, GS, MMM, NFLX, TSLA Pitfalls of the Strategy

• EMA gives us false signals at times when the cross-­over and cross-­below points are set at the zero line.

• The Rate of Change of all the stocks is not the same because every stock fluctuates by a different percentage. A wrong signal for one or two stocks may be sent out since a value has to be set for the BuyThreshold and SellThreshold.

• There is a restriction on the number of trades as we have put conditions on several parameters.

Page 13: Automated Trading Strategy

Trade No. Instrument Position Quantity Entry price Exit price Profit Cum. Profit MAE MFE ETD 1 FB Long 10 24.58 26.48 7.73% 7.73% 0.03 0.32 0.25 2 FB Long 10 26.39 54.649 107.08% 123.09% 0.03 1.22 0.15

Trade No. Instrument Position Quantity Entry price Exit price Profit Cum. Profit MAE MFE ETD 1 NFLX Long 10 12.16 8.47 -­30.35% -­30.35% 0.30 0.00 0.31 2 NFLX Long 10 9.4 52.6 459.57% 289.77% 0.13 4.91 0.32

Trade No. Instrument Position Quantity Entry price Exit price Profit Cum. Profit MAE MFE ETD 1 GS Long 10 102.5 152.3 48.59% 48.59% 0.00 0.64 0.16 2 GS Long 10 164.84 155.17 -­5.87% 39.87% 0.06 0.03 0.09

Trade No. Instrument Position Quantity Entry price Exit price Profit Cum. Profit MAE MFE ETD 1 MMM Long 10 87.93 140.25 59.50% 59.50% 0.03 0.60 0.00

Trade No. Instrument Position Quantity Entry price Exit price Profit Cum. Profit MAE MFE ETD 1 TSLA Long 10 33.9 30.8 -­9.14% -­9.14% 0.11 0.01 0.10 2 TSLA Long 10 30.9 150.429 386.83% 342.31% 0.13 5.29 1.43

Trade No. Instrument Position Quantity Entry price Exit price Profit Cum. Profit MAE MFE ETD 1 AMZN Long 10 186.79 235.88 26.28% 26.28% 0.03 0.41 0.15 2 AMZN Long 10 248.05 258.58 4.25% 31.64% 0.02 0.15 0.11 3 AMZN Long 10 267.07 398.79 49.32% 96.57% 0.03 0.52 0.03

Instrument Performance Total Net Profit Gross Profit Gross Loss Profit Factor Cumulative Profit Max. Drawdown Trades Profitable FB 301.59 301.59 301.59 0.00 99.00 123.09% 0.00% 2 100% NFLX 395.10 395.10 432.00 -­36.90 11.71 289.77% -­30.35% 2 50% GS 401.30 401.30 498.00 -­96.70 5.15 39.87% -­5.87% 2 50% MMM 523.20 523.20 523.20 0.00 99.00 59.50% 0.00% 1 100% TSLA 1164.29 1164.29 1195.29 -­31.00 38.56 342.31% -­9.14% 2 50% AMZN 1913.40 1913.40 1913.40 0.00 99.00 96.57% 0.00% 3 100%

Combined 4698.88 4698.88 4863.48 -­164.60 29.55 161.61% -­7.56% 12 75%

Automated Trading Strategy Platform: NinjaTrader

APPENDICES Appendix I – Sets from NinjaTrader

Appendix II – Back-­test for 2012-­2013 Data

Developed by:

Akhilesh Agarwal Mrunmayi Deshmukh

AMZN, FB, GS, MMM, NFLX, TSLA

Page 14: Automated Trading Strategy

Parameters Value Correlation 0.38 Fast 10 Slow 70 Period 11 Quantity 10 Slope 0 BuyThreshold -­2 SellThreshold 2 Data series Price based on Last Type Day Value 1 Time frame From 1/1/2012 To 12/31/2013 General Include commission False Label TradingStrategy Maximum bars look back 256 Min. bars required 20 Historical Fill Processing Fill type Default Slippage 0 Order Handling Entries per direction 1 Entry handling AllEntries Exit on close True Order Properties Set order quantity by strategy Time in force Gtc

Performance All Trades Long Trades Total Net Profit $4698.88 $4698.88 Gross Profit $4863.48 $4863.48 Gross Loss $-­164.60 $-­164.60 Commission $0.00 $0.00 Profit Factor 29.55 29.55

Cumulative Profit 161.61% 161.61% Max. Drawdown -­7.56% -­7.56% Sharpe Ratio 1.89 1.89 Start Date 1/1/2012 End Date 12/31/2013

No. of Trades 12 12 Percent Profitable 75.00% 75.00% Winning Trades 9 9 Losing Trades 3 3 Average Trade 91.98% 91.98%

Average Winning Trade 127.68% 127.68% Average Losing Trade -­15.12% -­15.12%

Ratio avg. Win / avg. Loss 8.45 8.45 Max. conseq. Winners 1 1 Max. conseq. Losers 0 0 Largest Winning Trade 459.57% 459.57% Largest Losing Trade -­30.35% -­30.35% No. of Trades per Day 0.00 0.00 Avg. Time in Market 230.33 days 230.33 days Avg. Bars in Trade 158.2 158.2 Profit per Month 5.22% 5.22%

Max. Time to Recover 207.00 days 207.00 days Average MAE 7.58% 7.58% Average MFE 117.58% 117.58% Average ETD 25.60% 25.60%

Trade No. Instrument Position Quantity Entry price Exit price Profit Cum. profit MAE MFE ETD 1 FB Long 10 63.84 77.72 0.22 22% 0.03 0.35 0.13 2 FB Long 10 81.41 104.66 0.29 57% 0.12 0.36 0.07

Trade No. Instrument Position Quantity Entry price Exit price Profit Cum. profit MAE MFE ETD 1 GS Long 10 189.87 198.43 0.05 5% 0.04 0.15 0.11 2 GS Long 10 196.58 188.99 -­0.04 0.00 0.05 0.01 0.05

Trade No. Instrument Position Quantity Entry price Exit price Profit Cum. profit MAE MFE ETD 1 NFLX Long 10 57.43 51.4 -­0.10 -­10% 0.18 0.22 0.32 2 NFLX Long 10 63.09 114.38 0.81 62% 0.07 1.11 0.30

Trade No. Instrument Position Quantity Entry price Exit price Profit Cum. profit MAE MFE ETD 1 TSLA Long 10 204.5 234.5 0.15 15% 0.03 0.42 0.28 2 TSLA Long 10 222.6 230.5 0.04 19% 0.12 0.29 0.25

Trade No. Instrument Position Quantity Entry price Exit price Profit Cum. profit MAE MFE ETD 1 AMZN Long 10 353.72 321.07 -­0.09 -­9% 0.14 0.03 0.12 2 AMZN Long 10 335.27 311.57 -­0.07 -­16% 0.07 0.02 0.09 3 AMZN Long 10 360.29 675.89 0.88 58% 0.01 0.93 0.06

Trade No. Instrument Position Quantity Entry price Exit price Profit Cum. profit MAE MFE ETD 1 MMM Long 10 137.3 139.33 0.01 1% 0.02 0.08 0.06 2 MMM Long 10 149.83 157.42 0.05 7% 0.00 0.14 0.09 3 MMM Long 10 163.07 159.82 -­0.02 4% 0.02 0.00 0.02 4 MMM Long 10 156.54 150.64 -­0.04 1% 0.06 0.02 0.06

Instrument Performance Total Net Profit Gross Profit Gross Loss Profit Factor Cumulative Profit Max. Drawdown Trades Profitable FB 99.00 371.30 371.30 0.00 99.00 56.51% 0.00% 2 100.00% GS 1.13 9.70 85.60 -­75.90 1.13 0.47% -­3.86% 2 50.00% NFLX 8.51 452.60 512.90 -­60.30 8.51 62.26% -­10.50% 2 50.00% TSLA 99.00 379.00 379.00 0.00 99.00 18.74% 0.00% 2 100.00% AMZN 5.60 2592.50 3156.00 -­563.50 5.60 58.24% -­15.65% 3 33.33% MMM 1.05 4.70 96.20 -­91.50 1.05 0.56% -­5.69% 4 50.00%

Combined 5.82 3809.80 4601.00 -­791.20 5.82 30.19% -­6.56% 15 60.00%

Appendix III – Back-­test for 2014-­2015 Data

Automated Trading Strategy Platform: NinjaTrader

Developed by:

Akhilesh Agarwal Mrunmayi Deshmukh

AMZN, FB, GS, MMM, NFLX, TSLA

Page 15: Automated Trading Strategy

Parameters Value Correlation 0.44 Fast 10 Slow 110 Period 4 Quantity 10 Slope 0 BuyThreshold -­10 SellThreshold 10 Data series Price based on Last Type Day Value 1 Time frame From 1/1/2014 To 12/31/2015 General Include commission False Label TradingStrategy Maximum bars look back 256 Min. bars required 20 Historical Fill Processing Fill type Default Slippage 0 Order Handling Entries per direction 1 Entry handling AllEntries Exit on close True Order Properties Set order quantity by strategy Time in force Gtc

Performance All Trades Long Trades Total Net Profit $3809.80 $3809.80 Gross Profit $4601.00 $4601.00 Gross Loss $-­791.20 $-­791.20 Commission $0.00 $0.00 Profit Factor 5.82 5.82

Cumulative Profit 30.19% 30.19% Max. Drawdown -­6.56% -­6.56% Sharpe Ratio 1.38 1.38 Start Date 1/1/2014 End Date 12/31/2015

No. of Trades 15 15 Percent Profitable 60.00% 60.00% Winning Trades 9 9 Losing Trades 6 6 Average Trade 14.14% 14.14%

Average Winning Trade 27.61% 27.61% Average Losing Trade -­6.07% -­6.07%

Ratio avg. Win / avg. Loss 4.55 4.55 Max. conseq. Winners 1 1 Max. conseq. Losers 0 0 Largest Winning Trade 87.60% 87.60% Largest Losing Trade -­10.50% -­10.50% No. of Trades per Day 0.01 0.01 Avg. Time in Market 159.07 days 159.07 days Avg. Bars in Trade 110.2 110.2 Profit per Month 1.35% 1.35%

Max. Time to Recover 220.67 days 220.67 days Average MAE 6.40% 6.40% Average MFE 27.58% 27.58% Average ETD 13.44% 13.44%

Trade No. Instrument Position Quantity Entry price Exit price Profit Cum. profit MAE MFE ETD 1 AMZN Long 10 183.89 398.79 116.86% 116.86% 0.04 1.21 0.04

Trade No. Instrument Position Quantity Entry price Exit price Profit Cum. profit MAE MFE ETD 1 NFLX Long 10 11.12 52.6 373.02% 373.02% 0.04 4.00 0.27

Trade No. Instrument Position Quantity Entry price Exit price Profit Cum. profit MAE MFE ETD 1 GS Long 10 104.15 156.83 50.58% 50.58% 0.02 0.63 0.13 2 GS Long 10 158.22 177.26 12.03% 68.70% 0.01 0.12 0.00

Trade No. Instrument Position Quantity Entry price Exit price Profit Cum. profit MAE MFE ETD 1 MMM Long 10 87.93 88.03 0.11% 0.11% 0.03 0.09 0.08 2 MMM Long 10 91.24 140.25 53.72% 53.89% 0.01 0.54 0.00

Trade No. Instrument Position Quantity Entry price Exit price Profit Cum. profit MAE MFE ETD 1 FB Long 10 26.5 26.68 0.68% 0.68% 0.05 0.23 0.22 2 FB Long 10 29.04 26.4 -­9.09% -­8.47% 0.11 0.00 0.09 3 FB Long 10 26.75 54.649 104.30% 86.98% 0.04 1.19 0.15

Trade No. Instrument Position Quantity Entry price Exit price Profit Cum. profit MAE MFE ETD 1 TSLA Long 10 31.5 29.9 -­5.08% -­5.08% 0.09 0.14 0.19 2 TSLA Long 10 31 119.4 285.16% 265.60% 0.04 5.27 2.42 3 TSLA Long 10 147.6 150.429 1.92% 272.60% 0.06 0.07 0.05

Instrument Performance Total Net Profit Gross Profit Gross Loss Profit Factor Cumulative Profit Max. Drawdown Trades Profitable AMZN 4922.78 2149.00 2149.00 0.00 99.00 116.86% 0.00% 1 100.00% NFLX 4922.78 414.80 414.80 0.00 99.00 373.02% 0.00% 1 100.00% GS 4922.78 717.20 717.20 0.00 99.00 68.70% 0.00% 2 100.00% MMM 4922.78 491.10 491.10 0.00 99.00 53.89% 0.00% 2 100.00% FB 4922.78 254.39 280.79 -­26.40 10.64 86.98% -­9.09% 3 66.67% TSLA 4922.78 896.29 912.29 -­16.00 57.02 272.60% -­5.08% 3 66.67%

Combined 4922.78 4922.78 4965.18 -­42.40 99.00 151.15% -­3.54% 12 83.33%

Automated Trading Strategy Platform: NinjaTrader

Developed by:

Akhilesh Agarwal Mrunmayi Deshmukh

AMZN, FB, GS, MMM, NFLX, TSLA

Appendix IV – Optimization

Page 16: Automated Trading Strategy

Performance All Trades Long Trades Total Net Profit $4922.78 $4922.78 Gross Profit $4965.18 $4965.18 Gross Loss $-­42.40 $-­42.40 Commission $0.00 $0.00 Profit Factor 99.00 99.00

Cumulative Profit 151.15% 151.15% Max. Drawdown -­3.54% -­3.54% Sharpe Ratio 0.14 0.14 Start Date 1/1/2012 End Date 12/31/2013

No. of Trades 12 12 Percent Profitable 83.33% 83.33% Winning Trades 10 10 Losing Trades 2 2 Average Trade 82.02% 82.02%

Average Winning Trade 99.84% 99.84% Average Losing Trade -­7.09% -­7.09%

Ratio avg. Win / avg. Loss 14.09 14.09 Max. conseq. Winners 1 1 Max. conseq. Losers 0 0 Largest Winning Trade 373.02% 373.02% Largest Losing Trade -­9.09% -­9.09% No. of Trades per Day 0.00 0.00 Avg. Time in Market 234.58 days 234.58 days Avg. Bars in Trade 161.3 161.3 Profit per Month 5.37% 5.37%

Max. Time to Recover 230.08 days 230.08 days Average MAE 4.46% 4.46% Average MFE 112.38% 112.38% Average ETD 30.36% 30.36%

Parameters Correlation 0.44 (0.2;;0.6;;0.01) Fast 10 (10;;150;;10) Slow 110 (50;;200;;10) Period 4 (3;;21;;1) Quantity 10 Slope 0 BuyThreshold -­2 SellThreshold 2 Data series Price based on Last Type Day Value 1 Time frame From 1/1/2012 To 12/31/2013 General Label TradingStrategy Optimize GO: # of Generations 5 GO: Crossover Rate (%) 80 GO: Generation Size 25 GO: Minimum Performance 0 GO: Mutation Rate (%) 2 GO: Mutation Strength (%) 25 GO: Reset Size (%) 3 GO: Stability Size (%) 4 Keep best # results 10 Optimize data series False Optimize on max. net profit Optimizer Genetic

Instrument Perf. From To Total Net Profit Gross Profit Gross Loss Profit Factor Cum. Profit Max. DD Trades Profitable AMZN 1694.2 1/1/12 12/30/13 1694.20 1694.20 0.00 99.00 75.65% 0.00 1 100.00% AMZN 2995.6 12/31/13 12/30/15 2995.60 3287.80 -­292.20 11.25 74.48% -­0.09 2 50.00% FB -­19.3 1/1/12 12/30/13 -­19.30 0.00 -­19.30 0.00 -­6.81% -­0.07 1 0.00% FB 164.8 12/31/13 12/30/15 164.80 164.80 0.00 99.00 26.32% 0.00 1 100.00% GS -­158.4 1/1/12 12/30/13 -­158.40 0.00 -­158.40 0.00 -­13.61% -­0.14 1 0.00% GS -­69.8 12/31/13 12/30/15 -­69.80 27.70 -­97.50 0.28 -­3.60% -­0.05 2 50.00% MMM 464.7 1/1/12 12/30/13 464.70 464.70 0.00 99.00 49.99% 0.00 1 100.00% MMM 90.3 12/31/13 12/30/15 90.30 152.40 -­62.10 2.45 6.22% -­0.04 4 75.00% NFLX 353.7 1/1/12 12/30/13 353.70 353.70 0.00 99.00 207.33% 0.00 1 100.00% NFLX 311.2 12/31/13 12/30/15 311.20 455.60 -­144.40 3.16 55.22% -­0.13 3 66.67% TSLA -­86 1/1/12 12/30/13 -­86.00 0.00 -­86.00 0.00 -­24.19% -­0.24 2 0.00% TSLA -­400 12/31/13 12/30/15 -­400.00 0.00 -­400.00 0.00 -­14.90% -­0.15 2 0.00%

Instrument Performance Total Net Profit Gross Profit Gross Loss Profit Factor Cumulative Profit Max. Drawdown Trades Profitable FB 145.50 145.50 164.80 -­19.30 8.54 9.75% -­3.41% 2 50.00%

AMZN 4689.80 4689.80 4982.00 -­292.20 17.05 74.87% -­5.85% 3 66.67% GS -­228.20 -­228.20 27.70 -­255.90 0.11 -­6.94% -­7.94% 3 33.33% NFLX 664.90 664.90 809.30 -­144.40 5.60 93.25% -­9.49% 4 75.00% TSLA -­486.00 -­486.00 0.00 -­486.00 0.00 -­19.54% -­19.54% 4 0.00% MMM 555.00 555.00 617.10 -­62.10 9.94 14.98% -­3.43% 5 80.00%

Combined 5341.00 5341.00 6600.90 -­1259.90 5.24 28.24% -­8.64% 21 52.38%

Automated Trading Strategy Platform: NinjaTrader

Developed by:

Akhilesh Agarwal Mrunmayi Deshmukh

AMZN, FB, GS, MMM, NFLX, TSLA

Appendix V – Walk-­Forward

Page 17: Automated Trading Strategy

Performance All Trades Long Trades Total Net Profit $5341.00 $5341.00 Gross Profit $6600.90 $6600.90 Gross Loss $-­1259.90 $-­1259.90 Commission $0.00 $0.00 Profit Factor 5.24 5.24

Cumulative Profit 28.24% 28.24% Max. Drawdown -­8.64% -­8.64% Sharpe Ratio 1.00 1.00 Start Date 1/1/2010 End Date 12/31/2015

No. of Trades 21 21 Percent Profitable 52.38% 52.38% Winning Trades 11 11 Losing Trades 10 10 Average Trade 21.15% 21.15%

Average Winning Trade 48.78% 48.78% Average Losing Trade -­9.25% -­9.25%

Ratio avg. Win / avg. Loss 5.27 5.27 Max. conseq. Winners 0 0 Max. conseq. Losers 0 0 Largest Winning Trade 207.33% 207.33% Largest Losing Trade -­14.57% -­14.57% No. of Trades per Day 0.01 0.01 Avg. Time in Market 202.67 days 202.67 days Avg. Bars in Trade 140.1 140.1 Profit per Month -­0.23% -­0.23%

Max. Time to Recover 341.71 days 341.71 days Average MAE 11.20% 11.20% Average MFE 35.46% 35.46% Average ETD 14.32% 14.32%

Parameters Value Correlation 0.38 (0.2;;0.6;;0.01) Fast 10 (10;;150;;10) Slow 70 (50;;200;;10) Period 11 (3;;21;;1) Quantity 10 Slope 0 BuyThreshold -­2 SellThreshold 2 Data series Price based on Last Type Day Value 1 Time frame From 1/1/2010 To 12/31/2015 Optimize GO: # of Generations 5 GO: Crossover Rate (%) 80 GO: Generation Size 25 GO: Minimum Performance 0 GO: Mutation Rate (%) 2 GO: Mutation Strength (%) 25 GO: Reset Size (%) 3 GO: Stability Size (%) 4 Keep best # results 10 Optimization period (days) 730 Optimize data series False Optimize on max. net profit Optimizer Genetic Test period (days) 730

AMZN Cumulative Profit (%) Drawdown (%) MAE (%) MFE (%) PROBABILITY MIN MAX MIN MAX MIN MAX MIN MAX

Bottom 10% -­17.1% 22.5% -­17.1% -­11.7% 6.07% 7.3% 19.89% 37.5% Bottom 20% -­17.1% 72.8% -­17.1% -­11.7% 6.07% 8.5% 19.89% 46.3% Top 20% 277.1% 651.5% 0.0% 0.0% 13.1% 19.6% 81.5% 99.2% Top 10% 432.6% 651.5% 0.0% 0.0% 15.1% 19.6% 90.3% 99.2%

MMM Cumulative Profit (%) Drawdown (%) MAE (%) MFE (%) PROBABILITY MIN MAX MIN MAX MIN MAX MIN MAX

Bottom 10% -­2.0% -­1.4% -­13.6% -­10.3% 1.0% 1.4% 5.4% 7.1% Bottom 20% -­2.0% -­0.7% -­13.6% -­8.6% 1.0% 1.9% 5.4% 8.0% Top 20% 13.8% 30.5% -­3.93% 0.0% 3.3% 4.6% 20.0% 33.4% Top 10% 15.3% 30.5% -­1.98% 0.0% 3.7% 4.6% 21.2% 33.4%

GS Cumulative Profit (%) Drawdown (%) MAE (%) MFE (%) PROBABILITY MIN MAX MIN MAX MIN MAX MIN MAX

Bottom 10% -­64.0% -­57.5% -­64.3% -­57.55% 1.4% 9.6% 6.5% 8.3% Bottom 20% -­64.0% -­49.8% -­64.3% -­50.0% 1.4% 15.9% 6.5% 9.2% Top 20% -­10.7% 40.62% -­28.9% 0.0% 32.3% 44.83% 12.1% 14.9% Top 10% -­5.4% 40.62% -­16.0% 0.0% 38.5% 44.83% 14.0% 14.9%

Automated Trading Strategy Platform: NinjaTrader

Developed by:

Akhilesh Agarwal Mrunmayi Deshmukh

AMZN, FB, GS, MMM, NFLX, TSLA

Appendix VI – Monte Carlo Simulation

Page 18: Automated Trading Strategy

Appendix VII – Parameter Set from NinjaTrader

Automated Trading Strategy Platform: NinjaTrader

Developed by:

Akhilesh Agarwal Mrunmayi Deshmukh

AMZN, FB, GS, MMM, NFLX, TSLA