forked from vdt/Algorithmic-Trading-API
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSecurity.java
More file actions
executable file
·114 lines (82 loc) · 2.99 KB
/
Security.java
File metadata and controls
executable file
·114 lines (82 loc) · 2.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
package TestJavaClient;
import java.util.ArrayList;
/**
* Security.java
*
* Data object containing crucial information for a security with its current transaction history.
*
* @author jhartless, nlopez
*
*/
public class Security{
private String symbol; // Tracks the security
private SecurityType securityType;// Stores one of seven security types for this security (STK, OPT, FUT, IND, FOP, CASH, BAG)
private ArrayList<Integer> marketDataHistory;//ArrayList for Request Market Data
private ArrayList<Integer> realTimeBarsHistory;//ArrayList for request Real time Bars
private ArrayList<Integer> marketScannerHistory;//ArrayList for Market Scanner
private ArrayList<Integer> placeOrderHistory;//ArrayList for Place Order
private ArrayList<Integer> historicalDataHistory;//ArrayList for request History Data
public Security(SecurityType newSecurityType, String tickerSymbol){
//sets our variables to be our incoming parameters
securityType = newSecurityType;
symbol = tickerSymbol;
marketDataHistory = new ArrayList <Integer>();
realTimeBarsHistory = new ArrayList <Integer>();
marketScannerHistory = new ArrayList <Integer>();
placeOrderHistory = new ArrayList <Integer>();
historicalDataHistory = new ArrayList <Integer>();
}
/**
*prints a toString for visual verification
*prints out security type and global id
*/
public String toString(){
return "SecurityType: " + securityType + "\nSymbol: " + symbol;
}
/**
* generate getters and setters for arrayLists and class variables
* @return
*/
public ArrayList<Integer> getMarketDataHistory() {
return marketDataHistory;
}
public void setMarketDataHistory(ArrayList<Integer> marketDataHistory) {
this.marketDataHistory = marketDataHistory;
}
public ArrayList<Integer> getRealTimeBarsHistory() {
return realTimeBarsHistory;
}
public void setRealTimeBarsHistory(ArrayList<Integer> realTimeBarsHistory) {
this.realTimeBarsHistory = realTimeBarsHistory;
}
public ArrayList<Integer> getMarketScannerHistory() {
return marketScannerHistory;
}
public void setMarketScannerHistory(ArrayList<Integer> marketScannerHistory) {
this.marketScannerHistory = marketScannerHistory;
}
public ArrayList<Integer> getPlaceOrderHistory() {
return placeOrderHistory;
}
public void setPlaceOrderHistory(ArrayList<Integer> placeOrderHistory) {
this.placeOrderHistory = placeOrderHistory;
}
public ArrayList<Integer> getHistoricalDataHistory() {
return historicalDataHistory;
}
public void setHistoricalDataHistory(ArrayList<Integer> historicalDataHistory) {
this.historicalDataHistory = historicalDataHistory;
}
public SecurityType getSecurityType() {
return securityType;
}
public void setSecurityType(SecurityType securityType) {
this.securityType = securityType;
}
public String getSymbol() {
return symbol;
}
public void setSymbol(String symbol) {
this.symbol = symbol;
}
}