Guest User

Untitled

a guest
Aug 22nd, 2015
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.68 KB | None | 0 0
  1.     class CorrelationUtil implements Runnable {
  2.  
  3.         StockTicker analysedTicker;
  4.         double[] sourceClosePrices;
  5.         int period;
  6.  
  7.         public CorrelationUtil(StockTicker analysedTicker, double[] sourceClosePrices, int period) {
  8.             this.analysedTicker = analysedTicker;
  9.             this.sourceClosePrices = sourceClosePrices;
  10.             this.period = period;
  11.         }
  12.  
  13.         @Override
  14.         public void run() {
  15.             double[] targetClosePrices = getClosePrices(getContent(analysedTicker, period));
  16.             double correlation = correlator.correlate(sourceClosePrices, targetClosePrices);
  17.             StockStatistic statistic = new StockStatistic(correlation, analysedTicker);
  18.             correlationTreeSet.add(statistic);
  19.             increaseStep();
  20.         }
  21.     }
Advertisement
Add Comment
Please, Sign In to add comment