/** * * This code works, i had to sort it out first the first time. * The second time coding anything works well for me apparently * Second time hacking this must the charm i guess. * * javac HW5Main.java * java HW5Main < f.csv * * CSV files are from google finance. * * This is a http://en.wikipedia.org/wiki/MACD * * * @author Freeman Lo * @version 0.0.1 Build 1 April 1, 2014. * Limitations - Missing the date, where i can do it next version i guess. * I have yet to find time to hack the MACD with a proper date associate with the MACD value on trading days. */ import java.io.IOException; import java.util.ArrayList; public class HW5Main { public static void main (String [] args) throws IOException { ArrayList fileItems = new ArrayList(); ArrayList ema12 = new ArrayList(); ArrayList ema26 = new ArrayList(); ReadFile readFile = new ReadFile(); fileItems = readFile.readFile(); ProcessEMA12 processema12 = new ProcessEMA12(fileItems); ema12 = processema12.computeEMAValues(); System.out.println(); ProcessEMA26 processema26 = new ProcessEMA26(fileItems); ema26 = processema26.computeEMAValues(); ProcessMACD processmacd = new ProcessMACD(fileItems); processmacd.setEMAValues(ema12, ema26); processmacd.computeMACD(); processmacd.printMACDValues(); } }