Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CorrelationUtil implements Runnable {
- StockTicker analysedTicker;
- double[] sourceClosePrices;
- int period;
- public CorrelationUtil(StockTicker analysedTicker, double[] sourceClosePrices, int period) {
- this.analysedTicker = analysedTicker;
- this.sourceClosePrices = sourceClosePrices;
- this.period = period;
- }
- @Override
- public void run() {
- double[] targetClosePrices = getClosePrices(getContent(analysedTicker, period));
- double correlation = correlator.correlate(sourceClosePrices, targetClosePrices);
- StockStatistic statistic = new StockStatistic(correlation, analysedTicker);
- correlationTreeSet.add(statistic);
- increaseStep();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment