Skip to content

Commit fd5523d

Browse files
committed
Standard Deviation
1 parent 60a5afd commit fd5523d

File tree

15 files changed

+6714
-4626
lines changed

15 files changed

+6714
-4626
lines changed
Binary file not shown.

Statistical_Analysis/Data/AAPL.csv

Lines changed: 4495 additions & 4493 deletions
Large diffs are not rendered by default.

Statistical_Analysis/Data/EDIG.csv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
timestamp,open,high,low,close,adjusted_close,volume,dividend_amount,,
2+
2017-11-10,0.0035,0.0039,0.0035,0.0037,0.0037,582653,0.0000,,
3+
2017-11-09,0.0041,0.0041,0.0040,0.0041,0.0041,36604,0.0000,,
24
2017-11-08,0.0040,0.0044,0.0040,0.0040,0.0040,753689,0.0000,,
35
2017-11-07,0.0043,0.0043,0.0043,0.0043,0.0043,86100,0.0000,,
46
2017-11-06,0.0042,0.0043,0.0042,0.0043,0.0043,7793,0.0000,,
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
timestamp,open,high,low,close,adjusted_close,volume,dividend_amount
2+
2017-11-10,0.78,0.81,0.78,0.81,115.8732086,36950,0
3+
2017-11-09,0.77,0.8,0.75,0.8,110.3554368,78306,0
4+
2017-11-08,0.82,0.82,0.78,0.79,118.66176,28550,0
5+
2017-11-07,0.81,0.84,0.78,0.8,108.864,80459,0
6+
2017-11-06,0.83,0.84,0.81,0.81,97.2,69222,0
7+
2017-11-03,0.82,0.83,0.78,0.81,108,96399,0
8+
2017-11-02,0.83,0.83,0.77,0.79,100,91078,0

Statistical_Analysis/Data/TSLA.csv

Lines changed: 1859 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
timestamp,open,high,low,close,adjusted_close,volume,dividend_amount
2+
2017-11-10,0.78,0.81,0.78,0.81,115.8732086,36950,0
3+
2017-11-09,0.77,0.8,0.75,0.8,110.3554368,78306,0
4+
2017-11-08,0.82,0.82,0.78,0.79,118.66176,28550,0
5+
2017-11-07,0.81,0.84,0.78,0.8,108.864,80459,0
6+
2017-11-06,0.83,0.84,0.81,0.81,97.2,69222,0
7+
2017-11-03,0.82,0.83,0.78,0.81,108,96399,0
8+
2017-11-02,0.83,0.83,0.77,0.79,100,91078,0
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
EDIG,2017-11-08,2000-01-03
2-
AAPL,2017-11-08,2000-01-03
3-
GENE,2017-11-08,2005-09-06
1+
EDIG,2017-11-13,2000-01-03
2+
TSLA,2017-11-13,2010-06-29
3+
AAPL,2017-11-13,2000-01-03
4+
TESTS,2017-11-13,2017-11-02
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
EDIG,2017-11-08,2000-01-03
2+
AAPL,2017-11-08,2000-01-03
3+
GENE,2017-11-08,2005-09-06
4+
TSLA,2017-11-09,2010-06-29
5+

Statistical_Analysis/Test Sample 3

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
2+
//SStat Test 2
3+
Stock S_EDIG = new Stock("EDIG");
4+
S_EDIG.retrieve();
5+
SStat St = new SStat(S_EDIG);
6+
7+
System.out.println("<<<" + S_EDIG.SYMBOL + ">>>");
8+
System.out.println("Geometric mean Return: " + St.MeanReturnGeometric("CLOSE", 30, "2012-12-25", "2016-01-01"));
9+
10+
ArrayList tmpArray1 = St.PercentageChange("CLOSE", 100, "2012-12-15", "2016-01-01");
11+
System.out.println("Percentage Change (Close, 100 from 2012/12/15 to 2016/01/01)\n" + tmpArray1);
12+
13+
ArrayList ReturnVariance_tmp_Array = St.ReturnVariance("CLOSE", 30, "2012-12-15", "2016-01-01");
14+
System.out.println("Return Variance (Close, 100 from 2012/12/15 to 2016/01/01)\n" + ReturnVariance_tmp_Array);
15+
16+
System.out.println(St.MeanReturnVariance("CLOSE", 30, "2012-12-15", "2016-01-01"));
17+
18+
DateManager DM = new DateManager("2011-12-01", "2012-02-01");
19+
ArrayList DateList = DM.Dates;
20+
System.out.println();
21+
System.out.println(DateList);
22+
23+
ArrayList tradingdaylist = DM.tradingday();
24+
System.out.println();
25+
for(int i = 0; i < tradingdaylist.size(); i++) {
26+
System.out.println(tradingdaylist.get(i));
27+
}
28+
29+
30+
/*
31+
System.out.println("========================================");
32+
LocalDate D = null; D.parse(D.now().toString(), DateTimeFormatter.ISO_DATE);
33+
System.out.println(D.now());
34+
*/

Statistical_Analysis/src/gui/GUIMain.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,18 +154,17 @@ public List<Double> getScores() {
154154
}
155155

156156
private static void createAndShowGui() {
157-
Stock S_AAPL = new Stock("EDIG");
157+
Stock S_AAPL = new Stock("TSLA");
158158
S_AAPL.retrieve();
159159
ArrayList P = S_AAPL.request("ADJ_CLOSE", "2017-05-08", "2017-11-08");
160160
//ArrayList AAPL_A = S_AAPL.request("CLOSE", "2012-01-01", "2017-01-01");
161161

162162
SStat EDIG_S = new SStat(S_AAPL);
163163
ArrayList AL = EDIG_S.PercentageChange("CLOSE", 30, "2012-01-01", "2017-01-01");
164-
ArrayList AL2 = EDIG_S.ReturnVariance("CLOSE", 30, "2012-01-01", "2017-01-01");
165164
System.out.println(AL);
166-
System.out.println(AL2);
165+
ArrayList Dev = EDIG_S.ReturnDeviation("ADJ_CLOSE", 30, "2012-01-01", "2014-01-01", "GEO");
167166

168-
GUIMain mainPanel = new GUIMain(P);
167+
GUIMain mainPanel = new GUIMain(Dev);
169168
mainPanel.setPreferredSize(new Dimension(800, 600));
170169
JFrame frame = new JFrame("DrawGraph");
171170
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

0 commit comments

Comments
 (0)