Consider the seven major currency pairs, sampled hourly over the last six months. We calculate the pairwise Pearson correlation coefficients to determine the degree with which each pair “moves” together: Values near one or negative one indicate high correlation, values with lower absolute value less so. Positive values indicate movement in the same direction; negative […]

# Tag: trading

## machine learning in FOREX (part one: establishing a performance baseline)

Introduction We’ve been applying machine learning to FOREX price prediction. The performance of our models varies widely, so to establish a baseline we created a simple linear regression model with which we can compare performance of more sophisticated models against. What We Are Trying To Do Given a time-series of 26 four-hour price samples, we […]

## autocorrelation in FOREX

To inform the construction of a machine learning-based price prediction algorithm, we want to understand how many lags prove statistically significant with regard to autocorrelation in the seven major FOREX pairs. So we first choose 10,000 random time points between January 1, 2000 and January 1, 2017 for each of the seven pairs. Then we […]

## pseudo-harmonic FOREX prediction with machine learning (part one)

“Harmonic” trading methods seek patterns in the relationships between neighboring peaks and valleys in the time series. Particularly, harmonic traders seek pre-specified ratios in the price differences among a series of peaks and valleys. For example, a trader might observe the following pattern: Let A, B, C, D, and E be the points in the […]

## picking stocks by graph database (part one)

Historical stock price data comes readily available at daily resolution. So we calculated the Granger causality for each pair of stocks we hold data for, at one and two day lags (testing the question “does daily percent change in volume for stock X Granger cause daily percent change in adjusted close price for stock Y?”). […]

## Bayesian network modeling stock price change

Update 29 April 2018 I suspect this result is erroneous in that the graph often shows two arrows between any two given nodes, one inward and one outward. I’ll investigate this further and get back to you… – Emily Introduction Taking a cue from the systems biology folks, I decided to model stock price change […]

## clustering stocks by price correlation (part 2)

In my last post, “clustering stocks by price correlation (part 1)“, I performed hierarchical clustering of NYSE stocks by correlation in weekly closing price. I expected the stocks to cluster by industry, and found that they did not. I proposed several explanations for this observation, including that perhaps I chose a poor distance metric for […]

## clustering stocks by price correlation (part 1)

I’ve been building my knowledge of clustering techniques to apply to genetic circuit engineering, and decided to try the same tools for stock price analysis. In this post I describe building a hierarchical cluster of stocks by pairwise correlation in weekly price, to see how well the stocks cluster by industry, and compare the derived […]

## Apache Spark and stock price causality

The Challenge I wanted to compute Granger causality (described below) for each pair of stocks listed in the New York Stock Exchange. Moreover, I wanted to analyze between one and thirty lags for each pair’s comparison. Needless to say, this requires massive computing power. I used Amazon EC2 as the computing platform, but needed a […]

## hacking the stock market (part 1)

Caveat: I am not a technical investor–just a hobbyist, so take this analysis with a grain of salt. I am also just beginning with my Master’s work in statistics. I wanted to examine the correlation between changes in the daily closing price of the Dow Jones Industrial Average (DJIA) and lags of those changes, to […]