Download presentation
Presentation is loading. Please wait.
1
Disjoint Subsets Investing Efficiency Analysis
Britton Deets, Jordan Argueta, Jiajian Ou
2
Abstract Choosing what to invest in and how to invest is a problem that most people will be posed with at some point in their life. Our project seeks to answer this question, partially, by examining three different methods out investing in an automated form. We will compare all three of these algorithms by recording their relative performance in relation to each other, and a basic investing strategy, buy-and- hold investing. These results will also be compared to the relative merits of each algorithm in terms of time and memory efficiency.
3
Basic Stock Market Principles
An investor can perform 3 basic actions in the stock market: Buy, sell, or hold An investor makes money 2 ways: Dividends or capital gains Our algorithms focus on maximizing capital gains A “candle” is a graphical representation of the price of a stock for any given time period including the open, high, low, and closing prices
4
Formal Problem Statement
Variables: Total number of trades n, Specific trade at trade number i = ni Change ci for trade ni = exit price - entry price, Sum of changes = C = sum(c1 + c2 + … + cn) t = time for algorithm to run (size of backtest file) Maximize C subject to amout of time available t
5
Algorithm 1 - Pattern Searching
The basic idea of the Pattern Searching Algorithm is to track historical stock prices, and record probabilities of positive returns after a certain pattern has occurred. Algorithm breakdown: Create patterns to search for based on length of pattern and variables - O(n2) Variables = {1,0} // 1 corresponds to a price increase, and 0 for price decrease i = length of pattern (length 5 will be used in test cases) Read historical data to “train” program (5 years of stock price data) - O(n) Search data for pattern occurrences When pattern is found, update Pattern class with descriptive statistics Read in backtest data to backtest results (1 year of stock price data)- O(n) Execute a long (buy) or short (sell) trade based on expected return of the specific Pattern
6
Pattern Search Example
Percent Up Expected Return 11 54.40% -0.41% 10 55.76% -0.42% 01 55.31% 0.11% 00 52.21% -0.82% Percent Up = Percent of positive candles occurring after the pattern (Nu/T) Nu = Number of positive resulting candles T = Total pattern occurrences Expected Return = (Pu * Cu) + ((Pd) * Cd) Pu = Percent up Pd = Percent down Cu = Average change of up candles Cd = Average change of down candles
7
Pattern Searching Algorithm - Performance - 1 year
End of year return FB 9.83% GPRO -28.74% JCP 70.20% JNJ -21.89% ODP -57.72% BAC 10.08% **Different returns for different types of stocks
8
Algorithm 2 (The Knife Catcher)
Main idea: To identify oversold bounces and capture profits by buying at the local extreme lows.
9
Relative Strength Index
RSI is a number ranging from 0 to 100. And it measures the magnitude of the price movement. 0 indicates extreme oversold and 100 suggests extreme overbought. However, RSI rarely reaches those extreme values. The realistic moving range is 20 to 80.
10
RSI in Action Normal Range
11
Implementation (In JAVA):
12
Summarizing the Implementation:
Get data Big O (1) Convert data to candlesticks Big O (1) Check the RSI level for the last 13 candlesticks. Big O (1) Buy, and sell at fixed RSI point Stand by Big O (1) Big O (1)
13
Results:
14
Algorithm 3 - Keyword Trading
The Keyword Trading Algorithm is designed to search for opinion articles of a certain stock. Once the articles are randomly selected, the articles are then scored based off of recurring words. Each word is given a score and then referenced to an array keywords. If there are more positive words over negative words in a given article, or vice versa, then a decision is made.
15
Algorithm Breakdown: Search for articles related to stock O(n):
Finds articles with date timestamp in reference to the stock N is the amount of articles found with Calculating Opinion Score based on keywords found in article O(n2) Iterate through n number of words from the compiled articles and find duplicates. Iterate through n number of duplicates to reference negative and positive keyword arrays. Make a trade based off of Opinion Score O(1): For each day we want to trade, add up the Opinion Score and make a decision.
16
Implementation This is where the code calls the proper functions to find articles, scan through them, find keywords, calculate a score, and make a decision based on the score.
17
Keyword Trading - Performance - 1 year
End of year return BAC 33.42% FB 54.57% JNJ 17.27% JCP -67.86% GPRO -21.17% ODP -26.54% **Different returns for different types of stocks
18
Algorithm Comparison To compare our algorithms based on return performance we chose a basket of 6 stocks from a variety of economic sectors and market capitalizations (company value) in order to reduce a possible bias in which one algorithm may perform better on a certain type of stock. Large Cap: BAC - Financial FB - Technology JNJ - Healthcare Small Cap JCP - Services GPRO - Consumer Goods ODP - Services
19
Algorithm Comparison - 1 year of simulated trading
**1 year % returns Buy & Hold (Benchmark) Pattern Search Knife Catcher Keyword Trading BAC 33.95% 9.83% 18.92% 33.42% FB 51.94% -28.74% 6.38% 54.57% JNJ 20.58% 70.20% -2.41% 17.27% JCP % -21.89% 7.20% -67.86% GPRO -22.79% -57.72% 19.61% -21.17% ODP -46.71% 10.08% 13.89% -26.54% Mean -28.75% -3.04% 10.60% -1.71% Standard Deviation 101.46% 44.06% 8.48% 45.02%
20
Future Work Create more sophisticated position sizing methods instead of all-in/all-out methods Implement stop loss functions Use more data Choose different stocks or a broader range of stocks
21
Questions What is the purpose of picking a basket of stocks to test the algorithms instead of just one stock? Why would an investor choose to use a trading algorithm instead of a simple buy-and-hold type investing strategy? What is the RSI indicator? Why is the Big O of the Keyword Searching algorithm more complex than the Knife Catcher or Pattern Searching algorithms? Why is the Knife Catcher algorithm constant time?
22
Answers What is the purpose of picking a basket of stocks to test the algorithms instead of just one stock? To diversify algorithm results based on the type of stock Why would an investor choose to use a trading algorithm instead of a simple buy-and-hold type investing strategy? The standard deviation of returns tends to be lower. What is the RSI indicator? It is an indicator meant to calculate the relative extremes of price movements. Why is the Knife Catcher algorithm constant time? For each price point the algorithm only does a single calculation. Why does the Keyword Search algorithm take a considerably longer amount of time to execute than the other two algorithms? For each price point the algorithm has to find then check multiple text files for relevant keywords, which takes longer than simple calculations.
23
Questions?
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.