# Using Machine Learning and Candlestick Patterns to Predict the Outcomes of American Football Games
## Methodology
### Data Source and Processing  
This study focuses on the NFL. Data for the past 32 years were obtained from covers.com using web scraping technologies in 2018. Only the data from after 2006 can be found since the recent website revision. The original data included the pre-season, regular season and post-season for each team from the 1985-1986 to 2016-2017 seasons, a total of 18,944 games. The NFL currently has 32 teams. Each team plays 3 games in a pre-season and 17 games in a regular season. The winner competes in the post-season to win the Super Bowl. For each season, we selected the data from week 3 of the regular season to organise into datasets and discard the pre-season, week 1 and week 2 data. The pre-season game mainly lets players warm up. Players take turns in the field and gradually adjust themselves to their best condition. A pre-season game is slightly different \begin{table}
\begin{tabular}{l l l} \hline \hline
**Notation** & **Description** & **Categories** \\ \hline PS & Point score & Game result \\ PA & Point allow & Game result \\ TP & Total points scored & Game result \\ Field & Match field, such as home or away & Situation variable \\ Outcome & Outcome, such as win or lose & Game result \\ O/LD & “Open” of the candlestick (i.e., the line on the margin) & OHLC/betting \\ H & “High” of the candlestick & OHLC \\ L & “Low” of the candlestick & OHLC \\ C/D & “Close” of the candlestick (i.e., the margin) & OHLC/game result \\ T & Total points scored by both teams (i.e., O/U) & Betting \\ LT & Line on T (i.e., O/U line) & Betting \\ GST & Gambling shock on T & Betting \\ BL & Body length of the candlestick (i.e., GSD) & Length \\ BLN (t) & Normalised BL of the candlestick at t, t \(-\) 1 and t \(-\) 2 & Length (series) \\ BLS (t) & BL style of the candlestick at t, t \(-\) 1 and t \(-\) 2 & Length style (series) \\ UWL & Upper wick length of the candlestick & Length \\ UWLN (t) & Normalised UWL of the candlestick at t, t \(-\) 1 and t \(-\) 2 & Length (series) \\ UWLs (t) & UWL style of the candlestick at t, t \(-\) 1 and t \(-\) 2 & Length style (series) \\ LWL & Lower wick length of the candlestick & Length \\ LWLN (t) & Normalised LWL of the candlestick at t, t \(-\) 1 and t \(-\) 2 & Length (series) \\ LWLS (t) & LWL style of the candlestick at t, t \(-\) 1 and t \(-\) 2 & Length style (series) \\ BC (t) & Body colour of the candlestick at t, t \(-\) 1 and t \(-\) 2 & OHLC (series) \\ OS (t) & Open style of the candlestick at t, t \(-\) 1 and t \(-\) 2 & Relation style (series) \\ CS (t) & Close style of the candlestick at t, t \(-\) 1 and t \(-\) 2 & Relation style (series) \\ Field (t + 1) & Known match field of the next game & Situation variable \\ O/LD (t + 1) & Known O/LD of the next game & Betting/OHLC \\ LT (t + 1) & Known LT of the next game & Betting \\ OS (t + 1) & Known OS of the next candlestick & Relation style \\ \hline Outcome (t + 1) & Unknown outcome of the next game & Output variable \\ C/D (t + 1) & Unknown winning/losing margin of the next game & Output variable \\ \hline \hline \end{tabular} Note: t, t \(-\) 1 and t \(-\) 2 of the candlestick are the current game, previous game, previous two games, respectively. OHLC: open-high-low-close; O/U: over/under; LT: the line on the total points scored by both teams; OS: open style of the candlestick.  
\end{table} 
Table 1: Description of the features used in this study. in terms of the main players on the field. Thus, pre-season data were not used. The pattern of the candlestick chart has at least three consecutive candlesticks that show the trend change to predict the next game. Therefore, the data from week 1 and week 2 were combined with those of week 3 in the regular season and were used as the parameters of the prediction model to predict the next match in week 4. The rest of the data were organised into the input and output fields of the prediction model sequentially. Data from the previous three games were used as the input, and the predicted win or loss as the output.